diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 390df0c3ed..a03915a264 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3413 +1,3932 @@ -/types/abbrev/ @BendingBender -/types/ably/ @ably -/types/abs/ @AyaMorisawa -/types/absolute/ @AyaMorisawa -/types/acc-wizard/ @cyrilschumacher -/types/accepts/ @bomret -/types/accounting/ @gerich-home @chrisleck -/types/ace/ @Diullei -/types/acl/ @tkQubo -/types/acorn/ @RReverser @e-cloud -/types/actioncable/ @zhu1230 -/types/activex-adodb/ @zspitz -/types/activex-scripting/ @zspitz -/types/activex-wia/ @zspitz -/types/adal/ @mmaitre314 -/types/adm-zip/ @jvilk @abner -/types/adone/ @s0m3on3 @maxveres -/types/aframe/ @devpaul -/types/agenda/ @meirgottlieb -/types/aggregate-error/ @BendingBender -/types/alertify/ @jjeffery -/types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce -/types/alexa-voice-service/ @dolanmiu -/types/algebra.js/ @CaselIT -/types/algoliasearch/ @cbaptiste -/types/alt/ @Shearerbeard -/types/amazon-product-api/ @MattiLehtinen -/types/amcharts/ @aleksey-bykov -/types/amplify/ @joeriks -/types/amplify-deferred/ @joeriks @laurentiustamate94 -/types/amplitude-js/ @Asido -/types/amqp/ @seikho -/types/amqp-rpc/ @wokim -/types/amqplib/ @mnahkies @abreits @nfantone -/types/analytics-node/ @fongandrew -/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu -/types/angular-agility/ @rolandzwaga -/types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf -/types/angular-block-ui/ @lassebn @sclassen -/types/angular-bootstrap-calendar/ @Odrin -/types/angular-bootstrap-lightbox/ @rolandzwaga -/types/angular-breadcrumb/ @marctalary -/types/angular-clipboard/ @bradfordwagner -/types/angular-cookie/ @borislavjivkov -/types/angular-cookies/ @diegovilar @aciccarello -/types/angular-deferred-bootstrap/ @Ritzlgrmft -/types/angular-dialog-service/ @wcomartin -/types/angular-dynamic-locale/ @stephenlautier -/types/angular-environment/ @terrawheat -/types/angular-es/ @mbutsykin -/types/angular-feature-flags/ @borislavjivkov -/types/angular-file-saver/ @deenairn -/types/angular-formly/ @scatcher -/types/angular-fullscreen/ @julienpa -/types/angular-gettext/ @AkosLukacs -/types/angular-google-analytics/ @cyrilschumacher @Toxantron -/types/angular-gridster/ @jpmnteiro -/types/angular-growl-v2/ @mkp05 -/types/angular-hotkeys/ @jlz27 @reppners -/types/angular-http-auth/ @vvakame -/types/angular-httpi/ @Kukks -/types/angular-idle/ @mthamil -/types/angular-jwt/ @rerezz -/types/angular-load/ @david-gang -/types/angular-loading-bar/ @stephenlautier -/types/angular-local-storage/ @kenfdev @dona278 -/types/angular-localforage/ @reppners -/types/angular-locker/ @nkovacic -/types/angular-material/ @blbigelow @PeterHajdu @Dona278 @geertjansen -/types/angular-media-queries/ @jpmnteiro -/types/angular-meteor/ @pgrm -/types/angular-mocks/ @diegovilar @daltin -/types/angular-modal/ @paullessing -/types/angular-oauth2/ @anteriovieira -/types/angular-pdfjs-viewer/ @bastienmoulia -/types/angular-permission/ @vmishevski -/types/angular-promise-tracker/ @rufusl -/types/angular-q-spread/ @rafw87 -/types/angular-resource/ @diegovilar @miffels -/types/angular-route/ @park9140 -/types/angular-sanitize/ @diegovilar -/types/angular-scenario/ @RomanoLindano -/types/angular-scroll/ @samherrmann -/types/angular-signalr-hub/ @AdamSantaniello -/types/angular-spinner/ @Biegal -/types/angular-storage/ @mdekrey -/types/angular-strap/ @samherrmann -/types/angular-toastr/ @nkovacic @trodi -/types/angular-toasty/ @muenchdo -/types/angular-tooltips/ @leonard-thieu -/types/angular-touchspin/ @nkovacic -/types/angular-translate/ @michelsalib -/types/angular-ui-bootstrap/ @xt0rted @ry8806 -/types/angular-ui-router/ @michelsalib @matiishyn -/types/angular-ui-scroll/ @marknadig -/types/angular-ui-sortable/ @thgreasi -/types/angular-ui-tree/ @CalvinFernandez -/types/angular-websocket/ @nickveys -/types/angular-wizard/ @mjurisic @rwwilden -/types/angular-xeditable/ @jpmnteiro -/types/angular.throttle/ @reppners -/types/angularfire/ @thSoft -/types/angularlocalstorage/ @horiuchi -/types/angulartics/ @stevenfan -/types/animation-frame/ @qinfchen -/types/animejs/ @A-Babin -/types/annyang/ @hisham @theluk -/types/ansi-styles/ @brynbellomy -/types/ansicolors/ @rogierschouten -/types/any-db/ @rogierschouten -/types/any-db-transaction/ @rogierschouten -/types/anybar/ @khoomeister -/types/anydb-sql-migrations/ @spion -/types/anymatch/ @BendingBender -/types/apex.js/ @y13i -/types/aphrodite/ @asvetliakov -/types/api-error-handler/ @tkrotoff -/types/apigee-access/ @CasperSkydt -/types/app-root-path/ @shantmarouti -/types/appframework/ @kyo-ago -/types/appletvjs/ @brainded -/types/applicationinsights/ @scsouthw -/types/applicationinsights-js/ @kamilszostak -/types/arbiter/ @arash16 -/types/arcgis-js-api/v3/ @Esri -/types/arcgis-js-api/ @Esri -/types/arcgis-rest-api/ @JeffJacobson -/types/arcgis-to-geojson-utils/ @JeffJacobson -/types/archiver/ @dolanmiu @crevil -/types/archy/ @vvakame -/types/are-we-there-yet/ @brianloveswords -/types/argparse/ @arcticwaters -/types/argv/ @hookclaw -/types/array-find-index/ @samverschueren -/types/array-foreach/ @skysteve -/types/array-uniq/ @DanielRosenwasser -/types/arrify/ @wanganjun -/types/artyom.js/ @semagarcia -/types/asana/ @tkqubo -/types/ascii2mathml/ @RagibHasin -/types/asenv/ @remisery -/types/askmethat-rating/ @AlexTeixeira -/types/asn1js/ @microshine -/types/aspnet-identity-pw/ @jt000 -/types/assert-equal-jsx/ @seryl -/types/assert-plus/ @KostyaTretyak -/types/assertion-error/ @Bartvds -/types/assertsharp/ @brunolm -/types/assets-webpack-plugin/ @kryops -/types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin -/types/async-lock/ @elisee -/types/async-polling/ @Goldsmith42 -/types/async.nexttick/ @pyrho -/types/asyncblock/ @horiuchi -/types/atmosphere/ @toedter -/types/atom/ @vvakame -/types/atom-keymap/ @enlight -/types/atpl/ @soywiz -/types/audiosprite/ @Perlmint -/types/aurelia-knockout/ @code-chris -/types/auth0/ @wbhob @westy92 @amiram -/types/auth0-angular/ @homesar -/types/auth0-js/v7/ @advancedrei -/types/auth0-js/ @adrianchia @mdurrant -/types/auth0-lock/ @carusology @goldcaddy77 -/types/auth0.widget/ @advancedrei -/types/auto-launch/ @rhysd @unindented -/types/auto-sni/ @janwo -/types/autobahn/ @darkl @valepu -/types/autobind-decorator/ @NoHomey -/types/autolinker/ @leonyu -/types/autoprefixer/ @odnamrataizem -/types/autosize/ @kingdango @keika299 @NeekSandhu -/types/awesomplete/ @webbiesdk @bmdixon @tbekolay -/types/aws-iot-device-sdk/ @niik -/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 -/types/aws-serverless-express/ @threesquared @jcaffey @mattmeye -/types/aws4/ @ajcrites -/types/axel/ @ruslan-molodyko -/types/azure/ @AndrewGaspar @antiveeranna @SomaticIT -/types/azure-mobile-services-client/ @dmorosinotto -/types/azure-sb/ @Azure -/types/b_/ @outring -/types/babel-code-frame/ @mohsen1 -/types/babel-core/ @yortus @marvinhagemeister -/types/babel-generator/ @yortus @johnnyestilles -/types/babel-plugin-syntax-jsx/ @marvinhagemeister -/types/babel-template/ @yortus @marvinhagemeister -/types/babel-traverse/ @yortus @marvinhagemeister -/types/babel-types/ @yortus @baxtersa @marvinhagemeister -/types/babelify/ @TeamworkGuy2 @marvinhagemeister -/types/babylon/ @yortus @marvinhagemeister -/types/babyparse/ @cdiddy77 -/types/backbone/ @borisyankov @nvivo -/types/backbone-associations/ @craigbrett17 -/types/backbone-fetch-cache/ @delphinus35 -/types/backbone-relational/ @eirikhm -/types/backbone.layoutmanager/ @hejiang2000 -/types/backbone.localstorage/ @lgrignon -/types/backbone.marionette/ @zhamid @nvivo @sventschui -/types/backbone.paginator/ @Nyamazing -/types/backbone.radio/ @alphaleonis -/types/backgrid/ @jlujan -/types/backlog-js/ @vvatanabe -/types/baconjs/ @alexander-matsievsky @gekkio -/types/bagpipes/ @micmro -/types/barcode/ @pvomhoff -/types/bardjs/ @TepigMC -/types/base-64/ @dolanmiu -/types/base-x/ @chrootsu -/types/base16/ @alechill -/types/base64-js/ @pe8ter -/types/bases/ @harikv -/types/basic-auth/ @moonpyk @vesse -/types/batch-stream/ @drudge -/types/bazinga-translator/ @alexndlm -/types/bcrypt/ @codeanimal @IOAyman -/types/bcryptjs/ @RafaelKr -/types/bem-cn/ @selkinvitaly -/types/better-curry/ @pocesar -/types/better-sqlite3/ @Morfent -/types/bezier-easing/ @ptlis -/types/bezier-js/ @danmarshall -/types/bgiframe/ @sumegizoltan -/types/big.js/ @nycdotnet -/types/bigi/ @mhegazy -/types/bigint/ @Evgenus -/types/bignum/ @Patman64 -/types/bignumber.js/ @LaserUnicorns -/types/bigscreen/ @dduugg -/types/bind-ponyfill/ @skysteve -/types/bingmaps/ @rbrundritt -/types/bintrees/ @CjS77 -/types/bip21/ @stefanhuber -/types/bit-array/ @mudkipme -/types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton -/types/bittorrent-protocol/ @feross @tlaziuk -/types/bitwise-xor/ @rogierschouten -/types/bl/ @Bartvds -/types/blacklist/ @mhegazy -/types/blazy/ @julienpa -/types/blessed/ @brynbellomy -/types/blissfuljs/ @fskorzec -/types/blob-stream/ @erichillah -/types/blob-util/ @WorldMaker -/types/blocks/ @ksmigiel -/types/bloomfilter/ @slawiko -/types/blue-tape/ @sodatea -/types/bluebird/v1/ @Bartvds -/types/bluebird/v2/ @Bartvds @falsandtru -/types/bluebird/ @lhecker -/types/bluebird-global/ @d-ph -/types/bluebird-retry/ @pvomhoff -/types/blueimp-md5/ @rmartone @mkohlmyr -/types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk -/types/bonjour/ @quentin-ol @octo-sniffle -/types/bookshelf/ @arcticwaters @vesse -/types/boom/v3/ @rogatty -/types/boom/ @rogatty @AJamesPhillips @jineshshah36 -/types/bootbox/ @vbortone @konpikwastaken @kanup @icereed @trodi @stannynuytkens -/types/bootpag/ @rdeneau -/types/bootstrap/ @borisyankov -/types/bootstrap-datepicker/ @borisyankov -/types/bootstrap-fileinput/ @CheCoxshall -/types/bootstrap-maxlength/ @danmana -/types/bootstrap-notify/ @niemyjski @mouse0270 @robert-voica -/types/bootstrap-select/ @LKay -/types/bootstrap-slider/ @dbeckwith @leonard-thieu -/types/bootstrap-switch/ @johnmbaughman -/types/bootstrap-table/ @talatbaig -/types/bootstrap-touchspin/ @albinsunnanbo -/types/bootstrap-treeview/ @jbtronics -/types/bootstrap-validator/ @BradyLiles -/types/bootstrap.paginator/ @derikwhittaker -/types/bootstrap.timepicker/ @derikwhittaker -/types/bootstrap.v3.datetimepicker/v3/ @bayitajesi -/types/bootstrap.v3.datetimepicker/ @katonap -/types/bounce.js/ @cherrry -/types/bowser/ @pocesar -/types/box2d/ @jbaldwin -/types/brace-expansion/ @BendingBender -/types/braintree-web/ @chlela -/types/breeze/ @borisyankov -/types/brorand/ @chrootsu -/types/browser-bunyan/ @PaulLockwood @kryops -/types/browser-fingerprint/ @LKay -/types/browser-harness/ @scriby -/types/browser-pack/ @TeamworkGuy2 -/types/browser-report/ @JTOne123 -/types/browser-resolve/ @marionebl -/types/browser-sync/ @joeskeen -/types/browserify/ @AndrewGaspar @jvilk @leonard-thieu -/types/bs58/ @chrootsu -/types/bson/ @horiuchi @CaselIT -/types/bucks/ @zaneli -/types/buffer-compare/ @chrootsu -/types/buffer-equal/ @Bartvds -/types/buffers/ @rhencke -/types/bufferstream/ @Bartvds -/types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 -/types/bunnymq/ @cyrilschumacher -/types/bunyan/ @amikhalev -/types/bunyan-blackhole/ @olivr70 -/types/bunyan-config/ @cyrilschumacher -/types/bunyan-prettystream/ @jasonswearingen @enlight -/types/bunyan-winston-adapter/ @stevehipwell -/types/busboy/ @jacobbaskin -/types/business-rules-engine/ @rsamec -/types/bwip-js/ @MugeSo -/types/byline/ @reppners -/types/bytebuffer/ @cappellin -/types/bytes/ @danny8002 -/types/c3/ @mcliment @gerinjacob @denyo -/types/cache-manager/ @GausSim -/types/cachefactory/ @vag1830 @danielmassa -/types/cal-heatmap/ @RetroChrisB -/types/callsite/ @newclear -/types/callsites/ @BendingBender -/types/calq/ @eirikhm -/types/camelcase/ @samverschueren -/types/camelcase-keys/ @mhegazy -/types/camo/ @lucasmciruzzi -/types/cannon/ @clark-stevenson -/types/canvas-gauges/ @Mikhus -/types/canvasjs/ @brutalimp -/types/capitalize/ @frederickfogerty -/types/cash/ @akvlko -/types/casperjs/ @jedmao -/types/cassandra-driver/ @Svjard -/types/catbox/ @jasonswearingen @AJamesPhillips -/types/cbor/ @pushplay -/types/ccap/ @taoqf -/types/chai/v2/ @Bartvds @AGBrown -/types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin -/types/chai-arrays/ @clementprevot -/types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu -/types/chai-datetime/ @cliffburger -/types/chai-dom/ @mattlewis92 -/types/chai-enzyme/ @asvetliakov -/types/chai-fuzzy/ @Bartvds -/types/chai-http/ @Nemo157 @G1itcher @CaselIT -/types/chai-jquery/ @kazimanzurrashid -/types/chai-json-schema/ @ulrichheiniger -/types/chai-oequal/ @mizunashi-mana -/types/chai-spies/ @kuzn-ilya -/types/chai-string/ @nmalaguti -/types/chai-subset/ @delta62 @AGBrown -/types/chai-xml/ @jedigo -/types/chalk/ @Diullei @Bartvds @nicojs -/types/chance/ @cbowdon -/types/change-emitter/ @iskandersierra -/types/charm/ @Xananax -/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr -/types/chartist/ @mtgibbs @psimonski -/types/chartjs/ @Steve-Fenton @FanaHOVA -/types/chayns/ @HenningKuehl -/types/check-sum/ @BendingBender -/types/checkstyle-formatter/ @mhegazy -/types/checksum/ @rogierschouten -/types/cheerio/ @blittle @wmaurer @umarniz -/types/chokidar/ @reppners @felixfbecker -/types/chosen-js/ @borisyankov @denisname -/types/chroma-js/v0/ @invliD -/types/chroma-js/ @invliD @mpacholec -/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 -/types/chunked-dc/ @dbrgn -/types/circular-json/ @jpevarnek -/types/ckeditor/ @ondrejsevcik -/types/clamp-js/ @Hikariii -/types/classnames/ @adidahiya @JKillian @seansfkelley @mradamczyk @marvinhagemeister -/types/cldrjs/ @RamanBut-Husaim @gcastre -/types/clean-css/ @tkrotoff -/types/clean-stack/ @BendingBender -/types/clear-require/ @dan-j -/types/cli/ @kayahr -/types/cli-color/ @ChaosinaCan -/types/cli-table2/ @mgroenhoff -/types/client-sessions/ @netroy -/types/cliff/ @brynbellomy -/types/clipboard/ @impworks -/types/clipboard-js/ @markwongsk -/types/clipboardy/ @BendingBender -/types/clndr/ @jasperjn -/types/closure-compiler/ @mprobst -/types/cloud-env/ @Morfent -/types/cloudflare-apps/ @MartynasZilinskas -/types/co-body/ @geoffreak -/types/co-views/ @devlee @geoffreak -/types/code/ @prashaantt -/types/codemirror/ @mihailik @nrbernard -/types/codependency/ @morphatic -/types/coffeeify/ @tkQubo -/types/coinstring/ @mhegazy -/types/collections/ @scarabedore -/types/color/v0/ @LKay -/types/color/v1/ @LKay -/types/color/ @Airlun -/types/color-convert/ @Airlun -/types/color-name/ @Ailrun -/types/color-string/ @BendingBender @danmarshall -/types/colorbrewer/ @mtraynham -/types/colors/ @Bartvds @staeke -/types/com.darktalker.cordova.screenshot/ @akarienta -/types/combine-source-map/ @TeamworkGuy2 -/types/combined-stream/ @felixge @tlaziuk -/types/combokeys/ @iclanton -/types/cometd/ @derekcicerone -/types/command-line-args/ @CzBuCHi -/types/command-line-commands/ @CzBuCHi -/types/commander/ @alan-agius4 @mdezem @vvakame -/types/commangular/ @hiraash -/types/comment-json/ @Jason3S -/types/common-tags/ @zuzusik -/types/commonmark/ @nicojs @leonard-thieu -/types/compare-version/ @jpevarnek -/types/complex/ @AyaMorisawa -/types/component-emitter/ @psnider -/types/compose-function/ @denis-sokolov -/types/compressible/ @BendingBender -/types/compression/ @santialbo -/types/compression-webpack-plugin/ @dublicator -/types/concat-stream/ @jmarianer -/types/concaveman/ @DenisCarriere -/types/conf/v0/ @SamVerschueren -/types/conf/ @SamVerschueren @BendingBender -/types/confidence/ @jppellerin -/types/config/ @RWander -/types/configstore/ @ArcticLight -/types/confit/ @ethanresnick -/types/connect/ @SomaticIT -/types/connect-ensure-login/ @0x6368656174 -/types/connect-flash/ @AndreasGassmann -/types/connect-history-api-fallback/ @douglasduteil -/types/connect-livereload/ @SomaticIT -/types/connect-modrewrite/ @tinganho -/types/connect-mongo/ @Syati -/types/connect-redis/ @xstoudi @morcerf -/types/connect-slashes/ @samherrmann -/types/connect-timeout/ @cyrilschumacher -/types/console-stamp/ @ericbyers -/types/consolidate/ @soywiz @theosherry @nicolashenry -/types/consul/ @chrootsu -/types/content-disposition/ @bomret -/types/content-type/ @horiuchi @BendingBender -/types/contentful-resolve-response/ @antonkarsten -/types/contextjs/ @kernhanda -/types/continuation-local-storage/ @rath @heycalmdown @aboveyou00 -/types/convert-hrtime/ @BendingBender -/types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 -/types/convict/ @Nemo157 @vesse @elyscape -/types/cookie/ @pine613 -/types/cookie-parser/ @santialbo @BendingBender -/types/cookie-session/ @borislavjivkov -/types/cookie-signature/ @lith-light-g -/types/cookie_js/ @slawiko -/types/cookies/ @WangZishi @jkeylu @BendingBender -/types/copy-paste/ @SrTobi -/types/copy-text-to-clipboard/ @BendingBender -/types/copy-webpack-plugin/ @flying-sheep -/types/cordova-ionic/ @hendrikmaus -/types/cordova-plugin-app-version/ @Ritzlgrmft -/types/cordova-plugin-background-mode/ @Lordnoname -/types/cordova-plugin-badge/ @timbru31 -/types/cordova-plugin-ble-central/ @gjunge -/types/cordova-plugin-device-name/ @larrybahr -/types/cordova-plugin-ibeacon/ @Ritzlgrmft -/types/cordova-plugin-insomnia/ @Ritzlgrmft -/types/cordova-plugin-keyboard/ @danmana -/types/cordova-plugin-mapsforge/ @rafw87 -/types/cordova-plugin-ms-adal/ @KaiWalter -/types/cordova-plugin-native-keyboard/ @lobo87 -/types/cordova-plugin-ouralabs/ @Justin-Credible -/types/cordova-plugin-qrscanner/ @bitjson @jab -/types/cordova-plugin-spinner/ @Justin-Credible -/types/cordova-plugin-statusbar/ @Xinkai -/types/cordova-plugin-vibration/ @Minishlink -/types/cordova-plugin-x-socialsharing/ @Ritzlgrmft @larrybahr -/types/cordova-sqlite-storage/ @rafw87 -/types/cordova.plugins.diagnostic/ @dpa99c -/types/cordova_app_version_plugin/ @larrybahr -/types/cordovarduino/ @hendrikmaus -/types/core-decorators/ @tkqubo -/types/core-js/ @rbuckton @mfdeveloper -/types/cote/ @makepost -/types/couchbase/ @maouida -/types/countdown/ @gjuchault -/types/country-list/ @iRoachie -/types/country-select-js/ @humrochagf -/types/cp-file/ @BendingBender -/types/cpy/ @mhegazy @BendingBender -/types/cradle/ @panuhorsmalahti -/types/crc/ @YuJianrong -/types/create-error/ @tkrotoff -/types/createjs/ @evilangelist @gyohk -/types/createjs-lib/ @evilangelist @gyohk -/types/credential/ @phuvo -/types/credit-card-type/ @LKay -/types/cron/ @horiuchi -/types/cropperjs/ @stepancar -/types/croppie/ @connor4312 -/types/crossfilter/ @schmuli @iebaker -/types/crossroads/ @diullei -/types/cryptiles/ @awendland -/types/crypto-js/ @misak113 -/types/cryptojs/ @giabao -/types/cson/ @stpettersens -/types/csprng/ @winksaville -/types/csrf/ @markis -/types/css/ @ilich -/types/css-font-loading-module/ @slikts -/types/css-modules/ @NeekSandhu -/types/cssbeautify/ @rictic -/types/csurf/ @horiuchi -/types/csv-parse/ @davidm77 @obi-jan-kenobi -/types/csv-stringify/ @rogierschouten @arjenvanderende -/types/csvtojson/ @EricByers @wcarson -/types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender -/types/cucumber/ @abraaoalves @jan-molak @isoung @BendingBender -/types/currency-formatter/ @mhegazy -/types/custom-error-generator/ @thmiceli -/types/cwise/ @taoqf -/types/cwise-compiler/ @taoqf -/types/cwise-parser/ @taoqf -/types/cybozulabs-md5/ @pine613 -/types/cypress/ @ghengeveld @mikewoudenberg -/types/d3/v3/ @gustavderdrache @borisyankov -/types/d3/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek -/types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-box/ @lk-chen -/types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-chord/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-collection/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-color/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-contour/ @tomwanzek @Ledragon -/types/d3-dispatch/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-drag/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-ease/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-force/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-format/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-geo/ @Ledragon @tomwanzek @gustavderdrache @borisyankov -/types/d3-hexbin/ @uncovertruth @tomwanzek -/types/d3-hierarchy/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-hsv/ @arrayjam -/types/d3-interpolate/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-path/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-polygon/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-quadtree/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-queue/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-random/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-request/ @Ledragon @gustavderdrache @borisyankov @tomwanzek -/types/d3-sankey/ @tomwanzek @gustavderdrache -/types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-scale-chromatic/ @Ledragon @gustavderdrache @borisyankov -/types/d3-selection/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-selection-multi/ @gustavderdrache @borisyankov -/types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-time/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-time-format/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-timer/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-tip/ @brspnnggrt -/types/d3-transition/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-voronoi/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-zoom/ @tomwanzek @gustavderdrache @borisyankov -/types/d3.cloud.layout/ @hansrwindhoff -/types/d3.slider/ @lk-chen -/types/d3kit/ @morphatic -/types/d3pie/ @mc-petry -/types/dagre/ @qinfchen -/types/dagre-d3/ @markwongsk -/types/dargs/ @BendingBender -/types/dat-gui/ @gyohk @sonic3d @rroylance -/types/data-driven/ @mrhen -/types/datadog-metrics/ @pushplay -/types/datatables.net/ @omidkrad @pragmatrix @denisemauldin -/types/datatables.net-buttons/ @SammyG4Free @jimhartford -/types/datatables.net-fixedheader/ @szechyjs -/types/datatables.net-rowreorder/ @baywet -/types/datatables.net-select/ @szechyjs -/types/date.format.js/ @balrob -/types/dateformat/ @aicest -/types/datejs/ @rupertavery -/types/daterangepicker/ @SirMartin @smasala -/types/db-migrate-base/ @nickiannone -/types/db-migrate-pg/ @nickiannone -/types/db.js/ @cgwrench -/types/dc/ @hansrwindhoff @mtraynham -/types/deasync/ @Sicilica -/types/debessmann/ @vkorehov -/types/debounce/ @denis-sokolov -/types/debug/ @swook @galtalmor @zamb3zi -/types/decamelize/ @samverschueren -/types/decay/ @enaeseth -/types/decimal.js/ @musicist288 -/types/decorum/ @dflor003 -/types/dedent/ @douglasduteil -/types/deep-assign/ @souldreamer -/types/deep-diff/ @ZauberNerd -/types/deep-equal/ @remojansen @janslow -/types/deep-extend/ @rhysd -/types/deep-freeze/ @Bartvds @aluanhaddad -/types/deep-freeze-strict/ @mhegazy -/types/deepmerge/ @marvinscharle -/types/defaults/ @IbtihelCHNAB -/types/define-lazy-prop/ @BendingBender -/types/defined/ @BendingBender -/types/deku/ @pocka -/types/del/v2/ @AyaMorisawa -/types/del/ @AyaMorisawa @BendingBender -/types/delaunator/ @DenisCarriere -/types/delay/ @BendingBender -/types/denodeify/ @joaomoreno -/types/deoxxa-content-type/ @pine613 -/types/depd/ @danny8002 -/types/deployjava/ @cyrilschumacher -/types/destroy/ @BendingBender -/types/destroy-on-hwm/ @BendingBender -/types/detect-browser/ @rogierschouten -/types/detect-hover/ @thomastilkema -/types/detect-indent/v0/ @Bartvds -/types/detect-indent/ @Bartvds @BendingBender -/types/detect-it/ @thomastilkema -/types/detect-newline/ @BendingBender -/types/detect-passive-events/ @thomastilkema -/types/detect-pointer/ @thomastilkema -/types/detect-port/ @lith-light-g -/types/detect-touch-events/ @thomastilkema -/types/df-visible/ @Litee -/types/dhtmlxgantt/ @mkozhukh @chriscamicas -/types/dhtmlxscheduler/ @mkozhukh -/types/di-lite/ @dcrusader -/types/diacritics/ @otociulis -/types/diff/ @vvakame -/types/diff2html/ @rtfpessoa -/types/dir-resolve/ @andy-ms -/types/discontinuous-range/ @OiCMudkips -/types/disposable-email-domains/ @geoffreak -/types/doccookies/ @jonegerton -/types/dockerode/ @seikho @nlaplante @isac322 -/types/docopt/ @giggio -/types/doctrine/ @rictic -/types/documentdb/ @NoelAbrahams @brettferdosi @ctstone @yifanwu -/types/documentdb-server/ @lith-light-g -/types/dojo/ @vansimke -/types/dom-inputevent/ @diagramatics -/types/dom4/ @adidahiya @giladgray -/types/domo/ @Steve-Fenton -/types/dompurify/ @bazuzi -/types/domready/ @dotnetnerd -/types/donna/ @vvakame -/types/dookie/ @swanest -/types/dot/ @ZombieHunter -/types/dot-object/ @nkovacic -/types/dot-prop/v2/ @samverschueren -/types/dot-prop/ @samverschueren @BendingBender -/types/dotdotdot/ @milanjaros -/types/dotenv/v2/ @borekb @enaeseth -/types/dotenv/ @jussikinnula @borekb @enaeseth -/types/dotenv-safe/ @krenor -/types/dottie/ @domarmstrong -/types/doublearray/ @mzsm -/types/doubleclick-gpt/ @johngeorgewright -/types/downloadjs/ @cwmoo740 -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer -/types/draggabilly/ @jaydubu -/types/dragster/ @zskovacs -/types/dragula/ @pwelter34 @abruzzihraig -/types/dropboxjs/ @Steve-Fenton @xperiments -/types/dropkickjs/ @VorobeY1326 -/types/dropzone/v4/ @nvivo @outring @renuo @Hikariii -/types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro -/types/duplexer2/ @Goldsmith42 -/types/duplexer3/ @BendingBender -/types/durandal/ @BlueSpire -/types/dustjs-linkedin/ @mdezem -/types/dw-bxslider-4/ @namerci -/types/dwt/ @yushulx -/types/dymo-label-framework/ @thijskuipers -/types/dynatable/ @francoismassart -/types/each/ @misak113 -/types/easeljs/ @evilangelist -/types/easy-api-request/ @DeadAlready -/types/easy-jsend/ @DeadAlready -/types/easy-session/ @DeadAlready -/types/easy-table/ @nikeee -/types/easy-x-headers/ @DeadAlready -/types/easy-xapi/ @DeadAlready -/types/easy-xapi-supertest/ @DeadAlready -/types/easy-xapi-utils/ @DeadAlready -/types/easystarjs/ @borundin -/types/ebongarde-root/ @Ebongarde -/types/echarts/ @xieisabug @AntiMoron -/types/ecurve/ @mhegazy -/types/egg/ @sheperdwind -/types/egg-mock/ @sheperdwind -/types/egg.js/ @ToastHawaii -/types/ej.web.all/ @syncfusion -/types/ejs-locals/ @jt000 -/types/ejson/ @shantanubhadoria -/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous -/types/electron-config/ @mrfunkycold @unindented -/types/electron-debug/ @unindented -/types/electron-devtools-installer/ @gamesmaxed -/types/electron-json-storage/ @stpettersens -/types/electron-notifications/ @djpereira -/types/electron-notify/ @djpereira -/types/electron-packager/ @SomaticIT @cortopy -/types/electron-settings/v2/ @leonard-thieu -/types/electron-settings/ @icopp -/types/electron-store/ @unindented -/types/electron-window-state/ @rhysd -/types/element-ready/ @BendingBender -/types/element-resize-event/ @rogierschouten @plgregoire -/types/elm/ @thSoft -/types/email-addresses/ @johngrimsey -/types/email-templates/ @cyrilschumacher @gurisko -/types/email-validator/ @paullessing -/types/ember/v1/ @jedmao -/types/ember/ @jedmao @bttf -/types/emissary/ @vvakame -/types/emojione/ @dbrgn -/types/empower/ @vvakame -/types/emscripten/ @zakki @periklis -/types/engine.io/ @KentarouTakeda -/types/engine.io-client/ @KentarouTakeda -/types/enhanced-resolve/ @e-cloud @onigoetz -/types/ent/ @rogierschouten -/types/entities/ @aliceklipper -/types/env-to-object/ @MugeSo -/types/envify/ @tkQubo -/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden -/types/enzyme-to-json/ @joscha -/types/eonasdan-bootstrap-datetimepicker/ @ToastHawaii -/types/epiceditor/ @borisyankov -/types/epub/ @julien-c -/types/eq.js/ @stephenlautier -/types/errorhandler/ @santialbo -/types/es6-collections/ @rbuckton -/types/es6-error/ @LKay -/types/es6-promise/ @fdecampredon @vvakame -/types/es6-promisify/ @harryshipton -/types/es6-shim/ @rbuckton -/types/es6-weak-map/ @pine -/types/escape-html/ @elisee -/types/escape-latex/ @olsio -/types/escape-string-regexp/ @kruncher -/types/escodegen/ @simondel -/types/eslint-plugin-prettier/ @ikatyang -/types/esprima/ @teppeis @RReverser -/types/esprima-walk/ @tswaters -/types/esri-leaflet/ @strajuser -/types/esri-leaflet-geocoder/ @BendingBender -/types/estraverse/ @sanex3339 -/types/estree/ @RReverser -/types/etag/ @BendingBender -/types/ethjs-signer/ @doppio -/types/eureka-js-client/ @Schnillz -/types/evaporate/ @kookster @chrisrhoden -/types/event-emitter/ @LKay -/types/event-kit/ @enlight -/types/event-loop-lag/ @rogierschouten -/types/event-stream/ @flcdrg -/types/event-to-promise/ @flying-sheep -/types/evernote/ @corps -/types/exceljs/ @rogierschouten @alitaheri -/types/execa/ @douglasduteil @BendingBender -/types/exit/ @Bartvds -/types/exit-hook/ @BendingBender -/types/exorcist/ @TeamworkGuy2 -/types/expect/ @jmreidy @merrywhether -/types/expect.js/ @teppeis -/types/expectations/ @vvakame -/types/expr-eval/ @connor4312 -/types/express/ @borisyankov -/types/express-brute/ @cyrilschumacher -/types/express-brute-memcached/ @cyrilschumacher -/types/express-brute-mongo/ @cyrilschumacher -/types/express-debug/ @federicobond -/types/express-domain-middleware/ @hookclaw -/types/express-enforces-ssl/ @kevinstubbs -/types/express-fileupload/ @Naktibalda -/types/express-flash-2/ @mathsalmi -/types/express-formidable/ @tdolsen -/types/express-graphql/ @isman-usoh @nitintutlani -/types/express-handlebars/ @stpettersens @yhaskell -/types/express-jwt/ @wokim @kacepe @Sl1MBoy -/types/express-less/ @xieyubo -/types/express-minify/ @borislavjivkov -/types/express-mung/ @cyrilschumacher -/types/express-myconnection/ @Cellule -/types/express-mysql-session/ @Akim95 -/types/express-openapi/ @mugeso -/types/express-partials/ @jt000 -/types/express-rate-limit/ @cyrilschumacher -/types/express-route-fs/ @kripod -/types/express-sanitized/ @cjbarth -/types/express-serve-static-core/ @borisyankov @19majkel94 @kacepe -/types/express-session/ @horiuchi -/types/express-unless/ @wokim -/types/extend/ @reppners -/types/extended-listbox/ @code-chris -/types/extjs/ @brian428 -/types/extract-stack/ @BendingBender -/types/extract-text-webpack-plugin/ @flying-sheep @katyo -/types/extract-zip/ @mizunashi-mana -/types/eyes/ @brynbellomy -/types/f1/ @neolwc -/types/fabric/ @oklemencic @joewashear007 @mrand01 -/types/facebook-js-sdk/ @amritk -/types/facebook-pixel/ @noctishsu -/types/faker/v3/ @Kuniwak -/types/faker/ @bensw @basp @Kuniwak -/types/falcor/ @Quramy -/types/falcor-express/ @Quramy -/types/falcor-http-datasource/ @Quramy -/types/falcor-json-graph/ @Quramy -/types/falcor-router/ @Quramy @cdhgee -/types/famous/ @borisvasilenko -/types/fancybox/ @borisyankov -/types/farbtastic/ @EnableSoftware -/types/fast-diff/ @djrenren -/types/fast-levenshtein/ @mizunashi-mana -/types/fast-stats/ @rogierschouten -/types/fastclick/ @shinnn -/types/favico.js/ @drowse314-dev-ymat -/types/fb/ @JoshStrobl -/types/fbemitter/ @kmxz -/types/featherlight/ @xStrom -/types/fecha/ @9y5 -/types/fetch-jsonp/ @tkrotoff -/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair -/types/fetch.io/ @newraina -/types/ffi/ @loyd -/types/ffmpeg-static/ @iamstevetran -/types/ffprobe-static/ @iamstevetran -/types/fibers/ @soywiz -/types/figures/ @BendingBender -/types/file-exists/ @BendingBender -/types/file-saver/ @cyrilschumacher @DaIgeb -/types/file-type/ @tcaesvk @BendingBender -/types/filenamify/ @rokt33r -/types/filesize/ @GiedriusGrabauskas -/types/fill-pdf/ @westy92 -/types/finalhandler/ @chrootsu -/types/finch/ @DavidSichau -/types/find-up/ @BendingBender -/types/findup-sync/ @Bartvds @ngbrown -/types/fingerprintjs/ @zaneli -/types/fingerprintjs2/ @curtstate -/types/firebase/ @vbortone @dsebastien @ciekawy -/types/firebase-client/ @fpsscarecrow -/types/firebase-token-generator/ @dotdotcommadot -/types/firebird/ @karak -/types/firefox/ @vvakame -/types/firmata/ @troywweber7 -/types/first-mate/ @enlight -/types/fixed-data-table/ @pepaar @stephenjelfs -/types/flat/ @chrootsu -/types/flatpickr/v2/ @UnwrittenFun -/types/flatpickr/ @UnwrittenFun @rowellx68 @wagich -/types/flexslider/ @diullei -/types/flight/ @jonathanhedren -/types/flightplan/ @borislavjivkov -/types/flipsnap/ @kubosho @gsino @mayuki -/types/flot/ @burlandm @Anticom -/types/flowjs/ @ryan10132 -/types/fluent-ffmpeg/ @tcaesvk @DingWeizhe -/types/flux/ @stkb @GiedriusGrabauskas -/types/flux-standard-action/ @tkqubo -/types/fluxxor/ @mrk21 -/types/fm-websync/ @markusmauch -/types/fontfaceobserver/ @RandScullard -/types/fontoxml/ @rolandzwaga -/types/forever-monitor/ @shuntksh -/types/forge-di/ @adamcarr -/types/form-data/ @soywiz @leonyu @BendingBender -/types/form-serializer/ @flqw -/types/format-unicorn/ @kruncher -/types/formidable/ @Nemo157 -/types/forwarded/ @BendingBender -/types/fossil-delta/ @endel -/types/foundation/ @borisyankov -/types/foundation-sites/ @samvloeberghs -/types/fpsmeter/ @alampros -/types/framebus/ @kbukum -/types/freedom/ @jpevarnek -/types/freeport/ @atd-schubert -/types/fresh/ @BendingBender -/types/frisby/ @johnny4753 -/types/from/ @Bartvds -/types/from2/ @BendingBender -/types/fromjs/ @glenndierckx -/types/fromnow/ @marinewater -/types/fs-ext/ @OguzhanE -/types/fs-extra/ @alan-agius4 @midknight41 @shiftkey -/types/fs-extra-promise/ @midknight41 @jasonswearingen @HiromiShikata -/types/fs-extra-promise-es6/ @midknight41 @jasonswearingen @geoffreak @HiromiShikata -/types/fs-finder/ @misak113 -/types/fs-mock/ @rogierschouten -/types/fs-promise/ @tarruda -/types/fsevents/ @BendingBender -/types/ftdomdelegate/ @dotnetnerd -/types/ftp/ @rogierschouten -/types/ftpd/ @rogierschouten -/types/fullcalendar/v1/ @nestalk @hasellcamargo -/types/fullcalendar/ @nestalk @hasellcamargo @panic175 -/types/fullname/ @kayahr -/types/fuse/ @smrq -/types/fusioncharts/ @rohitkr @shivarajkv -/types/fuzzaldrin/ @mhegazy -/types/fuzzaldrin-plus/ @jeancroy @jkillian -/types/fuzzyset/ @lgrignon -/types/fxn/ @charrondev -/types/gae.channel.api/ @vvakame -/types/gamequery/ @Laubi -/types/gandi-livedns/ @xstoudi -/types/gapi/ @sgtfrankieboy -/types/gapi.analytics/ @gatsbimantico -/types/gapi.auth2/ @flawless2011 -/types/gapi.calendar/ @tkrotoff -/types/gapi.drive/ @baxtersa -/types/gapi.pagespeedonline/ @sgtfrankieboy -/types/gapi.people/ @tkrotoff -/types/gapi.plus/ @tkrotoff -/types/gapi.translate/ @sgtfrankieboy -/types/gapi.urlshortener/ @sgtfrankieboy -/types/gapi.youtube/ @sgtfrankieboy -/types/gapi.youtubeanalytics/ @sgtfrankieboy -/types/gaussian/ @scttcper -/types/generic-functions/ @stpettersens -/types/generic-pool/ @jerray -/types/gently/ @bonnici -/types/geodesy/ @DenisCarriere @HandyG52 -/types/geojson/ @cobster -/types/geojson2osm/ @DenisCarriere -/types/geokdbush/ @DenisCarriere -/types/geolib/ @vvenegasv @dotnetpart -/types/geometry-dom/ @nakakura -/types/geopattern/ @Gaelan -/types/get-node-dimensions/ @vincekovacs -/types/get-stdin/ @DanielRosenwasser -/types/get-stream/ @douglasduteil @BendingBender -/types/getos/ @BendingBender -/types/gettext.js/ @jucrouzet -/types/gijgo/ @atatanasov -/types/giraffe/ @darthapo -/types/git/ @vvakame -/types/git-config/ @stpettersens -/types/git-remote-origin-url/ @janslow -/types/gl-matrix/ @mattijskneppers @tatchx -/types/gldatepicker/ @qcz -/types/glidejs/ @milanjaros -/types/glob/ @vvakame @voy -/types/glob-base/ @alan-agius4 -/types/glob-expand/ @vvakame -/types/glob-stream/ @Bartvds -/types/global-tunnel-ng/ @BendingBender -/types/globalize/ @gcastre @afromogli -/types/globalize-compiler/ @iclanton -/types/globby/ @douglasduteil -/types/globule/ @durad -/types/gm/ @ChaosinaCan -/types/go/ @NorthwoodsSoftware -/types/google-adwords-scripts/ @jafaircl -/types/google-apps-script/ @motemen -/types/google-cloud__storage/ @blove @nbperry -/types/google-earth/ @icholy -/types/google-images/ @dolanmiu -/types/google-libphonenumber/ @leonyu -/types/google-map-react/ @honzabrecka -/types/google-maps/ @DeividasBakanas @GiedriusGrabauskas -/types/google-protobuf/ @marcuslongmuir -/types/google.feeds/ @RodneyJT -/types/google.fonts/ @danmarshall -/types/google.geolocation/ @vbortone -/types/google.picker/ @grapswiz -/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov -/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello -/types/googlemaps.infobubble/ @Dashue -/types/got/ @BendingBender @LinusU -/types/graceful-fs/ @Bartvds -/types/graham_scan/ @hberntsen -/types/graphene-pk11/ @microshine -/types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet -/types/graphql-date/ @enaeseth -/types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo -/types/graphql-type-json/ @schfkt -/types/graphviz/ @mhfrantz -/types/gravatar/ @denis-sokolov -/types/greasemonkey/ @kotas -/types/grecaptcha/ @DethAriel -/types/gregorian-calendar/ @cwalv -/types/griddle-react/ @hodavidhara -/types/gridfs-stream/ @liorm -/types/gridstack/ @PascalSenn @ZoolWay @Sl1MBoy -/types/grunt/ @jeffmay @basarat -/types/gsap/ @codebelt @ProbablePrime -/types/gulp/ @GiedriusGrabauskas -/types/gulp-angular-templatecache/ @amanmahajan7 -/types/gulp-babel/ @AyaMorisawa -/types/gulp-batch/ @alvarollmenezes @vizeke -/types/gulp-cache/ @aravindarun -/types/gulp-cached/ @tomc974 -/types/gulp-changed/ @tomc974 -/types/gulp-cheerio/ @tkQubo -/types/gulp-coffeeify/ @tkQubo -/types/gulp-coffeelint/ @tkQubo -/types/gulp-concat/ @k-kagurazaka -/types/gulp-connect/ @andrewiggins -/types/gulp-copy/ @aravindarun -/types/gulp-csso/ @tkrotoff -/types/gulp-debug/ @tkrotoff -/types/gulp-diff/ @ikatyang -/types/gulp-dtsm/ @AyaMorisawa -/types/gulp-espower/ @tkQubo -/types/gulp-file-include/ @DanielRosenwasser -/types/gulp-filter/ @tkrotoff -/types/gulp-flatten/ @k-kagurazaka -/types/gulp-gzip/ @tkQubo -/types/gulp-help/ @tkQubo -/types/gulp-help-doc/ @Mikhus -/types/gulp-html-replace/ @peterjuras -/types/gulp-htmlmin/ @tkrotoff -/types/gulp-if/ @joeskeen -/types/gulp-inject/ @k-kagurazaka -/types/gulp-insert/ @shantmarouti -/types/gulp-install/ @peterjuras -/types/gulp-jade/ @berwyn -/types/gulp-jasmine-browser/ @tkrotoff -/types/gulp-json-editor/ @peterjuras -/types/gulp-jspm/ @peterjuras -/types/gulp-less/ @k-kagurazaka -/types/gulp-load-plugins/ @joeskeen -/types/gulp-minify-css/ @k-kagurazaka -/types/gulp-minify-html/ @tkrotoff -/types/gulp-modernizr/ @remisery -/types/gulp-newer/ @tomc974 -/types/gulp-ng-annotate/ @tkQubo -/types/gulp-nodemon/ @tkQubo -/types/gulp-plumber/ @joeskeen -/types/gulp-protractor/ @tkrotoff -/types/gulp-pug/ @remisery -/types/gulp-remember/ @tomc974 -/types/gulp-rev/ @tkrotoff -/types/gulp-rev-replace/ @tkrotoff -/types/gulp-ruby-sass/ @agnislav -/types/gulp-shell/ @tkqubo -/types/gulp-size/ @tkrotoff @remisery -/types/gulp-sort/ @joeskeen -/types/gulp-strip-debug/ @peterjuras -/types/gulp-svg-sprite/ @tkqubo -/types/gulp-task-listing/ @joeskeen -/types/gulp-tsd/ @k-kagurazaka -/types/gulp-uglify/ @ChristopherHaws @leonard-thieu -/types/gulp-useref/ @tkrotoff -/types/gulp-util/ @jedmao -/types/gulp-watch/ @tkrotoff -/types/gzip-size/ @plantain-00 -/types/h2o2/ @jasonswearingen @AJamesPhillips -/types/halfred/ @dherges -/types/halogen/ @steller -/types/hammerjs/ @milkisevil @codler -/types/handlebars/ @borisyankov -/types/handsontable/ @panesofglass @astegmaier -/types/hapi/v8/ @jasonswearingen -/types/hapi/v12/ @jasonswearingen -/types/hapi/v15/ @jasonswearingen -/types/hapi/ @jasonswearingen @AJamesPhillips -/types/hapi-auth-basic/ @AJamesPhillips -/types/hapi-auth-jwt2/ @warrenseymour -/types/hapi-decorators/ @kenhowardpdx -/types/har-format/ @micmro -/types/hard-rejection/ @BendingBender -/types/harmony-proxy/ @remojansen -/types/has-ansi/ @BendingBender -/types/hash-file/ @HiromiShikata -/types/hash-stream/ @BendingBender -/types/hasha/ @BendgingBender -/types/hasher/ @flyfishMT -/types/hashids/ @pocesar -/types/hashmap/ @outring -/types/haversine/ @screendriver -/types/he/ @sedwards2009 -/types/headroom/ @hakubo -/types/heap/ @ryan10132 -/types/heatmap.js/ @lookuptable -/types/hedron/ @dborysov -/types/hellojs/ @PavelPZ @vuorinem -/types/hellosign-embedded/ @xt0rted -/types/helmet/ @cyrilschumacher @EvanHahn @bluehatbrit -/types/heredatalens/ @denyo -/types/heremaps/ @Josh-ES @denyo -/types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens -/types/highcharts-ng/ @scatcher -/types/highland/ @Bartvds @hgwood @iwllyu -/types/highlight.js/ @nikeee @sourrust -/types/hiredis/ @titan -/types/history/v2/ @sergey-buturlakin @ngbrown -/types/history/v3/ @sergey-buturlakin @ngbrown @LKay -/types/history/ @sergey-buturlakin @ngbrown @rokoroku -/types/history.js/ @borisyankov @gjunge -/types/hjson/ @crunchie84 -/types/hls.js/ @jgainfort -/types/hoek/ @prashaantt -/types/homeworks/ @KennethanCeyer -/types/hooker/ @misak113 -/types/hopscotch/ @pimterry -/types/howler/ @xperiments @tdukart -/types/hpp/ @kryops -/types/html-entities/ @xstoudi -/types/html-minifier/ @tkrotoff -/types/html-pdf/ @westy92 -/types/html-to-text/ @erykwarren -/types/html-webpack-plugin/ @deevus @bumbleblym -/types/html-webpack-template/ @bumbleblym -/types/html2canvas/ @rwhepburn @tan9 -/types/htmlbars-inline-precompile/ @chriskrycho -/types/htmlparser2/ @staticfunction -/types/htmltojsx/ @basarat -/types/http-assert/ @jkeylu -/types/http-aws-es/ @marcogrcr -/types/http-codes/ @mhegazy -/types/http-errors/ @tkrotoff @BendingBender -/types/http-proxy/ @SomaticIT -/types/http-proxy-middleware/ @zebMcCorkle @BendingBender -/types/http-status/ @misak113 -/types/http-status-codes/ @JoshMcCullough -/types/http-string-parser/ @pine613 -/types/httperr/ @yortus -/types/hubot/ @dirk -/types/hubspot-pace/ @borislavjivkov -/types/humane/ @jmvrbanac -/types/humanize-plus/ @DenisCarriere -/types/humanparser/ @MichalPodeszwa -/types/humps/ @nikeee -/types/hyco-ws/ @mrcabellom -/types/hyperscript/ @spacejack @jmfirth -/types/hypertext-application-language/ @maks3w -/types/hystrixjs/ @igorsechyn -/types/i18n/ @SomaticIT @FindQ -/types/i18next/v2/ @mxl @deerawan @GiedriusGrabauskas -/types/i18next/ @mxl @deerawan @GiedriusGrabauskas -/types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas -/types/i18next-browser-languagedetector/ @cyrilschumacher @GiedriusGrabauskas -/types/i18next-express-middleware/ @cyrilschumacher -/types/i18next-node-fs-backend/ @cyrilschumacher -/types/i18next-sprintf-postprocessor/ @cyrilschumacher -/types/i18next-xhr-backend/ @jamuhl @GiedriusGrabauskas -/types/i2c-bus/ @101100 -/types/iban/ @cyrilschumacher -/types/ibm-mobilefirst/ @nacho4d -/types/ibm_db/ @agov -/types/icepick/ @ngbrown @tobico -/types/icheck/ @qcz -/types/iconv/ @delphinus35 -/types/iconv-lite/ @poelstra -/types/ids/ @3fd -/types/iframe-resizer/ @arminbaljic -/types/ignite-ui/ @IgniteUI -/types/image-size/ @elisee -/types/imagemagick/ @soywiz -/types/imagemagick-native/ @horiuchi -/types/imagemapster/ @delphinus35 -/types/images/ @DingWeizhe -/types/imagesloaded/ @coldacid @apexskier -/types/imap/ @psnider -/types/imap-simple/ @pushplay -/types/imgur-rest-api/ @lukewestby -/types/immutability-helper/ @seansfkelley -/types/impress/ @borisyankov -/types/in-range/ @DanielRosenwasser -/types/incremental-dom/ @basarat @lanthaler @vvakame -/types/indent-string/ @mhegazy -/types/inert/ @nycdotnet @AJamesPhillips -/types/inflected/ @dsci -/types/inflection/ @shiwano -/types/inherits/ @chrootsu -/types/ini/ @marcinporebski -/types/iniparser/ @chrootsu -/types/inline-css/ @philipisapain -/types/inline-style-prefixer/ @ahz @dpetrezselyova -/types/inquirer/ @tkQubo @ppathan -/types/insert-module-globals/ @leonard-thieu -/types/insight/ @vvakame -/types/integer/ @Morfent -/types/interact.js/ @dduugg @adidahiya @thasner -/types/intercomjs/ @spencerwi -/types/internal-ip/ @BendingBender -/types/intl/ @RagibHasin -/types/intl-messageformat/ @mhegazy -/types/intl-tel-input/ @fdnhkj @leonard-thieu -/types/into-stream/ @BendingBender -/types/intro.js/ @anahkiasen -/types/invariant/ @bennett000 -/types/inversify-devtools/ @inversify -/types/ion.rangeslider/v1/ @dduugg -/types/ion.rangeslider/ @sixinli -/types/ionic/ @spencerwi -/types/ioredis/ @chrisleck -/types/ip/ @codeanimal -/types/ip-regex/ @unindented -/types/irc/ @phillips1012 -/types/is/ @cabralRodrigo -/types/is-absolute-url/ @mhegazy -/types/is-alphanumerical/ @vutran -/types/is-archive/ @mhegazy -/types/is-array/ @pine -/types/is-binary-path/ @DanielRosenwasser -/types/is-compressed/ @mhegazy -/types/is-finite/ @mhegazy -/types/is-ip/ @coderslagoon -/types/is-my-json-valid/ @kruncher -/types/is-number/ @harryshipton -/types/is-path-cwd/ @DanielRosenwasser -/types/is-path-in-cwd/ @mhegazy -/types/is-plain-object/ @zengfenfei -/types/is-promise/ @DanielRosenwasser -/types/is-relative-url/ @mhegazy -/types/is-root/ @mhegazy -/types/is-root-path/ @mhegazy -/types/is-stream/ @me -/types/is-svg/ @BendingBender -/types/is-text-path/ @mhegazy -/types/is-url/ @RyotaMurohoshi -/types/is-url-superb/ @kryops -/types/is-windows/ @mizunashi-mana -/types/isbn-utils/ @elhaard -/types/iscroll/ @csrakowski -/types/iso-3166-2/ @sicilica -/types/iso8601-localizer/ @avielfedida -/types/isomorphic-fetch/ @toddlucas -/types/isotope-layout/ @avidenic -/types/istanbul/ @tkrotoff -/types/istanbul-middleware/ @hookclaw -/types/ityped/ @DanielRosenwasser -/types/ix.js/ @Igorbek -/types/jade/ @panuhorsmalahti -/types/jalaali-js/ @alitaheri -/types/japanese-holidays/ @syamatoo -/types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software -/types/jasmine-ajax/ @lgrignon -/types/jasmine-data_driven_tests/ @AnthonyMacKinnon -/types/jasmine-enzyme/ @bolatovumar -/types/jasmine-es6-promise-matchers/ @stephenlautier -/types/jasmine-expect/ @GeneralCss -/types/jasmine-fixture/ @craigbrett17 -/types/jasmine-given/ @shairez -/types/jasmine-jquery/ @gstamac -/types/jasmine-matchers/ @Bartvds -/types/jasmine-node/ @svi3c -/types/jasmine-promise-matchers/ @matthewjh -/types/jasmine_dom_matchers/ @devoto13 -/types/jasminewd2/ @sjelin -/types/java/ @jimlloyd @hrl7 -/types/java-applet/ @cyrilschumacher -/types/javascript-astar/ @ptlis -/types/javascript-bignum/ @sandersn -/types/javascript-obfuscator/ @sanex3339 -/types/javascript-state-machine/ @borisyankov @mdocter @MrBigDog2U @samael65535 @taoqf -/types/jbinary/ @tbureck -/types/jcanvas/ @rogierschouten -/types/jdataview/ @RReverser -/types/jdenticon/ @mtr -/types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang -/types/jest-matchers/ @joscha -/types/jfs/ @tlaziuk -/types/jimp/ @Jack-Works -/types/jjv/ @Nemo157 -/types/jjve/ @Nemo157 -/types/jmespath/ @pushplay -/types/jodata/ @cgwrench -/types/johnny-five/ @nakakura -/types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW -/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt -/types/joigoose/ @boothwhack -/types/jointjs/ @areel @DavidDurman @DenEwout @CaselIT @ChrisMoran -/types/jpm/ @github-account-because-they-want-it -/types/jqgrid/ @lokeshpeta -/types/jqrangeslider/ @qcz -/types/jquery/v1/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu -/types/jquery/v2/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu -/types/jquery/ @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @johnnyreilly @DickvdBrink @King2500 -/types/jquery-ajax-chain/ @humana-fragilitas -/types/jquery-alertable/ @stever -/types/jquery-backstretch/ @dkulyk -/types/jquery-cropbox/ @PerKastman -/types/jquery-deparam/ @patsissons -/types/jquery-easy-loading/ @delphinus35 -/types/jquery-editable-select/ @baywet -/types/jquery-fullscreen/ @bgrieder -/types/jquery-galleria/ @rimig -/types/jquery-handsontable/ @intelorca -/types/jquery-jsonrpcclient/ @Ty3uK -/types/jquery-knob/ @iain8 -/types/jquery-mask-plugin/ @avidenic -/types/jquery-match-height/ @kbytesys -/types/jquery-mockjax/ @laszlojakab @vladeck -/types/jquery-mousewheel/ @xt0rted -/types/jquery-param/ @patsissons -/types/jquery-sortable/ @Seltzer -/types/jquery-steps/ @jblank @nickwph -/types/jquery-timeentry/ @marknadig -/types/jquery-toastmessage-plugin/ @joeskeen -/types/jquery-truncate-html/ @abraaoalves -/types/jquery-urlparam/ @stpettersens -/types/jquery-validation-unobtrusive/ @EnableSoftware -/types/jquery.address/ @martinduparc @mardaneus86 -/types/jquery.are-you-sure/ @jonegerton -/types/jquery.autosize/ @kingdango -/types/jquery.bbq/ @sunetos -/types/jquery.bootstrap.wizard/ @niemyjski -/types/jquery.cleditor/ @pushplay -/types/jquery.clientsidelogging/ @diullei -/types/jquery.color/ @derekcicerone -/types/jquery.colorbox/ @gjunge -/types/jquery.colorpicker/ @pushplay -/types/jquery.contextmenu/ @nvivo -/types/jquery.cookie/ @RoyGoode @BenLorantfy -/types/jquery.customselect/ @adamcoulombe -/types/jquery.cycle2/ @dnadolny -/types/jquery.dropotron/ @cyrilschumacher -/types/jquery.dynatree/ @fdecampredon -/types/jquery.elang/ @sumegizoltan -/types/jquery.fancytree/ @alphaleonis @abedi-ir -/types/jquery.finger/ @maxackley -/types/jquery.flagstrap/ @felipedgarcia -/types/jquery.fullscreen/ @piraveen -/types/jquery.gridster/ @jbaldwin -/types/jquery.growl/ @yeganemehr -/types/jquery.highlight-bartaz/ @Pro -/types/jquery.jnotify/ @jamescurran -/types/jquery.joyride/ @vbortone -/types/jquery.jsignature/ @pjmagee -/types/jquery.leanmodal/ @FinelySliced -/types/jquery.livestampjs/ @vbortone -/types/jquery.notify/ @evil-shrike -/types/jquery.notifybar/ @zaneli -/types/jquery.noty/ @kingdango @thelfensdrfer -/types/jquery.payment/ @ejsmith @johnrutherford -/types/jquery.pjax/ @lijunle -/types/jquery.placeholder/ @majorsilence @EnableSoftware -/types/jquery.pnotify/ @DavidSichau @FUNExtreme -/types/jquery.postmessage/ @lijunle -/types/jquery.prettyphoto/ @pgaske -/types/jquery.qrcode/ @danmana -/types/jquery.rateit/ @gjunge -/types/jquery.rowgrid/ @vinayak-garg -/types/jquery.scrollto/ @nestalk -/types/jquery.simplemodal/ @ForNeVeR -/types/jquery.simplepagination/ @nvivo -/types/jquery.simulate/ @derekcicerone -/types/jquery.slimscroll/ @Promact -/types/jquery.soap/ @tigerxy -/types/jquery.sortelements/ @tbureck -/types/jquery.superlink/ @niemyjski -/types/jquery.tagsmanager/ @vbortone -/types/jquery.tile/ @zaneli -/types/jquery.timepicker/ @anwarjaved -/types/jquery.timer/ @JoshStrobl -/types/jquery.tinycarousel/ @csrakowski -/types/jquery.tinyscrollbar/ @csrakowski -/types/jquery.tipsy/ @bdukes -/types/jquery.tools/ @joeskeen -/types/jquery.tooltipster/ @pjmagee @VorobeY1326 @leonard-thieu @janhi -/types/jquery.total-storage/ @JeremyCBrooks -/types/jquery.transit/ @MrBigDog2U -/types/jquery.ui.datetimepicker/ @dougajmcdonald -/types/jquery.ui.layout/ @Steve-Fenton @drarmstr -/types/jquery.uniform/ @flyfishMT -/types/jquery.validation/ @fdecampredon @johnnyreilly @avidenic -/types/jquery.watermark/ @anwarjaved -/types/jquerymobile/ @borisyankov -/types/jqueryui/ @borisyankov @johnnyreilly -/types/js-base64/ @DenisCarriere -/types/js-beautify/ @JoshuaKGoldberg @hansrwindhoff -/types/js-clipper/ @omni360 -/types/js-combinatorics/ @outring -/types/js-cookie/ @theodorejb -/types/js-data/v1/ @reppners -/types/js-data/ @reppners -/types/js-data-angular/ @reppners -/types/js-data-http/ @reppners -/types/js-fixtures/ @kazimanzurrashid -/types/js-git/ @Bartvds -/types/js-md5/ @mwmccarthy -/types/js-quantities/ @wrummler -/types/js-schema/ @marcinporebski @roblabat -/types/js-search/ @guoyunhe -/types/js-to-java/ @skyitachi -/types/js-url/ @pine613 -/types/js-yaml/ @Bartvds @sclausen -/types/js.spec/ @mattbishop -/types/jsbn/ @Evgenus -/types/jscrollpane/ @qcz -/types/jsdeferred/ @minodisk -/types/jsdom/ @leonard-thieu -/types/jsen/ @vladeck -/types/jsend/ @CaselIT -/types/jsesc/ @Bartvds -/types/jsfl/ @soywiz -/types/jsforce/ @dolanmiu @netes -/types/jshamcrest/ @dharkness -/types/jsmockito/ @shiver-me-timbers -/types/jsnox/ @stkb @DovydasNavickas -/types/json-merge-patch/ @senyaarseniy -/types/json-patch/ @vvakame -/types/json-pointer/ @Bartvds -/types/json-rpc-ws/ @npenin -/types/json-schema/ @bcherny -/types/json-socket/ @svi3c -/types/json-stable-stringify/ @mhfrantz -/types/json-stringify-safe/ @BendingBender -/types/json2md/ @MartynasZilinskas -/types/jsoneditor/ @alejo90 -/types/jsoneditoronline/ @vbortone -/types/jsonminify/ @no23reason -/types/jsonnet/ @hookclaw -/types/jsonp/ @surenkov -/types/jsonpath/ @horiuchi @ikatyang -/types/jsonrpc-serializer/ @Akim95 -/types/jsonstream/ @Bartvds -/types/jsonwebtoken/ @SomaticIT @danielheim -/types/jspdf/ @amberjs -/types/jsplumb/ @shearnie -/types/jsrender/ @zakki -/types/jsrp/ @harryshipton -/types/jss/ @Ptival -/types/jssha/ @randombk @SrTobi -/types/jstimezonedetect/ @olamothe -/types/jstorage/ @dflor003 -/types/jstree/ @adaskothebeast -/types/jsts/ @StephaneAlie -/types/jsuite/ @darrenhillconsulting -/types/jsuri/ @coldacid @flqw -/types/jsurl/ @agorshkov23 -/types/jsx-chai/ @nupplaphil -/types/jszip/ @mzeiher -/types/jug/ @yevt -/types/jui/ @easylogic -/types/jui-core/ @easylogic -/types/jui-grid/ @easylogic -/types/jweixin/ @taoqf -/types/jwplayer/ @martinduparc -/types/jwt-client/ @timoteoponce -/types/jwt-decode/ @GiedriusGrabauskas @madsmadsen -/types/jwt-simple/ @kenfdev @GaelMagnan -/types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram -/types/karma/ @tkrotoff -/types/karma-chai/ @JayAndCatchFire -/types/karma-chai-sinon/ @vasek17 -/types/karma-coverage/ @tkrotoff -/types/karma-fixture/ @evictor -/types/karma-jasmine/ @michelsalib -/types/katex/ @mrand01 -/types/kcors/ @Xstoudi @izayoiko -/types/kdbush/ @DenisCarriere -/types/kefir/ @AyaMorisawa -/types/kendo-ui/ @telerik -/types/keyboardjs/ @vbortone @piranha771 -/types/keycloak-js/ @eppsilon -/types/keygrip/ @jkeylu -/types/keymaster/ @nitram509 -/types/keymirror/ @jfahrenkrug -/types/keypress.js/ @rcchen -/types/keysym/ @harryshipton -/types/keytar/ @miniak @shiftkey @juturu -/types/kik-browser/ @joelday -/types/klaw/ @mceachen -/types/klaw-sync/ @shiftkey -/types/knex/ @tkQubo @baronfel -/types/knockback/ @borisyankov -/types/knockout/ @EnableSoftware @BenjaminEckardt -/types/knockout-amd-helpers/ @DavidSichau -/types/knockout-secure-binding/ @pine613 -/types/knockout-transformations/ @johnnyreilly @Nemo157 -/types/knockout.deferred.updates/ @sgaliano -/types/knockout.editables/ @borisyankov -/types/knockout.es5/ @sgaliano -/types/knockout.kogrid/ @huer12 -/types/knockout.mapper/ @BMeyerKC -/types/knockout.mapping/ @borisyankov -/types/knockout.projections/ @johnnyreilly -/types/knockout.punches/ @johnnyreilly -/types/knockout.rx/ @Igorbek -/types/knockout.validation/ @danludwig -/types/knockout.viewmodel/ @oising -/types/knockstrap/ @adaskothebeast -/types/knuddels-userapps-api/ @Knuddels -/types/ko.plus/ @conficient -/types/koa/ @DavidCai1993 @jkeylu -/types/koa-basic-auth/ @Tobias4872 -/types/koa-bodyparser/ @hellopao -/types/koa-cache-control/ @pe8ter -/types/koa-compose/ @jkeylu -/types/koa-compress/ @hellopao -/types/koa-favicon/ @hellopao -/types/koa-generic-session/ @nsimmons -/types/koa-hbs/ @jcbmln @mudkipme -/types/koa-helmet/ @me -/types/koa-json/ @brooklyndev -/types/koa-json-error/ @mudkipme -/types/koa-jwt/ @brunokrebs -/types/koa-logger/ @geoffreak -/types/koa-morgan/ @vesse -/types/koa-mount/ @amirsaber -/types/koa-passport/ @horiuchi -/types/koa-pug/ @Xstoudi -/types/koa-redis/ @nsimmons -/types/koa-route/ @migstopheles -/types/koa-router/ @hellopao @schfkt -/types/koa-send/ @pe8ter -/types/koa-session/ @kerol2r20 -/types/koa-session-minimal/ @longztian -/types/koa-static/ @hellopao -/types/koa-views/ @brooklyndev -/types/koa-websocket/ @me -/types/kolite/ @borisyankov -/types/konami.js/ @mareek -/types/kramed/ @tonicblue -/types/kss/ @giladgray -/types/kue/ @drudge @amiram @pc-jedi -/types/kuromoji/ @mzsm -/types/lab/ @prashaantt -/types/ladda/ @dflor003 @leemicw -/types/lambda-phi/ @elitechance -/types/later/ @jasond-s -/types/latinize/ @GiedriusGrabauskas -/types/launchpad/ @rictic -/types/lazy.js/ @Bartvds -/types/lazypipe/ @tomc974 -/types/ldapjs/ @cvillemure @peterkooijmans -/types/leadfoot/ @theintern -/types/leaflet/v0/ @rgripper -/types/leaflet/ @alejo90 -/types/leaflet-areaselect/ @awallat -/types/leaflet-curve/ @onikiienko -/types/leaflet-draw/ @matt-guest @reblace -/types/leaflet-editable/ @dalie -/types/leaflet-fullscreen/ @DenisCarriere -/types/leaflet-imageoverlay-rotated/ @tkleinke -/types/leaflet-label/ @Nemo157 -/types/leaflet-polylinedecorator/ @soucekv -/types/leaflet-providers/ @BendingBender -/types/leaflet.awesome-markers/v0/ @Odrin @sebek64 -/types/leaflet.awesome-markers/ @sebek64 -/types/leaflet.fullscreen/ @wcomartin -/types/leaflet.gridlayer.googlemutant/ @ernest-rhinozeros -/types/leaflet.locatecontrol/ @DenisCarriere -/types/leaflet.markercluster/ @rimig -/types/leaflet.markercluster.layersupport/ @AsamK -/types/leaflet.pm/ @tkleinke -/types/leapmotionts/ @logotype -/types/left-pad/ @Goldsmith42 -/types/less/ @thasner @pranaygp -/types/less-middleware/ @federicobond -/types/lestate/ @thelambdaparty -/types/level-sublevel/ @basp -/types/leveldown/ @tarruda -/types/levelup/ @blittle @tarruda -/types/leven/ @jmalonzo -/types/levenshtein/ @geoffreak -/types/libpq/ @Lodin -/types/libxmljs/ @fdecampredon -/types/libxslt/ @alejo90 -/types/license-checker/ @rogierschouten -/types/lime-js/ @arthur-xavier -/types/line-by-line/ @etomsen -/types/line-reader/ @stpettersens -/types/linkify-it/ @praxxis -/types/linq4js/ @morrisjdev -/types/lls/ @borislavjivkov -/types/load-json-file/ @SamVerschueren -/types/loader-runner/ @e-cloud -/types/loader-utils/ @Perlmint -/types/lobibox/ @itboy87 -/types/localforage-cordovasqlitedriver/ @thgreasi -/types/localized-countries/ @coderslagoon -/types/locate-path/ @me -/types/lockfile/v0/ @Bartvds -/types/lockfile/ @Bartvds @BendingBender -/types/lockr/ @droritos -/types/locutus/ @hookclaw -/types/lodash/v3/ @bczengel @chrootsu -/types/lodash/ @bczengel @chrootsu @stepancar @ericanderson @aj-r @ailrun -/types/lodash-es/ @stephenlautier -/types/lodash-webpack-plugin/ @bumbleblym -/types/lodash.add/ @bczengel @chrootsu @stepancar -/types/lodash.after/ @bczengel @chrootsu @stepancar -/types/lodash.ary/ @bczengel @chrootsu @stepancar -/types/lodash.assign/ @bczengel @chrootsu @stepancar -/types/lodash.assignin/ @bczengel @chrootsu @stepancar -/types/lodash.assigninwith/ @bczengel @chrootsu @stepancar -/types/lodash.assignwith/ @bczengel @chrootsu @stepancar -/types/lodash.at/ @bczengel @chrootsu @stepancar -/types/lodash.attempt/ @bczengel @chrootsu @stepancar -/types/lodash.before/ @bczengel @chrootsu @stepancar -/types/lodash.bind/ @bczengel @chrootsu @stepancar -/types/lodash.bindall/ @bczengel @chrootsu @stepancar -/types/lodash.bindkey/ @bczengel @chrootsu @stepancar -/types/lodash.camelcase/ @bczengel @chrootsu @stepancar -/types/lodash.capitalize/ @bczengel @chrootsu @stepancar -/types/lodash.castarray/ @bczengel @chrootsu @stepancar -/types/lodash.ceil/ @bczengel @chrootsu @stepancar -/types/lodash.chunk/ @bczengel @chrootsu @stepancar -/types/lodash.clamp/ @bczengel @chrootsu @stepancar -/types/lodash.clone/ @bczengel @chrootsu @stepancar -/types/lodash.clonedeep/ @bczengel @chrootsu @stepancar -/types/lodash.clonedeepwith/ @bczengel @chrootsu @stepancar -/types/lodash.clonewith/ @bczengel @chrootsu @stepancar -/types/lodash.compact/ @bczengel @chrootsu @stepancar -/types/lodash.concat/ @bczengel @chrootsu @stepancar -/types/lodash.constant/ @bczengel @chrootsu @stepancar -/types/lodash.countby/ @bczengel @chrootsu @stepancar -/types/lodash.create/ @bczengel @chrootsu @stepancar -/types/lodash.curry/ @bczengel @chrootsu @stepancar -/types/lodash.curryright/ @bczengel @chrootsu @stepancar -/types/lodash.debounce/ @bczengel @chrootsu @stepancar -/types/lodash.deburr/ @bczengel @chrootsu @stepancar -/types/lodash.defaults/ @bczengel @chrootsu @stepancar -/types/lodash.defaultsdeep/ @bczengel @chrootsu @stepancar -/types/lodash.defer/ @bczengel @chrootsu @stepancar -/types/lodash.delay/ @bczengel @chrootsu @stepancar -/types/lodash.difference/ @bczengel @chrootsu @stepancar -/types/lodash.differenceby/ @bczengel @chrootsu @stepancar -/types/lodash.differencewith/ @bczengel @chrootsu @stepancar -/types/lodash.drop/ @bczengel @chrootsu @stepancar -/types/lodash.dropright/ @bczengel @chrootsu @stepancar -/types/lodash.droprightwhile/ @bczengel @chrootsu @stepancar -/types/lodash.dropwhile/ @bczengel @chrootsu @stepancar -/types/lodash.endswith/ @bczengel @chrootsu @stepancar -/types/lodash.eq/ @bczengel @chrootsu @stepancar -/types/lodash.escape/ @bczengel @chrootsu @stepancar -/types/lodash.escaperegexp/ @bczengel @chrootsu @stepancar -/types/lodash.every/ @bczengel @chrootsu @stepancar -/types/lodash.fill/ @bczengel @chrootsu @stepancar -/types/lodash.filter/ @bczengel @chrootsu @stepancar -/types/lodash.find/ @bczengel @chrootsu @stepancar -/types/lodash.findindex/ @bczengel @chrootsu @stepancar -/types/lodash.findkey/ @bczengel @chrootsu @stepancar -/types/lodash.findlast/ @bczengel @chrootsu @stepancar -/types/lodash.findlastindex/ @bczengel @chrootsu @stepancar -/types/lodash.findlastkey/ @bczengel @chrootsu @stepancar -/types/lodash.first/ @bczengel @chrootsu @stepancar -/types/lodash.flatmap/ @bczengel @chrootsu @stepancar -/types/lodash.flatten/ @bczengel @chrootsu @stepancar -/types/lodash.flattendeep/ @bczengel @chrootsu @stepancar -/types/lodash.flattendepth/ @bczengel @chrootsu @stepancar -/types/lodash.flip/ @bczengel @chrootsu @stepancar -/types/lodash.floor/ @bczengel @chrootsu @stepancar -/types/lodash.flow/ @bczengel @chrootsu @stepancar -/types/lodash.flowright/ @bczengel @chrootsu @stepancar -/types/lodash.foreach/ @bczengel @chrootsu @stepancar -/types/lodash.foreachright/ @bczengel @chrootsu @stepancar -/types/lodash.forin/ @bczengel @chrootsu @stepancar -/types/lodash.forinright/ @bczengel @chrootsu @stepancar -/types/lodash.forown/ @bczengel @chrootsu @stepancar -/types/lodash.forownright/ @bczengel @chrootsu @stepancar -/types/lodash.frompairs/ @bczengel @chrootsu @stepancar -/types/lodash.functions/ @bczengel @chrootsu @stepancar -/types/lodash.functionsin/ @bczengel @chrootsu @stepancar -/types/lodash.get/ @bczengel @chrootsu @stepancar -/types/lodash.groupby/ @bczengel @chrootsu @stepancar -/types/lodash.gt/ @bczengel @chrootsu @stepancar -/types/lodash.gte/ @bczengel @chrootsu @stepancar -/types/lodash.has/ @bczengel @chrootsu @stepancar -/types/lodash.hasin/ @bczengel @chrootsu @stepancar -/types/lodash.head/ @bczengel @chrootsu @stepancar -/types/lodash.identity/ @bczengel @chrootsu @stepancar -/types/lodash.includes/ @bczengel @chrootsu @stepancar -/types/lodash.indexof/ @bczengel @chrootsu @stepancar -/types/lodash.initial/ @bczengel @chrootsu @stepancar -/types/lodash.inrange/ @bczengel @chrootsu @stepancar -/types/lodash.intersection/ @bczengel @chrootsu @stepancar -/types/lodash.intersectionby/ @bczengel @chrootsu @stepancar -/types/lodash.intersectionwith/ @bczengel @chrootsu @stepancar -/types/lodash.invert/ @bczengel @chrootsu @stepancar -/types/lodash.invertby/ @bczengel @chrootsu @stepancar -/types/lodash.invoke/ @bczengel @chrootsu @stepancar -/types/lodash.invokemap/ @bczengel @chrootsu @stepancar -/types/lodash.isarguments/ @bczengel @chrootsu @stepancar -/types/lodash.isarray/ @bczengel @chrootsu @stepancar -/types/lodash.isarraybuffer/ @bczengel @chrootsu @stepancar -/types/lodash.isarraylike/ @bczengel @chrootsu @stepancar -/types/lodash.isarraylikeobject/ @bczengel @chrootsu @stepancar -/types/lodash.isboolean/ @bczengel @chrootsu @stepancar -/types/lodash.isbuffer/ @bczengel @chrootsu @stepancar -/types/lodash.isdate/ @bczengel @chrootsu @stepancar -/types/lodash.iselement/ @bczengel @chrootsu @stepancar -/types/lodash.isempty/ @bczengel @chrootsu @stepancar -/types/lodash.isequal/ @bczengel @chrootsu @stepancar -/types/lodash.isequalwith/ @bczengel @chrootsu @stepancar -/types/lodash.iserror/ @bczengel @chrootsu @stepancar -/types/lodash.isfinite/ @bczengel @chrootsu @stepancar -/types/lodash.isfunction/ @bczengel @chrootsu @stepancar -/types/lodash.isinteger/ @bczengel @chrootsu @stepancar -/types/lodash.islength/ @bczengel @chrootsu @stepancar -/types/lodash.ismap/ @bczengel @chrootsu @stepancar -/types/lodash.ismatch/ @bczengel @chrootsu @stepancar -/types/lodash.ismatchwith/ @bczengel @chrootsu @stepancar -/types/lodash.isnan/ @bczengel @chrootsu @stepancar -/types/lodash.isnative/ @bczengel @chrootsu @stepancar -/types/lodash.isnil/ @bczengel @chrootsu @stepancar -/types/lodash.isnull/ @bczengel @chrootsu @stepancar -/types/lodash.isnumber/ @bczengel @chrootsu @stepancar -/types/lodash.isobject/ @bczengel @chrootsu @stepancar -/types/lodash.isobjectlike/ @bczengel @chrootsu @stepancar -/types/lodash.isplainobject/ @bczengel @chrootsu @stepancar -/types/lodash.isregexp/ @bczengel @chrootsu @stepancar -/types/lodash.issafeinteger/ @bczengel @chrootsu @stepancar -/types/lodash.isset/ @bczengel @chrootsu @stepancar -/types/lodash.isstring/ @bczengel @chrootsu @stepancar -/types/lodash.issymbol/ @bczengel @chrootsu @stepancar -/types/lodash.istypedarray/ @bczengel @chrootsu @stepancar -/types/lodash.isundefined/ @bczengel @chrootsu @stepancar -/types/lodash.isweakmap/ @bczengel @chrootsu @stepancar -/types/lodash.isweakset/ @bczengel @chrootsu @stepancar -/types/lodash.iteratee/ @bczengel @chrootsu @stepancar -/types/lodash.join/ @bczengel @chrootsu @stepancar -/types/lodash.kebabcase/ @bczengel @chrootsu @stepancar -/types/lodash.keyby/ @bczengel @chrootsu @stepancar -/types/lodash.keys/ @bczengel @chrootsu @stepancar -/types/lodash.keysin/ @bczengel @chrootsu @stepancar -/types/lodash.last/ @bczengel @chrootsu @stepancar -/types/lodash.lastindexof/ @bczengel @chrootsu @stepancar -/types/lodash.lowercase/ @bczengel @chrootsu @stepancar -/types/lodash.lowerfirst/ @bczengel @chrootsu @stepancar -/types/lodash.lt/ @bczengel @chrootsu @stepancar -/types/lodash.lte/ @bczengel @chrootsu @stepancar -/types/lodash.mapkeys/ @bczengel @chrootsu @stepancar -/types/lodash.mapvalues/ @bczengel @chrootsu @stepancar -/types/lodash.matches/ @bczengel @chrootsu @stepancar -/types/lodash.matchesproperty/ @bczengel @chrootsu @stepancar -/types/lodash.max/ @bczengel @chrootsu @stepancar -/types/lodash.maxby/ @bczengel @chrootsu @stepancar -/types/lodash.mean/ @bczengel @chrootsu @stepancar -/types/lodash.meanby/ @bczengel @chrootsu @stepancar -/types/lodash.memoize/ @bczengel @chrootsu @stepancar -/types/lodash.merge/ @bczengel @chrootsu @stepancar -/types/lodash.mergewith/ @bczengel @chrootsu @stepancar -/types/lodash.method/ @bczengel @chrootsu @stepancar -/types/lodash.methodof/ @bczengel @chrootsu @stepancar -/types/lodash.min/ @bczengel @chrootsu @stepancar -/types/lodash.minby/ @bczengel @chrootsu @stepancar -/types/lodash.mixin/ @bczengel @chrootsu @stepancar -/types/lodash.negate/ @bczengel @chrootsu @stepancar -/types/lodash.noop/ @bczengel @chrootsu @stepancar -/types/lodash.now/ @bczengel @chrootsu @stepancar -/types/lodash.nth/ @bczengel @chrootsu @stepancar -/types/lodash.ntharg/ @bczengel @chrootsu @stepancar -/types/lodash.omit/ @bczengel @chrootsu @stepancar -/types/lodash.omitby/ @bczengel @chrootsu @stepancar -/types/lodash.once/ @bczengel @chrootsu @stepancar -/types/lodash.orderby/ @bczengel @chrootsu @stepancar -/types/lodash.over/ @bczengel @chrootsu @stepancar -/types/lodash.overargs/ @bczengel @chrootsu @stepancar -/types/lodash.overevery/ @bczengel @chrootsu @stepancar -/types/lodash.oversome/ @bczengel @chrootsu @stepancar -/types/lodash.pad/ @bczengel @chrootsu @stepancar -/types/lodash.padend/ @bczengel @chrootsu @stepancar -/types/lodash.padstart/ @bczengel @chrootsu @stepancar -/types/lodash.parseint/ @bczengel @chrootsu @stepancar -/types/lodash.partial/ @bczengel @chrootsu @stepancar -/types/lodash.partialright/ @bczengel @chrootsu @stepancar -/types/lodash.partition/ @bczengel @chrootsu @stepancar -/types/lodash.pick/ @bczengel @chrootsu @stepancar -/types/lodash.pickby/ @bczengel @chrootsu @stepancar -/types/lodash.property/ @bczengel @chrootsu @stepancar -/types/lodash.propertyof/ @bczengel @chrootsu @stepancar -/types/lodash.pull/ @bczengel @chrootsu @stepancar -/types/lodash.pullall/ @bczengel @chrootsu @stepancar -/types/lodash.pullallby/ @bczengel @chrootsu @stepancar -/types/lodash.pullat/ @bczengel @chrootsu @stepancar -/types/lodash.random/ @bczengel @chrootsu @stepancar -/types/lodash.range/ @bczengel @chrootsu @stepancar -/types/lodash.rangeright/ @bczengel @chrootsu @stepancar -/types/lodash.rearg/ @bczengel @chrootsu @stepancar -/types/lodash.reduce/ @bczengel @chrootsu @stepancar -/types/lodash.reduceright/ @bczengel @chrootsu @stepancar -/types/lodash.reject/ @bczengel @chrootsu @stepancar -/types/lodash.remove/ @bczengel @chrootsu @stepancar -/types/lodash.repeat/ @bczengel @chrootsu @stepancar -/types/lodash.replace/ @bczengel @chrootsu @stepancar -/types/lodash.rest/ @bczengel @chrootsu @stepancar -/types/lodash.result/ @bczengel @chrootsu @stepancar -/types/lodash.reverse/ @bczengel @chrootsu @stepancar -/types/lodash.round/ @bczengel @chrootsu @stepancar -/types/lodash.sample/ @bczengel @chrootsu @stepancar -/types/lodash.samplesize/ @bczengel @chrootsu @stepancar -/types/lodash.set/ @bczengel @chrootsu @stepancar -/types/lodash.setwith/ @bczengel @chrootsu @stepancar -/types/lodash.shuffle/ @bczengel @chrootsu @stepancar -/types/lodash.size/ @bczengel @chrootsu @stepancar -/types/lodash.slice/ @bczengel @chrootsu @stepancar -/types/lodash.snakecase/ @bczengel @chrootsu @stepancar -/types/lodash.some/ @bczengel @chrootsu @stepancar -/types/lodash.sortby/ @bczengel @chrootsu @stepancar -/types/lodash.sortedindex/ @bczengel @chrootsu @stepancar -/types/lodash.sortedindexby/ @bczengel @chrootsu @stepancar -/types/lodash.sortedindexof/ @bczengel @chrootsu @stepancar -/types/lodash.sortedlastindex/ @bczengel @chrootsu @stepancar -/types/lodash.sortedlastindexby/ @bczengel @chrootsu @stepancar -/types/lodash.sortedlastindexof/ @bczengel @chrootsu @stepancar -/types/lodash.sorteduniq/ @bczengel @chrootsu @stepancar -/types/lodash.sorteduniqby/ @bczengel @chrootsu @stepancar -/types/lodash.split/ @bczengel @chrootsu @stepancar -/types/lodash.spread/ @bczengel @chrootsu @stepancar -/types/lodash.startcase/ @bczengel @chrootsu @stepancar -/types/lodash.startswith/ @bczengel @chrootsu @stepancar -/types/lodash.subtract/ @bczengel @chrootsu @stepancar -/types/lodash.sum/ @bczengel @chrootsu @stepancar -/types/lodash.sumby/ @bczengel @chrootsu @stepancar -/types/lodash.tail/ @bczengel @chrootsu @stepancar -/types/lodash.take/ @bczengel @chrootsu @stepancar -/types/lodash.takeright/ @bczengel @chrootsu @stepancar -/types/lodash.takerightwhile/ @bczengel @chrootsu @stepancar -/types/lodash.takewhile/ @bczengel @chrootsu @stepancar -/types/lodash.template/ @bczengel @chrootsu @stepancar -/types/lodash.throttle/ @bczengel @chrootsu @stepancar -/types/lodash.times/ @bczengel @chrootsu @stepancar -/types/lodash.toarray/ @bczengel @chrootsu @stepancar -/types/lodash.tointeger/ @bczengel @chrootsu @stepancar -/types/lodash.tolength/ @bczengel @chrootsu @stepancar -/types/lodash.tolower/ @bczengel @chrootsu @stepancar -/types/lodash.tonumber/ @bczengel @chrootsu @stepancar -/types/lodash.topairs/ @bczengel @chrootsu @stepancar -/types/lodash.topairsin/ @bczengel @chrootsu @stepancar -/types/lodash.topath/ @bczengel @chrootsu @stepancar -/types/lodash.toplainobject/ @bczengel @chrootsu @stepancar -/types/lodash.tosafeinteger/ @bczengel @chrootsu @stepancar -/types/lodash.tostring/ @bczengel @chrootsu @stepancar -/types/lodash.toupper/ @bczengel @chrootsu @stepancar -/types/lodash.transform/ @bczengel @chrootsu @stepancar -/types/lodash.trim/ @bczengel @chrootsu @stepancar -/types/lodash.trimend/ @bczengel @chrootsu @stepancar -/types/lodash.trimstart/ @bczengel @chrootsu @stepancar -/types/lodash.truncate/ @bczengel @chrootsu @stepancar -/types/lodash.unary/ @bczengel @chrootsu @stepancar -/types/lodash.unescape/ @bczengel @chrootsu @stepancar -/types/lodash.union/ @bczengel @chrootsu @stepancar -/types/lodash.unionby/ @bczengel @chrootsu @stepancar -/types/lodash.unionwith/ @bczengel @chrootsu @stepancar -/types/lodash.uniq/ @bczengel @chrootsu @stepancar -/types/lodash.uniqby/ @bczengel @chrootsu @stepancar -/types/lodash.uniqueid/ @bczengel @chrootsu @stepancar -/types/lodash.uniqwith/ @bczengel @chrootsu @stepancar -/types/lodash.unset/ @bczengel @chrootsu @stepancar -/types/lodash.unzip/ @bczengel @chrootsu @stepancar -/types/lodash.unzipwith/ @bczengel @chrootsu @stepancar -/types/lodash.update/ @bczengel @chrootsu @stepancar -/types/lodash.uppercase/ @bczengel @chrootsu @stepancar -/types/lodash.upperfirst/ @bczengel @chrootsu @stepancar -/types/lodash.values/ @bczengel @chrootsu @stepancar -/types/lodash.valuesin/ @bczengel @chrootsu @stepancar -/types/lodash.without/ @bczengel @chrootsu @stepancar -/types/lodash.words/ @bczengel @chrootsu @stepancar -/types/lodash.wrap/ @bczengel @chrootsu @stepancar -/types/lodash.xor/ @bczengel @chrootsu @stepancar -/types/lodash.xorby/ @bczengel @chrootsu @stepancar -/types/lodash.xorwith/ @bczengel @chrootsu @stepancar -/types/lodash.zip/ @bczengel @chrootsu @stepancar -/types/lodash.zipobject/ @bczengel @chrootsu @stepancar -/types/lodash.zipobjectdeep/ @bczengel @chrootsu @stepancar -/types/lodash.zipwith/ @bczengel @chrootsu @stepancar -/types/log-symbols/ @BendingBender -/types/log-update/ @BendingBender -/types/log4javascript/ @Ritzlgrmft -/types/log4js/ @armorik83 -/types/logat/ @krvikash35 -/types/logg/ @blittle -/types/loggly/ @rmartone @geoffreak -/types/loglevel/ @Pro @flqw @szmeti -/types/logrotate-stream/ @rogierschouten -/types/lokijs/ @TeamworkGuy2 -/types/lolex/ @Nemo157 @joshuakgoldberg -/types/long/ @peterkooijmans -/types/loopback/ @kattsushi -/types/loopback-boot/ @kattsushi -/types/lorem-ipsum/ @durad -/types/lory.js/ @kubosho @milkisevil -/types/loud-rejection/ @BendingBender -/types/lovefield/ @freshp86 -/types/lowdb/ @typicode -/types/lowlight/ @NoHomey -/types/lru-cache/ @Bartvds -/types/lscache/ @Chris-Martinezz -/types/ltx/ @PJakcson -/types/luaparse/ @stpettersens -/types/lunr/ @sebastian-lenz -/types/lwip/ @AyaMorisawa -/types/lz-string/ @M0ns1gn0r -/types/magic-number/ @stpettersens -/types/magicsuggest/ @leonardochaia -/types/magnet-uri/ @tlaziuk -/types/mailcheck/ @pocesar -/types/maildev/ @cyrilschumacher @zbarbuto -/types/mailgen/ @vothanhkiet @jordanfarrer -/types/mailparser/ @psnider -/types/main-bower-files/ @k-kagurazaka -/types/make-dir/ @ikatyang @BendingBender -/types/maker.js/ @danmarshall -/types/mandrill-api/ @pocesar -/types/map-obj/ @BendingBender -/types/mapbox/ @anahkiasen -/types/mapbox-gl/ @dobrud -/types/mapbox__shelf-pack/ @Perlmint -/types/mapsjs/ @davismj -/types/mariasql/ @bennett000 -/types/markdown-it/ @rapropos -/types/markdown-it-anchor/ @seryl -/types/markdown-it-container/ @hronex -/types/marked/ @worr @BendingBender -/types/marker-animate-unobtrusive/ @viskin -/types/markerclustererplus/ @enanox -/types/markitup/ @drillbits -/types/maskedinput/ @lokeshpeta -/types/masonry-layout/ @m-a-wilson @warriorrocker -/types/massive/ @swissspidy @clarenceh -/types/match-media-mock/ @asvetliakov -/types/material-design-lite/ @bradzacher -/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk -/types/materialize-css/ @eriklieben @leonyu @SinghSukhdeep -/types/math3d/ @laszlojakab -/types/mathjax/ @rolandzwaga -/types/mathjs/ @siavol -/types/matter-js/ @piranha771 -/types/maxmind/ @geoffreak -/types/mcustomscrollbar/ @flurg -/types/md5/ @arcdev1 @jprogrammer -/types/mdns/ @reppners -/types/media-typer/ @BendingBender -/types/medium-editor/ @keika299 -/types/mem/ @SamVerschueren -/types/memcached/ @KentarouTakeda -/types/memoizee/ @juanpicado -/types/memory-cache/ @jedigo -/types/memory-fs/ @e-cloud -/types/memwatch-next/ @cyrilschumacher -/types/meow/ @KnisterPeter -/types/merge-descriptors/ @danny8002 -/types/merge-stream/ @k-kagurazaka -/types/merge2/ @tkrotoff @smac89 -/types/mersenne-twister/ @KentarouTakeda -/types/meshblu/ @fnipo -/types/mess/ @Nemo157 -/types/messenger/ @derekcicerone -/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel -/types/meteor-accounts-phone/ @DAB0mB -/types/meteor-collection-hooks/ @twastvedt -/types/meteor-jboulhous-dev/ @vangorra -/types/meteor-persistent-session/ @vangorra -/types/meteor-prime8consulting-oauth2/ @vangorra -/types/meteor-publish-composite/ @vangorra -/types/meteor-roles/ @vangorra -/types/method-override/ @santialbo -/types/methods/ @cprecioso -/types/metismenu/ @onokumus @denisname -/types/metric-suffix/ @davidm77 -/types/micro/ @kaoDev -/types/microgears/ @marcusdb -/types/micromatch/ @glen-84 -/types/microrouter/ @mathieudutour -/types/microsoft-ajax/ @pjmagee -/types/microsoft-live-connect/ @jvilk -/types/microsoft-sdk-soap/ @markusmauch -/types/microsoftteams/ @OfficeDev -/types/microtime/ @vincekovacs -/types/milkcocoa/ @odangosan -/types/mime/ @jedigo -/types/mime-db/ @AJamesPhillips -/types/mime-types/ @Perlmint -/types/mimos/ @AJamesPhillips -/types/mina/ @lhk @mattanja @kant2002 -/types/minimatch/ @vvakame @shantmarouti -/types/minimist/ @Bartvds @Necroskillz @kamranayub -/types/minipass/ @BendingBender -/types/mithril/ @spacejack @andraaspar @isiahmeadows -/types/mithril-global/ @spacejack @isiahmeadows -/types/mitm/ @alejo90 -/types/mixpanel/ @hjellek -/types/mixto/ @vvakame -/types/mkdirp/ @Bartvds -/types/mkpath/ @optical -/types/mobile-detect/ @martinmcwhorter -/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight -/types/mocha-phantomjs/ @ErikSchierboom -/types/mock-fs/ @Nemo157 @tkqubo -/types/mock-raf/ @djpereira -/types/mock-require/ @djpereira -/types/mockdate/ @brunolm -/types/mockery/ @jt000 -/types/modernizr/ @borisyankov @theodorejb @leonyu @lucax88x @nhardy -/types/modesl/ @neeschit -/types/moment-business/ @wonbyte -/types/moment-duration-format/ @SwintDC @TwoStone @leonard-thieu -/types/moment-jalaali/ @alitaheri -/types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas -/types/moment-round/ @jacobbaskin -/types/moment-timezone/ @michelsalib -/types/mongodb/ @CaselIT @alanmarcell @kikar -/types/mongoose/ @simonxca @horiuchi @sindrenm @lukasz-zak -/types/mongoose-auto-increment/ @AyaMorisawa -/types/mongoose-deep-populate/ @AyaMorisawa -/types/mongoose-mock/ @jt000 -/types/mongoose-paginate/ @linusbrolin @simonxca -/types/mongoose-promise/ @simonxca -/types/mongoose-seeder/ @Crevil -/types/mongoose-sequence/ @linusbrolin -/types/mongoose-simple-random/ @me -/types/mongoose-unique-validator/ @stevehipwell -/types/monk/ @wzr1337 -/types/moo/ @deltaidea -/types/morgan/ @staticfunction -/types/morris.js/ @mareek @sindilevich -/types/mousetrap/ @qcz -/types/move-concurrently/ @mgroenhoff -/types/moviedb/ @basarat @0x6368656174 -/types/moxios/ @itoasuka -/types/mpromise/ @sgkim126 -/types/mqtt/ @PekkaPLeppanen -/types/mri/ @shiftkey @j-f1 -/types/ms/ @danny8002 -/types/msgpack-lite/ @endel @efokschaner -/types/msgpack5/ @wokim @heycalmdown -/types/msnodesql/ @borisyankov @SomaticIT -/types/msportalfx-test/ @julioct -/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter -/types/mu2/ @jedigo -/types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob -/types/multer-gridfs-storage/v1/ @devconcept -/types/multer-gridfs-storage/ @devconcept -/types/multer-s3/ @tcaesvk -/types/multi-typeof/ @mhegazy -/types/multimatch/ @stephenlautier -/types/multiparty/ @kenfdev -/types/multiplexjs/ @KamyarNazeri -/types/murmurhash-js/ @cvle -/types/murmurhash3js/ @dlee-nvisia -/types/musicmetadata/ @Xstoudi -/types/mustache/ @markashleybell -/types/mysql/ @wjohnsto @kacepe -/types/mz/ @ThomasHickman -/types/n3/ @phreed -/types/nano/ @timjacobi -/types/nanoajax/ @nathancahill -/types/nanomsg/ @titan -/types/nanoscroller/ @zihark17 -/types/nanp/ @karn -/types/natsort/ @mgroenhoff -/types/natural/ @dmoonfire -/types/natural-sort/ @a-morales -/types/navigation/ @grahammendick -/types/navigation-react/ @grahammendick -/types/navigo/ @aersamkull -/types/nblas/ @erikgerrits -/types/nconf/ @jedigo @jmthibault -/types/ncp/ @bartvds -/types/ndarray/ @pawsong @taoqf -/types/nearley/ @deltaidea -/types/nedb/ @reppners -/types/nedb-logger/ @thisboyiscrazy -/types/needle/v0/ @bigsan -/types/needle/ @bigsan @nikeee -/types/negotiator/ @BendingBender -/types/neo4j/ @cyrilschumacher -/types/nes/ @NoHomey -/types/netmask/ @mhfrantz -/types/nexpect/ @vvakame -/types/next/ @dru89 -/types/next-redux-wrapper/ @stevegeek -/types/ng-command/ @stephenlautier -/types/ng-cordova/ @ksachdeva -/types/ng-dialog/ @stephenlautier -/types/ng-facebook/ @Crevil -/types/ng-file-upload/ @johnnyreilly @thewarpaint -/types/ng-flow/ @ryan10132 -/types/ng-grid/ @smithkl42 @rolandzwaga @kentcooper -/types/ng-i18next/ @cyrilschumacher -/types/ng-notify/ @nzamosenchuk -/types/ng-stomp/ @lpotapczuk -/types/ngbootbox/ @stpettersens -/types/ngeohash/ @erkie -/types/ngkookies/ @martinmcwhorter -/types/ngmap/ @nkovacic -/types/ngprogress/ @martinmcwhorter -/types/ngprogress-lite/ @LukeForder -/types/ngreact/ @velveret -/types/ngstorage/ @kubiq -/types/ngtoaster/ @btesser -/types/ngwysiwyg/ @patrick-mackay -/types/nightmare/ @horiuchi @samyang-au -/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball -/types/nock/ @bonnici @horiuchi -/types/nodal/ @charrondev -/types/node/v6/ @WilcoBakker -/types/node/v7/ @parambirs @RobDesideri @tellnes @WilcoBakker @Tyriar -/types/node/ @parambirs @RobDesideri @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @Tyriar @DeividasBakanas -/types/node-7z/ @erkie -/types/node-array-ext/ @Beng89 -/types/node-cache/ @chrootsu @dthunell -/types/node-calendar/ @luzianz -/types/node-cleanup/ @agadar -/types/node-common-errors/ @icopp -/types/node-dir/ @panuhorsmalahti -/types/node-dogstatsd/ @chrisbobo -/types/node-emoji/ @jonestristand -/types/node-feedparser/ @cortopy -/types/node-fetch/ @torstenwerner -/types/node-fibers/ @caryhaynie -/types/node-forge/ @westy92 @flynetworks @a-k-g -/types/node-gcm/ @horiuchi -/types/node-getopt/ @kcauchy -/types/node-hid/ @mhegazy @ert78gb -/types/node-hue-api/ @fjmorel -/types/node-int64/ @x3cion -/types/node-ipc/ @arvitaly -/types/node-jsfl-runner/ @mrand01 -/types/node-json-db/ @kuzn-ilya -/types/node-mysql-wrapper/ @kataras -/types/node-notifier/ @tkQubo -/types/node-pg-migrate/ @bradleyayers -/types/node-polyglot/ @timjk -/types/node-powershell/ @rodrigoff -/types/node-ral/ @ssddi456 -/types/node-rsa/ @alitaheri -/types/node-schedule/ @cyrilschumacher @flowpl -/types/node-slack/ @tkQubo -/types/node-snap7/ @heilingbrunner -/types/node-sprite-generator/ @Perlmint -/types/node-static/ @Morfent -/types/node-statsd/ @alexturek @convoyinc -/types/node-telegram-bot-api/ @ammuench @agadar -/types/node-uuid/ @jeffmay -/types/node-validator/ @kengorab -/types/node-vault/ @YuJianrong -/types/node-waves/ @stephenlautier -/types/node-wit/ @julienduf -/types/node-xmpp-client/ @PJakcson -/types/node-xmpp-core/ @PJakcson -/types/node-zookeeper-client/ @plantain-00 -/types/node_redis/ @borisyankov -/types/nodegit/ @dolanmiu -/types/nodemailer/ @rogierschouten -/types/nodemailer-direct-transport/ @rogierschouten -/types/nodemailer-mailgun-transport/ @otociulis -/types/nodemailer-pickup-transport/ @psnider -/types/nodemailer-ses-transport/ @westy92 -/types/nodemailer-smtp-pool/ @rogierschouten -/types/nodemailer-smtp-transport/ @rogierschouten -/types/nodemailer-stub-transport/ @cyrilschumacher -/types/nodeunit/ @jedigo -/types/noisejs/ @izmhr -/types/nomnom/ @panopticoncentral -/types/nopt/ @jbondc -/types/normalize-url/ @odin3 @BendingBender -/types/notie/ @mateusdemboski -/types/notify/ @hellochar -/types/notify.js/ @bahman616 -/types/notifyjs/ @soundTricker -/types/nouislider/v7/ @acoreyj -/types/nouislider/v8/ @bleuarg -/types/nouislider/ @bleuarg @lagaffe -/types/novnc-core/ @smithkl42 @BendingBender -/types/npm/ @SomaticIT -/types/npm-package-arg/ @mgroenhoff -/types/ns-api/ @Archcry -/types/nslog/ @unindented -/types/nsqjs/ @cezaryrk -/types/number-is-nan/ @mhegazy -/types/number-to-words/ @frederickfogerty -/types/numeral/ @vbortone -/types/numjs/ @taoqf -/types/nunjucks/ @RubenSlabbert -/types/nunjucks-date/ @kruncher -/types/nvd3/ @PjMitchell -/types/nw.gui/ @xperiments -/types/nw.js/ @alirdn -/types/o.js/ @IceOnFire @bradzacher @janhommes -/types/oauth.js/ @nobuoka -/types/oauth2-server/ @vangorra @cirick -/types/oauth2orize/ @wokim @heycalmdown @stevehipwell -/types/obelisk.js/ @bdrupieski -/types/object-assign/ @chbrown -/types/object-diff/ @rogierschouten -/types/object-hash/ @misak113 -/types/object-path/ @pocesar -/types/object-refs/ @3fd -/types/oblo-util/ @Oblosys -/types/oboe/ @optical -/types/observe-js/ @herrmanno -/types/oclazyload/ @rolandzwaga -/types/odata/ @janhommes -/types/ofe/ @Morfent -/types/office-js/ @OfficeDev @LanceEA -/types/offline-js/ @cgwrench -/types/oibackoff/ @geoffreak -/types/oidc-token-manager/ @rosieks -/types/on-finished/ @czechboy0 @BendingBender -/types/on-headers/ @jjeffery @BendingBender -/types/once/ @denis-sokolov @BendingBender -/types/onetime/ @BendingBender -/types/onoff/ @marcel-ernst -/types/open/ @Bartvds -/types/opener/ @tikurahul -/types/openfin/ @chrisbarker -/types/openjscad/ @danmarshall -/types/openlayers/v2/ @bolhovsky -/types/openlayers/v3/ @osechet @matthiasdailey-ccri -/types/openlayers/ @osechet @ganlhi -/types/openstack-wrapper/ @sanjaymadane -/types/opentok/ @westy92 @CatGuardian -/types/opentype.js/ @danmarshall -/types/opn/ @shinnn @SomaticIT -/types/optics-agent/ @crevil -/types/optimist/ @soywiz @chbrown -/types/optimize-css-assets-webpack-plugin/ @odnamrataizem -/types/ora/v0/ @screendriver -/types/ora/ @basarat @screendriver @BendingBender -/types/oracledb/ @Bigous -/types/orchestrator/ @tkQubo @TeamworkGuy2 -/types/orderedmap/ @bradleyayers -/types/orientjs/ @saeedtabrizi -/types/os-homedir/ @mhegazy -/types/os-locale/v1/ @AyaMorisawa @BendingBender -/types/os-locale/ @AyaMorisawa @BendingBender -/types/os-name/ @BendingBender -/types/os-tmpdir/ @mhegazy -/types/osmosis/ @jurajkocan -/types/osmtogeojson/ @tkqubo -/types/owlcarousel/ @dpiatkowski -/types/p-all/ @BendingBender -/types/p-any/ @BendingBender -/types/p-cancelable/ @BendingBender -/types/p-debounce/ @BendingBender -/types/p-defer/ @SamVerschueren -/types/p-do-whilst/ @BendingBender -/types/p-each-series/ @BendingBender -/types/p-event/ @BendingBender -/types/p-every/ @BendingBender -/types/p-lazy/ @BendingBender -/types/p-limit/ @BendingBender -/types/p-locate/ @BendingBender -/types/p-log/ @BendingBender -/types/p-map/ @BendingBender -/types/p-map-series/ @BendingBender -/types/p-one/ @BendingBender -/types/p-props/ @BendingBender -/types/p-queue/ @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-timeout/ @BendingBender -/types/p-try/ @BendingBender -/types/p-wait-for/ @BendingBender -/types/p-whilst/ @BendingBender -/types/p2/ @clark-stevenson -/types/packery/ @piraveen @hanssens -/types/pad/ @mhegazy -/types/paho-mqtt/ @amikhalev -/types/pako/ @cappellin @calebegg -/types/papaparse/ @torpedro @rainshen49 -/types/paper/ @clark-stevenson -/types/paralleljs/ @jbaldwin -/types/parse/ @dpoetzsch @jaeggerr -/types/parse-git-config/ @leonard-thieu -/types/parse-glob/ @glen-84 -/types/parse-link-header/ @zelein -/types/parse-mockdb/ @dpoetzsch -/types/parse-torrent/ @niieani @tlaziuk -/types/parse-torrent-file/ @tlaziuk -/types/parse-unit/ @Jack-Works -/types/parseurl/ @bomret -/types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu -/types/passport/ @horiuchi @enaeseth -/types/passport-anonymous/ @0x6368656174 -/types/passport-beam/ @AtlasDev -/types/passport-client-cert/ @warnersean -/types/passport-discord/ @kzay -/types/passport-facebook/ @staticfunction @lucasmacosta -/types/passport-facebook-token/ @rmartone -/types/passport-github/ @yasupeke -/types/passport-github2/ @yasupeke @mthmulders -/types/passport-google-oauth/ @staticfunction -/types/passport-google-oauth2/ @bluehatbrit -/types/passport-http/ @krizalys -/types/passport-http-bearer/ @isman-usoh -/types/passport-jwt/ @mugeso @alsiola -/types/passport-local/ @SomaticIT -/types/passport-local-mongoose/ @linusbrolin -/types/passport-oauth2-client-password/ @akaNightmare -/types/passport-saml/ @cjbarth -/types/passport-steam/ @kzay -/types/passport-strategy/ @liorm -/types/passport-twitter/ @staticfunction -/types/passport-unique-token/ @briman0094 @SomaticIT -/types/password-hash/ @mugeso -/types/password-hash-and-salt/ @alitaheri -/types/path-exists/v1/ @shiwano -/types/path-exists/ @shiwano @BendingBender -/types/path-is-absolute/ @mhegazy -/types/pathfinding/ @BNedry -/types/pathjs/ @lokeshpeta -/types/pathwatcher/ @vvakame -/types/pause/ @BendingBender -/types/payment/ @apare -/types/paypal-cordova-plugin/ @Justin-Credible -/types/paypal-rest-sdk/ @trainerbill -/types/pbf/ @cschwarz -/types/pdfjs-dist/ @jbaldwin -/types/pdfkit/ @erichillah -/types/pdfobject/ @nielsboogaard -/types/pebblekitjs/ @makotokw -/types/peerjs/ @nakakura -/types/pegjs/ @vvakame @SrTobi @siegebell -/types/pem/ @tony19 @DethAriel -/types/perfect-scrollbar/ @aicest @CarbonAtom -/types/persona/ @Nycto -/types/pet-finder-api/ @me -/types/pg-connection-string/ @bradleyayers -/types/pg-pool/ @aleung -/types/pg-query-stream/ @asmarques -/types/pg-types/ @waratuman -/types/pgwmodal/ @pine613 -/types/phantom/ @horiuchi @llRandom -/types/phantomcss/ @abauzac -/types/phantomjs/ @jedhunsaker @keesey -/types/phoenix/ @mciastek -/types/phone/ @DxCx -/types/phone-formatter/ @westy92 -/types/phonegap/ @borisyankov @DickvdBrink -/types/phonegap-facebook-plugin/ @Justin-Credible -/types/phonegap-nfc/ @michaeldesigaud -/types/phonegap-plugin-push/ @fredgalvao @larrybahr -/types/phonon/ @kserin -/types/photonui/ @florentpoujol -/types/photoswipe/ @hellochar -/types/physijs/ @gyohk -/types/pi-spi/ @marcel-ernst -/types/pick-weight/ @rsxdalv -/types/pickadate/ @theodorejb @leonard-thieu -/types/pidusage/ @cyrilschumacher -/types/pify/ @samverschueren -/types/pigpio/ @manerfan -/types/pikaday-time/ @Sayan751 -/types/pinkyswear/ @chances -/types/pino/v3/ @psnider -/types/pino/ @psnider @BendingBender -/types/pinterest-sdk/ @adamburmister -/types/pinyin/ @wanganjun -/types/piwik-tracker/ @lbguilherme -/types/pkijs/ @microshine -/types/platform/ @JakeH -/types/playerframework/ @ricardosabino -/types/pleasejs/ @nakakura -/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf -/types/plugapi/ @BNedry -/types/plupload/ @patrickbussmann -/types/pluralize/ @ukyo -/types/png-async/ @kanreisa -/types/podcast/ @nikeee -/types/podium/ @AJamesPhillips -/types/point-in-polygon/ @dyst5422 @kogai -/types/polylabel/ @DenisCarriere -/types/polyline/ @Kern0 -/types/polymer/ @lgrignon @laco0416 -/types/polymer-ts/ @lgrignon -/types/popcorn/ @grapswiz -/types/popper.js/ @joscha @seckardt @marcfallows -/types/portscanner/ @douglasduteil -/types/postal/ @lokeshpeta @myitcv -/types/postmark/ @benbayard -/types/pouch-redux-middleware/ @charrondev -/types/pouchdb/ @AGBrown @geppy @fredgalvao -/types/pouchdb-adapter-fruitdown/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-http/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-idb/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-leveldb/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-localstorage/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-memory/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-node-websql/ @spaulg @geppy @fredgalvao -/types/pouchdb-adapter-websql/ @spaulg @geppy @fredgalvao -/types/pouchdb-browser/ @spaulg @geppy @fredgalvao -/types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales -/types/pouchdb-find/ @trubit -/types/pouchdb-http/ @spaulg @geppy @fredgalvao -/types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao -/types/pouchdb-node/ @spaulg @geppy @fredgalvao -/types/pouchdb-replication/ @trubit -/types/pouchdb-upsert/ @keithdmoore @hotforfeature -/types/power-assert/ @vvakame -/types/power-assert-formatter/ @vvakame -/types/precise/ @codeanimal -/types/precond/ @olsio -/types/preloadjs/ @endel -/types/prelude-ls/ @AyaMorisawa -/types/prettier/ @ikatyang -/types/pretty-bytes/ @plantain-00 -/types/pretty-ms/ @BendingBender -/types/printf/ @AluisioASG -/types/priorityqueuejs/ @geoffreak -/types/prismjs/ @eriklieben @andrewiggins -/types/private-ip/ @coderslagoon -/types/procfs-stats/ @cyrilschumacher -/types/progress/ @sebastian-lenz -/types/progressbar/ @atd-schubert -/types/progressjs/ @zaneli -/types/proj4/ @DenisCarriere -/types/proj4leaflet/ @BendingBender -/types/project-oxford/ @scsouthw -/types/promise-dag/ @OSjoerdWie -/types/promise-pg/ @coldacid -/types/promise-polyfill/ @skysteve -/types/promise-pool/ @vilic -/types/promise.prototype.finally/ @slavik57 @BendingBender -/types/promised-temp/ @rokadias -/types/promisify-node/ @borekb -/types/promisify-supertest/ @aleung -/types/prompt-sync/ @MugeSo -/types/prompt-sync-history/ @MugeSo -/types/promptly/ @danrspencer -/types/prop-types/ @DovydasNavickas -/types/properties-reader/ @Goldsmith42 -/types/prosemirror-collab/ @bradleyayers @davidka -/types/prosemirror-commands/ @bradleyayers @davidka -/types/prosemirror-history/ @bradleyayers @davidka -/types/prosemirror-inputrules/ @bradleyayers @davidka -/types/prosemirror-keymap/ @bradleyayers @davidka -/types/prosemirror-markdown/ @bradleyayers -/types/prosemirror-menu/ @davidka -/types/prosemirror-model/ @bradleyayers @davidka -/types/prosemirror-schema-basic/ @bradleyayers @davidka -/types/prosemirror-schema-list/ @bradleyayers @davidka -/types/prosemirror-state/ @bradleyayers @davidka -/types/prosemirror-transform/ @bradleyayers @davidka -/types/prosemirror-view/ @bradleyayers @davidka -/types/protobufjs/ @panuhorsmalahti -/types/protractor-browser-logs/ @rokadias -/types/protractor-helpers/ @johncant -/types/protractor-http-mock/ @Crevil -/types/proxy-addr/ @BendingBender -/types/proxyquire/ @jt000 -/types/pty.js/ @enlight -/types/public-ip/ @BendingBender -/types/pubsub-js/ @borisyankov -/types/pug/ @TonyPythoneer @19majkel94 -/types/pulltorefreshjs/ @DanielRosenwasser -/types/pump/ @tlaziuk -/types/pure-render-decorator/ @seansfkelley -/types/purl/ @danfma -/types/pusher-js/ @tkqubo -/types/pvutils/ @microshine -/types/python-shell/ @dolanmiu -/types/q/v0/ @bnemetchek @johnnyreilly -/types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau -/types/q-io/ @Bartvds -/types/q-retry/ @vilic -/types/qhistory/ @Kovensky -/types/qlik/ @RubenSlabbert @AginicX -/types/qlik-engineapi/ @konne -/types/qlik-visualizationextensions/ @konne -/types/qr-image/ @taoqf -/types/qrcode-generator/ @stefanhuber -/types/qrcode.react/ @mleko -/types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda -/types/qtip2/ @Seltzer @leonard-thieu -/types/query-string/ @SamVerschueren @tkrotoff @huhuanming -/types/quick-lru/ @BendingBender -/types/quill/ @sumitkm @guillaume-ro-fr -/types/quixote/ @greybax -/types/qunit/v1/ @diullei -/types/qunit/ @waratuman -/types/quoted-printable/ @pushplay -/types/qwest/ @lindsayevans -/types/r-script/ @NaridaL -/types/rabbit.js/ @wokim -/types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe -/types/radius/ @codeanimal -/types/ramda/ @donnut @mdekrey @LiamGoodacre @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg -/types/random-js/ @pistacchio -/types/random-seed/ @endel -/types/random-string/ @stpettersens -/types/randomcolor/ @feitzi @BradyLiles -/types/range-parser/ @tlaziuk -/types/rangyinputs/ @ersimont -/types/raphael/ @CheCoxshall -/types/rappid/ @DenEwout -/types/ratelimiter/ @AyaMorisawa -/types/raty/ @terrawheat -/types/raven/ @scttcper @1999 -/types/raygun4js/ @xt0rted @BenjaminHarding -/types/rc/ @DanielRosenwasser -/types/rc-select/ @DenisTirilis -/types/rc-slider/ @mantasmarcinkus @mattoni -/types/rc-tree/ @johnnyreilly -/types/rcloader/ @panuhorsmalahti -/types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @richseviora -/types/react-app/ @prakarshpandey -/types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne -/types/react-body-classname/ @mhegazy -/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @katbusch -/types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar -/types/react-bootstrap-daterangepicker/ @ianks -/types/react-bootstrap-table/ @flaub @alelode -/types/react-breadcrumbs/ @KostyaEsmukov -/types/react-burger-menu/ @radziksh -/types/react-calendar-timeline/ @radziksh -/types/react-chartjs-2/ @apare @FabienLavocat -/types/react-codemirror/ @velveret @rudi-c -/types/react-color/ @LKay @markspolakovs @mntdn -/types/react-copy-to-clipboard/ @mabels -/types/react-cropper/ @stepancar -/types/react-css-modules/ @KostyaEsmukov @skirsdeda -/types/react-css-transition-replace/ @LKay -/types/react-custom-scrollbars/v3/ @David-LeBlanc-git -/types/react-custom-scrollbars/ @David-LeBlanc-git @kittimiyo -/types/react-data-grid/v1/ @SupernaviX -/types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 -/types/react-datagrid/ @stephenjelfs -/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach -/types/react-daterange-picker/ @uncovertruth @MartynasZilinskas -/types/react-dates/ @Artur-A -/types/react-daum-postcode/ @Sa-ryong -/types/react-dnd-html5-backend/ @oizie -/types/react-document-title/ @cleverguy25 -/types/react-dom/ @MartynasZilinskas -/types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard -/types/react-dropzone/ @matdube @LynxEyes @goblindegook @benbayard @LKay -/types/react-easy-chart/ @danzel -/types/react-event-listener/ @asvetliakov -/types/react-fa/ @flaub @patsissons @LKay -/types/react-facebook-login/ @apare @jankarres -/types/react-faux-dom/ @alitaheri @cleverguy25 -/types/react-file-input/ @dmitryrogozhny -/types/react-file-reader-input/ @dmitryrogozhny @alitaheri -/types/react-flatpickr/ @begincalendar -/types/react-flex/ @pushplay -/types/react-flexr/ @pushplay -/types/react-flip-move/ @jmhain -/types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory -/types/react-ga/ @telshin -/types/react-geosuggest/ @brmenchl -/types/react-gravatar/ @invliD -/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong -/types/react-hamburger-menu/ @grzesie2k -/types/react-helmet/v4/ @evanbb @isman-usoh -/types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit -/types/react-highlight-words/ @mhegazy -/types/react-highlighter/ @oizie -/types/react-holder/ @isman-usoh -/types/react-hot-loader/ @jacekjagiello -/types/react-i18next/v1/ @KostyaEsmukov -/types/react-i18next/ @GiedriusGrabauskas -/types/react-icon-base/ @apare @LKay -/types/react-icons/ @apare -/types/react-imageloader/ @stephenjelfs -/types/react-infinite/ @rhysd -/types/react-infinite-scroller/ @Lapanti @psrebniak -/types/react-input-calendar/ @stepancar -/types/react-input-mask/ @apare -/types/react-intl/v1/ @bgrieder -/types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari -/types/react-intl-redux/ @LKay -/types/react-is-deprecated/ @seansfkelley -/types/react-joyride/ @DanielRosenwasser @bendxn -/types/react-json-pretty/ @LKay -/types/react-json-tree/ @gnestor -/types/react-jsonschema-form/ @iamdanfox @sirreal -/types/react-lazyload/ @m0a -/types/react-leaflet/ @danzel @davschne @yuit -/types/react-list/ @buptyyf -/types/react-loadable/ @Kovensky @odensc -/types/react-loader/ @artfuldev -/types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti -/types/react-mdl/ @bradzacher -/types/react-measure/ @asvetliakov @marcfallows -/types/react-mixin/ @tkqubo -/types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher -/types/react-monaco-editor/ @jnetterf -/types/react-motion/ @stepancar @asvetliakov -/types/react-motion-slider/ @asvetliakov -/types/react-native/ @alloy @gyzerok @huhuanming @iRoachie @timwangdev @kamal -/types/react-native-collapsible/ @iRoachie -/types/react-native-communications/ @huhuanming -/types/react-native-datepicker/ @jacobbaskin -/types/react-native-drawer/ @jnbt -/types/react-native-drawer-layout/ @jmfirth -/types/react-native-elements/ @iRoachie -/types/react-native-fbsdk/ @ifiokjr -/types/react-native-fetch-blob/ @MNBuyskih -/types/react-native-fs/ @pocesar -/types/react-native-goby/ @MessageDream -/types/react-native-google-analytics-bridge/ @huhuanming @nbperry -/types/react-native-keep-awake/ @huhuanming -/types/react-native-material-design-searchbar/ @iRoachie -/types/react-native-material-ui/ @iRoachie -/types/react-native-modalbox/ @iRoachie -/types/react-native-orientation/ @MoLow -/types/react-native-scrollable-tab-view/ @CaiHuan -/types/react-native-sensor-manager/ @SahinVardar -/types/react-native-snap-carousel/ @jnbt -/types/react-native-sortable-list/ @sivolobov -/types/react-native-svg-uri/ @iRoachie -/types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq -/types/react-native-touch-id/ @huhuanming -/types/react-native-vector-icons/ @iRoachie @timwangdev -/types/react-native-video/ @huhuanming -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @abrahambotros @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev -/types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar -/types/react-notification-system-redux/ @LKay -/types/react-onclickoutside/v5/ @LKay -/types/react-onclickoutside/ @LKay -/types/react-overlays/ @aaronbeall @vitosamson -/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold -/types/react-pointable/ @istefo -/types/react-portal/ @shuntksh -/types/react-props-decorators/ @tkqubo -/types/react-recaptcha/ @mhegazy -/types/react-redux/ @tkqubo @seansfkelley @thasner @kenzierocks @clayne11 @tansongyang -/types/react-redux-i18n/ @clementdevos -/types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba -/types/react-relay/ @graphcool -/types/react-responsive/ @asvetliakov -/types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov -/types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga -/types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall -/types/react-router-config/ @lith-light-g -/types/react-router-dom/ @tkrotoff @huy-nguyen -/types/react-router-native/ @ezintz -/types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi -/types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas -/types/react-router-redux/ @huy-nguyen @8398a7 -/types/react-scroll/ @sudoplz @GiedriusGrabauskas -/types/react-scrollbar/ @stephenjelfs -/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas -/types/react-side-effect/ @remojansen -/types/react-sidebar/ @jeroenvervaeke -/types/react-slick/ @andrewBalekha @GiedriusGrabauskas -/types/react-smooth-scrollbar/ @asvetliakov -/types/react-sortable-hoc/ @NoHomey @charlesrey -/types/react-sortable-tree/ @wouterhardeman -/types/react-spinkit/v1/ @tkqubo @mleko @pelotom -/types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol -/types/react-split-pane/ @rcchen -/types/react-sticky/ @curtisw0 -/types/react-svg-pan-zoom/ @huy-nguyen -/types/react-swf/ @stepancar -/types/react-swipe/ @DeividasBakanas -/types/react-swipeable/ @GiedriusGrabauskas @mctep -/types/react-swipeable-views/ @mxl @DeividasBakanas -/types/react-syntax-highlighter/ @NoHomey -/types/react-tabs/ @danez -/types/react-tag-input/ @Ogglas @jankarres -/types/react-tagcloud/ @wassname -/types/react-tap-event-plugin/ @mxl -/types/react-test-renderer/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly -/types/react-tether/ @ryprice -/types/react-textarea-autosize/ @asvetliakov @zry656565 -/types/react-toggle/v2/ @LKay -/types/react-toggle/ @LKay -/types/react-tooltip/ @DeividasBakanas -/types/react-touch/ @grzesie2k -/types/react-transition-group/v1/ @LKay -/types/react-transition-group/ @LKay -/types/react-user-tour/ @ccancellieri -/types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 -/types/react-virtualized-select/ @seansfkelley -/types/react-weui/ @tairan -/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 -/types/reactable/ @spielc -/types/reactcss/ @chrisgervang @LKay -/types/reactstrap/ @alihammad @mfal @danilobjr -/types/read/ @timjk -/types/read-package-tree/ @mgroenhoff -/types/readdir-stream/ @Bartvds -/types/readline-sync/ @jonestristand -/types/realm/ @Akim95 -/types/reapop/ @Barrokgl -/types/recaptcha/ @brentj73 -/types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue -/types/recompose/ @iskandersierra @mrapogee @clayne11 -/types/reconnectingwebsocket/ @nguarracino -/types/recursive-readdir/ @elisee -/types/redis/ @soywiz @CodeAnimal @MugeSo -/types/redis-mock/ @BendingBender -/types/redis-rate-limiter/ @westy92 -/types/redis-scripto/ @westy92 -/types/redlock/v2/ @chrootsu -/types/redlock/ @chrootsu @BendingBender -/types/reduce-reducers/ @huy-nguyen -/types/redux-action/ @newraina -/types/redux-action-utils/ @tkqubo -/types/redux-actions/ @jaysoo @alexgorbatchev -/types/redux-auth-wrapper/v1/ @LKay -/types/redux-auth-wrapper/ @LKay -/types/redux-batched-subscribe/ @mDibyo -/types/redux-bootstrap/ @remojansen -/types/redux-debounced/ @seansfkelley -/types/redux-devtools/ @mc-petry -/types/redux-devtools-dock-monitor/ @mc-petry -/types/redux-devtools-log-monitor/ @mc-petry -/types/redux-doghouse/ @BendingBender -/types/redux-first-router/ @Valbrand @viggyfresh -/types/redux-form/v4/ @aikoven -/types/redux-form/v6/ @carsonf @aikoven @LKay @bancek -/types/redux-form/ @carsonf @aikoven @LKay @bancek -/types/redux-immutable/ @oizie @sebald @gavingregory -/types/redux-immutable-state-invariant/ @remojansen @highflying -/types/redux-infinite-scroll/ @silkyfray -/types/redux-localstorage/ @LKay -/types/redux-localstorage-debounce/ @LKay -/types/redux-localstorage-filter/ @LKay -/types/redux-logger/ @arusakov -/types/redux-mock-store/ @MarianPalkus -/types/redux-optimistic-ui/ @asvetliakov -/types/redux-pack/ @tansongyang -/types/redux-persist-transform-encrypt/ @LKay -/types/redux-persist-transform-filter/ @LKay -/types/redux-promise/ @molekilla @xStrom -/types/redux-promise-middleware/ @ianks -/types/redux-recycle/ @LKay -/types/redux-router/ @stepancar -/types/redux-storage/ @asvetliakov -/types/redux-ui/ @andyshuxin -/types/ref/ @loyd -/types/ref-array/ @loyd -/types/ref-struct/ @loyd -/types/ref-union/ @loyd -/types/reflect-metadata/ @rbuckton -/types/reflux/ @mauricedb -/types/relateurl/ @tkrotoff -/types/relaxed-json/ @18steps -/types/remote-redux-devtools/ @ColinEberhardt @unindented -/types/remove-markdown/ @RagibHasin -/types/replace-ext/ @DeividasBakanas -/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens -/types/request-ip/ @mrhen -/types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa -/types/request-promise-native/ @gustavohenke -/types/requestretry/ @EricByers -/types/require-directory/ @Igmat -/types/require-from-string/ @ikatyang -/types/requirejs/ @jbaldwin -/types/requirejs-domready/ @lefb766 -/types/resemblejs/ @pimterry -/types/resolve/ @marionebl -/types/resolve-from/ @unional -/types/response-time/ @urossmolnik @TonyPythoneer -/types/rest/ @Nemo157 -/types/restangular/ @borisyankov -/types/restful.js/ @tkqubo -/types/restify/v4/ @blittle @stevehipwell -/types/restify/ @blittle @stevehipwell -/types/restify-cors-middleware/ @dthunell -/types/restify-errors/ @stevehipwell -/types/restify-plugins/ @KostyaTretyak -/types/restler/ @cyrilschumacher -/types/resumablejs/ @DanielMcAssey -/types/rethinkdb/ @alexgorbatchev -/types/retry/ @krenor -/types/rev-hash/ @ikatyang -/types/revalidate/ @alex3165 -/types/revalidator/ @brewsoftware -/types/reveal/ @robertop87 @Nava2 -/types/rewire/ @borislavjivkov @CaselIT -/types/rfc2047/ @mugifly -/types/rheostat/ @SashaBayan @kourge -/types/rickshaw/ @niemyjski -/types/rimraf/ @soywiz @e-cloud @bash -/types/riot/ @Stubb0rn -/types/riot-api-nodejs/ @zafixlrp -/types/riot-games-api/ @xstoudi -/types/riotcontrol/ @chrootsu -/types/riotjs/ @vvakame -/types/rison/ @impworks -/types/rivets/ @TrevorDev -/types/rollup/ @flying-sheep -/types/ronomon__crypto-async/ @BendingBender -/types/rosie/ @abner -/types/roslib/ @Pro @skycoop -/types/rot-js/ @atiaxi -/types/route-parser/ @ianks @bobbuehler -/types/router5/ @sandersky -/types/routie/ @Adilson -/types/royalslider/ @csrakowski -/types/rpio/ @DominikPalo -/types/rrc/ @DeividasBakanas -/types/rrule/ @waratuman -/types/rsmq/ @MugeSo -/types/rsmq-worker/ @MugeSo -/types/rss/ @secondwtq -/types/rsvp/ @Taytay @mkohlmyr @theroncross @chriskrycho -/types/rsync/ @philippstucki -/types/rtree/ @oefirouz -/types/run-sequence/ @k-kagurazaka -/types/rvo2/ @erikvullings -/types/rx/ @Igorbek -/types/rx-angular/ @mickdelaney -/types/rx-core/ @Igorbek @mizunashi-mana -/types/rx-core-binding/ @Igorbek -/types/rx-dom/ @oliverw -/types/rx-jquery/ @Igorbek -/types/rx-lite/ @Igorbek -/types/rx-lite-aggregates/ @Igorbek -/types/rx-lite-async/ @zoetrope @Igorbek -/types/rx-lite-backpressure/ @Igorbek -/types/rx-lite-coincidence/ @Igorbek -/types/rx-lite-experimental/ @Igorbek -/types/rx-lite-joinpatterns/ @Igorbek -/types/rx-lite-testing/ @Igorbek -/types/rx-lite-time/ @Igorbek -/types/rx-lite-virtualtime/ @Igorbek -/types/rx.wamp/ @darkl -/types/s3-upload-stream/ @geoffreak -/types/safari-extension/ @luukd -/types/safari-extension-content/ @luukd -/types/safe-json-stringify/ @ericbyers -/types/safe-regex/ @mhegazy -/types/sails.io.js/ @arvitaly -/types/saml2-js/ @horiuchi -/types/saml20/ @HackerUndKoch -/types/samlp/ @horiuchi -/types/sammy/ @borisyankov @oising -/types/sandboxed-module/ @svi3c -/types/sane/ @BendingBender -/types/sanitize-filename/ @Nemo157 -/types/sanitize-html/ @rogierschouten @afshin -/types/sap__xsenv/ @mad-mike -/types/sass-graph/ @marvinhagemeister -/types/sat/ @omni360 -/types/satnav/ @DotNetNerd -/types/saywhen/ @SeanSobey -/types/scalike/ @ryoppy -/types/screenfull/ @icholy @lionelb @joelshepherd -/types/screeps-profiler/ @ramblurr -/types/scriptjs/ @ssttevee -/types/scroll-into-view/ @zivni -/types/scroller/ @borisyankov -/types/scrollreveal/ @Davidblkx -/types/scrolltofixed/ @bmdixon -/types/scrypt-async/ @xStrom -/types/seamless/ @danmana -/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg -/types/seedrandom/ @kernhanda -/types/segment-analytics/ @fongandrew -/types/select2/ @borisyankov -/types/selectize/ @adidahiya @naBausch -/types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina -/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn -/types/semantic-ui/ @leonard-thieu -/types/semantic-ui-accordion/ @leonard-thieu -/types/semantic-ui-api/ @leonard-thieu -/types/semantic-ui-checkbox/ @leonard-thieu -/types/semantic-ui-dimmer/ @leonard-thieu -/types/semantic-ui-dropdown/ @leonard-thieu -/types/semantic-ui-embed/ @leonard-thieu -/types/semantic-ui-form/ @leonard-thieu -/types/semantic-ui-modal/ @leonard-thieu -/types/semantic-ui-nag/ @leonard-thieu -/types/semantic-ui-popup/ @leonard-thieu -/types/semantic-ui-progress/ @leonard-thieu -/types/semantic-ui-rating/ @leonard-thieu -/types/semantic-ui-search/ @leonard-thieu -/types/semantic-ui-shape/ @leonard-thieu -/types/semantic-ui-sidebar/ @leonard-thieu -/types/semantic-ui-site/ @leonard-thieu -/types/semantic-ui-sticky/ @leonard-thieu -/types/semantic-ui-tab/ @leonard-thieu -/types/semantic-ui-transition/ @leonard-thieu -/types/semantic-ui-visibility/ @leonard-thieu -/types/semaphore/ @mhfrantz -/types/semver/ @Bartvds @BendingBender @LucianBuzzo -/types/semver-diff/ @chrismbarr -/types/sencha_touch/ @brian428 -/types/send/ @MikeJerred -/types/seneca/ @psnider -/types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal -/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @morpheusxaut -/types/sequelize-fixtures/ @cschwarz -/types/sequester/ @Strate -/types/serialize-javascript/ @lith-light-g -/types/serialport/ @codefoster -/types/serve-favicon/ @urossmolnik -/types/serve-index/ @tkrotoff -/types/serve-static/ @urossmolnik -/types/session-file-store/ @blendsdk -/types/set-cookie-parser/ @nickp10 -/types/sha1/ @arcdev1 -/types/shallowequal/ @seansfkelley -/types/shapefile/ @DenisCarriere -/types/sharedworker/ @nakakura -/types/sharepoint/ @baywet -/types/sharp/ @lith-light-g -/types/sharp-timer/ @afractal -/types/sheetify/ @toddself -/types/shell-quote/ @jason0x43 -/types/shelljs/ @nikeee @voy -/types/shipit/ @cyrilschumacher -/types/shipit-utils/ @cyrilschumacher -/types/shopify-buy/ @openminder -/types/shortid/ @stpettersens @despairblue -/types/shot/ @AJamesPhillips -/types/should/ @varju -/types/should-promised/ @devoto13 -/types/showdown/ @cbowdon @tan9 -/types/siema/ @Irmiz -/types/siesta/ @bquarmby -/types/sigmajs/ @qinfchen -/types/signalr/ @borisyankov @keesey @GiedriusGrabauskas -/types/signals/ @diullei -/types/signature_pad/ @AbubakerB -/types/simple-assign/ @NoHomey -/types/simple-cw-node/ @vvakame -/types/simple-mock/ @leonyu -/types/simple-oauth2/ @mad-mike -/types/simple-peer/ @tlaziuk -/types/simple-url-cache/ @a-lucas -/types/simple-xml/ @notVitaliy -/types/simplebar/v1/ @gregonnet @leonard-thieu -/types/simplebar/ @leonard-thieu -/types/simplemde/ @Scalesoft -/types/simplesmtp/ @rogierschouten -/types/simplestorage.js/ @axelcostaspena @mxl -/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j -/types/sinon-as-promised/ @igrayson -/types/sinon-chai/ @kazimanzurrashid @jedmao -/types/sinon-chrome/ @pimterry -/types/sinon-express-mock/ @jpchip @tlaziuk -/types/sinon-mongoose/ @stevehipwell -/types/sinon-stub-promise/ @vintem -/types/sinon-test/ @mummybot -/types/sip.js/ @decyrus -/types/sipml/ @chookies -/types/sitemap2/ @shundy -/types/sizzle/ @leonard-thieu -/types/sjcl/ @Evgenus -/types/ski/ @AyaMorisawa -/types/skyway/ @nakakura -/types/slack-node/ @geoffreak -/types/slack-winston/ @BlueHatbRit -/types/slackify-html/ @hypexr -/types/slate-irc/ @elisee -/types/sleep/ @rajarz -/types/slickgrid/ @jbaldwin -/types/slideout/ @ToastHawaii -/types/slimerjs/ @alexwall -/types/slocket/ @BendingBender -/types/slug/ @mhegazy -/types/smart-fox-server/ @ChanceM -/types/smooth-scrollbar/ @asvetliakov -/types/smoothie/ @mikehhawley -/types/smoothscroll-polyfill/ @kryops -/types/smtp-server/ @markisme -/types/smtpapi/ @a-morales -/types/snapsvg/ @lhk @mattanja @kant2002 -/types/snazzy-info-window/ @milosd92 -/types/snekfetch/ @DarkerTV -/types/snoowrap/ @vitosamson -/types/soap/ @aleung @cagefox -/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda -/types/socket.io-client/ @progre @divillysausages @florentpoujol -/types/socket.io-redis/ @nupplaphil -/types/socket.io.users/ @kataras -/types/socketio-wildcard/ @BendingBender -/types/socketty/ @Nax -/types/sockjs/ @pmccloghrylaing -/types/sockjs-client/ @vladev @arusakov @BendingBender -/types/solution-center-communicator/ @dami-gg -/types/sortablejs/ @Maw-Fox -/types/source-list-map/ @e-cloud -/types/source-map/ @MortenHoustonLudvigsen @rbuckton -/types/source-map-support/ @Bartvds @jason0x43 -/types/space-pen/ @vvakame -/types/spark-md5/ @bastienmoulia -/types/sparkly/ @BendingBender -/types/sparkpost/v1/ @geoffreak -/types/sparkpost/ @geoffreak @bondz -/types/spatialite/ @atd-schubert -/types/spdy/ @tony19 -/types/speakeasy/ @legendecas @mrOlorin -/types/speakingurl/ @Goldsmith42 -/types/spectacle/ @zmaybury -/types/spectrum/ @M-Zuber -/types/spin.js/ @borisyankov @theodorejb -/types/split/ @marcinporebski -/types/split2/ @mugeso -/types/spotify-api/ @skovmand -/types/sprintf/ @soywiz -/types/sql.js/ @Hozuki -/types/sqlite3/ @nmalaguti @dpyro -/types/sqlstring/ @marvinhagemeister -/types/squirejs/ @bradleyayers -/types/srp/ @Patman64 -/types/ss-utils/ @mythz -/types/ssh2/ @tkQubo @rbuckton -/types/ssh2-sftp-client/ @igrayson -/types/ssh2-streams/ @rbuckton -/types/sshpk/ @mabels -/types/stack-mapper/ @rogierschouten -/types/stack-trace/ @exceptionless -/types/stack-utils/ @BendingBender -/types/stacktrace-js/ @exceptionless @pilagod -/types/stale-lru-cache/ @cxcorp -/types/stampit/ @koresar -/types/stamplay-js-sdk/ @ridermansb -/types/stat-mode/ @BendingBender -/types/stats.js/ @gregolai @hberntsen -/types/statsd-client/ @peterkooijmans -/types/status-bar/ @vvakame -/types/statuses/ @tkrotoff @BendingBender -/types/steam/ @kant2002 -/types/steed/ @Paul-Isache -/types/stompjs/ @jimic -/types/storejs/ @vbortone -/types/storybook__addon-actions/ @joscha -/types/storybook__addon-knobs/ @joscha @martynaskadisa -/types/storybook__addon-links/ @joscha -/types/storybook__addon-notes/ @joscha -/types/storybook__addon-options/ @joscha -/types/storybook__react/ @joscha -/types/stream-buffers/ @Jason3S -/types/stream-meter/ @mugeso -/types/stream-series/ @k-kagurazaka -/types/stream-to-array/v0/ @Bartvds -/types/stream-to-array/ @Bartvds @BendingBender -/types/streaming-json-stringify/ @BendingBender -/types/streamjs/ @erosb -/types/strftime/ @cyrilschumacher -/types/string/ @basp -/types/string-hash/ @ethanrubio -/types/string-similarity/ @ragtime -/types/string-template/ @TonyPythoneer -/types/string_score/ @marcinporebski -/types/stringify-object/ @khoomeister -/types/strip-ansi/ @mhegazy -/types/strip-bom/ @mhegazy -/types/strip-json-comments/ @dmoonfire -/types/stripe-checkout/ @cgwrench -/types/stripe-node/ @wjohnsto @codeanimal -/types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/striptags/ @ccitro -/types/strong-cluster-control/ @shuntksh -/types/strophe/ @DavidKDeutsch -/types/stylelint/ @alan-agius4 -/types/stylus/ @SomaticIT -/types/subsume/ @BendingBender -/types/succinct/ @EnableSoftware -/types/sudo-block/ @BendingBender -/types/suitescript/ @darrenhillconsulting -/types/sumo-logger/ @forabi -/types/superagent/ @NicoZelaya @mxl @paplorinc -/types/superagent-no-cache/ @mxl -/types/superagent-prefix/ @mxl -/types/supercluster/ @DenisCarriere -/types/supertest/ @varju -/types/supertest-as-promised/ @tkrotoff -/types/supports-color/ @mgroenhoff -/types/survey-knockout/ @andrewtelnov -/types/svg-injector/ @poke -/types/svg-pan-zoom/v2/ @Promact -/types/svg-pan-zoom/ @Yimiprod -/types/svg-sprite/ @tkqubo -/types/svg2png/ @hansrwindhoff -/types/svg4everybody/ @BendingBender -/types/svgjs.draggable/ @LiFeleSs -/types/svgjs.resize/ @jkevingutierrez -/types/swag/ @shiwano -/types/swagger-express-middleware/ @alexandreroba -/types/swagger-express-mw/ @micmro -/types/swagger-hapi/ @micmro -/types/swagger-jsdoc/ @drGrove -/types/swagger-node-runner/ @micmro -/types/swagger-parser/ @Tobias4872 @EricHenry -/types/swagger-restify-mw/ @micmro -/types/swagger-sails-hook/ @micmro -/types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt -/types/swagger-tools/ @bricka -/types/swaggerize-express/ @mugeso @nickmorton -/types/sweetalert/ @ToastHawaii -/types/swfobject/ @rou -/types/swiftclick/ @Laurence-C -/types/swig/ @CodeAnimal @soywiz -/types/swig-email-templates/ @mrhen -/types/swipe/ @kant2002 -/types/swiper/ @sgaliano @lucax88x -/types/swipeview/ @borisyankov -/types/switchery/ @bgrieder @claylaut -/types/swiz/ @jedigo -/types/sylvester/ @StephaneAlie -/types/synaptic/ @ToastHawaii @austincummings -/types/systeminformation/ @PixelcrabAT -/types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas -/types/table/ @evanshortiss -/types/tabtab/ @vojtechhabarta -/types/tapable/ @e-cloud -/types/tape/ @Bartvds @sodatea @DennisSchwartz -/types/tar/ @SomaticIT -/types/tedious/ @rogierschouten @cjthompson -/types/tedious-connection-pool/ @sandorfr -/types/telebot/ @mariotsi -/types/temp/ @DanielRosenwasser -/types/temp-write/ @BendingBender -/types/tempfile/ @SamVerschueren @BendingBender -/types/tempy/ @douglasduteil -/types/terminal-menu/ @aravindarun -/types/testingbot-api/ @timbru31 -/types/tether/ @adidahiya -/types/tether-drop/ @adidahiya -/types/tether-shepherd/ @mtgibbs -/types/text-buffer/ @vvakame -/types/text-encoding/ @pine613 -/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner -/types/thrift/ @kamek-pf -/types/throng/ @cyrilschumacher -/types/throttle/ @BendingBender -/types/through/ @AndrewGaspar -/types/through2/v0/ @Bartvds @jedmao -/types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 -/types/through2-map/ @LucasHill -/types/tile-reduce/ @DenisCarriere -/types/tilebelt/ @DenisCarriere -/types/time-span/ @BendingBender @mdvorscak -/types/timelinejs/ @rolandzwaga -/types/timelinejs3/ @MikeMatusz -/types/timer-machine/ @dolanmiu -/types/timezone-js/ @bonnici -/types/timezonecomplete/ @rogierschouten -/types/tinder/ @pingec -/types/tinycolor2/ @M-Zuber @geertjansen @nvh -/types/tinycopy/ @vvatanabe -/types/tinymce/ @martinduparc @ipoul -/types/titanium/ @cyounkins -/types/title/ @fa7ad -/types/tldjs/ @geoffreak -/types/tmp/ @optical @Perlmint -/types/to-markdown/ @SuperPaintman -/types/to-title-case-gouch/ @stpettersens -/types/toastr/ @borisyankov -/types/tooltipster/ @stephenlautier -/types/topojson/ @ricardo-mello @chenzhutian -/types/torrent-stream/ @xstoudi -/types/touch/ @mizunashi-mana @BendingBender -/types/touch-events/ @kevinb7 -/types/tough-cookie/ @leonard-thieu -/types/traceback/ @misak113 -/types/tracking/ @pimterry -/types/transducers-js/ @colinkahn @dphilipson -/types/transducers.js/ @dphilipson -/types/traverse/ @newclear -/types/traverson/ @marcinporebski -/types/trayballoon/ @korve -/types/trim/ @skysteve -/types/trunk8/ @niemyjski -/types/tspromise/ @soywiz -/types/tunnel/ @BendingBender -/types/turf/v2/ @gcroteau -/types/turf/ @gcroteau @DenisCarriere -/types/tus-js-client/ @kevhiggins -/types/tv4/ @Bartvds @psnider -/types/tween.js/ @Amos47 @sunetos @jzarnikov -/types/tweenjs/ @evilangelist -/types/tweezer.js/ @praxxis -/types/twig/ @soywiz @enko -/types/twilio/ @nickiannone @ashleybrener -/types/twit/ @Volox -/types/twitter/ @chitoku-k -/types/twix/ @j3ko -/types/type-check/ @hansrwindhoff -/types/type-detect/ @Bartvds -/types/type-is/ @BendingBender -/types/type-name/ @armorik83 -/types/typeahead/ @igochkov @gjunge -/types/typedarray-pool/ @pawsong -/types/typescript-deferred/ @DirtyHairy -/types/tz-format/ @samverschueren -/types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo -/types/uglify-js/ @tkrotoff -/types/uglifycss/ @blendsdk -/types/ui-grid/ @btesser @joeskeen -/types/ui-router-extras/ @mputters @marcel-k @LaserUnicorns -/types/ui-select/ @nkovacic -/types/uid-safe/ @geoffreak -/types/uikit/ @giovannicandido @s0x -/types/uk.co.workingedge.phonegap.plugin.launchnavigator/ @dpa99c -/types/umbraco/ @DeCareSystemsIreland -/types/umd/ @TeamworkGuy2 -/types/umzug/ @drinchev -/types/underscore/ @borisyankov @jbaldwin @ccurrens -/types/underscore-ko/ @MagicMau -/types/underscore.string/ @rygine -/types/undertaker/ @tkqubo @GiedriusGrabauskas -/types/undertaker-registry/ @GiedriusGrabauskas -/types/uniq/ @hansrwindhoff -/types/uniqid/ @me -/types/unique-hash-stream/ @BendingBender -/types/unique-random/ @Kuniwak -/types/unity-webapi/ @jmvrbanac -/types/universal-analytics/ @Bartvds @DarkerTV -/types/universal-router/ @jtmthf -/types/unorm/ @chbrown -/types/untildify/ @BendingBender -/types/unused-filename/ @BendingBender -/types/update-notifier/ @vvakame @nchen63 -/types/uppercamelcase/ @plantain-00 -/types/urbanairship-cordova/ @Justin-Credible -/types/uri-templates/ @Bartvds -/types/urijs/ @RodneyJT @xt0rted -/types/uritemplate/ @teyc -/types/url-assembler/ @wolfgang42 -/types/url-join/ @rogierschouten @devrelm -/types/url-regex/ @unindented -/types/url-template/ @marcinporebski -/types/urlrouter/ @soywiz -/types/urlsafe-base64/ @tkrotoff -/types/usage/ @pvomhoff -/types/usb/ @underscorebrody -/types/user-home/ @mhegazy -/types/useragent/ @geoffreak -/types/username/ @kayahr -/types/utf8/ @zelein -/types/util-deprecate/ @BendingBender -/types/util.promisify/ @adamvoss -/types/utils-merge/ @chrootsu -/types/uuid/ @iamolivinius @felipeochoa @cjbarth -/types/uuid-1345/ @mugeso -/types/uuid-js/ @mhegazy -/types/uuid-validate/ @HiromiShikata -/types/uuidjs/ @staxmanade -/types/uws/ @plantain-00 -/types/valdr/ @ilbertz -/types/valdr-message/ @ilbertz -/types/valerie/ @conficient -/types/valid-url/ @stevehipwell -/types/validate.js/ @HillTravis -/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe -/types/validatorjs/ @LKay -/types/vanilla-tilt/ @BrunnerLivio -/types/vary/ @BendingBender -/types/vast-client/ @jgainfort -/types/vec3/ @xstoudi -/types/vectorious/ @erikgerrits -/types/vega/ @pelotom -/types/velocity-animate/ @smrq -/types/verror/ @svi3c @max4t -/types/vertx3-eventbus-client/ @oddeirik -/types/vex-js/ @gdcohan -/types/vexflow/ @rquiring @sebastianhaas @bohoffi -/types/victory/ @asvetliakov @snerks @Havret -/types/video.js/ @vbortone -/types/viewability-helper/ @lironzluf -/types/viewerjs/ @lrh3321 -/types/viewporter/ @borisyankov -/types/vimeo/ @DazWilkin -/types/vimeo__player/ @denisyilmaz -/types/vinyl/v0/ @jedmao -/types/vinyl/ @vvakame @jedmao @thorn0 -/types/vinyl-buffer/ @tkQubo -/types/vinyl-fs/ @vvakame @remisery -/types/vinyl-paths/ @tkQubo -/types/virtual-dom/ @chbrown -/types/virtual-keyboard/ @bsurai -/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 -/types/vision/ @jasonswearingen @AJamesPhillips -/types/vitalsigns/ @cyrilschumacher -/types/vivus/ @DanielRosenwasser @lekhmanrus -/types/vkbeautify/ @sch3lp -/types/voca/ @pine -/types/voronoi-diagram/ @michaelneu -/types/vortex-web-client/ @Pro -/types/voximplant-websdk/ @aylarov -/types/vue-i18n/ @aicest -/types/vue-resource/ @kaorun343 -/types/w2ui/ @Ptival -/types/wake_on_lan/ @SrTobi -/types/wallabyjs/ @andrewconnell -/types/wallpaper/ @BendingBender -/types/wampy/ @KSDaemon -/types/warning/ @cvle -/types/watch/ @soywiz @Perlmint -/types/watchify/ @TeamworkGuy2 -/types/watchpack/ @e-cloud -/types/waterline/ @arvitaly -/types/watson-developer-cloud/ @waldo000000 -/types/waypoints/ @dominikbulaj @Koloto -/types/weapp-api/ @vargeek -/types/web-animations-js/ @kritollm -/types/web-bluetooth/ @urish -/types/webappsec-credential-management/ @iainmcgin -/types/webassembly-js-api/ @periklis -/types/webcl/ @NCARalph -/types/webcomponents.js/ @adidahiya -/types/webcrypto/ @iislucas -/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 -/types/webfontloader/ @doskallemaskin -/types/webgl-ext/ @zenmumbler -/types/webgl2/ @nkemnitz -/types/webgme/ @phreed -/types/webix/ @mkozhukh -/types/webmidi/ @lostfictions -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 -/types/webpack-bundle-analyzer/ @kryops -/types/webpack-chain/ @eirikurn @psachs21 -/types/webpack-dev-middleware/ @bumbleblym -/types/webpack-dev-server/ @maestroh @daveparslow -/types/webpack-dotenv-plugin/ @kryops -/types/webpack-env/ @use-strict -/types/webpack-fail-plugin/ @deevus -/types/webpack-hot-middleware/ @bumbleblym -/types/webpack-merge/ @deevus -/types/webpack-notifier/ @bumbleblym -/types/webpack-sources/ @e-cloud @chriseppstein -/types/webpack-stream/ @iclanton @bumbleblym -/types/webpack-validator/ @deevus -/types/webrtc/ @nakakura -/types/websocket/ @loyd @flynetworks -/types/webspeechapi/ @saschanaz -/types/websql/ @TeamworkGuy2 -/types/webtorrent/ @niieani @tlaziuk -/types/webvr-api/ @lostfictions -/types/week/ @sindrenm -/types/weighted/ @ccitro -/types/weixin-app/ @taoqf -/types/wellknown/ @yairtawil -/types/whatwg-streams/ @saschanaz -/types/when/ @derekcicerone @Nemo157 -/types/which/ @vvakame -/types/wicg-mediasession/ @jucrouzet -/types/wiiu/ @mzsm -/types/window-or-global/ @vvakame -/types/window-size/ @pmkary -/types/windows-1251/ @RomanGolovanov -/types/windows-service/ @rogierschouten -/types/winjs/v1/ @adamhewitt627 @craigktreasure @xirzec -/types/winjs/v2/ @adamhewitt627 @craigktreasure @xirzec -/types/winjs/ @adamhewitt627 @craigktreasure @xirzec -/types/winreg/ @RX14 @BobBuehler -/types/winrt-uwp/ @saschanaz @taylor224 -/types/winston/ @bonnici @codeanimal @DABH -/types/winston-dynamodb/ @nickiannone -/types/wiring-pi/ @NoHomey -/types/wnumb/ @acoreyj -/types/wolfy87-eventemitter/ @ryiwamoto -/types/wonder-commonlib/ @yyc-git -/types/wonder-frp/ @yyc-git -/types/wonder.js/ @yyc-git -/types/wordcloud/ @joeskeen -/types/words-to-numbers/ @James-Frowen -/types/wrap-ansi/ @kayahr -/types/wreck/ @marcinporebski -/types/wrench/ @soywiz -/types/write-file-atomic/ @BendingBender -/types/write-json-file/ @DenisCarriere -/types/ws/ @loyd @elithrar -/types/wu/ @phiresky -/types/wx-js-sdk-dt/ @agasbzj -/types/x-editable/ @sirkirby -/types/xadesjs/ @microshine -/types/xdate/ @yamada28go -/types/xdg-basedir/ @tlaziuk -/types/xlsx/ @themauveavenger -/types/xml/ @YuJianrong -/types/xml-parser/ @mhfrantz -/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle -/types/xml2json/ @dolanmiu -/types/xmlbuilder/ @wallymathieu -/types/xmldoc/ @Xstoudi @ajsheehan -/types/xmldom/ @tkqubo -/types/xmlpoke/ @garthk -/types/xmltojson/ @traviscrowe -/types/xmpp__jid/ @PJakcson -/types/xregexp/ @Bartvds @jfahrenkrug @sigo -/types/xrm/v7/ @daryllabar -/types/xrm/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme -/types/xsd-schema-validator/ @Goldsmith42 -/types/xsockets/ @pushplay -/types/xterm/ @blink1073 @LucianBuzzo -/types/yallist/ @BendingBender -/types/yandex-money-sdk/ @chrootsu -/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney -/types/yayson/ @Codesleuth -/types/ydn-db/ @yathit @gabrielmaldi -/types/yeoman-generator/ @armorik83 @janslow -/types/yeoman-test/ @ikatyang -/types/yfiles/ @yGuy -/types/yog-bigpipe/ @ssddi456 -/types/yog-log/ @ssddi456 -/types/yog2-kernel/ @ssddi456 -/types/yosay/ @armorik83 -/types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 -/types/yui/ @giabao -/types/z-schema/ @pgonzal -/types/zen-observable/ @aicest -/types/zepto/ @jbaldwin -/types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu -/types/zeroclipboard/ @ejsmith @niemyjski @balassy @leonyu -/types/zeromq/ @davemckeown @erikma -/types/zetapush-js/ @ghoullier -/types/zip.js/ @lgrignon -/types/zmq/ @davemckeown -/types/zui/ @yuanxu -/types/zynga-scroller/ @haskellcamargo +/types/abbrev/ @BendingBender +/types/ably/ @ably +/types/abs/ @AyaMorisawa +/types/absolute/ @AyaMorisawa +/types/acc-wizard/ @cyrilschumacher +/types/accept-language-parser/ @kampfgnom +/types/accepts/ @bomret @brikou +/types/accounting/ @gerich-home @chrisleck +/types/ace/ @Diullei +/types/acl/ @tkQubo +/types/acorn/ @RReverser @e-cloud +/types/actioncable/ @zhu1230 +/types/actions-on-google/ @joelhegg +/types/activex-access/ @zspitz +/types/activex-adodb/ @zspitz +/types/activex-dao/ @zspitz +/types/activex-excel/ @zspitz +/types/activex-infopath/ @zspitz +/types/activex-libreoffice/ @zspitz +/types/activex-msforms/ @zspitz +/types/activex-mshtml/ @zspitz +/types/activex-msxml2/ @zspitz +/types/activex-office/ @zspitz +/types/activex-outlook/ @zspitz +/types/activex-powerpoint/ @zspitz +/types/activex-scripting/ @zspitz +/types/activex-stdole/ @zspitz +/types/activex-vbide/ @zspitz +/types/activex-wia/ @zspitz +/types/activex-word/ @zspitz +/types/adal-angular/ @unindented +/types/add-zero/ @Roaders +/types/adm-zip/ @jvilk @abner +/types/adone/ @s0m3on3 @maxveres +/types/aframe/ @devpaul @bertoritger +/types/agenda/ @meirgottlieb +/types/aggregate-error/ @BendingBender +/types/alertify/ @jjeffery +/types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 +/types/alexa-voice-service/ @dolanmiu +/types/algebra.js/ @CaselIT +/types/algoliasearch/ @cbaptiste @haroenv @aherve +/types/alt/ @Shearerbeard +/types/amazon-product-api/ @MattiLehtinen @alien35 +/types/amcharts/ @ldrick +/types/amplify/ @joeriks +/types/amplify-deferred/ @joeriks @laurentiustamate94 +/types/amplitude-js/ @Asido +/types/amqp/ @seikho @jonnysparkplugs +/types/amqp-rpc/ @wokim +/types/amqplib/ @mnahkies @abreits @nfantone +/types/analytics-node/ @fongandrew +/types/angular/ @diegovilar @thorn0 @calebstdenis @leonard-thieu +/types/angular-agility/ @rolandzwaga +/types/angular-animate/ @michelsalib @adidahiya @rasch @codyschaaf +/types/angular-block-ui/ @lassebn @sclassen +/types/angular-bootstrap-calendar/ @Odrin +/types/angular-bootstrap-lightbox/ @rolandzwaga +/types/angular-breadcrumb/ @marctalary +/types/angular-clipboard/ @bradfordwagner +/types/angular-cookie/ @borislavjivkov +/types/angular-cookies/ @diegovilar @aciccarello +/types/angular-deferred-bootstrap/ @Ritzlgrmft +/types/angular-dialog-service/ @wcomartin +/types/angular-dynamic-locale/ @stephenlautier +/types/angular-environment/ @terrawheat +/types/angular-es/ @mbutsykin +/types/angular-feature-flags/ @borislavjivkov +/types/angular-file-saver/ @deenairn +/types/angular-file-upload/ @cyrilgandon +/types/angular-formly/ @scatcher +/types/angular-fullscreen/ @julienpa +/types/angular-gettext/ @AkosLukacs +/types/angular-google-analytics/ @cyrilschumacher @Toxantron +/types/angular-gridster/ @jpmnteiro +/types/angular-growl-v2/ @mkp05 +/types/angular-hotkeys/ @jlz27 @reppners @cyrilgandon +/types/angular-http-auth/ @vvakame +/types/angular-httpi/ @Kukks +/types/angular-idle/ @mthamil +/types/angular-jwt/ @rerezz +/types/angular-load/ @david-gang +/types/angular-loading-bar/ @stephenlautier @tyronedougherty +/types/angular-local-storage/ @kenfdev @dona278 +/types/angular-localforage/ @reppners +/types/angular-locker/ @nkovacic +/types/angular-material/ @blbigelow @PeterHajdu @Dona278 @geertjansen @eknowles +/types/angular-media-queries/ @jpmnteiro +/types/angular-meteor/ @pgrm +/types/angular-mocks/ @diegovilar @daltin +/types/angular-modal/ @paullessing +/types/angular-oauth2/ @anteriovieira +/types/angular-pdfjs-viewer/ @bastienmoulia +/types/angular-permission/ @vmishevski +/types/angular-promise-tracker/ @rufusl +/types/angular-q-spread/ @rafw87 +/types/angular-resource/ @diegovilar @miffels +/types/angular-route/ @park9140 +/types/angular-sanitize/ @diegovilar +/types/angular-scenario/ @RomanoLindano +/types/angular-scroll/ @samherrmann +/types/angular-signalr-hub/ @AdamSantaniello +/types/angular-spinner/ @Biegal +/types/angular-storage/ @mdekrey +/types/angular-strap/ @samherrmann @mkannwischer +/types/angular-toastr/ @nkovacic @trodi +/types/angular-toasty/ @muenchdo +/types/angular-tooltips/ @leonard-thieu +/types/angular-touchspin/ @nkovacic +/types/angular-translate/ @michelsalib +/types/angular-ui-bootstrap/ @xt0rted @ry8806 +/types/angular-ui-router/ @michelsalib @matiishyn @mikehaas763 +/types/angular-ui-scroll/ @marknadig +/types/angular-ui-sortable/ @thgreasi +/types/angular-ui-tree/ @CalvinFernandez +/types/angular-websocket/ @nickveys +/types/angular-wizard/ @mjurisic @rwwilden +/types/angular-xeditable/ @jpmnteiro +/types/angular.throttle/ @reppners +/types/angularfire/ @thSoft +/types/angularlocalstorage/ @horiuchi +/types/angulartics/ @bateast2 +/types/animation-frame/ @qinfchen +/types/animejs/ @A-Babin +/types/annyang/ @hisham @theluk +/types/ansi-colors/ @rogierschouten +/types/ansi-regex/ @mvachhar +/types/ansi-styles/ @brynbellomy +/types/ansicolors/ @rogierschouten +/types/any-db/ @rogierschouten +/types/any-db-transaction/ @rogierschouten +/types/anybar/ @khoomeister +/types/anymatch/ @BendingBender +/types/apex.js/ @y13i +/types/aphrodite/ @asvetliakov +/types/api-error-handler/ @tkrotoff +/types/apigee-access/ @CasperSkydt +/types/apollo-codegen/ @bradleyayers +/types/app-root-path/ @shantmarouti +/types/appdmg/ @unindented +/types/appframework/ @kyo-ago +/types/applepayjs/ @martincostello +/types/appletvjs/ @brainded +/types/applicationinsights-js/ @kamilszostak +/types/arbiter/ @arash16 +/types/arcgis-js-api/v3/ @Esri +/types/arcgis-js-api/ @Esri +/types/arcgis-rest-api/ @JeffJacobson +/types/arcgis-to-geojson-utils/ @JeffJacobson +/types/archiver/ @dolanmiu @crevil +/types/archy/ @vvakame +/types/are-we-there-yet/ @brianloveswords +/types/argon2-browser/ @ivangabriele +/types/argparse/ @arcticwaters @tlaziuk +/types/args/ @Slessi +/types/argv/ @hookclaw +/types/arr-union/ @mrmlnc +/types/array-find-index/ @samverschueren +/types/array-foreach/ @skysteve +/types/array-uniq/ @DanielRosenwasser +/types/arrify/ @wanganjun +/types/artillery/ @kmccoan-allocadia +/types/asana/ @tkqubo +/types/ascii2mathml/ @RagibHasin +/types/asenv/ @remisery +/types/asn1js/ @microshine +/types/aspnet-identity-pw/ @jt000 +/types/assert-equal-jsx/ @seryl +/types/assert-plus/ @KostyaTretyak +/types/assertion-error/ @Bartvds +/types/assertsharp/ @brunolm +/types/assets-webpack-plugin/ @kryops +/types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin +/types/async-cache/ @BendingBender +/types/async-lock/ @elisee +/types/async-polling/ @Goldsmith42 +/types/async.nexttick/ @pyrho +/types/asynciterator/ @rubensworks +/types/atmosphere.js/ @toedter @Mory1879 +/types/atom/ @GlenCFL @smhxx @lierdakil +/types/atom-keymap/ @GlenCFL +/types/atom-mocha-test-runner/ @GlenCFL +/types/atpl/ @soywiz +/types/audiosprite/ @Perlmint +/types/auth0/ @wbhob @westy92 @amiram +/types/auth0-angular/ @homesar +/types/auth0-js/v7/ @advancedrei +/types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz +/types/auth0-lock/ @carusology @goldcaddy77 +/types/auth0.widget/ @advancedrei +/types/auto-launch/ @rhysd @unindented +/types/auto-sni/ @janwo +/types/autobahn/ @darkl @valepu +/types/autolinker/ @leonyu +/types/autoprefixer/ @odnamrataizem +/types/autosize/ @kingdango @keika299 @NeekSandhu +/types/awesomplete/ @webbiesdk @bmdixon @tbekolay +/types/aws-iot-device-sdk/ @niik @mlamp +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart +/types/aws-serverless-express/ @threesquared @jcaffey @mattmeye +/types/aws4/ @ajcrites +/types/axel/ @ruslan-molodyko +/types/azure/ @AndrewGaspar @antiveeranna @SomaticIT +/types/azure-mobile-services-client/ @dmorosinotto +/types/azure-sb/ @Azure +/types/b_/ @outring +/types/babel-code-frame/ @mohsen1 +/types/babel-core/ @yortus @marvinhagemeister +/types/babel-generator/ @yortus @johnnyestilles +/types/babel-plugin-react-pug/ @jpap +/types/babel-plugin-syntax-jsx/ @marvinhagemeister +/types/babel-template/ @yortus @marvinhagemeister +/types/babel-traverse/ @yortus @marvinhagemeister +/types/babel-types/ @yortus @baxtersa @marvinhagemeister @bcherny +/types/babel-webpack-plugin/ @j-f1 +/types/babelify/ @TeamworkGuy2 @marvinhagemeister +/types/babylon/ @yortus @marvinhagemeister +/types/babylon-walk/ @czbuchi +/types/babyparse/ @cdiddy77 +/types/backbone/ @borisyankov @nvivo +/types/backbone-associations/ @craigbrett17 +/types/backbone-fetch-cache/ @delphinus35 +/types/backbone-relational/ @eirikhm +/types/backbone.layoutmanager/ @hejiang2000 +/types/backbone.localstorage/ @lgrignon +/types/backbone.marionette/ @zhamid @nvivo @sventschui +/types/backbone.paginator/ @Nyamazing +/types/backbone.radio/ @alphaleonis +/types/backgrid/ @jlujan +/types/backlog-js/ @vvatanabe +/types/backoff/ @BendingBender +/types/baconjs/ @alexander-matsievsky @gekkio +/types/bagpipes/ @micmro +/types/barcode/ @pvomhoff +/types/bardjs/ @TepigMC +/types/base-64/ @dolanmiu +/types/base-x/ @chrootsu +/types/base16/ @alechill +/types/base64-js/ @pe8ter +/types/bases/ @harikv +/types/bash-glob/ @mrmlnc +/types/basic-auth/ @moonpyk @vesse +/types/batch-stream/ @drudge +/types/bazinga-translator/ @alexndlm +/types/bcrypt/ @codeanimal @IOAyman +/types/bcryptjs/ @RafaelKr +/types/beats/ @urish +/types/bech32/ @micksatana +/types/bem-cn/ @selkinvitaly +/types/better-curry/ @pocesar +/types/better-sqlite3/ @Morfent @matrumz +/types/bezier-easing/ @ptlis +/types/bezier-js/ @danmarshall +/types/bgiframe/ @sumegizoltan +/types/big.js/ @nycdotnet @googol +/types/bigi/ @mhegazy +/types/bigint/ @Evgenus +/types/bignum/ @Patman64 +/types/bigscreen/ @dduugg +/types/binary-parser/ @riggs @dolanmiu +/types/bind-ponyfill/ @skysteve +/types/bindings/ @unindented +/types/bingmaps/ @rbrundritt +/types/bintrees/ @CjS77 +/types/bip21/ @stefanhuber +/types/bip38/ @micksatana +/types/bip39/ @micksatana +/types/bit-array/ @mudkipme +/types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton @micksatana @youssefgh +/types/bittorrent-protocol/ @feross @tlaziuk +/types/bitwise-xor/ @rogierschouten +/types/bl/ @Bartvds +/types/blacklist/ @mhegazy +/types/blazy/ @julienpa +/types/blessed/ @brynbellomy @skellock +/types/blissfuljs/ @fskorzec +/types/blob-stream/ @erichillah +/types/blob-to-buffer/ @nrlquaker +/types/blob-util/ @WorldMaker +/types/blocks/ @ksmigiel +/types/bloomfilter/ @slawiko +/types/blue-tape/ @sodatea +/types/bluebird/v1/ @Bartvds +/types/bluebird/v2/ @Bartvds @falsandtru +/types/bluebird/ @lhecker +/types/bluebird-global/ @d-ph +/types/bluebird-retry/ @pvomhoff +/types/blueimp-md5/ @rmartone @mkohlmyr +/types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk +/types/bonjour/ @quentin-ol @octo-sniffle +/types/bookshelf/ @arcticwaters @vesse +/types/boom/v3/ @rogatty +/types/boom/v4/ @rogatty @AJamesPhillips @jineshshah36 +/types/boom/ @rogatty @AJamesPhillips @jineshshah36 @TimonVS +/types/bootbox/ @vbortone @konpikwastaken @kanup @icereed @trodi @stannynuytkens @renjfk +/types/bootpag/ @rdeneau +/types/bootstrap/ @borisyankov +/types/bootstrap-datepicker/ @borisyankov +/types/bootstrap-fileinput/ @CheCoxshall +/types/bootstrap-maxlength/ @danmana +/types/bootstrap-notify/ @niemyjski @mouse0270 @robert-voica +/types/bootstrap-select/ @LKay +/types/bootstrap-slider/ @dbeckwith @leonard-thieu +/types/bootstrap-switch/ @johnmbaughman +/types/bootstrap-table/ @talatbaig +/types/bootstrap-touchspin/ @albinsunnanbo +/types/bootstrap-treeview/ @jbtronics +/types/bootstrap-validator/ @BradyLiles +/types/bootstrap.paginator/ @derikwhittaker +/types/bootstrap.timepicker/ @derikwhittaker @heatherbooker +/types/bootstrap.v3.datetimepicker/v3/ @bayitajesi +/types/bootstrap.v3.datetimepicker/ @katonap +/types/bounce.js/ @cherrry +/types/box2d/ @jbaldwin +/types/brace-expansion/ @BendingBender +/types/braces/ @vemoo +/types/braft-editor/ @me +/types/braintree-web/ @chlela +/types/breeze/ @borisyankov +/types/bricks.js/ @kondi +/types/brorand/ @chrootsu +/types/browser-bunyan/ @PaulLockwood @kryops +/types/browser-fingerprint/ @LKay +/types/browser-harness/ @scriby +/types/browser-pack/ @TeamworkGuy2 +/types/browser-report/ @JTOne123 +/types/browser-resolve/ @marionebl +/types/browser-sync/ @joeskeen +/types/browserify/ @AndrewGaspar @jvilk @leonard-thieu +/types/bs58/ @chrootsu +/types/bson/ @horiuchi @CaselIT +/types/bucks/ @zaneli +/types/buffer-compare/ @chrootsu +/types/buffer-equal/ @Bartvds +/types/buffers/ @rhencke +/types/bufferstream/ @Bartvds +/types/bull/v2/ @bgrieder @JProgrammer +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco +/types/bump-regex/ @silkentrance +/types/bunnymq/ @cyrilschumacher +/types/bunyan/ @amikhalev +/types/bunyan-blackhole/ @olivr70 +/types/bunyan-bugsnag/ @pasieronen +/types/bunyan-config/ @cyrilschumacher +/types/bunyan-format/ @dex4er +/types/bunyan-prettystream/ @jasonswearingen @enlight +/types/bunyan-winston-adapter/ @stevehipwell +/types/busboy/ @jacobbaskin +/types/business-rules-engine/ @rsamec +/types/bwip-js/ @MugeSo +/types/byline/ @reppners +/types/bytebuffer/ @cappellin +/types/bytes/ @danny8002 +/types/c3/ @mcliment @gerinjacob @denyo +/types/cache-manager/ @GausSim +/types/cal-heatmap/ @RetroChrisB +/types/callsite/ @newclear +/types/callsites/ @BendingBender +/types/calq/ @eirikhm +/types/camelcase/ @samverschueren +/types/camelcase-keys/ @mhegazy +/types/camo/ @lucasmciruzzi +/types/cancan/ @Vincent-Pang +/types/cannon/ @clark-stevenson @Gelio +/types/canvas-gauges/ @Mikhus +/types/canvasjs/ @brutalimp +/types/capitalize/ @frederickfogerty +/types/card-validator/ @ChanceM +/types/case-sensitive-paths-webpack-plugin/ @r3nya +/types/caseless/ @downace +/types/cash/ @akvlko +/types/casperjs/ @jedmao @urielch +/types/cassandra-driver/ @Svjard +/types/catbox/ @jasonswearingen @AJamesPhillips +/types/cbor/ @pushplay +/types/ccap/ @taoqf +/types/chai/v2/ @Bartvds @AGBrown +/types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana +/types/chai-arrays/ @clementprevot +/types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu @lazerwalker @mattbishop +/types/chai-datetime/ @cliffburger +/types/chai-dom/ @mattlewis92 +/types/chai-enzyme/ @asvetliakov +/types/chai-fuzzy/ @Bartvds +/types/chai-http/ @Nemo157 @G1itcher @CaselIT +/types/chai-jest-snapshot/ @mattvperry +/types/chai-jquery/ @kazimanzurrashid +/types/chai-json-schema/ @ulrichheiniger +/types/chai-oequal/ @mizunashi-mana +/types/chai-spies/ @kuzn-ilya +/types/chai-string/ @nmalaguti +/types/chai-subset/ @delta62 @AGBrown +/types/chai-webdriverio/ @sherlock1982 +/types/chai-xml/ @jedigo +/types/chance/ @cbowdon @brikou +/types/change-emitter/ @iskandersierra +/types/charm/ @Xananax +/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana +/types/chartist/ @mtgibbs @psimonski @clottman +/types/chayns/ @HenningKuehl +/types/check-sum/ @BendingBender +/types/check-types/ @idchlife +/types/checkstyle-formatter/ @mhegazy +/types/checksum/ @rogierschouten +/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao +/types/chmodr/ @BendingBender +/types/chokidar/ @reppners @felixfbecker @bayssmekanique +/types/chosen-js/ @borisyankov @denisname +/types/chownr/ @BendingBender +/types/chroma-js/v0/ @invliD +/types/chroma-js/ @invliD @mpacholec +/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/circular-json/ @jpevarnek +/types/ckeditor/ @wittwert +/types/clamp-js/ @Hikariii +/types/clamp-js-main/ @sinziananicolae +/types/classnames/ @adidahiya @JKillian @seansfkelley @mradamczyk @marvinhagemeister +/types/cldrjs/ @RamanBut-Husaim @gcastre +/types/clean-css/ @tkrotoff +/types/clean-stack/ @BendingBender +/types/clean-webpack-plugin/ @j-f1 +/types/clear-require/ @dan-j +/types/cleave.js/ @clentfort @jasongi-at-sportsbet +/types/cli/ @kayahr +/types/cli-color/ @ChaosinaCan +/types/cli-spinner/ @janslow +/types/cli-table2/ @mgroenhoff +/types/client-sessions/ @netroy +/types/cliff/ @brynbellomy +/types/clipboard/ @impworks +/types/clipboard-js/ @markwongsk +/types/clipboardy/ @BendingBender +/types/clndr/ @jasperjn +/types/clockpicker/ @jfcere +/types/closure-compiler/ @mprobst +/types/cloud-env/ @Morfent +/types/cloudflare-apps/ @MartynasZilinskas +/types/cls-hooked/ @aleung +/types/clusterize.js/ @Pr1st0n +/types/cmd-shim/ @cspotcode +/types/co-body/ @geoffreak +/types/co-views/ @devlee @geoffreak +/types/code/ @prashaantt +/types/codemirror/ @mihailik @nrbernard @Pr1st0n +/types/codependency/ @morphatic +/types/coffeeify/ @tkQubo +/types/coinbase/ @rogierschouten +/types/coinstring/ @mhegazy +/types/collections/ @scarabedore +/types/color/v0/ @LKay +/types/color/v1/ @LKay +/types/color/ @Airlun +/types/color-convert/ @Airlun +/types/color-name/ @Ailrun +/types/color-string/ @BendingBender @danmarshall +/types/colorbrewer/ @mtraynham +/types/colors/ @Bartvds @staeke +/types/com.darktalker.cordova.screenshot/ @akarienta +/types/combine-source-map/ @TeamworkGuy2 +/types/combined-stream/ @felixge @tlaziuk +/types/combokeys/ @iclanton +/types/cometd/ @derekcicerone +/types/command-line-args/ @CzBuCHi +/types/command-line-commands/ @CzBuCHi +/types/commangular/ @hiraash +/types/comment-json/ @Jason3S +/types/common-tags/ @zuzusik @tzupengwang +/types/commonmark/ @nicojs @leonard-thieu +/types/compare-version/ @jpevarnek +/types/complex/ @AyaMorisawa +/types/component-emitter/ @psnider +/types/compose-function/ @denis-sokolov +/types/compressible/ @BendingBender +/types/compression/ @santialbo +/types/compression-webpack-plugin/ @dublicator +/types/compute-stdev/ @mrmlnc +/types/concat-stream/ @jmarianer +/types/concaveman/ @DenisCarriere +/types/conf/v0/ @SamVerschueren +/types/conf/ @SamVerschueren @BendingBender +/types/confidence/ @jppellerin +/types/config/ @RWander @forrestbice @jndonald3 +/types/configstore/ @ArcticLight +/types/confit/ @ethanresnick +/types/connect/ @SomaticIT +/types/connect-busboy/ @pinguet62 +/types/connect-ensure-login/ @0x6368656174 +/types/connect-flash/ @AndreasGassmann +/types/connect-history-api-fallback/ @douglasduteil +/types/connect-livereload/ @SomaticIT +/types/connect-modrewrite/ @tinganho +/types/connect-mongo/ @Syati +/types/connect-pg-simple/ @pasieronen +/types/connect-redis/ @xstoudi @morcerf +/types/connect-slashes/ @samherrmann +/types/connect-timeout/ @cyrilschumacher +/types/console-stamp/ @ericbyers +/types/consolidate/ @soywiz @theosherry @nicolashenry +/types/consul/ @chrootsu +/types/content-disposition/ @bomret +/types/content-type/ @horiuchi @BendingBender +/types/contentful-resolve-response/ @antonkarsten +/types/contextjs/ @kernhanda +/types/continuation-local-storage/ @rath @heycalmdown @aboveyou00 +/types/convert-hrtime/ @BendingBender +/types/convert-layout/ @xeningem +/types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 +/types/convict/ @Nemo157 @vesse @elyscape +/types/cookie/ @pine613 +/types/cookie-parser/ @santialbo @BendingBender +/types/cookie-session/ @borislavjivkov +/types/cookie-signature/ @lith-light-g +/types/cookie_js/ @slawiko +/types/cookies/ @WangZishi @jkeylu @BendingBender +/types/copy-paste/ @SrTobi +/types/copy-text-to-clipboard/ @BendingBender +/types/copy-webpack-plugin/ @flying-sheep +/types/cordova-ionic/ @hendrikmaus +/types/cordova-plugin-app-version/ @Ritzlgrmft +/types/cordova-plugin-background-mode/ @Lordnoname +/types/cordova-plugin-badge/ @timbru31 +/types/cordova-plugin-ble-central/ @gjunge +/types/cordova-plugin-canvascamera/ @lordazzi +/types/cordova-plugin-device-name/ @larrybahr +/types/cordova-plugin-file-opener2/ @cyrilgandon +/types/cordova-plugin-ibeacon/ @Ritzlgrmft +/types/cordova-plugin-insomnia/ @Ritzlgrmft +/types/cordova-plugin-keyboard/ @danmana @jkfb +/types/cordova-plugin-mapsforge/ @rafw87 +/types/cordova-plugin-ms-adal/ @KaiWalter +/types/cordova-plugin-native-keyboard/ @lobo87 +/types/cordova-plugin-ouralabs/ @Justin-Credible +/types/cordova-plugin-qrscanner/ @bitjson @jab +/types/cordova-plugin-spinner/ @Justin-Credible +/types/cordova-plugin-x-socialsharing/ @Ritzlgrmft @larrybahr +/types/cordova-sqlite-storage/ @rafw87 +/types/cordova-universal-links-plugin/ @broder +/types/cordova_app_version_plugin/ @larrybahr +/types/cordovarduino/ @hendrikmaus +/types/core-js/ @rbuckton @mfdeveloper +/types/cote/ @makepost +/types/couchbase/ @maouida +/types/countdown/ @gjuchault +/types/counterpart/ @santiagodoldan +/types/countries-and-timezones/ @zero51 +/types/country-list/ @iRoachie +/types/country-select-js/ @humrochagf +/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 +/types/create-error/ @tkrotoff +/types/create-react-class/ @jgoz +/types/createjs/ @evilangelist @gyohk +/types/createjs-lib/ @evilangelist @gyohk +/types/credential/ @phuvo +/types/credit-card-type/ @LKay +/types/cron/ @horiuchi +/types/cropperjs/ @stepancar +/types/croppie/ @connor4312 @dklmuc @sarunint +/types/crossfilter/ @schmuli @iebaker @nordfjord +/types/crossroads/ @diullei +/types/cryptiles/ @awendland +/types/crypto-js/ @misak113 +/types/cryptojs/ @giabao +/types/cson/ @stpettersens +/types/csprng/ @winksaville +/types/csrf/ @markis +/types/css/ @ilich +/types/css-font-loading-module/ @slikts +/types/css-modules/ @NeekSandhu +/types/cssbeautify/ @rictic +/types/csurf/ @horiuchi +/types/csv-parse/ @davidm77 @obi-jan-kenobi +/types/csv-stringify/ @rogierschouten @arjenvanderende +/types/csvrow/ @codeanimal +/types/csvtojson/ @EricByers @wcarson +/types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender +/types/cucumber/ @abraaoalves @jan-molak @isoung @BendingBender @ErikSchierboom +/types/currency-formatter/ @mhegazy @davidmpaz +/types/custom-error-generator/ @thmiceli +/types/cwise/ @taoqf +/types/cwise-compiler/ @taoqf +/types/cwise-parser/ @taoqf +/types/cybozulabs-md5/ @pine613 +/types/cytoscape/ @phreed @wy193777 @ypconstante +/types/d3/v3/ @gustavderdrache @borisyankov @MatthiasJobst +/types/d3/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-array/ @gustavderdrache @borisyankov @tomwanzek +/types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-box/ @lk-chen +/types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-chord/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-collection/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-color/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-contour/ @tomwanzek @Ledragon +/types/d3-dispatch/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-drag/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-ease/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-force/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-format/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-geo/ @Ledragon @tomwanzek @gustavderdrache @borisyankov +/types/d3-hexbin/ @uncovertruth @tomwanzek +/types/d3-hierarchy/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-hsv/ @arrayjam +/types/d3-interpolate/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-path/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-polygon/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-quadtree/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-queue/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-random/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-request/ @Ledragon @gustavderdrache @borisyankov @tomwanzek +/types/d3-sankey/ @tomwanzek @gustavderdrache +/types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-scale-chromatic/ @Ledragon @gustavderdrache @borisyankov @henriquefm +/types/d3-selection/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-selection-multi/ @gustavderdrache @borisyankov +/types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-time/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-time-format/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-timer/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-tip/ @brspnnggrt +/types/d3-transition/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-voronoi/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-zoom/ @tomwanzek @gustavderdrache @borisyankov +/types/d3.cloud.layout/ @hansrwindhoff +/types/d3.slider/ @lk-chen +/types/d3kit/ @morphatic +/types/d3pie/ @mc-petry +/types/dagre/ @qinfchen @Frankrike @vilterp @rustedgrail +/types/dagre-d3/ @markwongsk +/types/dagre-layout/ @qinfchen @Frankrike @vilterp +/types/dargs/ @BendingBender +/types/dat-gui/ @gyohk @sonic3d @rroylance +/types/data-driven/ @mrhen +/types/datadog-metrics/ @pushplay +/types/datatables.net/ @Silver-Connection @omidkrad @pragmatrix @CNBoland +/types/datatables.net-buttons/ @Silver-Connection @SammyG4Free @jimhartford +/types/datatables.net-fixedheader/ @szechyjs @Silver-Connection +/types/datatables.net-rowreorder/ @baywet +/types/datatables.net-select/ @szechyjs +/types/date-arithmetic/ @HeeL +/types/date.format.js/ @balrob +/types/dateformat/ @aicest +/types/datejs/ @rupertavery +/types/daterangepicker/ @SirMartin @smasala @nertzy +/types/db-migrate-base/ @nickiannone +/types/db-migrate-pg/ @nickiannone +/types/db.js/ @cgwrench +/types/dc/ @hansrwindhoff @mtraynham @MatthiasJobst +/types/deasync/ @Sicilica +/types/debessmann/ @vkorehov +/types/debounce/ @denis-sokolov +/types/debug/ @swook @galtalmor @zamb3zi +/types/decamelize/ @samverschueren +/types/decay/ @enaeseth +/types/decompress/ @plantain-00 +/types/decorum/ @dflor003 +/types/dedent/ @douglasduteil +/types/deep-assign/ @souldreamer +/types/deep-diff/ @ZauberNerd +/types/deep-equal/ @remojansen @janslow +/types/deep-extend/ @rhysd +/types/deep-freeze/ @Bartvds @aluanhaddad +/types/deep-freeze-es6/ @mattbishop +/types/deep-freeze-strict/ @mhegazy +/types/deepmerge/ @marvinscharle @syy1125 +/types/defaults/ @IbtihelCHNAB +/types/defer-promise/ @niklasf +/types/define-lazy-prop/ @BendingBender +/types/defined/ @BendingBender +/types/deku/ @pocka +/types/del/v2/ @AyaMorisawa +/types/del/ @AyaMorisawa @BendingBender +/types/delaunator/ @DenisCarriere +/types/delay/ @BendingBender +/types/denodeify/ @joaomoreno +/types/deoxxa-content-type/ @pine613 +/types/depcheck/ @ark120202 +/types/depd/ @danny8002 @BendingBender +/types/deployjava/ @cyrilschumacher +/types/destroy/ @BendingBender +/types/destroy-on-hwm/ @BendingBender +/types/detect-browser/ @rogierschouten +/types/detect-hover/ @thomastilkema +/types/detect-indent/v0/ @Bartvds +/types/detect-indent/ @Bartvds @BendingBender +/types/detect-it/ @thomastilkema +/types/detect-newline/ @BendingBender +/types/detect-passive-events/ @thomastilkema +/types/detect-pointer/ @thomastilkema +/types/detect-port/ @lith-light-g +/types/detect-touch-events/ @thomastilkema +/types/df-visible/ @Litee +/types/dhtmlxgantt/ @mkozhukh @chriscamicas +/types/dhtmlxscheduler/ @mkozhukh +/types/di-lite/ @dcrusader +/types/diacritics/ @otociulis +/types/diff/ @vvakame +/types/diff2html/ @rtfpessoa +/types/dir-resolve/ @andy-ms +/types/discontinuous-range/ @OiCMudkips +/types/disposable-email-domains/ @geoffreak +/types/doccookies/ @jonegerton +/types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl +/types/docopt/ @giggio +/types/doctrine/ @rictic +/types/documentdb/ @NoelAbrahams @brettferdosi @ctstone @yifanwu +/types/documentdb-server/ @lith-light-g +/types/documentdb-session/ @DanielRosenwasser +/types/dojo/ @vansimke +/types/dom-inputevent/ @diagramatics +/types/dom4/ @adidahiya @giladgray +/types/domo/ @Steve-Fenton +/types/dompurify/ @bazuzi +/types/domready/ @dotnetnerd +/types/donna/ @vvakame +/types/dookie/ @swanest +/types/dot/ @ZombieHunter +/types/dot-object/ @nkovacic +/types/dot-prop/v2/ @samverschueren +/types/dot-prop/ @samverschueren @BendingBender +/types/dotdir-regex/ @mrmlnc +/types/dotdotdot/ @milanjaros +/types/dotenv/v2/ @jussikinnula @borekb @enaeseth +/types/dotenv/ @jussikinnula @borekb @enaeseth +/types/dotenv-safe/ @krenor +/types/dotfile-regex/ @mrmlnc +/types/dottie/ @domarmstrong +/types/double-ended-queue/ @dsagal +/types/doublearray/ @mzsm +/types/doubleclick-gpt/ @johngeorgewright +/types/download/ @nicojs +/types/downloadjs/ @cwmoo740 +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar +/types/drag-timetable/ @chinkan +/types/draggabilly/ @jaydubu +/types/dragster/ @zskovacs +/types/dragula/ @pwelter34 @abruzzihraig +/types/dropboxjs/ @Steve-Fenton @xperiments +/types/dropkickjs/ @VorobeY1326 +/types/dropzone/v4/ @nvivo @outring @renuo @Hikariii +/types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro +/types/dts-generator/ @mtraynham +/types/duplexer2/ @Goldsmith42 +/types/duplexer3/ @BendingBender +/types/duplexify/ @strax +/types/duplicate-package-checker-webpack-plugin/ @mtraynham +/types/durandal/ @BlueSpire +/types/dustjs-linkedin/ @mdezem +/types/dvtng-jss/ @Ptival +/types/dw-bxslider-4/ @namerci +/types/dwt/v12/ @yushulx +/types/dwt/ @yushulx @jbh +/types/dygraphs/ @danvk +/types/dymo-label-framework/ @thijskuipers +/types/dynatable/ @francoismassart +/types/dynogels/ @SpartanLabs +/types/each/ @misak113 +/types/easeljs/ @evilangelist +/types/easy-api-request/ @DeadAlready +/types/easy-jsend/ @DeadAlready +/types/easy-session/ @DeadAlready +/types/easy-table/ @nikeee +/types/easy-xapi/ @DeadAlready +/types/easy-xapi-utils/ @DeadAlready +/types/ebongarde-root/ @Ebongarde +/types/echarts/ @xieisabug @AntiMoron +/types/ecurve/ @mhegazy +/types/ed25519/ @erikma +/types/egg-mock/ @sheperdwind +/types/egg.js/ @ToastHawaii +/types/egjs__axes/ @naver +/types/egjs__component/ @naver +/types/ej.web.all/ @syncfusion +/types/ejs/ @benliddicott +/types/ejs-locals/ @jt000 +/types/ejson/ @shantanubhadoria +/types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick +/types/electron-config/ @mrfunkycold @unindented +/types/electron-debug/ @unindented +/types/electron-devtools-installer/ @gamesmaxed +/types/electron-is-dev/ @trodi +/types/electron-json-storage/ @stpettersens @nrlquaker @jbw91 +/types/electron-notifications/ @djpereira +/types/electron-notify/ @djpereira +/types/electron-packager/ @SomaticIT @cortopy +/types/electron-settings/v2/ @leonard-thieu +/types/electron-settings/ @icopp @nrlquaker +/types/electron-spellchecker/ @unindented +/types/electron-store/ @unindented +/types/electron-util/ @kputh +/types/electron-window-state/ @rhysd +/types/electron-winstaller/ @shiftkey @unindented +/types/element-ready/ @BendingBender +/types/element-resize-detector/ @saranshkataria +/types/element-resize-event/ @rogierschouten @plgregoire +/types/elm/ @thSoft +/types/email-templates/ @cyrilschumacher @gurisko @blankstar85 +/types/ember/v1/ @jedmao +/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross @mfeckie +/types/ember-data/ @dwickern @mike-north +/types/ember-feature-flags/ @tansongyang +/types/ember-mocha/ @dwickern +/types/ember-modal-dialog/ @tansongyang +/types/ember-qunit/v2/ @dwickern +/types/ember-qunit/ @dwickern +/types/ember-test-helpers/ @dwickern +/types/ember-testing-helpers/ @chriskrycho +/types/emissary/ @vvakame +/types/emoji-mart/ @Kovensky +/types/emojione/ @dbrgn +/types/empower/ @vvakame +/types/emscripten/ @zakki @periklis +/types/end-of-stream/ @strax +/types/engine.io/ @KentarouTakeda +/types/engine.io-client/ @KentarouTakeda +/types/enhanced-resolve/ @e-cloud @onigoetz +/types/enigma.js/ @konne +/types/ent/ @rogierschouten +/types/entities/ @aliceklipper +/types/env-to-object/ @MugeSo +/types/envify/ @tkQubo +/types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden +/types/enzyme-adapter-react-15/ @tkrotoff +/types/enzyme-adapter-react-16/ @tkrotoff +/types/enzyme-to-json/ @joscha +/types/eonasdan-bootstrap-datetimepicker/ @ToastHawaii +/types/epiceditor/ @borisyankov +/types/epilogue/ @micksatana +/types/epub/ @julien-c +/types/eq.js/ @stephenlautier +/types/errorhandler/ @santialbo +/types/es6-collections/ @rbuckton +/types/es6-promisify/ @harryshipton +/types/es6-shim/ @rbuckton +/types/es6-weak-map/ @pine +/types/escape-html/ @elisee +/types/escape-latex/ @olsio +/types/escape-string-regexp/ @kruncher @faergeek +/types/escodegen/ @simondel +/types/eslint-plugin-prettier/ @ikatyang +/types/esprima/v2/ @teppeis @RReverser +/types/esprima/ @teppeis @RReverser @peter-scott +/types/esprima-walk/ @tswaters +/types/espruino/ @stasberkov +/types/esri-leaflet/ @strajuser +/types/esri-leaflet-geocoder/ @BendingBender +/types/estraverse/ @sanex3339 +/types/estree/ @RReverser +/types/etag/ @BendingBender +/types/ethjs-signer/ @doppio +/types/eureka-js-client/ @Schnillz +/types/evaporate/ @kookster @chrisrhoden +/types/event-emitter/ @LKay +/types/event-kit/ @GlenCFL +/types/event-loop-lag/ @rogierschouten +/types/event-stream/ @flcdrg +/types/event-to-promise/ @flying-sheep +/types/events/ @yasupeke +/types/evernote/ @corps +/types/exceljs/ @rogierschouten @alitaheri +/types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers +/types/exit/ @Bartvds +/types/exit-hook/ @BendingBender +/types/exorcist/ @TeamworkGuy2 +/types/expect/ @jmreidy @merrywhether +/types/expect.js/ @teppeis +/types/expectations/ @vvakame +/types/expo/v23/ @KonstantinKai +/types/expo/ @KonstantinKai @martynaskadisa +/types/expr-eval/ @connor4312 +/types/express/ @borisyankov +/types/express-brute/ @cyrilschumacher +/types/express-brute-memcached/ @cyrilschumacher +/types/express-brute-mongo/ @cyrilschumacher +/types/express-brute-redis/ @scottharwell +/types/express-busboy/ @pinguet62 +/types/express-cluster/ @nenadalm +/types/express-debug/ @federicobond +/types/express-domain-middleware/ @hookclaw +/types/express-ejs-layouts/ @erikma +/types/express-enforces-ssl/ @kevinstubbs +/types/express-fileupload/ @Naktibalda +/types/express-flash-2/ @mathsalmi +/types/express-flash-notification/ @Mister4Eyes +/types/express-formidable/ @tdolsen @evanshortiss +/types/express-graphql/ @isman-usoh @nitintutlani @hubel +/types/express-handlebars/ @stpettersens @yhaskell +/types/express-jwt/ @wokim @kacepe @Sl1MBoy +/types/express-less/ @xieyubo +/types/express-minify/ @borislavjivkov +/types/express-mongo-sanitize/ @ericbyers +/types/express-mung/ @cyrilschumacher +/types/express-myconnection/ @Cellule +/types/express-mysql-session/ @Akim95 +/types/express-oauth-server/ @atd-schubert +/types/express-openapi/ @mugeso +/types/express-partials/ @jt000 +/types/express-promise-router/ @wanganjun +/types/express-rate-limit/ @cyrilschumacher @makepost +/types/express-route-fs/ @kripod +/types/express-sanitized/ @cjbarth +/types/express-serve-static-core/ @borisyankov @19majkel94 @kacepe @micksatana +/types/express-session/ @horiuchi @jacobbogers +/types/express-unless/ @wokim +/types/express-winston/ @bricka +/types/extend/ @reppners +/types/extjs/ @brian428 +/types/extract-stack/ @BendingBender +/types/extract-text-webpack-plugin/ @flying-sheep @katyo +/types/extract-zip/ @mizunashi-mana +/types/eyes/ @brynbellomy +/types/f1/ @neolwc +/types/fabric/ @oklemencic @joewashear007 @mrand01 +/types/facebook-js-sdk/ @amritk +/types/facebook-pixel/ @noctishsu +/types/faker/v3/ @Kuniwak +/types/faker/ @bensw @basp @Kuniwak @mattbishop +/types/falcor/ @Quramy +/types/falcor-express/ @Quramy +/types/falcor-http-datasource/ @Quramy +/types/falcor-json-graph/ @Quramy +/types/falcor-router/ @Quramy @cdhgee +/types/famous/ @borisvasilenko +/types/fancy-log/ @pine +/types/fancybox/ @borisyankov +/types/farbtastic/ @EnableSoftware +/types/fast-diff/ @djrenren +/types/fast-levenshtein/ @mizunashi-mana +/types/fast-list/ @BendingBender +/types/fast-stats/ @rogierschouten +/types/fastclick/ @shinnn +/types/favico.js/ @drowse314-dev-ymat +/types/fb/ @JoshStrobl +/types/fbemitter/ @kmxz +/types/featherlight/ @xStrom +/types/feedme/ @codeanimal +/types/feedparser/ @cortopy +/types/fetch-jsonp/ @tkrotoff +/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair +/types/fetch.io/ @newraina +/types/ffi/ @loyd +/types/ffmpeg-static/ @iamstevetran +/types/ffprobe-static/ @iamstevetran +/types/fibers/ @soywiz +/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/filesize/ @GiedriusGrabauskas +/types/fill-pdf/ @westy92 +/types/finalhandler/ @chrootsu +/types/finch/ @DavidSichau +/types/find/ @andypyrope +/types/find-up/ @BendingBender +/types/findup-sync/ @Bartvds @ngbrown +/types/fingerprintjs/ @zaneli +/types/fingerprintjs2/ @curtstate +/types/firebase-client/ @fpsscarecrow +/types/firebase-token-generator/ @dotdotcommadot +/types/firebird/ @karak +/types/firefox/ @vvakame +/types/firefox-webext-browser/ @bomjacob +/types/firmata/ @troywweber7 +/types/first-mate/ @GlenCFL +/types/fixed-data-table/ @pepaar @stephenjelfs +/types/fixed-data-table-2/ @ilivit +/types/flat/ @chrootsu +/types/flexslider/ @diullei +/types/flickity/ @clmcgrath @wagich +/types/flight/ @jonathanhedren +/types/flightplan/ @borislavjivkov +/types/flipsnap/ @kubosho @gsino @mayuki +/types/flot/ @burlandm @Anticom @admiralsmaster +/types/flowjs/ @ryan10132 +/types/fluent-ffmpeg/ @tcaesvk @DingWeizhe +/types/flux/ @stkb @GiedriusGrabauskas +/types/fluxxor/ @mrk21 +/types/fm-websync/ @markusmauch +/types/fontfaceobserver/ @RandScullard +/types/fontoxml/ @rolandzwaga +/types/forever-monitor/ @shuntksh +/types/forge-di/ @adamcarr +/types/form-data/ @soywiz @leonyu @BendingBender +/types/form-serializer/ @flqw +/types/form-urlencoded/ @alepee +/types/format-duration/ @Roaders +/types/format-io/ @amitbeck +/types/format-unicorn/ @kruncher +/types/formidable/ @Nemo157 +/types/forwarded/ @BendingBender +/types/fossil-delta/ @endel +/types/foundation/ @borisyankov +/types/fpsmeter/ @alampros +/types/framebus/ @kbukum +/types/freedom/ @jpevarnek +/types/freeport/ @atd-schubert +/types/fresh/ @BendingBender +/types/friendly-errors-webpack-plugin/ @bahlo +/types/frisby/ @johnny4753 +/types/from/ @Bartvds +/types/from2/ @BendingBender +/types/fromjs/ @glenndierckx +/types/fromnow/ @marinewater +/types/fs-cson/ @dex4er +/types/fs-ext/ @OguzhanE +/types/fs-extra/v4/ @alan-agius4 @midknight41 @shiftkey @mees- +/types/fs-extra/ @alan-agius4 @midknight41 @shiftkey @mees- +/types/fs-extra-promise/ @midknight41 @jasonswearingen @HiromiShikata +/types/fs-extra-promise-es6/ @midknight41 @jasonswearingen @geoffreak @HiromiShikata +/types/fs-finder/ @misak113 +/types/fs-mock/ @rogierschouten +/types/fs-plus/ @unindented +/types/fs-promise/ @tarruda +/types/fs-readdir-recursive/ @pscanf +/types/fs-readfile-promise/ @mtsg +/types/fscreen/ @joscha +/types/fsevents/ @BendingBender +/types/ftdomdelegate/ @dotnetnerd +/types/ftp/ @rogierschouten +/types/ftpd/ @rogierschouten +/types/fullname/ @kayahr +/types/fullpage.js/ @jodiwarren +/types/fuse/ @smrq +/types/fusioncharts/ @rohitkr @shivarajkv +/types/fuzzaldrin/ @mhegazy +/types/fuzzaldrin-plus/ @jeancroy @jkillian +/types/fuzzyset/ @lgrignon +/types/fuzzyset.js/ @lgrignon +/types/fxn/ @charrondev +/types/gae.channel.api/ @vvakame +/types/gamequery/ @Laubi +/types/gandi-livedns/ @xstoudi +/types/gapi/ @sgtfrankieboy +/types/gapi.analytics/ @gatsbimantico +/types/gapi.auth2/ @flawless2011 +/types/gapi.calendar/ @tkrotoff +/types/gapi.client/ @Bolisov +/types/gapi.client.acceleratedmobilepageurl/ @Bolisov +/types/gapi.client.adexchangebuyer/ @Bolisov +/types/gapi.client.adexchangebuyer2/ @Bolisov +/types/gapi.client.adexchangeseller/ @Bolisov +/types/gapi.client.adexperiencereport/ @Bolisov +/types/gapi.client.admin/ @Bolisov +/types/gapi.client.adsense/ @Bolisov +/types/gapi.client.adsensehost/ @Bolisov +/types/gapi.client.analytics/ @Bolisov +/types/gapi.client.analyticsreporting/ @Bolisov +/types/gapi.client.androiddeviceprovisioning/ @Bolisov +/types/gapi.client.androidenterprise/ @Bolisov +/types/gapi.client.androidmanagement/ @Bolisov +/types/gapi.client.androidpublisher/ @Bolisov +/types/gapi.client.appengine/ @Bolisov +/types/gapi.client.appsactivity/ @Bolisov +/types/gapi.client.appstate/ @Bolisov +/types/gapi.client.bigquery/ @Bolisov +/types/gapi.client.bigquerydatatransfer/ @Bolisov +/types/gapi.client.blogger/ @Bolisov +/types/gapi.client.books/ @Bolisov +/types/gapi.client.calendar/ @Bolisov +/types/gapi.client.civicinfo/ @Bolisov +/types/gapi.client.classroom/ @Bolisov +/types/gapi.client.cloudbilling/ @Bolisov +/types/gapi.client.cloudbuild/ @Bolisov +/types/gapi.client.clouddebugger/ @Bolisov +/types/gapi.client.clouderrorreporting/ @Bolisov +/types/gapi.client.cloudfunctions/ @Bolisov +/types/gapi.client.cloudiot/ @Bolisov +/types/gapi.client.cloudkms/ @Bolisov +/types/gapi.client.cloudmonitoring/ @Bolisov +/types/gapi.client.cloudresourcemanager/ @Bolisov +/types/gapi.client.cloudtasks/ @Bolisov +/types/gapi.client.cloudtrace/ @Bolisov +/types/gapi.client.clouduseraccounts/ @Bolisov +/types/gapi.client.compute/ @Bolisov +/types/gapi.client.consumersurveys/ @Bolisov +/types/gapi.client.container/ @Bolisov +/types/gapi.client.content/ @Bolisov +/types/gapi.client.customsearch/ @Bolisov +/types/gapi.client.dataflow/ @Bolisov +/types/gapi.client.dataproc/ @Bolisov +/types/gapi.client.datastore/ @Bolisov +/types/gapi.client.deploymentmanager/ @Bolisov +/types/gapi.client.dfareporting/ @Bolisov +/types/gapi.client.discovery/ @Bolisov +/types/gapi.client.dlp/ @Bolisov +/types/gapi.client.dns/ @Bolisov +/types/gapi.client.doubleclickbidmanager/ @Bolisov +/types/gapi.client.doubleclicksearch/ @Bolisov +/types/gapi.client.drive/ @Bolisov +/types/gapi.client.firebasedynamiclinks/ @Bolisov +/types/gapi.client.firebaseremoteconfig/ @Bolisov +/types/gapi.client.firebaserules/ @Bolisov +/types/gapi.client.firestore/ @Bolisov +/types/gapi.client.fitness/ @Bolisov +/types/gapi.client.fusiontables/ @Bolisov +/types/gapi.client.games/ @Bolisov +/types/gapi.client.gamesconfiguration/ @Bolisov +/types/gapi.client.gamesmanagement/ @Bolisov +/types/gapi.client.genomics/ @Bolisov +/types/gapi.client.gmail/ @Bolisov +/types/gapi.client.groupsmigration/ @Bolisov +/types/gapi.client.groupssettings/ @Bolisov +/types/gapi.client.iam/ @Bolisov +/types/gapi.client.identitytoolkit/ @Bolisov +/types/gapi.client.kgsearch/ @Bolisov +/types/gapi.client.language/ @Bolisov +/types/gapi.client.licensing/ @Bolisov +/types/gapi.client.logging/ @Bolisov +/types/gapi.client.manufacturers/ @Bolisov +/types/gapi.client.mirror/ @Bolisov +/types/gapi.client.ml/ @Bolisov +/types/gapi.client.monitoring/ @Bolisov +/types/gapi.client.oauth2/ @Bolisov +/types/gapi.client.oslogin/ @Bolisov +/types/gapi.client.pagespeedonline/ @Bolisov +/types/gapi.client.partners/ @Bolisov +/types/gapi.client.people/ @Bolisov +/types/gapi.client.playcustomapp/ @Bolisov +/types/gapi.client.playmoviespartner/ @Bolisov +/types/gapi.client.plus/ @Bolisov +/types/gapi.client.plusdomains/ @Bolisov +/types/gapi.client.prediction/ @Bolisov +/types/gapi.client.proximitybeacon/ @Bolisov +/types/gapi.client.pubsub/ @Bolisov +/types/gapi.client.qpxexpress/ @Bolisov +/types/gapi.client.reseller/ @Bolisov +/types/gapi.client.resourceviews/ @Bolisov +/types/gapi.client.runtimeconfig/ @Bolisov +/types/gapi.client.safebrowsing/ @Bolisov +/types/gapi.client.script/ @Bolisov +/types/gapi.client.searchconsole/ @Bolisov +/types/gapi.client.servicecontrol/ @Bolisov +/types/gapi.client.servicemanagement/ @Bolisov +/types/gapi.client.serviceuser/ @Bolisov +/types/gapi.client.sheets/ @Bolisov +/types/gapi.client.siteverification/ @Bolisov +/types/gapi.client.slides/ @Bolisov +/types/gapi.client.sourcerepo/ @Bolisov +/types/gapi.client.spanner/ @Bolisov +/types/gapi.client.spectrum/ @Bolisov +/types/gapi.client.speech/ @Bolisov +/types/gapi.client.sqladmin/ @Bolisov +/types/gapi.client.storage/ @Bolisov +/types/gapi.client.storagetransfer/ @Bolisov +/types/gapi.client.streetviewpublish/ @Bolisov +/types/gapi.client.surveys/ @Bolisov +/types/gapi.client.tagmanager/ @Bolisov +/types/gapi.client.taskqueue/ @Bolisov +/types/gapi.client.tasks/ @Bolisov +/types/gapi.client.testing/ @Bolisov +/types/gapi.client.toolresults/ @Bolisov +/types/gapi.client.translate/ @Bolisov +/types/gapi.client.urlshortener/ @Bolisov +/types/gapi.client.vault/ @Bolisov +/types/gapi.client.videointelligence/ @Bolisov +/types/gapi.client.vision/ @Bolisov +/types/gapi.client.webfonts/ @Bolisov +/types/gapi.client.webmasters/ @Bolisov +/types/gapi.client.youtube/ @Bolisov +/types/gapi.client.youtubeanalytics/ @Bolisov +/types/gapi.client.youtubereporting/ @Bolisov +/types/gapi.drive/ @baxtersa +/types/gapi.pagespeedonline/ @sgtfrankieboy +/types/gapi.people/ @tkrotoff +/types/gapi.plus/ @tkrotoff +/types/gapi.translate/ @sgtfrankieboy +/types/gapi.urlshortener/ @sgtfrankieboy +/types/gapi.youtube/ @sgtfrankieboy +/types/gapi.youtubeanalytics/ @sgtfrankieboy +/types/gaussian/ @scttcper +/types/gen-readlines/ @CodeAnimal +/types/generic-functions/ @stpettersens +/types/generic-pool/ @jerray +/types/gently/ @bonnici +/types/geodesy/ @DenisCarriere @HandyG52 @excelulous +/types/geojson/ @cobster @atd-schubert @JeffJacobson +/types/geojson2osm/ @DenisCarriere +/types/geokdbush/ @DenisCarriere +/types/geometry-dom/ @nakakura +/types/geopattern/ @Gaelan +/types/get-node-dimensions/ @vincekovacs +/types/get-stdin/ @DanielRosenwasser +/types/get-stream/ @douglasduteil @BendingBender +/types/getos/ @BendingBender +/types/gettext.js/ @jucrouzet +/types/gifffer/ @gatimus +/types/gijgo/ @atatanasov +/types/giraffe/ @darthapo +/types/git/ @vvakame +/types/git-config/ @stpettersens +/types/git-remote-origin-url/ @janslow +/types/github-username-regex/ @BehindTheMath +/types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist @surtr-isaz +/types/gldatepicker/ @qcz +/types/glidejs/ @milanjaros +/types/glob/ @vvakame @voy +/types/glob-base/ @alan-agius4 +/types/glob-expand/ @vvakame +/types/glob-parent/ @mrmlnc +/types/glob-stream/ @Bartvds @mrmlnc +/types/global-tunnel-ng/ @BendingBender +/types/globalize/ @gcastre @afromogli +/types/globalize-compiler/ @iclanton +/types/globby/ @douglasduteil @ikatyang +/types/globule/ @durad +/types/gm/ @ChaosinaCan @maartenvanvliet +/types/go/ @NorthwoodsSoftware +/types/google-adwords-scripts/ @jafaircl +/types/google-apps-script/ @motemen +/types/google-apps-script-oauth2/ @dhayab +/types/google-cloud__datastore/ @beaulac +/types/google-cloud__pubsub/ @pheromonez +/types/google-cloud__storage/ @blove @nbperry +/types/google-earth/ @icholy +/types/google-images/ @dolanmiu +/types/google-libphonenumber/ @leonyu +/types/google-map-react/ @honzabrecka +/types/google-maps/ @DeividasBakanas @GiedriusGrabauskas +/types/google-protobuf/ @marcuslongmuir +/types/google.analytics/ @tyler-murphy +/types/google.feeds/ @RodneyJT +/types/google.fonts/ @danmarshall +/types/google.geolocation/ @vbortone +/types/google.picker/ @grapswiz +/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm +/types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss +/types/googlemaps.infobubble/ @Dashue +/types/got/ @BendingBender @LinusU +/types/graceful-fs/v2/ @Bartvds +/types/graceful-fs/ @Bartvds @BendingBender +/types/graham_scan/ @hberntsen +/types/graphite-udp/ @EricByers +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal +/types/graphql-date/ @enaeseth +/types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo +/types/graphql-type-json/ @schfkt +/types/graphviz/ @mhfrantz +/types/grasp/ @agnoster +/types/gravatar/ @denis-sokolov +/types/gravatar-url/ @ivangabriele +/types/greasemonkey/ @kotas +/types/grecaptcha/v0/ @brentj73 +/types/grecaptcha/ @DethAriel +/types/gregorian-calendar/ @cwalv +/types/gridfs-stream/ @liorm +/types/gridstack/ @PascalSenn @ZoolWay @Sl1MBoy +/types/grunt/ @jeffmay @basarat +/types/gsap/ @codebelt @ProbablePrime +/types/guid/ @maroy1986 +/types/gulp/ @GiedriusGrabauskas +/types/gulp-angular-templatecache/ @amanmahajan7 +/types/gulp-babel/ @AyaMorisawa +/types/gulp-batch/ @alvarollmenezes @vizeke +/types/gulp-bump/ @silkentrance +/types/gulp-cache/ @aravindarun +/types/gulp-cached/ @tomc974 +/types/gulp-changed/ @tomc974 +/types/gulp-cheerio/ @tkQubo +/types/gulp-clean-dest/ @andypyrope +/types/gulp-coffeeify/ @tkQubo +/types/gulp-coffeelint/ @tkQubo +/types/gulp-concat/ @k-kagurazaka +/types/gulp-connect/ @andrewiggins +/types/gulp-copy/ @aravindarun +/types/gulp-csso/ @tkrotoff +/types/gulp-debug/ @tkrotoff +/types/gulp-diff/ @ikatyang +/types/gulp-dtsm/ @AyaMorisawa +/types/gulp-espower/ @tkQubo +/types/gulp-file-include/ @DanielRosenwasser +/types/gulp-filter/ @tkrotoff +/types/gulp-flatten/ @k-kagurazaka +/types/gulp-gzip/ @tkQubo +/types/gulp-help/ @tkQubo +/types/gulp-help-doc/ @Mikhus +/types/gulp-html-replace/ @peterjuras +/types/gulp-htmlmin/ @tkrotoff +/types/gulp-if/ @joeskeen +/types/gulp-inject/ @k-kagurazaka +/types/gulp-insert/ @shantmarouti +/types/gulp-install/ @peterjuras +/types/gulp-jade/ @berwyn +/types/gulp-jasmine/ @andypyrope +/types/gulp-jasmine-browser/ @tkrotoff +/types/gulp-json-editor/ @peterjuras +/types/gulp-jsonminify/ @pine +/types/gulp-jspm/ @peterjuras +/types/gulp-less/ @k-kagurazaka +/types/gulp-load-plugins/ @joeskeen +/types/gulp-minify-css/ @k-kagurazaka +/types/gulp-minify-html/ @tkrotoff +/types/gulp-modernizr/ @remisery +/types/gulp-newer/ @tomc974 +/types/gulp-ng-annotate/ @tkQubo +/types/gulp-nodemon/ @tkQubo +/types/gulp-plumber/ @joeskeen +/types/gulp-protractor/ @tkrotoff +/types/gulp-pug/ @remisery +/types/gulp-remember/ @tomc974 +/types/gulp-rev/ @tkrotoff +/types/gulp-rev-replace/ @tkrotoff +/types/gulp-ruby-sass/ @agnislav +/types/gulp-shell/ @tkqubo +/types/gulp-size/ @tkrotoff @remisery +/types/gulp-sort/ @joeskeen +/types/gulp-strip-debug/ @peterjuras +/types/gulp-svg-sprite/ @tkqubo +/types/gulp-task-listing/ @joeskeen +/types/gulp-tsd/ @k-kagurazaka +/types/gulp-uglify/ @ChristopherHaws @leonard-thieu +/types/gulp-useref/ @tkrotoff +/types/gulp-util/ @jedmao +/types/gulp-watch/ @tkrotoff +/types/gulp-zip/ @dudeofawesome +/types/gzip-js/ @rhysd +/types/gzip-size/v3/ @plantain-00 +/types/gzip-size/ @plantain-00 @jimivdw @andrewiggins +/types/h2o2/ @jasonswearingen @AJamesPhillips +/types/halfred/ @dherges +/types/halogen/ @steller +/types/hammerjs/ @milkisevil @codler +/types/handlebars/ @borisyankov +/types/hapi/v8/ @jasonswearingen +/types/hapi/v12/ @jasonswearingen +/types/hapi/v15/ @jasonswearingen +/types/hapi/ @jasonswearingen @AJamesPhillips +/types/hapi-auth-basic/ @AJamesPhillips @saboya +/types/hapi-auth-jwt2/ @warrenseymour +/types/hapi-decorators/ @kenhowardpdx +/types/har-format/ @micmro +/types/hard-rejection/ @BendingBender +/types/harmony-proxy/ @remojansen +/types/has-ansi/ @BendingBender +/types/hash-file/ @HiromiShikata +/types/hash-stream/ @BendingBender +/types/hasha/ @BendgingBender +/types/hasher/ @flyfishMT +/types/hashids/ @pocesar +/types/hashmap/ @outring +/types/haversine/ @screendriver +/types/he/ @sedwards2009 +/types/headroom/ @hakubo +/types/heap/ @ryan10132 +/types/heapdump/ @weekens +/types/heatmap.js/ @lookuptable @rhys-vdw +/types/hedron/ @dborysov +/types/hellojs/ @PavelPZ @vuorinem +/types/hellosign-embedded/ @xt0rted +/types/helmet/ @cyrilschumacher @EvanHahn @bluehatbrit +/types/heredatalens/ @denyo +/types/heremaps/ @Josh-ES @denyo +/types/heroku-logger/ @kylevogt +/types/hex-rgba/ @r3nya +/types/hexo-bunyan/ @segayuu +/types/hexo-fs/ @segayuu +/types/hexo-log/ @segayuu +/types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens +/types/highcharts-ng/ @scatcher +/types/highland/ @Bartvds @hgwood @iwllyu @alvis +/types/highlight.js/ @nikeee @sourrust @joshuakgoldberg +/types/hiredis/ @titan +/types/history/v2/ @sergey-buturlakin @ngbrown +/types/history/v3/ @sergey-buturlakin @ngbrown @LKay +/types/history/ @sergey-buturlakin @ngbrown @rokoroku +/types/history.js/ @borisyankov @gjunge +/types/hjson/ @crunchie84 +/types/hls.js/ @jgainfort +/types/hoek/ @prashaantt +/types/holderjs/ @renjfk +/types/hooker/ @misak113 +/types/hopscotch/ @pimterry @Aurimas1 +/types/howler/ @xperiments @tdukart @alien35 @nicholashza +/types/hpp/ @kryops +/types/html-entities/ @xstoudi +/types/html-minifier/v1/ @tkrotoff +/types/html-minifier/ @tkrotoff @rikuayanokozy +/types/html-pdf/ @westy92 +/types/html-to-text/ @erykwarren +/types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk +/types/html-webpack-template/ @bumbleblym +/types/html2canvas/ @rwhepburn @tan9 +/types/htmlbars-inline-precompile/ @chriskrycho +/types/htmlparser2/ @staticfunction @LinusU +/types/htmltojsx/ @basarat +/types/http-assert/ @jkeylu +/types/http-aws-es/ @marcogrcr +/types/http-codes/ @mhegazy +/types/http-context/ @mtraynham +/types/http-errors/ @tkrotoff @BendingBender +/types/http-proxy/ @SomaticIT +/types/http-proxy-agent/ @mrmlnc +/types/http-proxy-middleware/ @zebMcCorkle @BendingBender +/types/http-server/ @plantain-00 +/types/http-status/ @misak113 +/types/http-string-parser/ @pine613 +/types/httperr/ @yortus +/types/hubot/ @dirk +/types/hubspot-pace/ @borislavjivkov +/types/humane/ @jmvrbanac +/types/humanize-plus/ @DenisCarriere +/types/humanparser/ @MichalPodeszwa +/types/humps/ @nikeee +/types/hyco-ws/ @mrcabellom +/types/hyperscript/ @spacejack @jmfirth +/types/hypertext-application-language/ @maks3w +/types/hystrixjs/ @igorsechyn +/types/i18n/ @SomaticIT @FindQ +/types/i18n-js/ @ypresto +/types/i18next/v2/ @mxl @deerawan @GiedriusGrabauskas +/types/i18next/ @mxl @deerawan @GiedriusGrabauskas +/types/i18next-browser-languagedetector/v0/ @cyrilschumacher @GiedriusGrabauskas +/types/i18next-browser-languagedetector/ @cyrilschumacher @GiedriusGrabauskas +/types/i18next-express-middleware/ @cyrilschumacher +/types/i18next-node-fs-backend/ @cyrilschumacher +/types/i18next-sprintf-postprocessor/ @cyrilschumacher +/types/i18next-xhr-backend/ @jamuhl @GiedriusGrabauskas +/types/i2c-bus/ @101100 +/types/iban/ @cyrilschumacher +/types/ibm-mobilefirst/ @nacho4d +/types/ibm_db/ @agov +/types/icepick/ @ngbrown @tobico +/types/icheck/ @qcz +/types/iconv/ @delphinus35 +/types/ids/ @3fd +/types/iframe-resizer/ @arminbaljic +/types/ignite-ui/ @IgniteUI +/types/ignore-styles/ @tai2 +/types/iltorb/ @Alorel +/types/image-size/ @elisee +/types/imagemagick/ @soywiz +/types/imagemagick-native/ @horiuchi +/types/imagemapster/ @delphinus35 +/types/images/ @DingWeizhe +/types/imagesloaded/ @coldacid @apexskier +/types/imap/ @psnider +/types/imap-simple/ @pushplay +/types/imgur-rest-api/ @lukewestby +/types/immutability-helper/ @seansfkelley +/types/impress/ @borisyankov +/types/in-range/ @DanielRosenwasser +/types/incremental-dom/ @basarat @lanthaler @vvakame +/types/indent-string/ @mhegazy +/types/inert/ @nycdotnet @AJamesPhillips +/types/inflected/ @dsci +/types/inflection/ @shiwano +/types/inherits/ @chrootsu +/types/ini/ @marcinporebski +/types/iniparser/ @chrootsu +/types/inline-css/ @philipisapain +/types/inline-style-prefixer/ @ahz @dpetrezselyova +/types/inquirer/ @tkQubo @ppathan @jouderianjr +/types/insert-module-globals/ @leonard-thieu +/types/insight/ @vvakame +/types/integer/ @Morfent +/types/interact.js/ @dduugg @adidahiya @thasner +/types/intercom-web/ @fongandrew @salbahra +/types/intercomjs/ @spencerwi +/types/internal-ip/ @BendingBender +/types/intl/ @RagibHasin +/types/intl-messageformat/ @mhegazy +/types/intl-tel-input/ @fdnhkj @leonard-thieu +/types/into-stream/ @BendingBender +/types/intro.js/ @anahkiasen +/types/invariant/ @bennett000 +/types/inversify-devtools/ @inversify +/types/ion.rangeslider/v1/ @dduugg +/types/ion.rangeslider/ @sixinli +/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor +/types/iota.lib.js/ @fogsh +/types/ip/ @codeanimal +/types/ip-regex/ @unindented +/types/irc/ @phillips1012 +/types/iron/ @simonschick @rafaelsouzaf +/types/is/ @cabralRodrigo +/types/is-absolute-url/ @mhegazy +/types/is-alphanumerical/ @vutran +/types/is-archive/ @mhegazy +/types/is-array/ @pine +/types/is-binary-path/ @DanielRosenwasser +/types/is-compressed/ @mhegazy +/types/is-finite/ @mhegazy +/types/is-glob/ @mrmlnc +/types/is-ip/ @coderslagoon +/types/is-my-json-valid/ @kruncher +/types/is-negated-glob/ @ajafff +/types/is-number/ @harryshipton +/types/is-object/ @wbhob +/types/is-path-cwd/ @DanielRosenwasser +/types/is-path-in-cwd/ @mhegazy +/types/is-promise/ @DanielRosenwasser +/types/is-relative-url/ @mhegazy +/types/is-root/ @mhegazy +/types/is-root-path/ @mhegazy +/types/is-scoped/ @postcrafter +/types/is-stream/ @me +/types/is-svg/ @BendingBender +/types/is-text-path/ @mhegazy +/types/is-url/ @RyotaMurohoshi +/types/is-url-superb/ @kryops +/types/is-windows/ @mizunashi-mana +/types/isbn-utils/ @elhaard +/types/iscroll/ @csrakowski +/types/iso-3166-2/ @sicilica +/types/iso8601-localizer/ @avielfedida +/types/isomorphic-fetch/ @toddlucas +/types/isotope-layout/ @avidenic +/types/istanbul/ @tkrotoff +/types/istanbul-lib-coverage/ @jason0x43 +/types/istanbul-lib-hook/ @jason0x43 +/types/istanbul-lib-instrument/ @jason0x43 +/types/istanbul-lib-report/ @jason0x43 +/types/istanbul-lib-source-maps/ @jason0x43 +/types/istanbul-middleware/ @hookclaw +/types/istanbul-reports/ @jason0x43 +/types/ityped/ @DanielRosenwasser +/types/ix.js/ @Igorbek +/types/jade/ @panuhorsmalahti +/types/jalaali-js/ @alitaheri +/types/japanese-holidays/ @syamatoo +/types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software +/types/jasmine-ajax/ @lgrignon +/types/jasmine-data_driven_tests/ @AnthonyMacKinnon +/types/jasmine-enzyme/ @bolatovumar +/types/jasmine-es6-promise-matchers/ @stephenlautier +/types/jasmine-fixture/ @craigbrett17 +/types/jasmine-given/ @shairez +/types/jasmine-jquery/ @gstamac +/types/jasmine-matchers/ @Bartvds +/types/jasmine-node/ @svi3c +/types/jasmine-promise-matchers/ @matthewjh +/types/jasmine_dom_matchers/ @devoto13 +/types/jasminewd2/ @sjelin +/types/java/ @jimlloyd @hrl7 +/types/java-applet/ @cyrilschumacher +/types/javascript-astar/ @ptlis +/types/javascript-bignum/ @sandersn +/types/javascript-obfuscator/ @sanex3339 +/types/javascript-state-machine/ @borisyankov @mdocter @MrBigDog2U @samael65535 @taoqf +/types/jbinary/ @tbureck +/types/jcanvas/ @rogierschouten +/types/jdataview/ @RReverser +/types/jdenticon/ @mtr +/types/jest/v16/ @NoHomey @jwbay +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil +/types/jest-diff/ @myabc +/types/jest-docblock/ @ikatyang +/types/jest-get-type/ @myabc +/types/jest-in-case/ @geovanisouza92 +/types/jest-json-schema/ @deadNightTiger +/types/jest-matcher-utils/ @myabc +/types/jest-matchers/ @joscha +/types/jest-validate/ @ikatyang +/types/jfs/ @tlaziuk +/types/jjv/ @Nemo157 +/types/jjve/ @Nemo157 +/types/jmespath/ @pushplay +/types/johnny-five/ @nakakura +/types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW +/types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku +/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus +/types/joigoose/ @boothwhack +/types/jpeg-js/ @DanielRosenwasser +/types/jpm/ @github-account-because-they-want-it +/types/jqgrid/ @lokeshpeta +/types/jqrangeslider/ @qcz +/types/jquery/v1/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu +/types/jquery/v2/ @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @DickvdBrink @King2500 @leonard-thieu +/types/jquery/ @leonard-thieu @borisyankov @choffmeister @Steve-Fenton @Diullei @tasoili @jasons-novaleaf @seanski @Guuz @ksummerlin @basarat @nwolverson @derekcicerone @AndrewGaspar @seikichi @benjaminjackman @s093294 @JoshStrobl @johnnyreilly @DickvdBrink @King2500 +/types/jquery-ajax-chain/ @humana-fragilitas +/types/jquery-alertable/ @stever +/types/jquery-backstretch/ @dkulyk +/types/jquery-cropbox/ @PerKastman +/types/jquery-deparam/ @patsissons +/types/jquery-easy-loading/ @delphinus35 +/types/jquery-editable-select/ @baywet +/types/jquery-fullscreen/ @bgrieder +/types/jquery-galleria/ @rimig +/types/jquery-handsontable/ @intelorca +/types/jquery-jcrop/ @joeskeen +/types/jquery-jsonrpcclient/ @Ty3uK +/types/jquery-knob/ @iain8 +/types/jquery-mask-plugin/ @avidenic +/types/jquery-match-height/ @kbytesys +/types/jquery-mockjax/ @laszlojakab @vladeck +/types/jquery-mousewheel/ @xt0rted +/types/jquery-notifier/ @allipierre +/types/jquery-param/ @patsissons +/types/jquery-sortable/ @Seltzer +/types/jquery-steps/ @jblank @nickwph +/types/jquery-timeentry/ @marknadig +/types/jquery-toastmessage-plugin/ @joeskeen +/types/jquery-truncate-html/ @abraaoalves +/types/jquery-urlparam/ @stpettersens +/types/jquery-validation-unobtrusive/ @EnableSoftware +/types/jquery.address/ @martinduparc @mardaneus86 +/types/jquery.are-you-sure/ @jonegerton +/types/jquery.autosize/ @kingdango +/types/jquery.bbq/ @sunetos +/types/jquery.bootstrap.wizard/ @niemyjski @dennisahlin +/types/jquery.cleditor/ @pushplay +/types/jquery.clientsidelogging/ @diullei +/types/jquery.color/ @derekcicerone +/types/jquery.colorbox/ @gjunge +/types/jquery.colorpicker/ @pushplay +/types/jquery.contextmenu/ @nvivo +/types/jquery.cookie/ @RoyGoode @BenLorantfy +/types/jquery.customselect/ @adamcoulombe +/types/jquery.cycle2/ @dnadolny +/types/jquery.dropotron/ @cyrilschumacher +/types/jquery.dynatree/ @fdecampredon +/types/jquery.elang/ @sumegizoltan +/types/jquery.fancytree/ @alphaleonis @abedi-ir @Nitecube +/types/jquery.filtertable/ @totpero +/types/jquery.finger/ @maxackley +/types/jquery.flagstrap/ @felipedgarcia +/types/jquery.fullscreen/ @piraveen +/types/jquery.gridster/ @jbaldwin +/types/jquery.growl/ @yeganemehr +/types/jquery.highlight-bartaz/ @Pro +/types/jquery.jnotify/ @jamescurran +/types/jquery.joyride/ @vbortone +/types/jquery.jsignature/ @pjmagee +/types/jquery.leanmodal/ @FinelySliced +/types/jquery.livestampjs/ @vbortone +/types/jquery.notify/ @evil-shrike +/types/jquery.notifybar/ @zaneli +/types/jquery.noty/ @kingdango @thelfensdrfer +/types/jquery.payment/ @ejsmith @johnrutherford +/types/jquery.pjax/ @lijunle +/types/jquery.placeholder/ @majorsilence @EnableSoftware +/types/jquery.pnotify/ @DavidSichau @FUNExtreme +/types/jquery.postmessage/ @lijunle +/types/jquery.prettyphoto/ @pgaske +/types/jquery.qrcode/ @danmana +/types/jquery.rateit/ @gjunge +/types/jquery.rowgrid/ @vinayak-garg +/types/jquery.scrollto/ @nestalk +/types/jquery.simplemodal/ @ForNeVeR +/types/jquery.simplepagination/ @nvivo +/types/jquery.simulate/ @derekcicerone +/types/jquery.slimscroll/ @Promact +/types/jquery.soap/ @tigerxy +/types/jquery.sortelements/ @tbureck +/types/jquery.superlink/ @niemyjski +/types/jquery.tagsmanager/ @vbortone +/types/jquery.tile/ @zaneli +/types/jquery.timepicker/ @anwarjaved +/types/jquery.timer/ @JoshStrobl +/types/jquery.tinycarousel/ @csrakowski +/types/jquery.tinyscrollbar/ @csrakowski +/types/jquery.tipsy/ @bdukes +/types/jquery.tools/ @joeskeen +/types/jquery.total-storage/ @JeremyCBrooks +/types/jquery.transit/ @MrBigDog2U +/types/jquery.ui.datetimepicker/ @dougajmcdonald +/types/jquery.ui.layout/ @Steve-Fenton @drarmstr +/types/jquery.uniform/ @flyfishMT +/types/jquery.validation/ @fdecampredon @johnnyreilly @avidenic +/types/jquery.watermark/ @anwarjaved +/types/jquerymobile/ @borisyankov +/types/jqueryui/ @borisyankov @johnnyreilly +/types/js-base64/ @DenisCarriere @tlent +/types/js-beautify/ @JoshuaKGoldberg @hansrwindhoff +/types/js-clipper/ @omni360 +/types/js-combinatorics/ @outring +/types/js-cookie/ @theodorejb @BendingBender +/types/js-data-angular/ @reppners +/types/js-fixtures/ @kazimanzurrashid +/types/js-git/ @Bartvds +/types/js-md5/ @mwmccarthy +/types/js-quantities/ @wrummler +/types/js-schema/ @marcinporebski @roblabat +/types/js-search/ @guoyunhe +/types/js-to-java/ @skyitachi +/types/js-url/ @pine613 +/types/js-yaml/ @Bartvds @sclausen +/types/js.spec/ @mattbishop +/types/jsbn/ @Evgenus @al2xed +/types/jschannel/ @yitzchok +/types/jscrollpane/ @qcz +/types/jsdeferred/ @minodisk +/types/jsdom/ @leonard-thieu +/types/jsen/ @vladeck +/types/jsend/ @CaselIT +/types/jsesc/ @Bartvds +/types/jsfl/ @soywiz +/types/jsforce/ @dolanmiu @netes +/types/jshamcrest/ @dharkness +/types/jsmockito/ @shiver-me-timbers +/types/jsnox/ @stkb @DovydasNavickas +/types/json-merge-patch/ @senyaarseniy +/types/json-patch/ @vvakame +/types/json-pointer/ @Bartvds +/types/json-query/ @mtraynham +/types/json-rpc-ws/ @npenin @mlamp +/types/json-schema/ @bcherny @cyrilletuzi +/types/json-socket/ @svi3c +/types/json-stable-stringify/ @mhfrantz +/types/json-stringify-safe/ @BendingBender +/types/json2md/ @MartynasZilinskas +/types/jsonata/ @nick121212 +/types/jsoneditor/ @alejo90 +/types/jsoneditoronline/ @vbortone +/types/jsonfile/ @dbowring +/types/jsonminify/ @no23reason +/types/jsonnet/ @hookclaw +/types/jsonp/ @surenkov +/types/jsonpath/ @horiuchi @ikatyang +/types/jsonrpc-serializer/ @Akim95 +/types/jsonstream/ @Bartvds +/types/jsonwebtoken/ @SomaticIT @danielheim @brikou +/types/jspdf/ @amberjs +/types/jsqrcode/ @lordazzi +/types/jsrender/ @zakki +/types/jsrp/ @harryshipton +/types/jss/ @appsforartists @kof +/types/jssha/ @randombk @SrTobi +/types/jstimezonedetect/ @olamothe +/types/jstorage/ @dflor003 +/types/jstree/ @adaskothebeast +/types/jsts/ @StephaneAlie +/types/jsuite/ @darrenhillconsulting +/types/jsuri/ @coldacid @flqw +/types/jsurl/ @agorshkov23 +/types/jsx-chai/ @nupplaphil +/types/jszip/ @mzeiher @forabi +/types/jug/ @yevt +/types/jui/ @easylogic +/types/jui-core/ @easylogic +/types/jui-grid/ @easylogic +/types/jweixin/ @taoqf @gomydodo +/types/jwplayer/ @martinduparc @kutomer +/types/jws/ @JustinBeckwith +/types/jwt-client/ @timoteoponce +/types/jwt-decode/v1/ @QuatroDevOfficial +/types/jwt-decode/ @GiedriusGrabauskas @madsmadsen +/types/jwt-simple/ @kenfdev @GaelMagnan +/types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram +/types/karma/ @tkrotoff @43081j +/types/karma-chai/ @JayAndCatchFire +/types/karma-chai-sinon/ @vasek17 +/types/karma-coverage/ @tkrotoff +/types/karma-fixture/ @evictor +/types/karma-jasmine/ @michelsalib +/types/karma-webpack/ @mtraynham +/types/katex/ @mrand01 +/types/kcors/ @Xstoudi @izayoiko +/types/kdbush/ @DenisCarriere +/types/kefir/ @AyaMorisawa @HitoriSensei +/types/kendo-ui/ @telerik +/types/keyboardjs/ @vbortone @piranha771 +/types/keygrip/ @jkeylu +/types/keymaster/ @nitram509 +/types/keymirror/ @jfahrenkrug +/types/keypress.js/ @rcchen +/types/keysym/ @harryshipton +/types/keytar/ @miniak @shiftkey @juturu +/types/kik-browser/ @joelday +/types/klaw/v1/ @mceachen +/types/klaw/ @mceachen +/types/klaw-sync/ @shiftkey +/types/knex/ @tkQubo @baronfel @MeLlamoPablo @mastermatt @micksatana +/types/knex-postgis/ @vesse +/types/knockback/ @borisyankov +/types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy +/types/knockout-amd-helpers/ @DavidSichau +/types/knockout-secure-binding/ @pine613 +/types/knockout-transformations/ @johnnyreilly @Nemo157 +/types/knockout.deferred.updates/ @sgaliano +/types/knockout.editables/ @borisyankov +/types/knockout.es5/ @sgaliano +/types/knockout.kogrid/ @huer12 +/types/knockout.mapper/ @BMeyerKC +/types/knockout.mapping/ @borisyankov @ffMathy +/types/knockout.projections/ @johnnyreilly +/types/knockout.punches/ @johnnyreilly +/types/knockout.rx/ @Igorbek +/types/knockout.validation/ @danludwig +/types/knockout.viewmodel/ @oising +/types/knockstrap/ @adaskothebeast +/types/knuddels-userapps-api/ @Knuddels +/types/ko.plus/ @conficient +/types/koa/ @DavidCai1993 @jkeylu @brikou +/types/koa-basic-auth/ @Tobias4872 +/types/koa-bodyparser/ @hellopao +/types/koa-cache-control/ @pe8ter +/types/koa-compose/ @jkeylu +/types/koa-compress/ @hellopao +/types/koa-conditional-get/ @wingsbob +/types/koa-csrf/ @haskaalo +/types/koa-etag/ @wingsbob +/types/koa-favicon/ @hellopao +/types/koa-generic-session/ @nsimmons @Ragg- +/types/koa-hbs/ @jcbmln @mudkipme +/types/koa-helmet/ @me +/types/koa-joi-router/ @wingsbob +/types/koa-json/ @brooklyndev +/types/koa-json-error/ @mudkipme +/types/koa-logger/ @geoffreak @tlaziuk +/types/koa-logger-winston/ @stevehipwell +/types/koa-morgan/ @vesse +/types/koa-mount/ @amirsaber +/types/koa-passport/ @horiuchi @tlaziuk @brendtumi +/types/koa-pino-logger/ @khell +/types/koa-pug/ @Xstoudi +/types/koa-range/ @strax +/types/koa-redis/ @nsimmons +/types/koa-route/ @migstopheles +/types/koa-router/ @hellopao @schfkt +/types/koa-send/ @pe8ter @tlaziuk +/types/koa-session/ @kerol2r20 +/types/koa-session-minimal/ @longztian +/types/koa-sslify/ @wingsbob +/types/koa-static/ @hellopao @tlaziuk +/types/koa-views/ @brooklyndev +/types/koa-webpack/ @malj +/types/koa-websocket/ @me +/types/koa2-cors/ @xialeistudio +/types/koa__cors/ @Xstoudi @izayoiko @stevehipwell +/types/kolite/ @borisyankov +/types/konami.js/ @mareek +/types/kraken-js/ @darkwebdev +/types/kramed/ @tonicblue +/types/kss/ @giladgray +/types/kue/ @drudge @amiram @pc-jedi +/types/kurento-utils/ @nenadalm +/types/kuromoji/ @mzsm @kgtkr +/types/lab/ @prashaantt +/types/ladda/ @dflor003 @leemicw +/types/lasso/ @darkwebdev +/types/later/ @jasond-s +/types/latinize/ @GiedriusGrabauskas +/types/latlon-geohash/ @rimig +/types/launchpad/ @rictic +/types/lazy.js/ @Bartvds +/types/lazypipe/ @tomc974 +/types/ldapjs/ @cvillemure @peterkooijmans +/types/leadfoot/ @theintern +/types/leaflet/v0/ @rgripper +/types/leaflet/ @alejo90 @atd-schubert +/types/leaflet-areaselect/ @awallat +/types/leaflet-curve/ @onikiienko +/types/leaflet-draw/ @matt-guest @reblace @YunS-Stacy +/types/leaflet-editable/ @dalie +/types/leaflet-fullscreen/ @DenisCarriere +/types/leaflet-geocoder-mapzen/ @leezu +/types/leaflet-gpx/ @soucekv +/types/leaflet-imageoverlay-rotated/ @tkleinke +/types/leaflet-label/ @Nemo157 +/types/leaflet-polylinedecorator/ @soucekv +/types/leaflet-providers/ @BendingBender +/types/leaflet-rotatedmarker/ @robert-prib-polestar +/types/leaflet.awesome-markers/v0/ @Odrin @sebek64 +/types/leaflet.awesome-markers/ @sebek64 +/types/leaflet.fullscreen/ @wcomartin +/types/leaflet.gridlayer.googlemutant/ @ernest-rhinozeros +/types/leaflet.heat/ @onderceylan +/types/leaflet.locatecontrol/ @DenisCarriere +/types/leaflet.markercluster/ @rimig +/types/leaflet.markercluster.layersupport/ @AsamK +/types/leaflet.mouseposition/ @Hanyon +/types/leaflet.pancontrol/ @Brictarus +/types/leaflet.pm/ @tkleinke +/types/leaflet.polylinemeasure/ @RiON69 +/types/leapmotionts/ @logotype +/types/legal-eagle/ @j-f1 +/types/less/ @thasner @pranaygp +/types/less-middleware/ @federicobond +/types/less2sass/ @gatimus +/types/lestate/ @thelambdaparty +/types/level-sublevel/ @basp +/types/leveldown/ @tarruda +/types/levelup/ @blittle @tarruda +/types/leven/ @jmalonzo +/types/levenshtein/ @geoffreak +/types/libpq/ @Lodin +/types/libxmljs/ @fdecampredon +/types/libxslt/ @alejo90 +/types/license-checker/ @rogierschouten @unindented +/types/lil-uuid/ @Pr1st0n +/types/lime-js/ @arthur-xavier +/types/line-by-line/ @etomsen +/types/line-reader/ @stpettersens +/types/linkify-it/ @praxxis +/types/linq4js/ @morrisjdev +/types/lls/ @borislavjivkov +/types/load-json-file/ @SamVerschueren +/types/loader-runner/ @e-cloud +/types/loader-utils/ @Perlmint @TotooriaHyperion +/types/loadware/ @ALyman +/types/lobibox/ @itboy87 +/types/local-dynamo/ @Sicilica +/types/localforage-cordovasqlitedriver/ @thgreasi +/types/localized-countries/ @coderslagoon +/types/localizejs-library/ @salbahra +/types/locate-path/ @me +/types/lockfile/v0/ @Bartvds +/types/lockfile/ @Bartvds @BendingBender +/types/lockr/ @droritos +/types/locutus/ @hookclaw +/types/lodash/v3/ @bczengel @chrootsu +/types/lodash/ @bczengel @chrootsu @stepancar @ericanderson @aj-r @ailrun @e-cloud @thorn0 @jtmthf +/types/lodash-es/ @stephenlautier @e-cloud +/types/lodash-webpack-plugin/ @bumbleblym +/types/lodash.add/ @bczengel @chrootsu @stepancar +/types/lodash.after/ @bczengel @chrootsu @stepancar +/types/lodash.ary/ @bczengel @chrootsu @stepancar +/types/lodash.assign/ @bczengel @chrootsu @stepancar +/types/lodash.assignin/ @bczengel @chrootsu @stepancar +/types/lodash.assigninwith/ @bczengel @chrootsu @stepancar +/types/lodash.assignwith/ @bczengel @chrootsu @stepancar +/types/lodash.at/ @bczengel @chrootsu @stepancar +/types/lodash.attempt/ @bczengel @chrootsu @stepancar +/types/lodash.before/ @bczengel @chrootsu @stepancar +/types/lodash.bind/ @bczengel @chrootsu @stepancar +/types/lodash.bindall/ @bczengel @chrootsu @stepancar +/types/lodash.bindkey/ @bczengel @chrootsu @stepancar +/types/lodash.camelcase/ @bczengel @chrootsu @stepancar +/types/lodash.capitalize/ @bczengel @chrootsu @stepancar +/types/lodash.castarray/ @bczengel @chrootsu @stepancar +/types/lodash.ceil/ @bczengel @chrootsu @stepancar +/types/lodash.chunk/ @bczengel @chrootsu @stepancar +/types/lodash.clamp/ @bczengel @chrootsu @stepancar +/types/lodash.clone/ @bczengel @chrootsu @stepancar +/types/lodash.clonedeep/ @bczengel @chrootsu @stepancar +/types/lodash.clonedeepwith/ @bczengel @chrootsu @stepancar +/types/lodash.clonewith/ @bczengel @chrootsu @stepancar +/types/lodash.compact/ @bczengel @chrootsu @stepancar +/types/lodash.concat/ @bczengel @chrootsu @stepancar +/types/lodash.cond/ @bczengel @chrootsu @stepancar +/types/lodash.constant/ @bczengel @chrootsu @stepancar +/types/lodash.countby/ @bczengel @chrootsu @stepancar +/types/lodash.create/ @bczengel @chrootsu @stepancar +/types/lodash.curry/ @bczengel @chrootsu @stepancar +/types/lodash.curryright/ @bczengel @chrootsu @stepancar +/types/lodash.debounce/ @bczengel @chrootsu @stepancar +/types/lodash.deburr/ @bczengel @chrootsu @stepancar +/types/lodash.defaults/ @bczengel @chrootsu @stepancar +/types/lodash.defaultsdeep/ @bczengel @chrootsu @stepancar +/types/lodash.defer/ @bczengel @chrootsu @stepancar +/types/lodash.delay/ @bczengel @chrootsu @stepancar +/types/lodash.difference/ @bczengel @chrootsu @stepancar +/types/lodash.differenceby/ @bczengel @chrootsu @stepancar +/types/lodash.differencewith/ @bczengel @chrootsu @stepancar +/types/lodash.divide/ @bczengel @chrootsu @stepancar +/types/lodash.drop/ @bczengel @chrootsu @stepancar +/types/lodash.dropright/ @bczengel @chrootsu @stepancar +/types/lodash.droprightwhile/ @bczengel @chrootsu @stepancar +/types/lodash.dropwhile/ @bczengel @chrootsu @stepancar +/types/lodash.endswith/ @bczengel @chrootsu @stepancar +/types/lodash.eq/ @bczengel @chrootsu @stepancar +/types/lodash.escape/ @bczengel @chrootsu @stepancar +/types/lodash.escaperegexp/ @bczengel @chrootsu @stepancar +/types/lodash.every/ @bczengel @chrootsu @stepancar +/types/lodash.fill/ @bczengel @chrootsu @stepancar +/types/lodash.filter/ @bczengel @chrootsu @stepancar +/types/lodash.find/ @bczengel @chrootsu @stepancar +/types/lodash.findindex/ @bczengel @chrootsu @stepancar +/types/lodash.findkey/ @bczengel @chrootsu @stepancar +/types/lodash.findlast/ @bczengel @chrootsu @stepancar +/types/lodash.findlastindex/ @bczengel @chrootsu @stepancar +/types/lodash.findlastkey/ @bczengel @chrootsu @stepancar +/types/lodash.first/ @bczengel @chrootsu @stepancar +/types/lodash.flatmap/ @bczengel @chrootsu @stepancar +/types/lodash.flatmapdeep/ @bczengel @chrootsu @stepancar +/types/lodash.flatmapdepth/ @bczengel @chrootsu @stepancar +/types/lodash.flatten/ @bczengel @chrootsu @stepancar +/types/lodash.flattendeep/ @bczengel @chrootsu @stepancar +/types/lodash.flattendepth/ @bczengel @chrootsu @stepancar +/types/lodash.flip/ @bczengel @chrootsu @stepancar +/types/lodash.floor/ @bczengel @chrootsu @stepancar +/types/lodash.flow/ @bczengel @chrootsu @stepancar +/types/lodash.flowright/ @bczengel @chrootsu @stepancar +/types/lodash.foreach/ @bczengel @chrootsu @stepancar +/types/lodash.foreachright/ @bczengel @chrootsu @stepancar +/types/lodash.forin/ @bczengel @chrootsu @stepancar +/types/lodash.forinright/ @bczengel @chrootsu @stepancar +/types/lodash.forown/ @bczengel @chrootsu @stepancar +/types/lodash.forownright/ @bczengel @chrootsu @stepancar +/types/lodash.frompairs/ @bczengel @chrootsu @stepancar +/types/lodash.functions/ @bczengel @chrootsu @stepancar +/types/lodash.functionsin/ @bczengel @chrootsu @stepancar +/types/lodash.get/ @bczengel @chrootsu @stepancar +/types/lodash.groupby/ @bczengel @chrootsu @stepancar +/types/lodash.gt/ @bczengel @chrootsu @stepancar +/types/lodash.gte/ @bczengel @chrootsu @stepancar +/types/lodash.has/ @bczengel @chrootsu @stepancar +/types/lodash.hasin/ @bczengel @chrootsu @stepancar +/types/lodash.head/ @bczengel @chrootsu @stepancar +/types/lodash.identity/ @bczengel @chrootsu @stepancar +/types/lodash.includes/ @bczengel @chrootsu @stepancar +/types/lodash.indexof/ @bczengel @chrootsu @stepancar +/types/lodash.initial/ @bczengel @chrootsu @stepancar +/types/lodash.inrange/ @bczengel @chrootsu @stepancar +/types/lodash.intersection/ @bczengel @chrootsu @stepancar +/types/lodash.intersectionby/ @bczengel @chrootsu @stepancar +/types/lodash.intersectionwith/ @bczengel @chrootsu @stepancar +/types/lodash.invert/ @bczengel @chrootsu @stepancar +/types/lodash.invertby/ @bczengel @chrootsu @stepancar +/types/lodash.invoke/ @bczengel @chrootsu @stepancar +/types/lodash.invokemap/ @bczengel @chrootsu @stepancar +/types/lodash.isarguments/ @bczengel @chrootsu @stepancar +/types/lodash.isarray/ @bczengel @chrootsu @stepancar +/types/lodash.isarraybuffer/ @bczengel @chrootsu @stepancar +/types/lodash.isarraylike/ @bczengel @chrootsu @stepancar +/types/lodash.isarraylikeobject/ @bczengel @chrootsu @stepancar +/types/lodash.isboolean/ @bczengel @chrootsu @stepancar +/types/lodash.isbuffer/ @bczengel @chrootsu @stepancar +/types/lodash.isdate/ @bczengel @chrootsu @stepancar +/types/lodash.iselement/ @bczengel @chrootsu @stepancar +/types/lodash.isempty/ @bczengel @chrootsu @stepancar +/types/lodash.isequal/ @bczengel @chrootsu @stepancar +/types/lodash.isequalwith/ @bczengel @chrootsu @stepancar +/types/lodash.iserror/ @bczengel @chrootsu @stepancar +/types/lodash.isfinite/ @bczengel @chrootsu @stepancar +/types/lodash.isfunction/ @bczengel @chrootsu @stepancar +/types/lodash.isinteger/ @bczengel @chrootsu @stepancar +/types/lodash.islength/ @bczengel @chrootsu @stepancar +/types/lodash.ismap/ @bczengel @chrootsu @stepancar +/types/lodash.ismatch/ @bczengel @chrootsu @stepancar +/types/lodash.ismatchwith/ @bczengel @chrootsu @stepancar +/types/lodash.isnan/ @bczengel @chrootsu @stepancar +/types/lodash.isnative/ @bczengel @chrootsu @stepancar +/types/lodash.isnil/ @bczengel @chrootsu @stepancar +/types/lodash.isnull/ @bczengel @chrootsu @stepancar +/types/lodash.isnumber/ @bczengel @chrootsu @stepancar +/types/lodash.isobject/ @bczengel @chrootsu @stepancar +/types/lodash.isobjectlike/ @bczengel @chrootsu @stepancar +/types/lodash.isplainobject/ @bczengel @chrootsu @stepancar +/types/lodash.isregexp/ @bczengel @chrootsu @stepancar +/types/lodash.issafeinteger/ @bczengel @chrootsu @stepancar +/types/lodash.isset/ @bczengel @chrootsu @stepancar +/types/lodash.isstring/ @bczengel @chrootsu @stepancar +/types/lodash.issymbol/ @bczengel @chrootsu @stepancar +/types/lodash.istypedarray/ @bczengel @chrootsu @stepancar +/types/lodash.isundefined/ @bczengel @chrootsu @stepancar +/types/lodash.isweakmap/ @bczengel @chrootsu @stepancar +/types/lodash.isweakset/ @bczengel @chrootsu @stepancar +/types/lodash.iteratee/ @bczengel @chrootsu @stepancar +/types/lodash.join/ @bczengel @chrootsu @stepancar +/types/lodash.kebabcase/ @bczengel @chrootsu @stepancar +/types/lodash.keyby/ @bczengel @chrootsu @stepancar +/types/lodash.keys/ @bczengel @chrootsu @stepancar +/types/lodash.keysin/ @bczengel @chrootsu @stepancar +/types/lodash.last/ @bczengel @chrootsu @stepancar +/types/lodash.lastindexof/ @bczengel @chrootsu @stepancar +/types/lodash.lowercase/ @bczengel @chrootsu @stepancar +/types/lodash.lowerfirst/ @bczengel @chrootsu @stepancar +/types/lodash.lt/ @bczengel @chrootsu @stepancar +/types/lodash.lte/ @bczengel @chrootsu @stepancar +/types/lodash.mapkeys/ @bczengel @chrootsu @stepancar +/types/lodash.mapvalues/ @bczengel @chrootsu @stepancar +/types/lodash.matches/ @bczengel @chrootsu @stepancar +/types/lodash.matchesproperty/ @bczengel @chrootsu @stepancar +/types/lodash.max/ @bczengel @chrootsu @stepancar +/types/lodash.maxby/ @bczengel @chrootsu @stepancar +/types/lodash.mean/ @bczengel @chrootsu @stepancar +/types/lodash.meanby/ @bczengel @chrootsu @stepancar +/types/lodash.memoize/ @bczengel @chrootsu @stepancar +/types/lodash.merge/ @bczengel @chrootsu @stepancar +/types/lodash.mergewith/ @bczengel @chrootsu @stepancar +/types/lodash.method/ @bczengel @chrootsu @stepancar +/types/lodash.methodof/ @bczengel @chrootsu @stepancar +/types/lodash.min/ @bczengel @chrootsu @stepancar +/types/lodash.minby/ @bczengel @chrootsu @stepancar +/types/lodash.mixin/ @bczengel @chrootsu @stepancar +/types/lodash.negate/ @bczengel @chrootsu @stepancar +/types/lodash.noop/ @bczengel @chrootsu @stepancar +/types/lodash.now/ @bczengel @chrootsu @stepancar +/types/lodash.nth/ @bczengel @chrootsu @stepancar +/types/lodash.ntharg/ @bczengel @chrootsu @stepancar +/types/lodash.omit/ @bczengel @chrootsu @stepancar +/types/lodash.omitby/ @bczengel @chrootsu @stepancar +/types/lodash.once/ @bczengel @chrootsu @stepancar +/types/lodash.orderby/ @bczengel @chrootsu @stepancar +/types/lodash.over/ @bczengel @chrootsu @stepancar +/types/lodash.overargs/ @bczengel @chrootsu @stepancar +/types/lodash.overevery/ @bczengel @chrootsu @stepancar +/types/lodash.oversome/ @bczengel @chrootsu @stepancar +/types/lodash.pad/ @bczengel @chrootsu @stepancar +/types/lodash.padend/ @bczengel @chrootsu @stepancar +/types/lodash.padstart/ @bczengel @chrootsu @stepancar +/types/lodash.parseint/ @bczengel @chrootsu @stepancar +/types/lodash.partial/ @bczengel @chrootsu @stepancar +/types/lodash.partialright/ @bczengel @chrootsu @stepancar +/types/lodash.partition/ @bczengel @chrootsu @stepancar +/types/lodash.pick/ @bczengel @chrootsu @stepancar +/types/lodash.pickby/ @bczengel @chrootsu @stepancar +/types/lodash.property/ @bczengel @chrootsu @stepancar +/types/lodash.propertyof/ @bczengel @chrootsu @stepancar +/types/lodash.pull/ @bczengel @chrootsu @stepancar +/types/lodash.pullall/ @bczengel @chrootsu @stepancar +/types/lodash.pullallby/ @bczengel @chrootsu @stepancar +/types/lodash.pullallwith/ @bczengel @chrootsu @stepancar +/types/lodash.pullat/ @bczengel @chrootsu @stepancar +/types/lodash.random/ @bczengel @chrootsu @stepancar +/types/lodash.range/ @bczengel @chrootsu @stepancar +/types/lodash.rangeright/ @bczengel @chrootsu @stepancar +/types/lodash.rearg/ @bczengel @chrootsu @stepancar +/types/lodash.reduce/ @bczengel @chrootsu @stepancar +/types/lodash.reduceright/ @bczengel @chrootsu @stepancar +/types/lodash.reject/ @bczengel @chrootsu @stepancar +/types/lodash.remove/ @bczengel @chrootsu @stepancar +/types/lodash.repeat/ @bczengel @chrootsu @stepancar +/types/lodash.replace/ @bczengel @chrootsu @stepancar +/types/lodash.rest/ @bczengel @chrootsu @stepancar +/types/lodash.result/ @bczengel @chrootsu @stepancar +/types/lodash.reverse/ @bczengel @chrootsu @stepancar +/types/lodash.round/ @bczengel @chrootsu @stepancar +/types/lodash.sample/ @bczengel @chrootsu @stepancar +/types/lodash.samplesize/ @bczengel @chrootsu @stepancar +/types/lodash.set/ @bczengel @chrootsu @stepancar +/types/lodash.setwith/ @bczengel @chrootsu @stepancar +/types/lodash.shuffle/ @bczengel @chrootsu @stepancar +/types/lodash.size/ @bczengel @chrootsu @stepancar +/types/lodash.slice/ @bczengel @chrootsu @stepancar +/types/lodash.snakecase/ @bczengel @chrootsu @stepancar +/types/lodash.some/ @bczengel @chrootsu @stepancar +/types/lodash.sortby/ @bczengel @chrootsu @stepancar +/types/lodash.sortedindex/ @bczengel @chrootsu @stepancar +/types/lodash.sortedindexby/ @bczengel @chrootsu @stepancar +/types/lodash.sortedindexof/ @bczengel @chrootsu @stepancar +/types/lodash.sortedlastindex/ @bczengel @chrootsu @stepancar +/types/lodash.sortedlastindexby/ @bczengel @chrootsu @stepancar +/types/lodash.sortedlastindexof/ @bczengel @chrootsu @stepancar +/types/lodash.sorteduniq/ @bczengel @chrootsu @stepancar +/types/lodash.sorteduniqby/ @bczengel @chrootsu @stepancar +/types/lodash.split/ @bczengel @chrootsu @stepancar +/types/lodash.spread/ @bczengel @chrootsu @stepancar +/types/lodash.startcase/ @bczengel @chrootsu @stepancar +/types/lodash.startswith/ @bczengel @chrootsu @stepancar +/types/lodash.subtract/ @bczengel @chrootsu @stepancar +/types/lodash.sum/ @bczengel @chrootsu @stepancar +/types/lodash.sumby/ @bczengel @chrootsu @stepancar +/types/lodash.tail/ @bczengel @chrootsu @stepancar +/types/lodash.take/ @bczengel @chrootsu @stepancar +/types/lodash.takeright/ @bczengel @chrootsu @stepancar +/types/lodash.takerightwhile/ @bczengel @chrootsu @stepancar +/types/lodash.takewhile/ @bczengel @chrootsu @stepancar +/types/lodash.template/ @bczengel @chrootsu @stepancar +/types/lodash.throttle/ @bczengel @chrootsu @stepancar +/types/lodash.times/ @bczengel @chrootsu @stepancar +/types/lodash.toarray/ @bczengel @chrootsu @stepancar +/types/lodash.tofinite/ @bczengel @chrootsu @stepancar +/types/lodash.tointeger/ @bczengel @chrootsu @stepancar +/types/lodash.tolength/ @bczengel @chrootsu @stepancar +/types/lodash.tolower/ @bczengel @chrootsu @stepancar +/types/lodash.tonumber/ @bczengel @chrootsu @stepancar +/types/lodash.topairs/ @bczengel @chrootsu @stepancar +/types/lodash.topairsin/ @bczengel @chrootsu @stepancar +/types/lodash.topath/ @bczengel @chrootsu @stepancar +/types/lodash.toplainobject/ @bczengel @chrootsu @stepancar +/types/lodash.tosafeinteger/ @bczengel @chrootsu @stepancar +/types/lodash.tostring/ @bczengel @chrootsu @stepancar +/types/lodash.toupper/ @bczengel @chrootsu @stepancar +/types/lodash.transform/ @bczengel @chrootsu @stepancar +/types/lodash.trim/ @bczengel @chrootsu @stepancar +/types/lodash.trimend/ @bczengel @chrootsu @stepancar +/types/lodash.trimstart/ @bczengel @chrootsu @stepancar +/types/lodash.truncate/ @bczengel @chrootsu @stepancar +/types/lodash.unary/ @bczengel @chrootsu @stepancar +/types/lodash.unescape/ @bczengel @chrootsu @stepancar +/types/lodash.union/ @bczengel @chrootsu @stepancar +/types/lodash.unionby/ @bczengel @chrootsu @stepancar +/types/lodash.unionwith/ @bczengel @chrootsu @stepancar +/types/lodash.uniq/ @bczengel @chrootsu @stepancar +/types/lodash.uniqby/ @bczengel @chrootsu @stepancar +/types/lodash.uniqueid/ @bczengel @chrootsu @stepancar +/types/lodash.uniqwith/ @bczengel @chrootsu @stepancar +/types/lodash.unset/ @bczengel @chrootsu @stepancar +/types/lodash.unzip/ @bczengel @chrootsu @stepancar +/types/lodash.unzipwith/ @bczengel @chrootsu @stepancar +/types/lodash.update/ @bczengel @chrootsu @stepancar +/types/lodash.updatewith/ @bczengel @chrootsu @stepancar +/types/lodash.uppercase/ @bczengel @chrootsu @stepancar +/types/lodash.upperfirst/ @bczengel @chrootsu @stepancar +/types/lodash.values/ @bczengel @chrootsu @stepancar +/types/lodash.valuesin/ @bczengel @chrootsu @stepancar +/types/lodash.without/ @bczengel @chrootsu @stepancar +/types/lodash.words/ @bczengel @chrootsu @stepancar +/types/lodash.wrap/ @bczengel @chrootsu @stepancar +/types/lodash.xor/ @bczengel @chrootsu @stepancar +/types/lodash.xorby/ @bczengel @chrootsu @stepancar +/types/lodash.xorwith/ @bczengel @chrootsu @stepancar +/types/lodash.zip/ @bczengel @chrootsu @stepancar +/types/lodash.zipobject/ @bczengel @chrootsu @stepancar +/types/lodash.zipobjectdeep/ @bczengel @chrootsu @stepancar +/types/lodash.zipwith/ @bczengel @chrootsu @stepancar +/types/log-symbols/ @BendingBender +/types/log-update/ @BendingBender +/types/logat/ @krvikash35 +/types/logg/ @blittle +/types/loggly/ @rmartone @geoffreak +/types/loglevel/ @Pro @szmeti @screendriver +/types/logrotate-stream/ @rogierschouten +/types/lokijs/ @TeamworkGuy2 +/types/lolex/ @Nemo157 @joshuakgoldberg @rogierschouten +/types/long/ @peterkooijmans +/types/loopback/ @kattsushi @enko @sequoia @drmikecrowe +/types/loopback-boot/ @kattsushi +/types/lorem-ipsum/ @durad +/types/lory.js/ @kubosho @milkisevil +/types/loud-rejection/ @BendingBender +/types/lovefield/ @freshp86 +/types/lowdb/ @typicode @niieani +/types/lowlight/ @NoHomey +/types/lozad/ @plantain-00 +/types/lru-cache/ @Bartvds @BendingBender +/types/lscache/ @Chris-Martinezz +/types/ltx/ @PJakcson +/types/luaparse/ @stpettersens +/types/lunr/v0/ @sebastian-lenz +/types/lunr/ @seantanly +/types/lusca/ @crutchcorn +/types/luxon/ @colbydehart @FourwingsY +/types/lwip/ @AyaMorisawa +/types/lz-string/ @M0ns1gn0r +/types/magic-number/ @stpettersens +/types/magicsuggest/ @leonardochaia +/types/magnet-uri/ @tlaziuk +/types/mailcheck/ @pocesar +/types/maildev/ @cyrilschumacher @zbarbuto +/types/mailgen/ @vothanhkiet @jordanfarrer +/types/mailparser/ @psnider +/types/main-bower-files/ @k-kagurazaka +/types/make-dir/ @ikatyang @BendingBender +/types/maker.js/ @danmarshall +/types/mandrill-api/ @pocesar +/types/map-obj/ @BendingBender +/types/mapbox/ @anahkiasen +/types/mapbox-gl/ @dobrud @patrickr +/types/mapbox__shelf-pack/ @Perlmint +/types/mapnik/ @ipv4sec +/types/mapsjs/ @davismj +/types/mariasql/ @bennett000 +/types/mark.js/ @renjfk +/types/markdown-it/ @rapropos +/types/markdown-it-anchor/ @seryl +/types/markdown-it-container/ @hronex +/types/markdownlint/ @ark120202 +/types/marked/ @worr @BendingBender +/types/marker-animate-unobtrusive/ @viskin +/types/markerclustererplus/ @enanox @mxl +/types/markitup/ @drillbits +/types/maskedinput/ @lokeshpeta +/types/masonry-layout/ @m-a-wilson @warriorrocker +/types/massive/v3/ @swissspidy @clarenceh +/types/massive/ @swissspidy @clarenceh @AmazingTurtle +/types/match-media-mock/ @asvetliakov +/types/material-design-lite/ @bradzacher +/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk +/types/material-ui-datatables/ @coding2012 +/types/materialize-css/v0/ @eriklieben @leonyu @SinghSukhdeep @jfcere @scote +/types/materialize-css/ @huww98 +/types/math3d/ @laszlojakab @jimsmart +/types/mathjax/ @rolandzwaga +/types/mathjs/ @siavol +/types/matter-js/ @piranha771 +/types/maxmind/ @geoffreak +/types/mcustomscrollbar/ @flurg +/types/md5/ @arcdev1 @jprogrammer +/types/mdns/ @reppners +/types/mdurl/ @rokt33r +/types/media-typer/ @BendingBender +/types/medium-editor/ @keika299 +/types/mem/ @SamVerschueren +/types/memcached/ @KentarouTakeda +/types/memoizee/ @juanpicado +/types/memory-cache/ @jedigo @thieman +/types/memory-fs/ @e-cloud +/types/memwatch-next/ @cyrilschumacher +/types/meow/ @KnisterPeter +/types/merge-descriptors/ @danny8002 +/types/merge-stream/ @k-kagurazaka @daniel-zazula +/types/merge2/ @tkrotoff @smac89 +/types/mersenne-twister/ @KentarouTakeda +/types/meshblu/ @fnipo +/types/mess/ @Nemo157 +/types/messenger/ @derekcicerone +/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel +/types/meteor-accounts-phone/ @DAB0mB +/types/meteor-collection-hooks/ @twastvedt +/types/meteor-jboulhous-dev/ @vangorra +/types/meteor-persistent-session/ @vangorra +/types/meteor-prime8consulting-oauth2/ @vangorra +/types/meteor-publish-composite/ @vangorra +/types/meteor-roles/ @vangorra +/types/method-override/ @santialbo +/types/methods/ @cprecioso +/types/metric-suffix/ @davidm77 +/types/mfiles/ @avonwyss +/types/micro/ @kaoDev +/types/micromatch/v2/ @glen-84 +/types/micromatch/ @glen-84 @vemoo +/types/microrouter/ @mathieudutour +/types/microsoft-ajax/ @pjmagee +/types/microsoft-live-connect/ @jvilk +/types/microsoft-sdk-soap/ @markusmauch +/types/microsoftteams/ @WrathOfZombies @jayongg @ydogandjiev +/types/microtime/ @vincekovacs +/types/milkcocoa/ @odangosan +/types/mime/ @jedigo @dhritzkiv +/types/mime-db/ @AJamesPhillips +/types/mime-types/ @Perlmint +/types/mimos/ @AJamesPhillips +/types/mina/ @lhk @mattanja @kant2002 +/types/minimatch/ @vvakame @shantmarouti +/types/minimist/ @Bartvds @Necroskillz @kamranayub +/types/minimist-options/ @ikatyang +/types/minipass/ @BendingBender +/types/mirrorx/ @aaronphy +/types/mithril/ @spacejack @andraaspar @isiahmeadows +/types/mithril-global/ @spacejack @isiahmeadows +/types/mitm/ @alejo90 +/types/mixpanel/ @hjellek @Manduro +/types/mixto/ @vvakame +/types/mkdirp/ @Bartvds @mrmlnc +/types/mkpath/ @optical +/types/mobx-apollo/ @pselden +/types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight +/types/mocha-phantomjs/ @ErikSchierboom +/types/mochaccino/ @thomas-p +/types/mock-aws-s3/ @bluehatbrit +/types/mock-fs/ @Nemo157 @tkqubo +/types/mock-knex/ @jessezhang91 +/types/mock-raf/ @djpereira +/types/mock-require/ @gDelgado14 +/types/mockdate/ @brunolm +/types/mockery/ @jt000 +/types/modernizr/ @borisyankov @theodorejb @leonyu @lucax88x @nhardy +/types/modesl/ @neeschit +/types/moji/ @yasupeke +/types/moment-business/ @wonbyte +/types/moment-business-time/ @swist +/types/moment-duration-format/ @SwintDC @TwoStone @leonard-thieu +/types/moment-holiday/ @rwdalpe +/types/moment-jalaali/ @alitaheri +/types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas +/types/moment-round/ @jacobbaskin +/types/moment-strftime2/ @dex4er +/types/moment-timezone/ @michelsalib @alanblins +/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi +/types/mongoose/ @simonxca @horiuchi @sindrenm @lukasz-zak +/types/mongoose-auto-increment/ @AyaMorisawa +/types/mongoose-deep-populate/ @AyaMorisawa +/types/mongoose-geojson-schema/ @bondz +/types/mongoose-mock/ @jt000 +/types/mongoose-paginate/ @linusbrolin @simonxca +/types/mongoose-promise/ @simonxca +/types/mongoose-seeder/ @Crevil +/types/mongoose-sequence/ @linusbrolin +/types/mongoose-simple-random/ @rsxdalv +/types/mongoose-unique-validator/ @stevehipwell +/types/moo/ @deltaidea @MofX +/types/moonjs/ @DanielRosenwasser +/types/morgan/ @staticfunction @pscanf +/types/morris.js/ @mareek @sindilevich +/types/mousetrap/ @qcz +/types/move-concurrently/ @mgroenhoff +/types/moviedb/ @basarat @0x6368656174 +/types/moxios/ @itoasuka +/types/mpromise/ @sgkim126 +/types/mri/ @shiftkey @j-f1 +/types/ms/ @danny8002 +/types/msgpack-lite/ @endel @efokschaner +/types/msgpack5/ @wokim @heycalmdown +/types/msnodesql/ @borisyankov @SomaticIT +/types/msportalfx-test/ @julioct +/types/mssql/ @jaminfarr @buzinas @mrrichar @elhaard @pkeuter +/types/mu2/ @jedigo +/types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob +/types/multer-gridfs-storage/v1/ @devconcept +/types/multer-gridfs-storage/ @devconcept +/types/multer-s3/ @tcaesvk @galtalmor +/types/multi-typeof/ @mhegazy +/types/multimatch/ @stephenlautier +/types/multiparty/ @kenfdev +/types/multiplexjs/ @KamyarNazeri +/types/multisort/ @CzBuCHi +/types/multistream/ @mrmlnc +/types/murmurhash-js/ @cvle +/types/murmurhash3js/ @dlee-nvisia +/types/musicmetadata/ @Xstoudi +/types/mustache/ @markashleybell +/types/mv/ @nenadalm +/types/mysql/ @wjohnsto @kacepe @kpping +/types/mz/ @ThomasHickman +/types/n3/ @phreed +/types/nano/ @timjacobi @vincekovacs +/types/nanoajax/ @nathancahill +/types/nanomsg/ @titan +/types/nanoscroller/ @zihark17 +/types/nanp/ @karn +/types/nats-hemera/ @vforv +/types/natsort/ @mgroenhoff +/types/natural/ @dmoonfire +/types/natural-sort/ @a-morales +/types/navigation/ @grahammendick +/types/navigation-react/ @grahammendick +/types/navigo/ @aersamkull +/types/nblas/ @erikgerrits +/types/nconf/ @jedigo @jmthibault +/types/ncp/ @bartvds +/types/ndarray/ @pawsong @taoqf +/types/nearley/ @deltaidea @BendingBender +/types/nedb/ @reppners @anthonynichols +/types/nedb-logger/ @thisboyiscrazy +/types/needle/v0/ @bigsan +/types/needle/v1/ @bigsan @nikeee +/types/needle/ @bigsan @nikeee @sindilevich +/types/negotiator/ @BendingBender +/types/neo4j/ @cyrilschumacher +/types/nes/ @NoHomey @saboya +/types/net-keepalive/ @hertzg +/types/netmask/ @mhfrantz +/types/nexpect/ @vvakame +/types/next/ @dru89 @brikou +/types/next-redux-wrapper/ @stevegeek +/types/ng-command/ @stephenlautier +/types/ng-cordova/ @ksachdeva +/types/ng-dialog/ @stephenlautier +/types/ng-facebook/ @Crevil +/types/ng-file-upload/ @johnnyreilly @thewarpaint +/types/ng-flow/ @ryan10132 +/types/ng-grid/ @smithkl42 @rolandzwaga @kentcooper +/types/ng-i18next/ @cyrilschumacher +/types/ng-notify/ @nzamosenchuk +/types/ng-stomp/ @lpotapczuk +/types/ngbootbox/ @stpettersens +/types/ngeohash/ @erkie +/types/ngkookies/ @martinmcwhorter +/types/ngmap/ @nkovacic +/types/ngprogress/ @martinmcwhorter +/types/ngprogress-lite/ @LukeForder +/types/ngreact/ @velveret +/types/ngstorage/ @kubiq +/types/ngtoaster/ @btesser +/types/ngwysiwyg/ @patrick-mackay +/types/nightmare/ @horiuchi @samyang-au +/types/nightwatch/ @rkavalap @schlesiger +/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball @keton +/types/nock/ @bonnici @horiuchi @afharo @mastermatt +/types/nodal/ @charrondev +/types/node/v4/ @eps1lon +/types/node/v6/ @WilcoBakker @inlined @eps1lon +/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon +/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno +/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff +/types/node-7z/ @erkie +/types/node-array-ext/ @Beng89 +/types/node-cache/ @chrootsu @dthunell @useltmann +/types/node-calendar/ @luzianz +/types/node-cleanup/ @agadar +/types/node-common-errors/ @icopp +/types/node-dir/ @panuhorsmalahti +/types/node-dogstatsd/ @chrisbobo +/types/node-emoji/ @jonestristand @styu +/types/node-fetch/ @torstenwerner +/types/node-fibers/ @caryhaynie +/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 +/types/node-gcm/ @horiuchi +/types/node-geocoder/ @rosek86 +/types/node-getopt/ @kcauchy +/types/node-hid/ @mhegazy @ert78gb +/types/node-horseman/ @apratheek +/types/node-hue-api/ @fjmorel +/types/node-int64/ @x3cion @kevin-greene-ck +/types/node-ipc/ @arvitaly +/types/node-jsfl-runner/ @mrand01 +/types/node-json-db/ @kuzn-ilya +/types/node-mysql-wrapper/ @kataras +/types/node-notifier/ @tkQubo +/types/node-pg-migrate/ @bradleyayers +/types/node-polyglot/ @timjk +/types/node-powershell/ @rodrigoff +/types/node-ral/ @ssddi456 +/types/node-red/ @andersea +/types/node-rsa/ @alitaheri +/types/node-schedule/ @cyrilschumacher @flowpl +/types/node-slack/ @tkQubo +/types/node-snap7/ @heilingbrunner +/types/node-sprite-generator/ @Perlmint +/types/node-static/ @Morfent +/types/node-statsd/ @alexturek @convoyinc +/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus +/types/node-uuid/ @jeffmay +/types/node-validator/ @kengorab +/types/node-vault/ @YuJianrong +/types/node-waves/ @stephenlautier +/types/node-wit/ @julienduf +/types/node-xmpp-client/ @PJakcson +/types/node-xmpp-core/ @PJakcson +/types/node-zookeeper-client/ @plantain-00 @jessezhang91 +/types/node_redis/ @borisyankov +/types/nodegit/ @dolanmiu +/types/nodemailer/v3/ @rogierschouten +/types/nodemailer/ @rogierschouten @dex4er +/types/nodemailer-direct-transport/ @rogierschouten +/types/nodemailer-mailgun-transport/ @otociulis +/types/nodemailer-pickup-transport/ @psnider +/types/nodemailer-ses-transport/ @westy92 +/types/nodemailer-smtp-pool/ @rogierschouten +/types/nodemailer-smtp-transport/ @rogierschouten +/types/nodemailer-stub-transport/ @cyrilschumacher +/types/nodeunit/ @jedigo +/types/noisejs/ @izmhr +/types/nomnom/ @panopticoncentral +/types/nopt/ @jbondc +/types/normalize-package-data/ @jdxcode +/types/normalize-url/ @odin3 @BendingBender +/types/notie/ @mateusdemboski +/types/notify/ @hellochar +/types/notifyjs/ @soundTricker +/types/notifyjs-browser/ @bahman616 +/types/notyf/ @gurov +/types/nouislider/v7/ @acoreyj +/types/nouislider/v8/ @bleuarg +/types/nouislider/ @bleuarg @lagaffe +/types/novnc-core/ @smithkl42 @BendingBender +/types/npm/ @SomaticIT +/types/npm-package-arg/ @mgroenhoff +/types/ns-api/ @Archcry +/types/nslog/ @unindented +/types/nsqjs/ @cezaryrk +/types/number-is-nan/ @mhegazy +/types/number-to-words/ @frederickfogerty +/types/numeral/ @vbortone +/types/numjs/ @taoqf +/types/nunjucks/ @RubenSlabbert +/types/nunjucks-date/ @kruncher +/types/nvd3/ @PjMitchell +/types/nw.gui/ @xperiments +/types/nw.js/ @alirdn +/types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte +/types/oauth.js/ @nobuoka +/types/oauth2-server/ @vangorra @cirick +/types/oauth2orize/ @wokim @heycalmdown @stevehipwell +/types/obelisk.js/ @bdrupieski +/types/object-assign/ @chbrown +/types/object-diff/ @rogierschouten +/types/object-hash/ @misak113 +/types/object-inspect/ @demurgos +/types/object-map/ @wolfgang42 +/types/object-path/ @pocesar +/types/object-refs/ @3fd +/types/oblo-util/ @Oblosys +/types/oboe/ @optical +/types/observe-js/ @herrmanno +/types/oclazyload/ @rolandzwaga +/types/odata/ @janhommes @jcchalte +/types/ofe/ @Morfent +/types/office-js/ @OfficeDev @LanceEA +/types/offline-js/ @cgwrench +/types/oibackoff/ @geoffreak +/types/oidc-token-manager/ @rosieks +/types/on-finished/ @czechboy0 @BendingBender +/types/on-headers/ @jjeffery @BendingBender +/types/once/ @denis-sokolov @BendingBender +/types/onesignal-cordova-plugin/ @broder +/types/onetime/ @BendingBender +/types/oniguruma/ @smhxx +/types/onoff/ @marcel-ernst +/types/open/ @Bartvds +/types/opener/ @tikurahul +/types/openfin/ @chrisbarker +/types/openjscad/ @danmarshall +/types/openlayers/v2/ @bolhovsky +/types/openlayers/v3/ @osechet @matthiasdailey-ccri +/types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana +/types/openstack-wrapper/ @sanjaymadane +/types/opentok/ @westy92 @CatGuardian +/types/opentype.js/ @danmarshall +/types/opn/ @shinnn @SomaticIT @tlent +/types/optics-agent/ @crevil +/types/optimist/ @soywiz @chbrown +/types/optimize-css-assets-webpack-plugin/ @odnamrataizem +/types/ora/v0/ @screendriver +/types/ora/ @basarat @screendriver @BendingBender +/types/oracledb/ @Bigous +/types/orchestrator/ @tkQubo @TeamworkGuy2 +/types/orderedmap/ @bradleyayers +/types/orientjs/ @saeedtabrizi +/types/os-homedir/ @mhegazy +/types/os-locale/v1/ @AyaMorisawa @BendingBender +/types/os-locale/ @AyaMorisawa @BendingBender +/types/os-name/ @BendingBender +/types/os-tmpdir/ @mhegazy +/types/osmosis/ @jurajkocan +/types/osmtogeojson/ @tkqubo +/types/osrm/ @DenisCarriere +/types/otplib/ @renjfk +/types/owasp-password-strength-test/ @stephtr +/types/owl.carousel/ @igorissen @KennethanCeyer +/types/owlcarousel/ @dpiatkowski +/types/p-all/ @BendingBender +/types/p-any/ @BendingBender +/types/p-cancelable/ @BendingBender +/types/p-debounce/ @BendingBender +/types/p-defer/ @SamVerschueren +/types/p-do-whilst/ @BendingBender +/types/p-each-series/ @BendingBender +/types/p-event/ @BendingBender +/types/p-every/ @BendingBender +/types/p-lazy/ @BendingBender +/types/p-limit/ @BendingBender +/types/p-locate/ @BendingBender +/types/p-log/ @BendingBender +/types/p-map/ @BendingBender +/types/p-map-series/ @BendingBender +/types/p-one/ @BendingBender +/types/p-props/ @BendingBender +/types/p-queue/ @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-timeout/ @BendingBender +/types/p-try/ @BendingBender +/types/p-wait-for/ @BendingBender +/types/p-whilst/ @BendingBender +/types/p2/ @clark-stevenson +/types/package-json/ @jinwoo +/types/packery/ @piraveen @hanssens +/types/pad/ @mhegazy +/types/paho-mqtt/ @amikhalev +/types/pako/ @cappellin @calebegg +/types/pangu/ @plantain-00 +/types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly +/types/paper/ @clark-stevenson @Xakaloz +/types/paralleljs/ @jbaldwin +/types/parent-package-json/ @sgmccli +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao +/types/parse-git-config/ @leonard-thieu +/types/parse-glob/ @glen-84 +/types/parse-json/ @mrmlnc +/types/parse-link-header/ @zelein +/types/parse-mockdb/ @dpoetzsch +/types/parse-ms/ @Roaders +/types/parse-torrent/ @niieani @tlaziuk +/types/parse-torrent-file/ @tlaziuk +/types/parse-unit/ @Jack-Works +/types/parseurl/ @bomret +/types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu +/types/passport/ @horiuchi @enaeseth @theigor @tlaziuk +/types/passport-anonymous/ @0x6368656174 +/types/passport-beam/ @AtlasDev +/types/passport-discord/ @kzay +/types/passport-facebook/ @staticfunction @lucasmacosta +/types/passport-facebook-token/ @rmartone @mrand01 +/types/passport-github/ @yasupeke +/types/passport-github2/ @yasupeke @mthmulders +/types/passport-google-oauth/ @staticfunction +/types/passport-google-oauth2/ @bluehatbrit +/types/passport-http/ @krizalys +/types/passport-http-bearer/ @isman-usoh +/types/passport-local/ @SomaticIT +/types/passport-local-mongoose/ @linusbrolin +/types/passport-oauth2/ @pasieronen +/types/passport-oauth2-client-password/ @akaNightmare +/types/passport-saml/ @cjbarth +/types/passport-steam/ @kzay +/types/passport-strategy/ @liorm +/types/passport-twitter/ @staticfunction +/types/passport-unique-token/ @briman0094 @SomaticIT +/types/password-hash/ @mugeso +/types/password-hash-and-salt/ @alitaheri +/types/path-exists/v1/ @shiwano +/types/path-exists/ @shiwano @BendingBender +/types/path-is-absolute/ @mhegazy +/types/pathfinding/ @BNedry +/types/pathjs/ @lokeshpeta +/types/pathwatcher/ @GlenCFL +/types/pause/ @BendingBender +/types/payment/ @apare +/types/paypal-cordova-plugin/ @Justin-Credible +/types/paypal-rest-sdk/ @trainerbill +/types/pbf/ @cschwarz +/types/pdfjs-dist/ @jbaldwin +/types/pdfkit/ @erichillah +/types/pdfobject/ @nielsboogaard +/types/pebblekitjs/ @makotokw +/types/peer-dial/ @RealTYPICAL +/types/peerjs/ @nakakura +/types/pegjs/ @vvakame @SrTobi @siegebell +/types/pem/ @tony19 @DethAriel +/types/persona/ @Nycto +/types/pet-finder-api/ @me +/types/pg/v6/ @pspeter3 +/types/pg/ @pspeter3 +/types/pg-ears/ @bradleyayers +/types/pg-escape/ @khell +/types/pg-pool/ @aleung +/types/pg-query-stream/ @asmarques +/types/pg-types/ @waratuman +/types/pgwmodal/ @pine613 +/types/phantom/ @horiuchi @llRandom +/types/phantomcss/ @abauzac +/types/phantomjs/ @jedhunsaker @keesey +/types/phoenix/ @mciastek +/types/phone/ @DxCx +/types/phone-formatter/ @westy92 +/types/phonegap/ @borisyankov @DickvdBrink +/types/phonegap-facebook-plugin/ @Justin-Credible +/types/phonegap-nfc/ @michaeldesigaud +/types/phonon/ @kserin +/types/photonui/ @florentpoujol +/types/photoswipe/ @hellochar +/types/physijs/ @gyohk +/types/pi-spi/ @marcel-ernst +/types/pick-weight/ @rsxdalv +/types/pickadate/ @theodorejb @leonard-thieu +/types/picturefill/ @alaz +/types/pidusage/ @cyrilschumacher +/types/pify/ @samverschueren @mad-mike +/types/pigpio/ @manerfan +/types/pikaday/ @MidnightDesign @wake42 +/types/pikaday-time/ @Sayan751 +/types/pinkyswear/ @chances +/types/pino/v3/ @psnider +/types/pino/ @psnider @BendingBender +/types/pino-multi-stream/ @JakeGinnivan +/types/pinterest-sdk/ @adamburmister +/types/pinyin/ @wanganjun +/types/piwik-tracker/ @lbguilherme +/types/pixelmatch/ @iamolegga +/types/pkg-dir/ @NK-WEB-Git +/types/pkijs/ @microshine +/types/platform/ @JakeH +/types/playcanvas/ @Neoflash1979 +/types/playerframework/ @ricardosabino +/types/pleasejs/ @nakakura +/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf +/types/plugapi/ @BNedry +/types/plugin-error/ @rogierschouten +/types/plupload/ @patrickbussmann +/types/pluralize/ @ukyo +/types/png-async/ @kanreisa +/types/pngjs/ @jason0x43 +/types/podcast/ @nikeee +/types/podium/ @AJamesPhillips +/types/point-in-polygon/ @dyst5422 @kogai +/types/polylabel/ @DenisCarriere +/types/polyline/ @Kern0 +/types/polymer/ @lgrignon @laco0416 +/types/polymer-ts/ @lgrignon +/types/popcorn/ @grapswiz +/types/portscanner/ @douglasduteil +/types/postal/ @lokeshpeta @myitcv +/types/postmark/ @benbayard +/types/pouch-redux-middleware/ @charrondev +/types/pouchdb/ @AGBrown @geppy @fredgalvao +/types/pouchdb-adapter-fruitdown/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-http/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-idb/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-leveldb/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-localstorage/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-memory/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-node-websql/ @spaulg @geppy @fredgalvao +/types/pouchdb-adapter-websql/ @spaulg @geppy @fredgalvao +/types/pouchdb-browser/ @spaulg @geppy @fredgalvao +/types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales +/types/pouchdb-find/ @trubit +/types/pouchdb-http/ @spaulg @geppy @fredgalvao +/types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao +/types/pouchdb-node/ @spaulg @geppy @fredgalvao +/types/pouchdb-replication/ @trubit +/types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 +/types/power-assert/ @vvakame +/types/power-assert-formatter/ @vvakame +/types/precise/ @codeanimal +/types/precond/ @olsio +/types/preloadjs/ @endel +/types/prelude-ls/ @AyaMorisawa +/types/prettier/ @ikatyang +/types/pretty-bytes/ @plantain-00 +/types/pretty-format/ @ikatyang +/types/pretty-ms/ @BendingBender +/types/printf/ @AluisioASG +/types/priorityqueuejs/ @geoffreak +/types/prismjs/ @eriklieben @andrewiggins @mmiszy +/types/private-ip/ @coderslagoon +/types/procfs-stats/ @cyrilschumacher +/types/progress/ @sebastian-lenz +/types/progressbar/ @atd-schubert +/types/progressjs/ @zaneli +/types/proj4/ @DenisCarriere +/types/proj4leaflet/ @BendingBender +/types/project-oxford/ @scsouthw +/types/promise-dag/ @OSjoerdWie +/types/promise-pg/ @coldacid +/types/promise-polyfill/ @skysteve +/types/promise-pool/ @vilic +/types/promise-retry/ @shirakaba +/types/promise.prototype.finally/ @slavik57 @BendingBender +/types/promised-temp/ @rokadias +/types/promisify-node/ @borekb +/types/promisify-supertest/ @aleung +/types/prompt-sync/ @MugeSo +/types/prompt-sync-history/ @MugeSo +/types/promptly/ @danrspencer +/types/prop-types/ @DovydasNavickas +/types/properties-reader/ @Goldsmith42 +/types/prosemirror-collab/ @bradleyayers @davidka @timjb +/types/prosemirror-commands/ @bradleyayers @davidka @timjb +/types/prosemirror-gapcursor/ @bradleyayers @davidka @timjb +/types/prosemirror-history/ @bradleyayers @davidka @timjb +/types/prosemirror-inputrules/ @bradleyayers @davidka @timjb +/types/prosemirror-keymap/ @bradleyayers @davidka @timjb +/types/prosemirror-markdown/ @bradleyayers @davidka @timjb +/types/prosemirror-menu/ @bradleyayers @davidka @timjb +/types/prosemirror-model/ @bradleyayers @davidka @timjb +/types/prosemirror-schema-basic/ @bradleyayers @davidka @timjb +/types/prosemirror-schema-list/ @bradleyayers @davidka @timjb +/types/prosemirror-state/ @bradleyayers @davidka @timjb +/types/prosemirror-tables/ @superchu @eshvedai +/types/prosemirror-transform/ @bradleyayers @davidka @timjb +/types/prosemirror-view/ @bradleyayers @davidka @timjb +/types/protractor-browser-logs/ @rokadias +/types/protractor-helpers/ @johncant +/types/protractor-http-mock/ @Crevil +/types/provinces/ @gatimus +/types/proxy-addr/ @BendingBender +/types/proxyquire/ @jt000 +/types/pty.js/ @enlight +/types/public-ip/ @BendingBender +/types/pubnub/ @bitbankinc @rollymaduk +/types/pubsub-js/ @borisyankov +/types/pug/ @TonyPythoneer @19majkel94 +/types/pulltorefreshjs/ @DanielRosenwasser +/types/pump/ @tlaziuk +/types/pupa/ @nju33 +/types/puppeteer/ @marvinhagemeister @cdeutsch +/types/pure-render-decorator/ @seansfkelley +/types/purl/ @danfma +/types/pusher-js/ @tkqubo +/types/pvutils/ @microshine +/types/python-shell/ @dolanmiu +/types/q/v0/ @bnemetchek @johnnyreilly +/types/q/ @bnemetchek @AndrewGaspar @johnnyreilly @mboudreau +/types/q-io/ @Bartvds +/types/q-retry/ @vilic +/types/qhistory/ @Kovensky +/types/qlik/ @RubenSlabbert @AginicX +/types/qlik-engineapi/ @konne +/types/qlik-visualizationextensions/ @konne +/types/qr-image/ @taoqf +/types/qrcode.react/ @mleko +/types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti +/types/qtip2/ @Seltzer @leonard-thieu +/types/query-string/ @SamVerschueren @tkrotoff @huhuanming +/types/quick-lru/ @BendingBender +/types/quill/ @sumitkm @guillaume-ro-fr @43081j +/types/quixote/ @greybax +/types/qunit/v1/ @diullei +/types/qunit/ @waratuman +/types/quoted-printable/ @pushplay +/types/qwest/ @lindsayevans +/types/r-script/ @NaridaL +/types/rabbit.js/ @wokim +/types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe +/types/radius/ @codeanimal +/types/ramda/ @donnut @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky +/types/random-js/ @pistacchio +/types/random-seed/ @endel +/types/random-string/ @stpettersens +/types/randomcolor/ @feitzi @BradyLiles +/types/range-parser/ @tlaziuk +/types/rangyinputs/ @ersimont +/types/raphael/ @CheCoxshall +/types/rappid/ @DenEwout +/types/raspi/ @nebrius +/types/raspi-board/ @nebrius +/types/raspi-peripheral/ @nebrius +/types/ratelimiter/ @AyaMorisawa +/types/raty/ @terrawheat +/types/raven/ @scttcper @1999 +/types/raven-for-redux/ @chiubaka +/types/raygun4js/ @xt0rted @BenjaminHarding +/types/rbac-a/ @tlaziuk +/types/rc/ @DanielRosenwasser +/types/rc-select/ @DenisTirilis +/types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro +/types/rc-tree/ @johnnyreilly +/types/rcloader/ @panuhorsmalahti +/types/rdf-data-model/ @rubensworks +/types/rdf-js/ @rubensworks +/types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @richseviora @theruther4d +/types/react-alert/ @ssyrell +/types/react-alice-carousel/ @endigo +/types/react-app/ @prakarshpandey +/types/react-aria-menubutton/ @forabi @crohlfs +/types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin +/types/react-beautiful-dnd/ @varHarrie @bradleyayers +/types/react-body-classname/ @mhegazy +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall +/types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar +/types/react-bootstrap-daterangepicker/ @ianks +/types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 +/types/react-bootstrap-table/ @flaub @alelode @UJosue10 @dawnmist @Ogglas +/types/react-bootstrap-typeahead/ @Guymestef +/types/react-breadcrumbs/ @KostyaEsmukov +/types/react-breadcrumbs-dynamic/ @mitsuruog +/types/react-broadcast/ @kandros +/types/react-burger-menu/ @radziksh +/types/react-calendar-heatmap/ @9renpoto +/types/react-calendar-timeline/ @radziksh +/types/react-cartographer/ @trevonmckay +/types/react-codemirror/ @velveret @rudi-c +/types/react-collapse/ @Kimahriman +/types/react-color/ @LKay @markspolakovs @mntdn +/types/react-confirm/ @santiagodoldan +/types/react-content-loader/ @alaatm +/types/react-copy-to-clipboard/ @mabels +/types/react-cropper/ @stepancar +/types/react-css-modules/ @KostyaEsmukov @skirsdeda +/types/react-css-transition-replace/ @LKay +/types/react-custom-scrollbars/v3/ @David-LeBlanc-git +/types/react-custom-scrollbars/ @David-LeBlanc-git @kittimiyo +/types/react-data-grid/v1/ @SupernaviX +/types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 +/types/react-datagrid/ @stephenjelfs +/types/react-date-range/ @Junbong +/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue +/types/react-daterange-picker/ @uncovertruth @MartynasZilinskas +/types/react-dates/ @Artur-A +/types/react-daum-postcode/ @Sa-ryong +/types/react-dnd-html5-backend/ @oizie +/types/react-dnd-multi-backend/ @dawnmist +/types/react-dnd-test-backend/ @gustavohenke +/types/react-dnd-touch-backend/ @mleko @dawnmist +/types/react-document-title/ @cleverguy25 +/types/react-dom/v15/ @MartynasZilinskas +/types/react-dom/ @MartynasZilinskas @theruther4d +/types/react-dom-factories/ @jgoz +/types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard +/types/react-dropzone/v3/ @matdube @LynxEyes @goblindegook @benbayard @LKay +/types/react-dropzone/ @matdube @LynxEyes @goblindegook @benbayard @LKay @codeaid @jurosh +/types/react-easy-chart/ @danzel +/types/react-event-listener/ @asvetliakov +/types/react-fa/ @flaub @patsissons @LKay +/types/react-facebook-login/ @apare @jankarres +/types/react-faux-dom/ @alitaheri @cleverguy25 +/types/react-file-input/ @dmitryrogozhny +/types/react-file-reader-input/ @dmitryrogozhny @alitaheri +/types/react-flatpickr/ @begincalendar +/types/react-flex/ @pushplay +/types/react-flexr/ @pushplay +/types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory +/types/react-form/v1/ @cameron-mcateer +/types/react-form/ @cameron-mcateer +/types/react-foundation/ @danielearwicker +/types/react-geosuggest/ @brmenchl +/types/react-google-recaptcha/ @KoalaHuman +/types/react-gravatar/ @invliD +/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway +/types/react-hamburger-menu/ @grzesie2k +/types/react-helmet/v4/ @evanbb @isman-usoh +/types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit +/types/react-highlight-words/ @mhegazy +/types/react-highlighter/ @oizie +/types/react-holder/ @isman-usoh +/types/react-hot-loader/ @jacekjagiello +/types/react-hyperscript/ @tock203 +/types/react-i18next/v1/ @KostyaEsmukov +/types/react-i18next/v4/ @GiedriusGrabauskas +/types/react-i18next/ @GiedriusGrabauskas @chnoch +/types/react-icon-base/ @apare @LKay +/types/react-icons/ @apare @johnnyreilly @LKay +/types/react-image-gallery/ @adamwpc +/types/react-imageloader/ @stephenjelfs +/types/react-infinite/ @rhysd +/types/react-infinite-scroller/ @Lapanti @psrebniak +/types/react-input-calendar/ @stepancar +/types/react-input-mask/ @apare +/types/react-intl/v1/ @bgrieder +/types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari +/types/react-intl-redux/ @LKay +/types/react-is-deprecated/ @seansfkelley +/types/react-joyride/ @DanielRosenwasser @bendxn +/types/react-json/ @spielc +/types/react-json-pretty/ @LKay +/types/react-json-tree/ @gnestor +/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 @KurtPreston +/types/react-lazyload/ @m0a +/types/react-leaflet/ @danzel @davschne @yuit +/types/react-list/ @buptyyf @tomshen +/types/react-loadable/ @Kovensky @odensc +/types/react-loader/ @artfuldev +/types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti +/types/react-mce/ @morphologue +/types/react-mdl/ @bradzacher +/types/react-measure/ @asvetliakov @marcfallows +/types/react-mixin/ @tkqubo +/types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz +/types/react-monaco-editor/ @jnetterf +/types/react-motion/ @stepancar @asvetliakov +/types/react-motion-slider/ @asvetliakov +/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi +/types/react-native-collapsible/ @iRoachie +/types/react-native-communications/ @huhuanming @PaitoAnderson +/types/react-native-datepicker/ @jacobbaskin +/types/react-native-doc-viewer/ @iRoachie +/types/react-native-document-picker/ @plantain-00 +/types/react-native-drawer/ @jnbt +/types/react-native-drawer-layout/ @jmfirth +/types/react-native-fabric/ @josephroque +/types/react-native-fbsdk/ @ifiokjr +/types/react-native-fetch-blob/ @MNBuyskih +/types/react-native-fs/ @pocesar @josephroque +/types/react-native-google-signin/ @j-fro +/types/react-native-keep-awake/ @huhuanming +/types/react-native-linear-gradient/ @j-fro +/types/react-native-material-design-searchbar/ @iRoachie +/types/react-native-material-kit/ @iRoachie @timwangdev +/types/react-native-material-ui/ @iRoachie +/types/react-native-mixpanel/ @r3nya +/types/react-native-modalbox/ @iRoachie +/types/react-native-orientation/ @MoLow +/types/react-native-popup-dialog/ @PaitoAnderson @connectdotz +/types/react-native-push-notification/ @PaitoAnderson +/types/react-native-qrcode/ @plantain-00 +/types/react-native-safari-view/ @mrand01 +/types/react-native-scrollable-tab-view/ @CaiHuan +/types/react-native-sensor-manager/ @SahinVardar +/types/react-native-snap-carousel/ @jnbt +/types/react-native-sortable-grid/ @j-fro +/types/react-native-sortable-list/ @sivolobov +/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 +/types/react-native-touch-id/ @huhuanming +/types/react-native-vector-icons/ @iRoachie @timwangdev +/types/react-native-video/ @huhuanming @abrahambotros +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @abrahambotros @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko +/types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar +/types/react-notification-system-redux/ @LKay +/types/react-numeric-input/ @heatherbooker +/types/react-onclickoutside/v5/ @LKay +/types/react-onclickoutside/ @LKay +/types/react-overlays/ @aaronbeall @vitosamson +/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold +/types/react-pointable/ @istefo @mdibyo +/types/react-portal/ @shuntksh +/types/react-props-decorators/ @tkqubo +/types/react-recaptcha/ @mhegazy @zzanol +/types/react-redux/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva +/types/react-redux-i18n/ @clementdevos +/types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba +/types/react-relay/ @graphcool @voxmatt @alloy +/types/react-resolver/ @forabi +/types/react-responsive/v1/ @asvetliakov +/types/react-responsive/ @asvetliakov @alechill @xaviergonz +/types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov +/types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen +/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga +/types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall +/types/react-router-config/ @lith-light-g +/types/react-router-dom/ @tkrotoff @huy-nguyen +/types/react-router-native/ @ezintz +/types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi +/types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas +/types/react-router-redux/ @huy-nguyen @8398a7 +/types/react-s-alert/ @mitsuruog +/types/react-scroll/ @sudoplz @GiedriusGrabauskas +/types/react-scrollbar/ @stephenjelfs +/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 +/types/react-side-effect/ @remojansen +/types/react-sidebar/ @jeroenvervaeke +/types/react-sketchapp/ @ricokahler +/types/react-slick/ @andrewBalekha @GiedriusGrabauskas @r3nya +/types/react-smooth-scrollbar/ @asvetliakov +/types/react-sortable-hoc/ @NoHomey @charlesrey +/types/react-sortable-pane/ @rhysd +/types/react-sortable-tree/ @wouterhardeman @jzoric +/types/react-spinkit/v1/ @tkqubo @mleko @pelotom +/types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol +/types/react-sticky/ @curtisw0 +/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha +/types/react-svg-pan-zoom/ @huy-nguyen +/types/react-swf/ @stepancar +/types/react-swipe/ @DeividasBakanas +/types/react-swipeable/ @GiedriusGrabauskas @mctep @horiuchi +/types/react-swipeable-views/ @mxl @DeividasBakanas +/types/react-syntax-highlighter/ @NoHomey +/types/react-table/ @royxue @psakalo @Havret +/types/react-tabs/ @danez +/types/react-tag-input/ @Ogglas @jankarres +/types/react-tagcloud/ @wassname +/types/react-tagsinput/ @mykter +/types/react-tap-event-plugin/ @mxl +/types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly +/types/react-test-renderer/ @arvitaly @lochbrunner @johnnyreilly @jgoz +/types/react-tether/ @ryprice +/types/react-textarea-autosize/ @asvetliakov @zry656565 +/types/react-toastr/ @shssoichiro +/types/react-toggle/v2/ @LKay +/types/react-toggle/ @LKay +/types/react-tooltip/ @DeividasBakanas +/types/react-touch/ @grzesie2k +/types/react-tracking/ @alloy +/types/react-transition-group/v1/ @LKay +/types/react-transition-group/ @LKay +/types/react-treeview/ @janslow +/types/react-truncate/ @mattvperry +/types/react-user-tour/ @ccancellieri +/types/react-virtual-keyboard/ @bsurai +/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen +/types/react-virtualized-select/ @seansfkelley +/types/react-weui/ @tairan +/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 +/types/react-widgets-moment/ @dawnmist +/types/react-youtube/ @kgtkr +/types/reactable/ @spielc +/types/reactcss/ @chrisgervang @LKay +/types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva +/types/reactstrap/ @alihammad @mfal @danilobjr @fabiopaiva @FaithForHumans @KurtPreston +/types/read/ @timjk +/types/read-chunk/ @crispybee +/types/read-package-tree/ @mgroenhoff +/types/read-pkg/ @jdxcode +/types/read-pkg-up/ @dudeofawesome @jdxcode +/types/readdir-stream/ @Bartvds +/types/readline-sync/ @jonestristand +/types/reapop/ @Barrokgl +/types/recase/ @18steps +/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong +/types/recompose/ @iskandersierra @mrapogee @clayne11 +/types/reconnectingwebsocket/ @nguarracino +/types/recursive-readdir/v1/ @elisee +/types/recursive-readdir/ @elisee @MicahZoltu +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j +/types/redis-errors/ @43081j +/types/redis-mock/ @BendingBender +/types/redis-rate-limiter/ @westy92 +/types/redis-scripto/ @westy92 +/types/redlock/v2/ @chrootsu +/types/redlock/ @chrootsu @BendingBender +/types/redom/ @RauliL +/types/reduce-reducers/ @huy-nguyen +/types/redux-action/ @newraina +/types/redux-action-utils/ @tkqubo +/types/redux-actions/ @jaysoo @alexgorbatchev @alechill +/types/redux-auth-wrapper/v1/ @LKay +/types/redux-auth-wrapper/ @LKay +/types/redux-batched-subscribe/ @mDibyo +/types/redux-debounced/ @seansfkelley +/types/redux-devtools/ @mc-petry +/types/redux-devtools-dock-monitor/ @mc-petry +/types/redux-devtools-log-monitor/ @mc-petry +/types/redux-doghouse/ @BendingBender +/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen +/types/redux-first-router-link/ @janb87 +/types/redux-form/v4/ @aikoven +/types/redux-form/v6/ @carsonf @aikoven @LKay @bancek +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 +/types/redux-immutable/ @oizie @sebald @gavingregory +/types/redux-immutable-state-invariant/ @remojansen @highflying +/types/redux-infinite-scroll/ @silkyfray +/types/redux-injectable-store/ @unindented +/types/redux-localstorage/ @LKay +/types/redux-localstorage-debounce/ @LKay +/types/redux-localstorage-filter/ @LKay +/types/redux-logger/ @arusakov @kgroat +/types/redux-mock-store/ @MarianPalkus +/types/redux-optimistic-ui/ @asvetliakov +/types/redux-pack/ @tansongyang +/types/redux-persist-transform-encrypt/ @LKay +/types/redux-persist-transform-filter/ @LKay +/types/redux-promise/ @molekilla @xStrom +/types/redux-promise-middleware/ @ianks +/types/redux-recycle/ @LKay +/types/redux-router/ @stepancar +/types/redux-storage/ @asvetliakov +/types/redux-storage-engine-jsurl/ @screendriver +/types/redux-storage-engine-localstorage/ @screendriver +/types/redux-ui/ @andyshuxin +/types/ref/ @loyd +/types/ref-array/ @loyd +/types/ref-struct/ @loyd +/types/ref-union/ @loyd +/types/reflux/ @mauricedb +/types/relateurl/ @tkrotoff +/types/relaxed-json/ @18steps +/types/relay-runtime/ @voxmatt @alloy +/types/remote-redux-devtools/ @ColinEberhardt @unindented +/types/remove-markdown/ @RagibHasin +/types/replace-ext/ @DeividasBakanas +/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt +/types/request-ip/ @mrhen +/types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa +/types/request-promise-native/ @gustavohenke +/types/requestretry/ @EricByers @trainerbill +/types/require-dir/ @weekens +/types/require-directory/ @Igmat +/types/require-from-string/ @ikatyang +/types/requirejs/ @jbaldwin +/types/requirejs-domready/ @lefb766 +/types/resemblejs/ @pimterry +/types/resolve/ @marionebl @ajafff +/types/resolve-from/ @unional +/types/resourcejs/ @shaunluttin +/types/response-time/ @urossmolnik @TonyPythoneer +/types/rest/ @Nemo157 +/types/restangular/ @borisyankov +/types/restful.js/ @tkqubo +/types/restify/v4/ @blittle @stevehipwell +/types/restify/ @blittle @stevehipwell +/types/restify-cookies/ @weekens +/types/restify-cors-middleware/ @dthunell +/types/restify-errors/ @stevehipwell +/types/restify-plugins/ @KostyaTretyak +/types/restler/ @cyrilschumacher +/types/restling/ @loghorn +/types/resumablejs/ @DanielMcAssey +/types/rethinkdb/ @alexgorbatchev +/types/retry/ @krenor +/types/rev-hash/ @ikatyang +/types/revalidate/ @alex3165 +/types/revalidator/ @brewsoftware +/types/reveal/ @robertop87 @Nava2 +/types/rewire/ @borislavjivkov @CaselIT +/types/rfc2047/ @mugifly +/types/rheostat/ @SashaBayan @kourge +/types/rickshaw/ @niemyjski +/types/rimraf/ @soywiz @e-cloud @bash +/types/riot/ @Stubb0rn +/types/riot-api-nodejs/ @zafixlrp +/types/riot-games-api/ @xstoudi +/types/riotcontrol/ @chrootsu +/types/riotjs/ @vvakame +/types/rison/ @impworks +/types/rivets/ @TrevorDev @matjanos +/types/rollup/ @flying-sheep @csvn +/types/rollup-plugin-json/ @asmockler +/types/ronomon__crypto-async/ @BendingBender +/types/rosie/ @abner @subvertallchris +/types/roslib/ @Pro @skycoop +/types/rot-js/ @atiaxi +/types/route-parser/ @ianks @bobbuehler +/types/routie/ @Adilson +/types/royalslider/ @csrakowski +/types/rpio/ @DominikPalo +/types/rrc/ @DeividasBakanas +/types/rrule/ @waratuman +/types/rsmq/ @MugeSo +/types/rsmq-worker/ @MugeSo +/types/rss/ @secondwtq +/types/rsvp/ @chriskrycho +/types/rsync/ @philippstucki +/types/rtree/ @oefirouz +/types/run-sequence/ @k-kagurazaka +/types/rx/ @Igorbek +/types/rx-angular/ @mickdelaney +/types/rx-core/ @Igorbek @mizunashi-mana +/types/rx-core-binding/ @Igorbek +/types/rx-dom/ @oliverw +/types/rx-jquery/ @Igorbek +/types/rx-lite/ @Igorbek +/types/rx-lite-aggregates/ @Igorbek +/types/rx-lite-async/ @zoetrope @Igorbek +/types/rx-lite-backpressure/ @Igorbek +/types/rx-lite-coincidence/ @Igorbek +/types/rx-lite-experimental/ @Igorbek +/types/rx-lite-joinpatterns/ @Igorbek +/types/rx-lite-testing/ @Igorbek +/types/rx-lite-time/ @Igorbek +/types/rx-lite-virtualtime/ @Igorbek +/types/rx.wamp/ @darkl +/types/s3-upload-stream/ @geoffreak +/types/safari-extension/ @luukd +/types/safari-extension-content/ @luukd +/types/safe-compare/ @bevalorous +/types/safe-json-stringify/ @ericbyers +/types/safe-regex/ @mhegazy +/types/sails.io.js/ @arvitaly +/types/saml2-js/ @horiuchi +/types/saml20/ @HackerUndKoch +/types/samlp/ @horiuchi +/types/sammy/ @borisyankov @oising +/types/sanctuary/ @davidchambers @cortopy +/types/sandboxed-module/ @svi3c +/types/sane/ @BendingBender +/types/sanitize-filename/ @Nemo157 +/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath +/types/sap__xsenv/ @mad-mike +/types/sass-graph/ @marvinhagemeister +/types/sat/ @omni360 +/types/satnav/ @DotNetNerd +/types/saywhen/ @SeanSobey +/types/scalike/ @ryoppy +/types/screenfull/ @icholy @lionelb @joelshepherd +/types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @apemanzilla +/types/screeps-profiler/ @ramblurr +/types/scriptjs/ @ssttevee +/types/scroll-into-view/ @zivni +/types/scroller/ @haskellcamargo +/types/scrollreveal/ @Davidblkx +/types/scrolltofixed/ @bmdixon +/types/scrypt-async/ @xStrom +/types/scryptsy/ @micksatana +/types/seamless/ @danmana +/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg +/types/seedrandom/ @kernhanda +/types/segment-analytics/ @fongandrew +/types/select2/ @borisyankov +/types/selectables/ @renjfk +/types/selectize/ @adidahiya @naBausch +/types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina +/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn +/types/semantic-ui/ @leonard-thieu +/types/semantic-ui-accordion/ @leonard-thieu +/types/semantic-ui-api/ @leonard-thieu +/types/semantic-ui-checkbox/ @leonard-thieu +/types/semantic-ui-dimmer/ @leonard-thieu +/types/semantic-ui-dropdown/ @leonard-thieu +/types/semantic-ui-embed/ @leonard-thieu +/types/semantic-ui-form/ @leonard-thieu +/types/semantic-ui-modal/ @leonard-thieu +/types/semantic-ui-nag/ @leonard-thieu +/types/semantic-ui-popup/ @leonard-thieu +/types/semantic-ui-progress/ @leonard-thieu +/types/semantic-ui-rating/ @leonard-thieu +/types/semantic-ui-search/ @leonard-thieu +/types/semantic-ui-shape/ @leonard-thieu +/types/semantic-ui-sidebar/ @leonard-thieu +/types/semantic-ui-site/ @leonard-thieu +/types/semantic-ui-sticky/ @leonard-thieu +/types/semantic-ui-tab/ @leonard-thieu +/types/semantic-ui-transition/ @leonard-thieu +/types/semantic-ui-visibility/ @leonard-thieu +/types/semaphore/ @mhfrantz @Alorel +/types/semver/ @Bartvds @BendingBender @LucianBuzzo +/types/semver-compare/ @vincekovacs +/types/semver-diff/ @chrismbarr +/types/sencha_touch/ @brian428 +/types/send/ @MikeJerred +/types/seneca/ @psnider +/types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 +/types/sequelize-fixtures/ @cschwarz +/types/sequencify/ @npenin +/types/sequester/ @Strate +/types/serialize-javascript/ @lith-light-g +/types/serialport/v4/ @codefoster +/types/serialport/ @codefoster @apearson +/types/serve-favicon/ @urossmolnik +/types/serve-index/ @tkrotoff +/types/serve-static/ @urossmolnik @LinusU +/types/server-destroy/ @gyszalai +/types/session-file-store/ @blendsdk @rokt33r +/types/set-cookie-parser/ @nickp10 +/types/sha1/ @arcdev1 +/types/shallowequal/ @seansfkelley +/types/shapefile/ @DenisCarriere +/types/sharedworker/ @nakakura +/types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg +/types/sharp/ @lith-light-g +/types/sheetify/ @toddself +/types/shell-escape/ @nenadalm +/types/shell-quote/ @jason0x43 +/types/shelljs/ @nikeee @voy +/types/shimmer/ @kjin +/types/shipit/ @cyrilschumacher +/types/shipit-utils/ @cyrilschumacher +/types/shopify-buy/ @openminder +/types/shortid/ @stpettersens @despairblue +/types/shot/ @AJamesPhillips +/types/showdown/ @cbowdon @tan9 +/types/shrink-ray/ @forabi +/types/siema/ @Irmiz @0x6368656174 @samnau +/types/siesta/ @bquarmby +/types/sigmajs/ @qinfchen +/types/sigmund/ @BendingBender +/types/signalr/ @borisyankov @keesey @GiedriusGrabauskas +/types/signalr-no-jquery/ @gjoshevski +/types/signals/ @diullei +/types/signature_pad/ @AbubakerB @jrmihalick +/types/simple-assign/ @NoHomey +/types/simple-cw-node/ @vvakame +/types/simple-mock/ @leonyu +/types/simple-oauth2/ @mad-mike +/types/simple-peer/ @tlaziuk +/types/simple-url-cache/ @a-lucas +/types/simple-xml/ @notVitaliy +/types/simplebar/v1/ @gregonnet @leonard-thieu +/types/simplebar/ @leonard-thieu +/types/simplemde/ @Scalesoft +/types/simplesmtp/ @rogierschouten +/types/simplestorage.js/ @axelcostaspena @mxl +/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j +/types/sinon-as-promised/ @igrayson +/types/sinon-chai/ @kazimanzurrashid @jedmao +/types/sinon-chrome/ @pimterry +/types/sinon-express-mock/ @jpchip @tlaziuk +/types/sinon-mongoose/ @stevehipwell +/types/sinon-stub-promise/ @vintem +/types/sinon-test/ @mummybot +/types/sip.js/ @decyrus +/types/sipml/ @chookies +/types/sitemap2/ @shundy +/types/sizzle/ @leonard-thieu +/types/sjcl/ @Evgenus +/types/ski/ @AyaMorisawa +/types/skyway/ @nakakura +/types/slack-node/ @geoffreak +/types/slack-winston/ @BlueHatbRit +/types/slackify-html/ @hypexr +/types/slate-irc/ @elisee +/types/sleep/ @rajarz +/types/slickgrid/ @jbaldwin +/types/slideout/ @ToastHawaii +/types/slimerjs/ @alexwall +/types/slocket/ @BendingBender +/types/slug/ @mhegazy +/types/smart-fox-server/ @ChanceM +/types/smoothscroll-polyfill/ @kryops +/types/smtp-server/v1/ @markisme @Taisiias +/types/smtp-server/ @markisme @Taisiias @dex4er +/types/smtpapi/ @a-morales +/types/snapsvg/ @lhk @mattanja @kant2002 +/types/snazzy-info-window/ @milosd92 +/types/snekfetch/ @DarkerTV +/types/snoowrap/ @vitosamson +/types/snowboy/ @dolanmiu +/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi +/types/socket.io-client/ @progre @divillysausages @florentpoujol +/types/socket.io-parser/ @plantain-00 +/types/socket.io-redis/ @nupplaphil +/types/socket.io.users/ @kataras +/types/socketio-wildcard/ @BendingBender +/types/socketty/ @Nax +/types/sockjs/ @pmccloghrylaing +/types/sockjs-client/ @vladev @arusakov @BendingBender @renjfk +/types/solution-center-communicator/ @dami-gg +/types/sort-array/ @mrmlnc +/types/sortablejs/ @Maw-Fox +/types/soundmanager2/ @elton2048 +/types/source-list-map/ @e-cloud +/types/source-map-support/ @Bartvds @jason0x43 +/types/space-pen/ @vvakame +/types/spark-md5/ @bastienmoulia +/types/sparkly/ @BendingBender +/types/sparkpost/v1/ @geoffreak +/types/sparkpost/ @geoffreak @bondz +/types/sparqljs/ @AlexeyMz +/types/spatialite/ @atd-schubert +/types/spdx-correct/ @jinwoo +/types/spdx-satisfies/ @jinwoo +/types/spdy/ @tony19 +/types/speakeasy/ @legendecas @mrOlorin +/types/speakingurl/ @Goldsmith42 +/types/spectacle/ @zmaybury +/types/spectrum/ @M-Zuber +/types/split/ @marcinporebski +/types/split.js/ @icholy +/types/split2/ @mugeso +/types/spotify-api/ @skovmand +/types/spotify-web-playback-sdk/ @Festify +/types/sprintf/ @soywiz @BendingBender +/types/sprintf-js/ @jasonswearingen @BendingBender +/types/sql.js/ @Hozuki +/types/sqlite3/ @nmalaguti @dpyro +/types/sqlstring/ @marvinhagemeister +/types/squirejs/ @bradleyayers +/types/srp/ @Patman64 +/types/ssh-key-decrypt/ @BendingBender +/types/ssh2/ @tkQubo @rbuckton +/types/ssh2-sftp-client/ @igrayson @ascariandrea +/types/ssh2-streams/ @rbuckton +/types/sshpk/ @mabels +/types/stack-mapper/ @rogierschouten +/types/stack-trace/ @exceptionless +/types/stack-utils/ @BendingBender +/types/stacktrace-js/ @exceptionless @pilagod +/types/stale-lru-cache/ @cxcorp +/types/stampit/ @koresar +/types/stamplay-js-sdk/ @ridermansb +/types/stat-mode/ @BendingBender +/types/stats.js/ @gregolai @hberntsen @danvk +/types/statsd-client/ @peterkooijmans @chrisleck +/types/statuses/ @tkrotoff @BendingBender +/types/steam/ @kant2002 +/types/steed/ @Paul-Isache +/types/stemmer/ @will-ockmore +/types/sticky-cluster/ @paustint +/types/stompjs/ @jimic +/types/stoppable/ @EricByers +/types/storejs/ @vbortone @harry0000 +/types/storybook__addon-actions/ @joscha +/types/storybook__addon-backgrounds/ @hyunseob +/types/storybook__addon-info/ @mkornblum @fyrkant +/types/storybook__addon-knobs/ @joscha @martynaskadisa +/types/storybook__addon-links/ @joscha +/types/storybook__addon-notes/ @joscha +/types/storybook__addon-options/ @joscha +/types/storybook__react/ @joscha @wapgear +/types/stream-buffers/ @Jason3S +/types/stream-meter/ @mugeso +/types/stream-series/ @k-kagurazaka +/types/stream-to-array/v0/ @Bartvds +/types/stream-to-array/ @Bartvds @BendingBender +/types/streaming-json-stringify/ @BendingBender +/types/streamjs/ @erosb +/types/strftime/ @cyrilschumacher +/types/string/ @basp +/types/string-hash/ @ethanrubio +/types/string-similarity/ @ragtime +/types/string-template/ @TonyPythoneer +/types/string_score/ @marcinporebski +/types/stringify-object/ @khoomeister +/types/strip-ansi/ @mhegazy +/types/strip-bom/ @mhegazy +/types/strip-json-comments/ @dmoonfire +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi +/types/stripe-checkout/ @cgwrench +/types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak +/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak +/types/strong-cluster-control/ @shuntksh +/types/strophe/ @DavidKDeutsch +/types/styled-jsx/ @R1ZZU +/types/stylelint/ @alan-agius4 +/types/stylelint-webpack-plugin/ @bahlo +/types/stylus/ @SomaticIT +/types/subsume/ @BendingBender +/types/succinct/ @EnableSoftware +/types/sudo-block/ @BendingBender +/types/suitescript/ @darrenhillconsulting +/types/sumo-logger/ @forabi +/types/superagent/v2/ @varju @NicoZelaya @mxl +/types/superagent/ @NicoZelaya @mxl @paplorinc +/types/superagent-no-cache/ @mxl +/types/superagent-prefix/ @mxl +/types/supercluster/ @DenisCarriere +/types/supertest/ @varju +/types/supertest-as-promised/ @tkrotoff +/types/supports-color/ @mgroenhoff +/types/svg-injector/ @poke +/types/svg-parser/ @mrmlnc +/types/svg-sprite/ @tkqubo +/types/svg2png/ @hansrwindhoff @sccgithub +/types/svg4everybody/ @BendingBender +/types/svgjs.draggable/ @LiFeleSs +/types/svgjs.resize/ @jkevingutierrez +/types/svgo/ @bradleyayers +/types/swag/ @shiwano +/types/swagger-express-middleware/ @alexandreroba +/types/swagger-express-mw/ @micmro +/types/swagger-hapi/ @micmro +/types/swagger-jsdoc/ @drGrove +/types/swagger-node-runner/ @micmro +/types/swagger-parser/ @Tobias4872 @EricHenry +/types/swagger-restify-mw/ @micmro +/types/swagger-sails-hook/ @micmro +/types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt +/types/swagger-tools/ @bricka +/types/swaggerize-express/ @mugeso @nickmorton +/types/swfobject/ @rou +/types/swiftclick/ @Laurence-C +/types/swig/ @CodeAnimal @soywiz +/types/swig-email-templates/ @mrhen @micksatana +/types/swipe/ @kant2002 +/types/swiper/ @sgaliano @lucax88x +/types/swipeview/ @borisyankov +/types/switchery/ @bgrieder @claylaut +/types/swiz/ @jedigo +/types/sylvester/ @StephaneAlie +/types/synaptic/ @ToastHawaii @austincummings +/types/systeminformation/ @PixelcrabAT +/types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad +/types/table/ @evanshortiss @mrmlnc +/types/tabris-plugin-firebase/ @eclipsesource +/types/tabtab/ @vojtechhabarta +/types/tabulator/ @euginio +/types/tapable/ @e-cloud +/types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty +/types/tar/ @SomaticIT @connor4312 +/types/tcp-ping/ @stegano +/types/tedious/ @rogierschouten @cjthompson +/types/tedious-connection-pool/ @sandorfr +/types/telebot/ @mariotsi +/types/temp/ @DanielRosenwasser +/types/temp-write/ @BendingBender +/types/tempfile/ @SamVerschueren @BendingBender +/types/tempy/ @douglasduteil +/types/terminal-menu/ @aravindarun +/types/testingbot-api/ @timbru31 +/types/tether/ @adidahiya +/types/tether-drop/ @adidahiya +/types/tether-shepherd/ @mtgibbs +/types/text-buffer/ @GlenCFL +/types/text-encoding/ @pine613 +/types/text-encoding-utf-8/ @trxcllnt +/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv +/types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 +/types/throng/ @cyrilschumacher @tatethurston +/types/throttle/ @BendingBender +/types/throttle-debounce/ @czbuchi +/types/through/ @AndrewGaspar +/types/through2/v0/ @Bartvds @jedmao +/types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 +/types/through2-map/ @LucasHill +/types/tile-reduce/ @DenisCarriere +/types/tilebelt/ @DenisCarriere +/types/time-span/ @BendingBender @mdvorscak +/types/timelinejs/ @rolandzwaga +/types/timelinejs3/ @MikeMatusz +/types/timer-machine/ @dolanmiu +/types/timezone-js/ @bonnici +/types/tinder/ @pingec +/types/tinycolor2/ @M-Zuber @geertjansen @nvh +/types/tinycopy/ @vvatanabe +/types/tinymce/ @martinduparc @ipoul +/types/titanium/ @cyounkins +/types/title/ @fa7ad +/types/tldjs/ @geoffreak +/types/tmp/ @optical @Perlmint +/types/to-absolute-glob/ @ajafff +/types/to-camel-case/ @j-f1 +/types/to-markdown/ @SuperPaintman +/types/to-title-case-gouch/ @stpettersens +/types/toastr/ @borisyankov +/types/tocktimer/ @evanshortiss +/types/tooltipster/ @stephenlautier @pjmagee @VorobeY1326 @leonard-thieu @janhi @joeskeen +/types/topojson/ @ricardo-mello @chenzhutian +/types/torrent-stream/ @xstoudi +/types/touch/ @mizunashi-mana @BendingBender +/types/touch-events/ @kevinb7 +/types/tough-cookie/ @leonard-thieu @LiJinyao +/types/traceback/ @misak113 +/types/tracking/ @pimterry +/types/transducers-js/ @colinkahn @dphilipson @NaridaL +/types/transducers.js/ @dphilipson +/types/trash/ @matthew-matvei +/types/traverse/ @newclear +/types/traverson/ @marcinporebski +/types/trayballoon/ @korve +/types/tress/ @sindilevich +/types/trim/ @skysteve +/types/trunk8/ @niemyjski +/types/tspromise/ @soywiz +/types/tunnel/ @BendingBender +/types/tus-js-client/ @kevhiggins +/types/tv4/ @Bartvds @psnider +/types/tween.js/ @Amos47 @sunetos @jzarnikov @alexburner +/types/tweenjs/ @evilangelist +/types/tweezer.js/ @praxxis +/types/twig/ @soywiz @enko +/types/twilio/ @nickiannone @ashleybrener +/types/twit/ @Volox @lostfictions +/types/twitter/ @chitoku-k +/types/twitter-stream-channels/ @adrianbardan +/types/twitter-text/ @rhysd +/types/twix/ @j3ko +/types/type-check/ @hansrwindhoff +/types/type-detect/ @Bartvds +/types/type-is/ @BendingBender +/types/type-name/ @armorik83 +/types/typeahead/ @igochkov @gjunge +/types/typedarray-pool/ @pawsong +/types/typescript-deferred/ @DirtyHairy +/types/tz-format/ @samverschueren +/types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo +/types/uglify-js/ @tkrotoff +/types/uglifycss/ @blendsdk +/types/ui-grid/ @btesser @joeskeen +/types/ui-router-extras/ @mputters @marcel-k @LaserUnicorns +/types/ui-select/ @nkovacic +/types/uid-safe/ @geoffreak +/types/uikit/ @giovannicandido @s0x +/types/uinput/ @Fidge123 +/types/ultra-strftime/ @dex4er +/types/umbraco/ @DeCareSystemsIreland +/types/umd/ @TeamworkGuy2 +/types/umzug/ @drinchev @mlamp +/types/underscore/ @borisyankov @jbaldwin @ccurrens @clottman +/types/underscore-ko/ @MagicMau +/types/underscore.string/ @rygine +/types/undertaker/ @tkqubo @GiedriusGrabauskas +/types/undertaker-registry/ @GiedriusGrabauskas +/types/uniq/ @hansrwindhoff +/types/uniqid/ @idchlife +/types/unique-hash-stream/ @BendingBender +/types/unique-random/ @Kuniwak +/types/unist/ @bizen241 +/types/unity-webapi/ @jmvrbanac +/types/universal-analytics/ @Bartvds @DarkerTV +/types/universal-router/ @jtmthf +/types/unorm/ @chbrown +/types/untildify/ @BendingBender +/types/unused-filename/ @BendingBender +/types/unzip/ @coding2012 +/types/update-notifier/ @vvakame @nchen63 +/types/uppercamelcase/ @plantain-00 +/types/urbanairship-cordova/ @Justin-Credible +/types/uri-templates/ @Bartvds +/types/urijs/ @RodneyJT @xt0rted +/types/uritemplate/ @teyc @rubensworks +/types/url-assembler/ @wolfgang42 +/types/url-join/ @rogierschouten @devrelm +/types/url-metadata/ @mrkmg +/types/url-parse/ @ChernenkoPaul +/types/url-regex/ @unindented +/types/url-search-params/ @nick121212 +/types/url-template/ @marcinporebski +/types/urlrouter/ @soywiz +/types/urlsafe-base64/ @tkrotoff +/types/usage/ @pvomhoff +/types/usb/ @underscorebrody +/types/user-home/ @mhegazy +/types/useragent/ @geoffreak +/types/username/ @kayahr +/types/utf8/ @zelein +/types/util-deprecate/ @BendingBender +/types/util.promisify/ @adamvoss +/types/utils-merge/ @chrootsu +/types/uuid/ @iamolivinius @felipeochoa @cjbarth +/types/uuid-1345/ @mugeso +/types/uuid-js/ @mhegazy +/types/uuid-validate/ @HiromiShikata +/types/uws/ @plantain-00 +/types/valdr/ @ilbertz +/types/valdr-message/ @ilbertz +/types/valerie/ @conficient +/types/vali-date/ @SamVerschueren +/types/valid-url/ @stevehipwell +/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno +/types/validatorjs/ @LKay @danmana +/types/vanilla-modal/ @samnau +/types/vanilla-tilt/ @BrunnerLivio +/types/vary/ @BendingBender +/types/vast-client/ @jgainfort +/types/vec3/ @xstoudi +/types/vectorious/ @erikgerrits +/types/vega/ @pelotom +/types/velocity-animate/ @smrq +/types/verror/ @svi3c @max4t +/types/vertx3-eventbus-client/ @oddeirik +/types/vex-js/ @gdcohan +/types/vexflow/ @rquiring @sebastianhaas @bohoffi +/types/vfile/ @bizen241 @rokt33r +/types/victory/ @asvetliakov @snerks @Havret +/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus +/types/viewability-helper/ @lironzluf +/types/viewerjs/ @lrh3321 +/types/viewporter/ @borisyankov +/types/vimeo/ @DazWilkin +/types/vimeo__player/ @denisyilmaz +/types/vinyl/v0/ @jedmao +/types/vinyl/ @vvakame @jedmao @thorn0 +/types/vinyl-buffer/ @tkQubo +/types/vinyl-fs/ @vvakame @remisery +/types/vinyl-paths/ @tkQubo +/types/virtual-dom/ @chbrown +/types/virtual-keyboard/ @bsurai +/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 +/types/vision/ @jasonswearingen @AJamesPhillips +/types/vitalsigns/ @cyrilschumacher +/types/vivus/ @DanielRosenwasser @lekhmanrus +/types/vkbeautify/ @sch3lp +/types/voca/ @pine +/types/voronoi-diagram/ @michaelneu +/types/vortex-web-client/ @Pro +/types/voximplant-websdk/ @aylarov +/types/vue-resource/ @kaorun343 +/types/vue-scrollto/ @vincekovacs +/types/vuex-i18n/ @jaeggerr +/types/w2ui/ @Ptival +/types/w3c-generic-sensor/ @kenchris +/types/w3c-image-capture/ @cosium +/types/w3c-screen-orientation/ @kenchris +/types/w3c-web-usb/ @larsgk +/types/waitme/ @totpero +/types/wake_on_lan/ @SrTobi +/types/wallabyjs/ @andrewconnell +/types/wallpaper/ @BendingBender +/types/wampy/ @KSDaemon +/types/warning/ @cvle +/types/watch/ @soywiz @Perlmint +/types/watchify/ @TeamworkGuy2 +/types/watchpack/ @e-cloud +/types/waterline/ @arvitaly +/types/watson-developer-cloud/ @waldo000000 @Naktibalda +/types/waypoints/ @dominikbulaj @Koloto +/types/wcwidth/ @rokt33r +/types/weak/ @int0h +/types/weapp-api/ @vargeek +/types/web-animations-js/ @kritollm +/types/web-bluetooth/ @urish +/types/webappsec-credential-management/ @iainmcgin +/types/webassembly-js-api/ @periklis +/types/webcl/ @NCARalph +/types/webcomponents.js/ @adidahiya +/types/webcrypto/ @iislucas +/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 +/types/webfontloader/ @doskallemaskin +/types/webgl-ext/ @zenmumbler +/types/webgl2/ @nkemnitz +/types/webix/ @mkozhukh +/types/webmidi/ @lostfictions +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 +/types/webpack-bundle-analyzer/ @kryops +/types/webpack-chain/ @eirikurn @psachs21 +/types/webpack-chunk-hash/ @mtraynham +/types/webpack-cleanup-plugin/ @malj +/types/webpack-dev-middleware/v1/ @bumbleblym @reduckted +/types/webpack-dev-middleware/ @bumbleblym @reduckted +/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong @alan-agius4 +/types/webpack-dotenv-plugin/ @kryops +/types/webpack-env/ @use-strict @rhonsby +/types/webpack-fail-plugin/ @deevus +/types/webpack-hot-middleware/ @bumbleblym @icylace +/types/webpack-manifest-plugin/ @r3nya +/types/webpack-merge/v0/ @deevus +/types/webpack-merge/ @deevus @mtraynham +/types/webpack-node-externals/ @mtraynham +/types/webpack-notifier/ @bumbleblym +/types/webpack-sources/ @e-cloud @chriseppstein +/types/webpack-stream/ @iclanton @bumbleblym +/types/webpack-validator/ @deevus +/types/webrtc/ @nakakura +/types/websocket/ @loyd @flynetworks @zhaoleimxd +/types/webspeechapi/ @saschanaz +/types/websql/ @TeamworkGuy2 +/types/webtorrent/ @niieani @tlaziuk +/types/webvr-api/ @lostfictions +/types/week/ @sindrenm +/types/weighted/ @ccitro +/types/weixin-app/ @taoqf +/types/wellknown/ @yairtawil +/types/whatwg-streams/ @saschanaz +/types/wheel/ @BTOdell +/types/when/ @derekcicerone @Nemo157 +/types/which/ @vvakame @cspotcode +/types/wicg-mediasession/ @jucrouzet +/types/wiiu/ @mzsm +/types/window-or-global/ @vvakame +/types/window-size/ @pmkary +/types/windows-1251/ @RomanGolovanov +/types/windows-service/ @rogierschouten +/types/winjs/v1/ @adamhewitt627 @craigktreasure @xirzec +/types/winjs/v2/ @adamhewitt627 @craigktreasure @xirzec +/types/winjs/ @adamhewitt627 @craigktreasure @xirzec +/types/winreg/ @RX14 @BobBuehler +/types/winrt-uwp/ @saschanaz @taylor224 +/types/winston/ @bonnici @codeanimal @DABH +/types/winston-dynamodb/ @nickiannone +/types/wiring-pi/ @NoHomey +/types/wnumb/ @acoreyj +/types/wonder.js/ @yyc-git +/types/word-list-json/ @dovidm +/types/wordcloud/ @joeskeen +/types/words-to-numbers/ @James-Frowen +/types/wrap-ansi/ @kayahr +/types/wreck/ @marcinporebski +/types/wrench/ @soywiz +/types/write-file-atomic/ @BendingBender +/types/write-json-file/ @DenisCarriere +/types/ws/ @loyd @elithrar @mlamp +/types/wtfnode/ @dex4er +/types/wu/ @phiresky +/types/wx-js-sdk-dt/ @agasbzj +/types/x-editable/ @sirkirby +/types/x-ray/ @mtraynham +/types/x-ray-crawler/ @mtraynham +/types/xdate/ @yamada28go +/types/xdg-basedir/ @tlaziuk +/types/xhr-mock/ @joscha +/types/xml/ @YuJianrong +/types/xml-parser/ @mhfrantz +/types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @BehindTheMath +/types/xml2json/ @dolanmiu +/types/xmlbuilder/ @wallymathieu +/types/xmldoc/ @Xstoudi @ajsheehan +/types/xmldom/ @tkqubo +/types/xmlpoke/ @garthk +/types/xmltojson/ @traviscrowe +/types/xmpp__jid/ @PJakcson +/types/xregexp/ @Bartvds @jfahrenkrug @sigo +/types/xrm/v7/ @daryllabar +/types/xrm/v8/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @mariusagur +/types/xrm/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @scottdurow +/types/xsd-schema-validator/ @Goldsmith42 +/types/xsockets/ @pushplay +/types/xterm/ @blink1073 @LucianBuzzo +/types/xxhashjs/ @mDibyo +/types/yallist/ @BendingBender +/types/yandex-maps/ @Delagen +/types/yandex-money-sdk/ @chrootsu +/types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney +/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC +/types/yayson/ @Codesleuth +/types/ydn-db/ @yathit @gabrielmaldi +/types/yeoman-generator/ @armorik83 @janslow @ikatyang +/types/yeoman-test/ @ikatyang +/types/yfiles/ @yGuy +/types/yog-bigpipe/ @ssddi456 +/types/yog-log/ @ssddi456 +/types/yog2-kernel/ @ssddi456 +/types/yosay/ @armorik83 +/types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 +/types/youtube-dl/ @bsurai +/types/yui/ @giabao +/types/yup/ @dhardtke @vtserman +/types/z-schema/ @pgonzal +/types/zapier-platform-core/ @bradleyayers +/types/zen-observable/ @aicest +/types/zen-push/ @daprahamian +/types/zenscroll/ @HamedFathi +/types/zepto/ @jbaldwin +/types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu +/types/zeroclipboard/ @ejsmith @niemyjski @balassy @leonyu +/types/zeromq/ @davemckeown @erikma +/types/zip.js/ @lgrignon +/types/zipcodes/ @headdetect +/types/zmq/ @davemckeown +/types/zookeeper/ @xialeistudio +/types/zui/ @yuanxu +/types/zxcvbn/ @mtraynham diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 4078b4808b..536e38c4e2 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,9 @@ +If you know how to fix the issue, make a pull request instead. + - [ ] I tried using the `@types/xxxx` package and had problems. - [ ] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript - [ ] I have a question that is inappropriate for [StackOverflow](https://stackoverflow.com/). (Please ask any appropriate questions there). - [ ] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see `Definitions by:` in `index.d.ts`) so they can respond. - Authors: @.... + +If you do not mention the authors the issue will be ignored. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 979a8311e0..4217471f9d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,7 +12,7 @@ If adding a new definition: - [ ] The package does not provide its own types, and you can not add them. - [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [ ] Create it with `dts-gen --dt`, not by basing it on an existing project. -- [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, and `strictNullChecks` set to `true`. +- [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. If changing an existing definition: - [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <> diff --git a/.travis.yml b/.travis.yml index 07914721a9..9bd31bda14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - node + - 8 sudo: false diff --git a/README.md b/README.md index b826bf5ad5..854cae7e40 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ or just look for any ".d.ts" files in the package and manually include them with These can be used by TypeScript 1.0. * [Typings](https://github.com/typings/typings) -* ~~[NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped)~~ (use preferred alternatives, nuget DT type publishing has been turned off) +* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped)~~ (use preferred alternatives, nuget DT type publishing has been turned off) * Manually download from the `master` branch of this repository You may need to add manual [references](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). @@ -313,6 +313,18 @@ When `dts-gen` is used to scaffold a scoped package, the `paths` property has to GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) file history for renamed files. Use [`git log --follow`](https://www.git-scm.com/docs/git-log) instead. +#### Should I add an empty namespace to a package that doesn't export a module to use ES6 style imports? + +Some packages, like [chai-http](https://github.com/chaijs/chai-http), export a function. + +Importing this module with an ES6 style import in the form `import * as foo from "foo";` leads to the error: + +> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct + +This error can be suppressed by merging the function declaration with an empty namespace of the same name, but this practice is discouraged. +This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) regarding this matter. + +It is more appropriate to import the module using the `import foo = require("foo");` syntax, or to use a default import like `import foo from "foo";` if using the `--allowSyntheticDefaultImports` flag if your module runtime supports an interop scheme for non-ECMAScript modules as such. ## License diff --git a/notNeededPackages.json b/notNeededPackages.json index 579bcf46ef..8f3270392f 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -42,18 +42,60 @@ "sourceRepoURL": "https://github.com/doxout/anydb-sql", "asOfVersion": "0.6.46" }, + { + "libraryName": "anydb-sql-migrations", + "typingsPackageName": "anydb-sql-migrations", + "sourceRepoURL": "https://github.com/spion/anydb-sql-migrations", + "asOfVersion": "2.1.1" + }, { "libraryName": "apn", "typingsPackageName": "apn", "sourceRepoURL": "https://github.com/node-apn/node-apn", "asOfVersion": "2.1.2" }, + { + "libraryName": "Application Insights", + "typingsPackageName": "applicationinsights", + "sourceRepoURL": "https://github.com/Microsoft/ApplicationInsights-node.js", + "asOfVersion": "0.20.0" + }, { "libraryName": "Argon2", "typingsPackageName": "argon2", "sourceRepoURL": "https://github.com/ranisalt/node-argon2", "asOfVersion": "0.15.0" }, + { + "libraryName": "artyom.js", + "typingsPackageName": "artyom.js", + "sourceRepoURL": "https://github.com/sdkcarlos/artyom.js", + "asOfVersion": "1.0.6" + }, + { + "libraryName": "askmethat-rating", + "typingsPackageName": "askmethat-rating", + "sourceRepoURL": "https://github.com/AlexTeixeira/Askmethat-Rating", + "asOfVersion": "0.4.0" + }, + { + "libraryName": "asyncblock", + "typingsPackageName": "asyncblock", + "sourceRepoURL": "https://github.com/scriby/asyncblock", + "asOfVersion": "2.2.11" + }, + { + "libraryName": "aurelia-knockout", + "typingsPackageName": "aurelia-knockout", + "sourceRepoURL": "https://github.com/code-chris/aurelia-knockout", + "asOfVersion": "2.1.0" + }, + { + "libraryName": "autobind-decorator", + "typingsPackageName": "autobind-decorator", + "sourceRepoURL": "https://github.com/andreypopp/autobind-decorator", + "asOfVersion": "2.1.0" + }, { "libraryName": "aws-sdk", "typingsPackageName": "aws-sdk", @@ -72,6 +114,12 @@ "sourceRepoURL": "https://github.com/mzabriskie/axios", "asOfVersion": "0.14.0" }, + { + "libraryName": "axios-mock-adapter", + "typingsPackageName": "axios-mock-adapter", + "sourceRepoURL": "https://github.com/ctimmerm/axios-mock-adapter", + "asOfVersion": "1.10.0" + }, { "libraryName": "azure-mobile-apps", "typingsPackageName": "azure-mobile-apps", @@ -90,24 +138,60 @@ "sourceRepoURL": "https://github.com/brianloveswords/base64url", "asOfVersion": "2.0.0" }, + { + "libraryName": "better-scroll", + "typingsPackageName": "better-scroll", + "sourceRepoURL": "https://github.com/ustbhuangyi/better-scroll", + "asOfVersion": "1.5.0" + }, { "libraryName": "BigInteger.js", "typingsPackageName": "big-integer", "sourceRepoURL": "https://github.com/peterolson/BigInteger.js", "asOfVersion": "0.0.31" }, + { + "libraryName": "bignumber.js", + "typingsPackageName": "bignumber.js", + "sourceRepoURL": "https://github.com/MikeMcl/bignumber.js/", + "asOfVersion": "5.0.0" + }, + { + "libraryName": "botvs", + "typingsPackageName": "botvs", + "sourceRepoURL": "https://www.botvs.com/", + "asOfVersion": "1.0.0" + }, + { + "libraryName": "Bowser", + "typingsPackageName": "bowser", + "sourceRepoURL": "https://github.com/ded/bowser", + "asOfVersion": "1.1.1" + }, { "libraryName": "Bugsnag Browser", "typingsPackageName": "bugsnag-js", "sourceRepoURL": "https://github.com/bugsnag/bugsnag-js", "asOfVersion": "3.1.0" }, + { + "libraryName": "CacheFactory", + "typingsPackageName": "cachefactory", + "sourceRepoURL": "https://github.com/jmdobry/CacheFactory", + "asOfVersion": "3.0.0" + }, { "libraryName": "camel-case", "typingsPackageName": "camel-case", "sourceRepoURL": "https://github.com/blakeembrey/camel-case", "asOfVersion": "1.2.1" }, + { + "libraryName": "chalk", + "typingsPackageName": "chalk", + "sourceRepoURL": "https://github.com/chalk/chalk", + "asOfVersion": "2.2.0" + }, { "libraryName": "change-case", "typingsPackageName": "change-case", @@ -120,18 +204,162 @@ "sourceRepoURL": "https://github.com/mapbox/cheap-ruler", "asOfVersion": "2.5.0" }, + { + "libraryName": "chunked-dc", + "typingsPackageName": "chunked-dc", + "sourceRepoURL": "https://github.com/saltyrtc/chunked-dc-js", + "asOfVersion": "0.2.2" + }, + { + "libraryName": "commander", + "typingsPackageName": "commander", + "sourceRepoURL": "https://github.com/tj/commander.js", + "asOfVersion": "2.12.2" + }, + { + "libraryName": "confirmdialog", + "typingsPackageName": "confirmdialog", + "sourceRepoURL": "https://github.com/allipierre/Type-definitions-for-jquery-confirm/tree/master/types/confirmDialog-js", + "asOfVersion": "1.0.0" + }, { "libraryName": "constant-case", "typingsPackageName": "constant-case", "sourceRepoURL": "https://github.com/blakeembrey/constant-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "cordova-plugin-battery-status", + "typingsPackageName": "cordova-plugin-battery-status", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-battery-status", + "asOfVersion": "1.2.3" + }, + { + "libraryName": "cordova-plugin-camera", + "typingsPackageName": "cordova-plugin-camera", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-camera", + "asOfVersion": "2.4.0" + }, + { + "libraryName": "cordova-plugin-contacts", + "typingsPackageName": "cordova-plugin-contacts", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-contacts", + "asOfVersion": "2.3.0" + }, + { + "libraryName": "cordova-plugin-device", + "typingsPackageName": "cordova-plugin-device", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-device", + "asOfVersion": "1.1.5" + }, + { + "libraryName": "cordova-plugin-device-motion", + "typingsPackageName": "cordova-plugin-device-motion", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-device-motion", + "asOfVersion": "1.2.4" + }, + { + "libraryName": "Apache Cordova Device Orientation plugin", + "typingsPackageName": "cordova-plugin-device-orientation", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-device-orientation", + "asOfVersion": "1.0.6" + }, + { + "libraryName": "cordova-plugin-dialogs", + "typingsPackageName": "cordova-plugin-dialogs", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-dialogs", + "asOfVersion": "1.3.2" + }, + { + "libraryName": "Apache Cordova File System plugin", + "typingsPackageName": "cordova-plugin-file", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-file", + "asOfVersion": "4.3.2" + }, + { + "libraryName": "cordova-plugin-file-transfer", + "typingsPackageName": "cordova-plugin-file-transfer", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-file-transfer", + "asOfVersion": "1.6.2" + }, + { + "libraryName": "cordova-plugin-globalization", + "typingsPackageName": "cordova-plugin-globalization", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-globalization", + "asOfVersion": "1.0.6" + }, + { + "libraryName": "cordova-plugin-inappbrowser", + "typingsPackageName": "cordova-plugin-inappbrowser", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-inappbrowser", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "cordova-plugin-media", + "typingsPackageName": "cordova-plugin-media", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-media", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "cordova-plugin-media-capture", + "typingsPackageName": "cordova-plugin-media-capture", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-media-capture", + "asOfVersion": "1.4.2" + }, + { + "libraryName": "cordova-plugin-network-information", + "typingsPackageName": "cordova-plugin-network-information", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-network-information", + "asOfVersion": "1.3.2" + }, + { + "libraryName": "cordova-plugin-splashscreen", + "typingsPackageName": "cordova-plugin-splashscreen", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-splashscreen", + "asOfVersion": "4.0.2" + }, + { + "libraryName": "Apache Cordova StatusBar plugin", + "typingsPackageName": "cordova-plugin-statusbar", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-statusbar", + "asOfVersion": "2.2.2" + }, + { + "libraryName": "Apache Cordova Vibration plugin", + "typingsPackageName": "cordova-plugin-vibration", + "sourceRepoURL": "https://github.com/apache/cordova-plugin-vibration", + "asOfVersion": "2.1.4" + }, + { + "libraryName": "cordova.plugins.diagnostic", + "typingsPackageName": "cordova.plugins.diagnostic", + "sourceRepoURL": "https://github.com/dpa99c/cordova-diagnostic-plugin", + "asOfVersion": "3.7.0" + }, + { + "libraryName": "core-decorators.js", + "typingsPackageName": "core-decorators", + "sourceRepoURL": "https://github.com/jayphelps/core-decorators.js", + "asOfVersion": "0.20.0" + }, + { + "libraryName": "cypress", + "typingsPackageName": "cypress", + "sourceRepoURL": "https://cypress.io", + "asOfVersion": "1.1.3" + }, { "libraryName": "date-fns", "typingsPackageName": "date-fns", "sourceRepoURL": "https://github.com/date-fns/date-fns", "asOfVersion": "2.6.0" }, + { + "libraryName": "decimal.js", + "typingsPackageName": "decimal.js", + "sourceRepoURL": "https://github.com/MikeMcl/decimal.js", + "asOfVersion": "7.4.0" + }, { "libraryName": "DevExtreme", "typingsPackageName": "devextreme", @@ -144,6 +372,12 @@ "sourceRepoURL": "https://github.com/dfahlander/Dexie.js", "asOfVersion": "1.3.1" }, + { + "libraryName": "docker-file-parser", + "typingsPackageName": "docker-file-parser", + "sourceRepoURL": "https://github.com/joyent/docker-file-parser", + "asOfVersion": "1.0.3" + }, { "libraryName": "dot-case", "typingsPackageName": "dot-case", @@ -156,12 +390,36 @@ "sourceRepoURL": "https://github.com/dvajs/dva", "asOfVersion": "1.1.0" }, + { + "libraryName": "easy-x-headers", + "typingsPackageName": "easy-x-headers", + "sourceRepoURL": "https://github.com/DeadAlready/easy-x-headers", + "asOfVersion": "1.0.0" + }, + { + "libraryName": "easy-xapi-supertest", + "typingsPackageName": "easy-xapi-supertest", + "sourceRepoURL": "https://github.com/DeadAlready/easy-xapi-supertest", + "asOfVersion": "1.0.0" + }, + { + "libraryName": "EasyStar.js", + "typingsPackageName": "easystarjs", + "sourceRepoURL": "http://easystarjs.com/", + "asOfVersion": "0.3.1" + }, { "libraryName": "ecmarkup", "typingsPackageName": "ecmarkup", "sourceRepoURL": "https://github.com/bterlson/ecmarkup", "asOfVersion": "3.4.0" }, + { + "libraryName": "Egg", + "typingsPackageName": "egg", + "sourceRepoURL": "https://github.com/eggjs/egg", + "asOfVersion": "1.5.0" + }, { "libraryName": "electron", "typingsPackageName": "electron", @@ -174,6 +432,36 @@ "sourceRepoURL": "https://github.com/loopline-systems/electron-builder", "asOfVersion": "2.8.0" }, + { + "libraryName": "email-addresses", + "typingsPackageName": "email-addresses", + "sourceRepoURL": "https://github.com/jackbowman/email-addresses", + "asOfVersion": "3.0.0" + }, + { + "libraryName": "email-validator", + "typingsPackageName": "email-validator", + "sourceRepoURL": "https://github.com/Sembiance/email-validator", + "asOfVersion": "1.0.6" + }, + { + "libraryName": "error-stack-parser", + "typingsPackageName": "error-stack-parser", + "sourceRepoURL": "https://github.com/stacktracejs/error-stack-parser", + "asOfVersion": "2.0.0" + }, + { + "libraryName": "es6-error", + "typingsPackageName": "es6-error", + "sourceRepoURL": "https://github.com/bjyoungblood/es6-error", + "asOfVersion": "4.0.2" + }, + { + "libraryName": "es6-promise", + "typingsPackageName": "es6-promise", + "sourceRepoURL": "https://github.com/jakearchibald/ES6-Promise", + "asOfVersion": "3.3.0" + }, { "libraryName": "eventemitter2", "typingsPackageName": "eventemitter2", @@ -186,12 +474,24 @@ "sourceRepoURL": "https://github.com/primus/eventemitter3", "asOfVersion": "2.0.2" }, + { + "libraryName": "expr-eval", + "typingsPackageName": "expr-eval", + "sourceRepoURL": "https://github.com/silentmatt/expr-eval", + "asOfVersion": "1.1.0" + }, { "libraryName": "express-validator", "typingsPackageName": "express-validator", "sourceRepoURL": "https://github.com/ctavan/express-validator", "asOfVersion": "3.0.0" }, + { + "libraryName": "extended-listbox", + "typingsPackageName": "extended-listbox", + "sourceRepoURL": "https://github.com/code-chris/extended-listbox", + "asOfVersion": "4.0.1" + }, { "libraryName": "JSON-Patch", "typingsPackageName": "fast-json-patch", @@ -204,30 +504,120 @@ "sourceRepoURL": "https://www.npmjs.com/package/fast-simplex-noise", "asOfVersion": "3.0.0" }, + { + "libraryName": "fecha", + "typingsPackageName": "fecha", + "sourceRepoURL": "https://github.com/taylorhakes/fecha", + "asOfVersion": "2.3.1" + }, { "libraryName": "FineUploader", "typingsPackageName": "fine-uploader", "sourceRepoURL": "http://fineuploader.com/", "asOfVersion": "5.14.0" }, + { + "libraryName": "Firebase API", + "typingsPackageName": "firebase", + "sourceRepoURL": "https://www.firebase.com/docs/javascript/firebase", + "asOfVersion": "3.2.1" + }, + { + "libraryName": "flatpickr", + "typingsPackageName": "flatpickr", + "sourceRepoURL": "https://github.com/chmln/flatpickr", + "asOfVersion": "3.1.2" + }, + { + "libraryName": "flux-standard-action", + "typingsPackageName": "flux-standard-action", + "sourceRepoURL": "https://github.com/acdlite/flux-standard-action", + "asOfVersion": "1.1.0" + }, + { + "libraryName": "Foundation Sites", + "typingsPackageName": "foundation-sites", + "sourceRepoURL": "http://foundation.zurb.com/", + "asOfVersion": "6.4.3" + }, + { + "libraryName": "FullCalendar", + "typingsPackageName": "fullcalendar", + "sourceRepoURL": "http://arshaw.com/fullcalendar/", + "asOfVersion": "3.8.0" + }, { "libraryName": "gaea-model", "typingsPackageName": "gaea-model", "sourceRepoURL": "https://github.com/ascoders/gaea-model", "asOfVersion": "0.0.0" }, + { + "libraryName": "geolib", + "typingsPackageName": "geolib", + "sourceRepoURL": "https://github.com/manuelbieh/Geolib", + "asOfVersion": "2.0.23" + }, { "libraryName": "github", "typingsPackageName": "github", "sourceRepoURL": "https://github.com/mikedeboer/node-github", "asOfVersion": "7.1.0" }, + { + "libraryName": "graphene-pk11", + "typingsPackageName": "graphene-pk11", + "sourceRepoURL": "https://github.com/PeculiarVentures/graphene", + "asOfVersion": "2.0.31" + }, + { + "libraryName": "griddle-react", + "typingsPackageName": "griddle-react", + "sourceRepoURL": "https://github.com/griddlegriddle/griddle", + "asOfVersion": "1.3.0" + }, + { + "libraryName": "gulp-tslint", + "typingsPackageName": "gulp-tslint", + "sourceRepoURL": "https://github.com/panuhorsmalahti/gulp-tslint", + "asOfVersion": "4.2.0" + }, { "libraryName": "gulp-typescript", "typingsPackageName": "gulp-typescript", "sourceRepoURL": "https://github.com/ivogabe/gulp-typescript", "asOfVersion": "2.13.0" }, + { + "libraryName": "handsontable", + "typingsPackageName": "handsontable", + "sourceRepoURL": "https://handsontable.com/", + "asOfVersion": "0.35.0" + }, + { + "libraryName": "homeworks", + "typingsPackageName": "homeworks", + "sourceRepoURL": "https://github.com/IGAWorksDev/homeworks/", + "asOfVersion": "1.0.19" + }, + { + "libraryName": "http-status-codes", + "typingsPackageName": "http-status-codes", + "sourceRepoURL": "https://github.com/prettymuchbryce/node-http-status", + "asOfVersion": "1.2.0" + }, + { + "libraryName": "iconv-lite", + "typingsPackageName": "iconv-lite", + "sourceRepoURL": "https://github.com/ashtuchkin/iconv-lite", + "asOfVersion": "0.4.14" + }, + { + "libraryName": "immutability-helper", + "typingsPackageName": "immutability-helper", + "sourceRepoURL": "https://github.com/kolodny/immutability-helper", + "asOfVersion": "2.6.3" + }, { "libraryName": "Facebook's Immutable", "typingsPackageName": "immutable", @@ -270,18 +660,54 @@ "sourceRepoURL": "https://github.com/inversify/inversify-restify-utils", "asOfVersion": "2.0.0" }, + { + "libraryName": "Ionic", + "typingsPackageName": "ionic", + "sourceRepoURL": "http://ionicframework.com", + "asOfVersion": "3.19.0" + }, { "libraryName": "is-lower-case", "typingsPackageName": "is-lower-case", "sourceRepoURL": "https://github.com/blakeembrey/is-lower-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "is-plain-object", + "typingsPackageName": "is-plain-object", + "sourceRepoURL": "https://github.com/jonschlinkert/is-plain-object", + "asOfVersion": "2.0.4" + }, { "libraryName": "is-upper-case", "typingsPackageName": "is-upper-case", "sourceRepoURL": "https://github.com/blakeembrey/is-upper-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "jasmine-expect", + "typingsPackageName": "jasmine-expect", + "sourceRepoURL": "https://github.com/JamieMason/Jasmine-Matchers", + "asOfVersion": "3.8.1" + }, + { + "libraryName": "jimp", + "typingsPackageName": "jimp", + "sourceRepoURL": "https://github.com/oliver-moran/jimp#readme", + "asOfVersion": "0.2.28" + }, + { + "libraryName": "joData", + "typingsPackageName": "jodata", + "sourceRepoURL": "https://github.com/mccow002/joData", + "asOfVersion": "1.0.13" + }, + { + "libraryName": "JointJS", + "typingsPackageName": "jointjs", + "sourceRepoURL": "http://www.jointjs.com/", + "asOfVersion": "2.0.0" + }, { "libraryName": "jpush-react-native", "typingsPackageName": "jpush-react-native", @@ -300,6 +726,12 @@ "sourceRepoURL": "https://github.com/js-data/js-data", "asOfVersion": "3.0.0" }, + { + "libraryName": "JSData Http Adapter", + "typingsPackageName": "js-data-http", + "sourceRepoURL": "https://github.com/js-data/js-data-http", + "asOfVersion": "3.0.0" + }, { "libraryName": "JSNLog", "typingsPackageName": "jsnlog", @@ -312,6 +744,18 @@ "sourceRepoURL": "https://github.com/tdegrunt/jsonschema", "asOfVersion": "1.1.1" }, + { + "libraryName": "jsplumb", + "typingsPackageName": "jsplumb", + "sourceRepoURL": "https://github.com/jsplumb/jsPlumb", + "asOfVersion": "2.5.7" + }, + { + "libraryName": "keycloak-js", + "typingsPackageName": "keycloak-js", + "sourceRepoURL": "https://github.com/keycloak/keycloak", + "asOfVersion": "3.4.1" + }, { "libraryName": "knockout-paging", "typingsPackageName": "knockout-paging", @@ -324,12 +768,30 @@ "sourceRepoURL": "https://github.com/ErikSchierboom/knockout-pre-rendered", "asOfVersion": "0.7.1" }, + { + "libraryName": "koa-jwt", + "typingsPackageName": "koa-jwt", + "sourceRepoURL": "https://github.com/koajs/jwt", + "asOfVersion": "3.3.0" + }, { "libraryName": "lambda-phi", "typingsPackageName": "lambda-phi", "sourceRepoURL": "https://github.com/elitechance/lambda-phi", "asOfVersion": "1.0.1" }, + { + "libraryName": "ldclient-js", + "typingsPackageName": "ldclient-js", + "sourceRepoURL": "https://github.com/launchdarkly/js-client", + "asOfVersion": "1.1.11" + }, + { + "libraryName": "left-pad", + "typingsPackageName": "left-pad", + "sourceRepoURL": "https://github.com/stevemao/left-pad", + "asOfVersion": "1.2.0" + }, { "libraryName": "Linq.JS", "typingsPackageName": "linq", @@ -354,6 +816,12 @@ "sourceRepoURL": "https://github.com/steelsojka/lodash-decorators", "asOfVersion": "4.0.0" }, + { + "libraryName": "log4javascript", + "typingsPackageName": "log4javascript", + "sourceRepoURL": "http://log4javascript.org/", + "asOfVersion": "1.4.15" + }, { "libraryName": "log4js", "typingsPackageName": "log4js", @@ -384,6 +852,24 @@ "sourceRepoURL": "http://www.mendix.com", "asOfVersion": "0.8.1" }, + { + "libraryName": "metisMenu", + "typingsPackageName": "metismenu", + "sourceRepoURL": "https://github.com/onokumus/metisMenu", + "asOfVersion": "2.7.1" + }, + { + "libraryName": "microgears", + "typingsPackageName": "microgears", + "sourceRepoURL": "https://github.com/marcusdb/microgears", + "asOfVersion": "4.0.5" + }, + { + "libraryName": "mobile-detect", + "typingsPackageName": "mobile-detect", + "sourceRepoURL": "http://hgoebl.github.io/mobile-detect.js/", + "asOfVersion": "1.3.4" + }, { "libraryName": "mobservable", "typingsPackageName": "mobservable", @@ -402,6 +888,12 @@ "sourceRepoURL": "https://github.com/moment/moment", "asOfVersion": "2.13.0" }, + { + "libraryName": "Monk", + "typingsPackageName": "monk", + "sourceRepoURL": "https://github.com/LearnBoost/monk.git", + "asOfVersion": "6.0.0" + }, { "libraryName": "MQTT", "typingsPackageName": "mqtt", @@ -414,6 +906,12 @@ "sourceRepoURL": "https://github.com/esvit/ng-table", "asOfVersion": "2.0.1" }, + { + "libraryName": "node-pg-migrate", + "typingsPackageName": "node-pg-migrate", + "sourceRepoURL": "https://github.com/theoephraim/node-pg-migrate#readme", + "asOfVersion": "2.15.0" + }, { "libraryName": "Normalizr", "typingsPackageName": "normalizr", @@ -450,6 +948,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/pascal-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "passport-client-cert", + "typingsPackageName": "passport-client-cert", + "sourceRepoURL": "https://github.com/ripjar/passport-client-cert", + "asOfVersion": "2.1.0" + }, { "libraryName": "path-case", "typingsPackageName": "path-case", @@ -462,12 +966,30 @@ "sourceRepoURL": "https://github.com/pillarjs/path-to-regexp", "asOfVersion": "1.7.0" }, + { + "libraryName": "perfect-scrollbar", + "typingsPackageName": "perfect-scrollbar", + "sourceRepoURL": "https://github.com/noraesae/perfect-scrollbar", + "asOfVersion": "1.3.0" + }, + { + "libraryName": "pg-connection-string", + "typingsPackageName": "pg-connection-string", + "sourceRepoURL": "https://github.com/iceddev/pg-connection-string", + "asOfVersion": "2.0.0" + }, { "libraryName": "pg-promise", "typingsPackageName": "pg-promise", "sourceRepoURL": "https://github.com/vitaly-t/pg-promise", "asOfVersion": "5.4.3" }, + { + "libraryName": "phonegap-plugin-push", + "typingsPackageName": "phonegap-plugin-push", + "sourceRepoURL": "https://github.com/phonegap/phonegap-plugin-push", + "asOfVersion": "2.1.2" + }, { "libraryName": "pixi-spine", "typingsPackageName": "pixi-spine", @@ -480,18 +1002,36 @@ "sourceRepoURL": "https://github.com/PeculiarVentures/pkcs11js", "asOfVersion": "1.0.4" }, + { + "libraryName": "plottable", + "typingsPackageName": "plottable", + "sourceRepoURL": "http://plottablejs.org/", + "asOfVersion": "3.7.0" + }, { "libraryName": "poly2tri.js", "typingsPackageName": "poly2tri", "sourceRepoURL": "https://github.com/r3mi/poly2tri.js", "asOfVersion": "1.4.0" }, + { + "libraryName": "popper.js", + "typingsPackageName": "popper.js", + "sourceRepoURL": "https://github.com/FezVrasta/popper.js/", + "asOfVersion": "1.11.0" + }, { "libraryName": "Prando", "typingsPackageName": "prando", "sourceRepoURL": "https://github.com/zeh/prando", "asOfVersion": "1.0.0" }, + { + "libraryName": "ProtoBuf.js", + "typingsPackageName": "protobufjs", + "sourceRepoURL": "https://github.com/dcodeIO/ProtoBuf.js", + "asOfVersion": "6.0.0" + }, { "libraryName": "Protractor", "typingsPackageName": "protractor", @@ -504,6 +1044,12 @@ "sourceRepoURL": "https://github.com/qiniu/nodejs-sdk", "asOfVersion": "7.0.1" }, + { + "libraryName": "qrcode-generator", + "typingsPackageName": "qrcode-generator", + "sourceRepoURL": "https://github.com/kazuhikoarase/qrcode-generator", + "asOfVersion": "1.0.6" + }, { "libraryName": "Raven JS", "typingsPackageName": "raven-js", @@ -516,12 +1062,66 @@ "sourceRepoURL": "https://github.com/stream-utils/raw-body", "asOfVersion": "2.3.0" }, + { + "libraryName": "react-chartjs-2", + "typingsPackageName": "react-chartjs-2", + "sourceRepoURL": "https://github.com/gor181/react-chartjs-2", + "asOfVersion": "2.5.7" + }, { "libraryName": "react-day-picker", "typingsPackageName": "react-day-picker", "sourceRepoURL": "https://github.com/gpbl/react-day-picker", "asOfVersion": "5.3.0" }, + { + "libraryName": "react-flip-move", + "typingsPackageName": "react-flip-move", + "sourceRepoURL": "https://github.com/joshwcomeau/react-flip-move", + "asOfVersion": "2.9.12" + }, + { + "libraryName": "react-ga", + "typingsPackageName": "react-ga", + "sourceRepoURL": "https://github.com/react-ga/react-ga", + "asOfVersion": "2.3.0" + }, + { + "libraryName": "react-native-elements", + "typingsPackageName": "react-native-elements", + "sourceRepoURL": "https://github.com/react-native-training/react-native-elements", + "asOfVersion": "0.18.0" + }, + { + "libraryName": "react-native-goby", + "typingsPackageName": "react-native-goby", + "sourceRepoURL": "https://gitlab.com/MessageDream/react-native-goby", + "asOfVersion": "0.0.5" + }, + { + "libraryName": "react-native-google-analytics-bridge", + "typingsPackageName": "react-native-google-analytics-bridge", + "sourceRepoURL": "https://github.com/idehub/react-native-google-analytics-bridge", + "asOfVersion": "5.3.3" + }, + { + "libraryName": "react-native-modal", + "typingsPackageName": "react-native-modal", + "sourceRepoURL": "https://github.com/react-native-community/react-native-modal", + "asOfVersion": "4.1.1" + }, + { + "libraryName": "react-split-pane", + "typingsPackageName": "react-split-pane", + "sourceRepoURL": "https://github.com/tomkp/react-split-pane", + "asOfVersion": "0.1.67" + }, + { + "libraryName": "realm", + "typingsPackageName": "realm", + "sourceRepoURL": "https://github.com/realm/realm-js", + "asOfVersion": "1.13.0" + }, { "libraryName": "Redux", "typingsPackageName": "redux", @@ -534,6 +1134,12 @@ "sourceRepoURL": "https://github.com/tshelburne/redux-batched-actions", "asOfVersion": "0.1.5" }, + { + "libraryName": "react-bootstrap", + "typingsPackageName": "redux-bootstrap", + "sourceRepoURL": "https://github.com/remojansen/redux-bootstrap", + "asOfVersion": "1.1.0" + }, { "libraryName": "redux-devtools-extension", "typingsPackageName": "redux-devtools-extension", @@ -558,12 +1164,24 @@ "sourceRepoURL": "https://github.com/redux-saga/redux-saga", "asOfVersion": "0.10.5" }, + { + "libraryName": "redux-saga-routines", + "typingsPackageName": "redux-saga-routines", + "sourceRepoURL": "https://github.com/afitiskin/redux-saga-routines#readme", + "asOfVersion": "2.1.0" + }, { "libraryName": "Redux Thunk", "typingsPackageName": "redux-thunk", "sourceRepoURL": "https://github.com/gaearon/redux-thunk", "asOfVersion": "2.1.0" }, + { + "libraryName": "reflect-metadata", + "typingsPackageName": "reflect-metadata", + "sourceRepoURL": "https://github.com/rbuckton/ReflectDecorators", + "asOfVersion": "0.1.0" + }, { "libraryName": "reselect", "typingsPackageName": "reselect", @@ -588,6 +1206,12 @@ "sourceRepoURL": "https://github.com/router5/router5", "asOfVersion": "5.0.0" }, + { + "libraryName": "rvo2", + "typingsPackageName": "rvo2", + "sourceRepoURL": "https://github.com/TNOCS/rvo2", + "asOfVersion": "1.1.0" + }, { "libraryName": "samchon", "typingsPackageName": "samchon", @@ -624,36 +1248,102 @@ "sourceRepoURL": "https://github.com/blakeembrey/sentence-case", "asOfVersion": "1.1.3" }, + { + "libraryName": "sharp-timer", + "typingsPackageName": "sharp-timer", + "sourceRepoURL": "https://github.com/afractal/SharpTimer", + "asOfVersion": "0.1.3" + }, { "libraryName": "Shopify Prime", "typingsPackageName": "shopify-prime", "sourceRepoURL": "https://github.com/nozzlegear/shopify-prime", "asOfVersion": "2.0.0" }, + { + "libraryName": "should.js", + "typingsPackageName": "should", + "sourceRepoURL": "https://github.com/shouldjs/should.js", + "asOfVersion": "13.0.0" + }, { "libraryName": "SimpleSignal", "typingsPackageName": "simplesignal", "sourceRepoURL": "https://github.com/zeh/simplesignal", "asOfVersion": "1.0.0" }, + { + "libraryName": "smooth-scrollbar", + "typingsPackageName": "smooth-scrollbar", + "sourceRepoURL": "https://github.com/idiotWu/smooth-scrollbar", + "asOfVersion": "8.2.5" + }, + { + "libraryName": "Smoothie Charts", + "typingsPackageName": "smoothie", + "sourceRepoURL": "https://github.com/joewalnes/smoothie", + "asOfVersion": "1.29.1" + }, { "libraryName": "snake-case", "typingsPackageName": "snake-case", "sourceRepoURL": "https://github.com/blakeembrey/snake-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "soap", + "typingsPackageName": "soap", + "sourceRepoURL": "https://www.npmjs.com/package/soap", + "asOfVersion": "0.21.0" + }, + { + "libraryName": "source-map", + "typingsPackageName": "source-map", + "sourceRepoURL": "https://github.com/mozilla/source-map", + "asOfVersion": "0.5.7" + }, + { + "libraryName": "Spin.js", + "typingsPackageName": "spin.js", + "sourceRepoURL": "http://fgnass.github.com/spin.js/", + "asOfVersion": "3.0.0" + }, { "libraryName": "spotify-web-api-js", "typingsPackageName": "spotify-web-api-js", "sourceRepoURL": "https://github.com/JMPerez/spotify-web-api-js", "asOfVersion": "0.21.0" }, + { + "libraryName": "ServiceStack Utils", + "typingsPackageName": "ss-utils", + "sourceRepoURL": "https://servicestack.net/", + "asOfVersion": "0.1.5" + }, + { + "libraryName": "striptags", + "typingsPackageName": "striptags", + "sourceRepoURL": "https://github.com/ericnorris/striptags", + "asOfVersion": "3.1.1" + }, { "libraryName": "Sugar", "typingsPackageName": "sugar", "sourceRepoURL": "https://github.com/andrewplummer/Sugar", "asOfVersion": "2.0.2" }, + { + "libraryName": "survey-knockout", + "typingsPackageName": "survey-knockout", + "sourceRepoURL": "http://surveyjs.org/", + "asOfVersion": "0.10.0" + }, + { + "libraryName": "svg-pan-zoom", + "typingsPackageName": "svg-pan-zoom", + "sourceRepoURL": "https://github.com/ariutta/svg-pan-zoom", + "asOfVersion": "3.4.0" + }, { "libraryName": "svg.js", "typingsPackageName": "svg.js", @@ -666,6 +1356,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/swap-case", "asOfVersion": "1.1.2" }, + { + "libraryName": "SweetAlert", + "typingsPackageName": "sweetalert", + "sourceRepoURL": "https://github.com/t4t5/sweetalert/", + "asOfVersion": "2.0.4" + }, { "libraryName": "Tabris.js", "typingsPackageName": "tabris", @@ -678,6 +1374,12 @@ "sourceRepoURL": "http://gcanti.github.io/tcomb/guide/index.html", "asOfVersion": "2.6.0" }, + { + "libraryName": "timezonecomplete", + "typingsPackageName": "timezonecomplete", + "sourceRepoURL": "https://github.com/SpiritIT/timezonecomplete", + "asOfVersion": "5.5.0" + }, { "libraryName": "title-case", "typingsPackageName": "title-case", @@ -714,6 +1416,12 @@ "sourceRepoURL": "https://github.com/dpa99c/phonegap-istablet", "asOfVersion": "1.1.3" }, + { + "libraryName": "uk.co.workingedge.phonegap.plugin.launchnavigator", + "typingsPackageName": "uk.co.workingedge.phonegap.plugin.launchnavigator", + "sourceRepoURL": "https://github.com/dpa99c/phonegap-launch-navigator", + "asOfVersion": "4.0.0" + }, { "libraryName": "upper-case", "typingsPackageName": "upper-case", @@ -726,6 +1434,18 @@ "sourceRepoURL": "https://github.com/blakeembrey/upper-case-first", "asOfVersion": "1.1.2" }, + { + "libraryName": "UUID.js", + "typingsPackageName": "uuidjs", + "sourceRepoURL": "https://github.com/LiosK/UUID.js", + "asOfVersion": "3.6.0" + }, + { + "libraryName": "Validate.js", + "typingsPackageName": "validate.js", + "sourceRepoURL": "https://github.com/ansman/validate.js", + "asOfVersion": "0.11.0" + }, { "libraryName": "vso-node-api", "typingsPackageName": "vso-node-api", @@ -738,6 +1458,12 @@ "sourceRepoURL": "https://github.com/vuejs/vue", "asOfVersion": "2.0.0" }, + { + "libraryName": "vue-i18n", + "typingsPackageName": "vue-i18n", + "sourceRepoURL": "https://github.com/kazupon/vue-i18n", + "asOfVersion": "7.0.0" + }, { "libraryName": "vue-router", "typingsPackageName": "vue-router", @@ -750,12 +1476,42 @@ "sourceRepoURL": "https://github.com/tgdwyer/WebCola", "asOfVersion": "3.2.0" }, + { + "libraryName": "webgme", + "typingsPackageName": "webgme", + "sourceRepoURL": "https://webgme.org", + "asOfVersion": "2.11.0" + }, + { + "libraryName": "wolfy87-eventemitter", + "typingsPackageName": "wolfy87-eventemitter", + "sourceRepoURL": "https://github.com/Wolfy87/EventEmitter", + "asOfVersion": "5.2.0" + }, + { + "libraryName": "wonder-commonlib", + "typingsPackageName": "wonder-commonlib", + "sourceRepoURL": "https://github.com/yyc-git/Wonder-CommonLib", + "asOfVersion": "0.1.12" + }, + { + "libraryName": "wonder-frp", + "typingsPackageName": "wonder-frp", + "sourceRepoURL": "https://github.com/yyc-git/Wonder-FRP", + "asOfVersion": "0.1.25" + }, { "libraryName": "x2js", "typingsPackageName": "x2js", "sourceRepoURL": "https://code.google.com/p/x2js/", "asOfVersion": "3.1.0" }, + { + "libraryName": "xadesjs", + "typingsPackageName": "xadesjs", + "sourceRepoURL": "https://github.com/PeculiarVentures/xadesjs", + "asOfVersion": "2.0.2" + }, { "libraryName": "xlsx", "typingsPackageName": "xlsx", @@ -774,6 +1530,12 @@ "sourceRepoURL": "github.com/node-xmpp/node-xmpp/", "asOfVersion": "1.2.0" }, + { + "libraryName": "zetapush-js", + "typingsPackageName": "zetapush-js", + "sourceRepoURL": "https://github.com/zetapush/zetapush-js", + "asOfVersion": "3.1.2" + }, { "libraryName": "Zone.js", "typingsPackageName": "zone.js", diff --git a/types/absolute/tslint.json b/types/absolute/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/absolute/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/acc-wizard/tslint.json b/types/acc-wizard/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/acc-wizard/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/accepts/index.d.ts b/types/accepts/index.d.ts index 08ac71e919..33ee0db8a1 100644 --- a/types/accepts/index.d.ts +++ b/types/accepts/index.d.ts @@ -1,13 +1,14 @@ // Type definitions for accepts 1.3 // Project: https://github.com/jshttp/accepts // Definitions by: Stefan Reichel +// Brice BERNARD // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace accepts { - interface Headers { - [key: string]: string | string[]; - } +/// +import { IncomingMessage } from "http"; + +declare namespace accepts { interface Accepts { /** * Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned. @@ -55,6 +56,6 @@ declare namespace accepts { } } -declare function accepts(req: { headers: accepts.Headers }): accepts.Accepts; +declare function accepts(req: IncomingMessage): accepts.Accepts; export = accepts; diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index 456727756c..822c394a32 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -345,18 +345,47 @@ declare namespace AceAjax { insert(position: Position, text: string): any; /** - * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. - * @param row The index of the row to insert at - * @param lines An array of strings - **/ + * @deprecated Use the insertFullLines method instead. + */ insertLines(row: number, lines: string[]): any; /** - * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. - * @param position The position to insert at - **/ + * Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event. + * @param {Number} row The index of the row to insert at + * @param {Array} lines An array of strings + * @returns {Object} Contains the final row and column, like this: + * ``` + * {row: endRow, column: 0} + * ``` + * If `lines` is empty, this function returns an object containing the current row, and column, like this: + * ``` + * {row: row, column: 0} + * ``` + * + **/ + insertFullLines(row: number, lines: string[]): any; + + /** + * @deprecated Use insertMergedLines(position, ['', '']) instead. + */ insertNewLine(position: Position): any; + /** + * Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event. + * @param {Number} row The index of the row to insert at + * @param {Array} lines An array of strings + * @returns {Object} Contains the final row and column, like this: + * ``` + * {row: endRow, column: 0} + * ``` + * If `lines` is empty, this function returns an object containing the current row, and column, like this: + * ``` + * {row: row, column: 0} + * ``` + * + **/ + insertMergedLines(row: number, lines: string[]): any; + /** * Inserts `text` into the `position` at the current row. This method also triggers the `'change'` event. * @param position The position to insert at @@ -379,12 +408,19 @@ declare namespace AceAjax { removeInLine(row: number, startColumn: number, endColumn: number): any; /** - * Removes a range of full lines. This method also triggers the `'change'` event. - * @param firstRow The first row to be removed - * @param lastRow The last row to be removed - **/ + * @deprecated Use the removeFullLines method instead. + */ removeLines(firstRow: number, lastRow: number): string[]; + /** + * Removes a range of full lines. This method also triggers the `"change"` event. + * @param {Number} firstRow The first row to be removed + * @param {Number} lastRow The last row to be removed + * @returns {[String]} Returns all the removed lines. + * + **/ + removeFullLines(firstRow: number, lastRow: number): string[]; + /** * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * @param row The row to check @@ -474,9 +510,9 @@ declare namespace AceAjax { removeFold(arg: any): void; expandFold(arg: any): void; - + foldAll(startRow?: number, endRow?: number, depth?: number): void - + unfold(arg1: any, arg2: boolean): void; screenToDocumentColumn(row: number, column: number): void; @@ -2659,9 +2695,9 @@ declare namespace AceAjax { characterWidth: number; lineHeight: number; - + setScrollMargin(top:number, bottom:number, left: number, right: number): void; - + screenToTextCoordinates(left: number, top: number): void; /** diff --git a/types/ace/tslint.json b/types/ace/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ace/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/acl/tslint.json b/types/acl/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/acl/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/acorn/acorn-tests.ts b/types/acorn/acorn-tests.ts index 72ca71d2f6..7574df2481 100644 --- a/types/acorn/acorn-tests.ts +++ b/types/acorn/acorn-tests.ts @@ -1,13 +1,13 @@ import acorn = require('acorn'); import * as ESTree from 'estree'; -declare var token: acorn.Token; -declare var tokens: acorn.Token[]; -declare var comment: acorn.Comment; -declare var comments: acorn.Comment[]; -declare var program: ESTree.Program; -var any: any; -var string: string; +declare let token: acorn.Token; +declare let tokens: acorn.Token[]; +declare let comment: acorn.Comment; +declare let comments: acorn.Comment[]; +declare let program: ESTree.Program; +let any: any; +let string: string; // acorn string = acorn.version; @@ -32,16 +32,12 @@ const parser = new acorn.Parser({}, 'export default ""', 0); const node = new acorn.Node(parser, 1, 1); class LooseParser { - constructor(input: string, options = {}) { - - } + constructor(input: string, options = {}) {} // this means you can extend LooseParser - test() { - - } + test() {} } -acorn.addLooseExports(function () { +acorn.addLooseExports(() => { return { type: 'Program', sourceType: 'script', @@ -50,7 +46,7 @@ acorn.addLooseExports(function () { type: 'EmptyStatement' } ] - } + }; }, LooseParser, {}); acorn.parseExpressionAt('string', 2); @@ -63,8 +59,7 @@ acorn.isIdentifierChar(56); acorn.getLineInfo('string', 56); -acorn.plugins['test'] = function (p: acorn.Parser, config: any) { -} +acorn.plugins['test'] = (p: acorn.Parser, config: any) => {}; acorn.tokenizer('console.log("hello world)', {locations: true}).getToken(); acorn.tokenizer('console.log("hello world)', {locations: true})[Symbol.iterator]().next(); diff --git a/types/acorn/index.d.ts b/types/acorn/index.d.ts index ce7da6d368..5d02bd716c 100644 --- a/types/acorn/index.d.ts +++ b/types/acorn/index.d.ts @@ -1,10 +1,8 @@ -// Type definitions for Acorn v4.0.3 +// Type definitions for Acorn 4.0 // Project: https://github.com/marijnh/acorn // Definitions by: RReverser , e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - export as namespace acorn; export = acorn; import * as ESTree from 'estree'; @@ -181,7 +179,7 @@ declare namespace acorn { _typeof: TokenType; _void: TokenType; _delete: TokenType; - } + }; class TokContext { constructor(token: string, isExpr: boolean, preserveSpace: boolean, override: (p: Parser) => void); @@ -230,19 +228,18 @@ declare namespace acorn { const version: string; - interface IParse { - (input: string, options?: Options): ESTree.Program; - } + // TODO: rename type. + type IParse = (input: string, options?: Options) => ESTree.Program; const parse: IParse; function parseExpressionAt(input: string, pos?: number, options?: Options): ESTree.Expression; interface ITokenizer { - getToken() : Token, - [Symbol.iterator](): Iterator + getToken(): Token; + [Symbol.iterator](): Iterator; } - + function tokenizer(input: string, options: Options): ITokenizer; let parse_dammit: IParse | undefined; @@ -250,12 +247,10 @@ declare namespace acorn { let pluginsLoose: PluginsObject | undefined; interface ILooseParserClass { - new (input: string, options?: Options): ILooseParser + new (input: string, options?: Options): ILooseParser; } - interface ILooseParser { - - } + interface ILooseParser {} function addLooseExports(parse: IParse, parser: ILooseParserClass, plugins: PluginsObject): void; } diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json new file mode 100644 index 0000000000..2d05b8507c --- /dev/null +++ b/types/acorn/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "export-just-namespace": false, + "interface-name": false, + "no-empty-interface": false, + "no-unnecessary-class": false + } +} diff --git a/types/actioncable/tslint.json b/types/actioncable/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/actioncable/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/actions-on-google/NOTICE b/types/actions-on-google/NOTICE new file mode 100644 index 0000000000..262b08db36 --- /dev/null +++ b/types/actions-on-google/NOTICE @@ -0,0 +1,13 @@ +License Notices: + +The API definitions are from Actions on Google reference site [1] and actions-on-google library [2]. +The actions-on-google library is licensed under the Apache 2.0 License [3]. + +The code documentation is reproduced from work created and shared by Google [4] +and used according to terms described in the Creative Commons 3.0 Attribution License [5]. + +[1] https://developers.google.com/actions/ +[2] https://github.com/actions-on-google/actions-on-google-nodejs +[3] http://www.apache.org/licenses/LICENSE-2.0 +[4] https://developers.google.com/readme/policies/ +[5] http://creativecommons.org/licenses/by/3.0/ diff --git a/types/actions-on-google/actions-on-google-tests.ts b/types/actions-on-google/actions-on-google-tests.ts new file mode 100644 index 0000000000..e57e1e8d98 --- /dev/null +++ b/types/actions-on-google/actions-on-google-tests.ts @@ -0,0 +1,33 @@ +import { ActionsSdkApp, ActionsSdkAppOptions, DialogflowApp, DialogflowAppOptions, AssistantApp, + Responses, Transactions } from 'actions-on-google'; +import * as express from 'express'; + +function testActionsSdk(request: express.Request, response: express.Response) { + const app = new ActionsSdkApp({request, response}); + const actionMap = new Map(); + actionMap.set(app.StandardIntents.MAIN, () => { + const richResponse: Responses.RichResponse = app.buildRichResponse() + .addSimpleResponse('Hello world') + .addSuggestions(['foo', 'bar']); + app.ask(richResponse); + }); + app.handleRequest(actionMap); +} + +function testDialogflow(request: express.Request, response: express.Response) { + const app = new DialogflowApp({request, response}); + const actionMap = new Map(); + actionMap.set(app.StandardIntents.MAIN, () => { + const order: Transactions.Order = app.buildOrder('foo'); + app.askForTransactionDecision(order, { + type: app.Transactions.PaymentType.PAYMENT_CARD, + displayName: 'VISA-1234', + deliveryAddressRequired: true + }); + }); + app.handleRequest(actionMap); +} + +const expressApp = express(); +expressApp.get('/actionssdk', testActionsSdk); +expressApp.get('/dialogflow', testDialogflow); diff --git a/types/actions-on-google/actions-sdk-app.d.ts b/types/actions-on-google/actions-sdk-app.d.ts new file mode 100644 index 0000000000..afa422fad3 --- /dev/null +++ b/types/actions-on-google/actions-sdk-app.d.ts @@ -0,0 +1,427 @@ +import * as express from 'express'; + +import { AssistantApp } from './assistant-app'; +import { Carousel, List, RichResponse, SimpleResponse } from './response-builder'; + +// --------------------------------------------------------------------------- +// Actions SDK support +// --------------------------------------------------------------------------- + +export interface ActionsSdkAppOptions { + /** Express HTTP request object. */ + request: express.Request; + /** Express HTTP response object. */ + response: express.Response; + /** Function callback when session starts. */ + sessionStarted?(): any; +} + +/** + * This is the class that handles the conversation API directly from Assistant, + * providing implementation for all the methods available in the API. + */ +export class ActionsSdkApp extends AssistantApp { + /** + * Constructor for ActionsSdkApp object. + * To be used in the Actions SDK HTTP endpoint logic. + * + * @example + * const ActionsSdkApp = require('actions-on-google').ActionsSdkApp; + * const app = new ActionsSdkApp({request: request, response: response, + * sessionStarted:sessionStarted}); + * + * @actionssdk + */ + constructor(options: ActionsSdkAppOptions); + + /** + * @deprecated + * Validates whether request is from Assistant through signature verification. + * Uses Google-Auth-Library to verify authorization token against given + * Google Cloud Project ID. Auth token is given in request header with key, + * "Authorization". + * + * @example + * const app = new ActionsSdkApp({request, response}); + * app.isRequestFromAssistant('nodejs-cloud-test-project-1234') + * .then(() => { + * app.ask('Hey there, thanks for stopping by!'); + * }) + * .catch(err => { + * response.status(400).send(); + * }); + * + * @param projectId Google Cloud Project ID for the Assistant app. + * @return Promise resolving with google-auth-library LoginTicket + * if request is from a valid source, otherwise rejects with the error reason + * for an invalid token. + * @actionssdk + */ + isRequestFromAssistant(projectId: string): Promise; + + /** + * Validates whether request is from Google through signature verification. + * Uses Google-Auth-Library to verify authorization token against given + * Google Cloud Project ID. Auth token is given in request header with key, + * "Authorization". + * + * @example + * const app = new ActionsSdkApp({request, response}); + * app.isRequestFromGoogle('nodejs-cloud-test-project-1234') + * .then(() => { + * app.ask('Hey there, thanks for stopping by!'); + * }) + * .catch(err => { + * response.status(400).send(); + * }); + * + * @param projectId Google Cloud Project ID for the Assistant app. + * @return Promise resolving with google-auth-library LoginTicket + * if request is from a valid source, otherwise rejects with the error reason + * for an invalid token. + * @actionssdk + */ + isRequestFromGoogle(projectId: string): Promise; + + /** + * Gets the request Conversation API version. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * const apiVersion = app.getApiVersion(); + * + * @return Version value or null if no value. + * @actionssdk + */ + getApiVersion(): string; + + /** + * Gets the user's raw input query. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * app.tell('You said ' + app.getRawInput()); + * + * @return User's raw query or null if no value. + * @actionssdk + */ + getRawInput(): string; + + /** + * Gets previous JSON dialog state that the app sent to Assistant. + * Alternatively, use the app.data field to store JSON values between requests. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * const dialogState = app.getDialogState(); + * + * @return JSON object provided to the Assistant in the previous + * user turn or {} if no value. + * @actionssdk + */ + getDialogState(): any; + + /** + * Gets the "versionLabel" specified inside the Action Package. + * Used by app to do version control. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * const actionVersionLabel = app.getActionVersionLabel(); + * + * @return The specified version label or null if unspecified. + * @actionssdk + */ + getActionVersionLabel(): string; + + /** + * Gets the unique conversation ID. It's a new ID for the initial query, + * and stays the same until the end of the conversation. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * const conversationId = app.getConversationId(); + * + * @return Conversation ID or null if no value. + * @actionssdk + */ + getConversationId(): string; + + /** + * Get the current intent. Alternatively, using a handler Map with + * {@link AssistantApp#handleRequest|handleRequest}, the client library will + * automatically handle the incoming intents. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * + * function responseHandler (app) { + * const intent = app.getIntent(); + * switch (intent) { + * case app.StandardIntents.MAIN: + * const inputPrompt = app.buildInputPrompt(false, 'Welcome to action snippets! Say anything.'); + * app.ask(inputPrompt); + * break; + * + * case app.StandardIntents.TEXT: + * app.tell('You said ' + app.getRawInput()); + * break; + * } + * } + * + * app.handleRequest(responseHandler); + * + * @return Intent id or null if no value. + * @actionssdk + */ + getIntent(): string; + + /** + * Get the argument value by name from the current intent. If the argument + * is not a text argument, the entire argument object is returned. + * + * Note: If incoming request is using an API version under 2 (e.g. 'v1'), + * the argument object will be in Proto2 format (snake_case, etc). + * + * @param argName Name of the argument. + * @return Argument value matching argName + * or null if no matching argument. + * @actionssdk + */ + getArgument(argName: string): string; + + /** + * Returns the option key user chose from options response. + * + * @example + * const app = new App({request: req, response: res}); + * + * function pickOption (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askWithCarousel('Which of these looks good?', + * app.buildCarousel().addItems( + * app.buildOptionItem('another_choice', ['Another choice']). + * setTitle('Another choice').setDescription('Choose me!'))); + * } else { + * app.ask('What would you like?'); + * } + * } + * + * function optionPicked (app) { + * app.ask('You picked ' + app.getSelectedOption()); + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.TEXT, pickOption); + * actionMap.set(app.StandardIntents.OPTION, optionPicked); + * + * app.handleRequest(actionMap); + * + * @return Option key of selected item. Null if no option selected or + * if current intent is not OPTION intent. + * @actionssdk + */ + getSelectedOption(): string; + + /** + * Asks to collect user's input; all user's queries need to be sent to the app. + * {@link https://developers.google.com/actions/policies/general-policies#user_experience| + * The guidelines when prompting the user for a response must be followed at all times}. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * + * const noInputs = [ + * `I didn't hear a number`, + * `If you're still there, what's the number?`, + * 'What is the number?' + * ]; + * + * function mainIntent (app) { + * const ssml = 'Hi! ' + + * 'I can read out an ordinal like ' + + * '123. Say a number.'; + * const inputPrompt = app.buildInputPrompt(true, ssml, noInputs); + * app.ask(inputPrompt); + * } + * + * function rawInput (app) { + * if (app.getRawInput() === 'bye') { + * app.tell('Goodbye!'); + * } else { + * const ssml = 'You said, ' + + * app.getRawInput() + ''; + * const inputPrompt = app.buildInputPrompt(true, ssml, noInputs); + * app.ask(inputPrompt); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, mainIntent); + * actionMap.set(app.StandardIntents.TEXT, rawInput); + * + * app.handleRequest(actionMap); + * + * @param inputPrompt Holding initial and + * no-input prompts. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by App. + * @return The response that is sent to Assistant to ask user to provide input. + * @actionssdk + */ + ask(inputPrompt: object | SimpleResponse | RichResponse, dialogState?: object): express.Response | null; + + /** + * Asks to collect user's input with a list. + * + * @example + * const app = new ActionsSdkApp({request, response}); + * + * function welcomeIntent (app) { + * app.askWithList('Which of these looks good?', + * app.buildList('List title') + * .addItems([ + * app.buildOptionItem(SELECTION_KEY_ONE, + * ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2']) + * .setTitle('Number one'), + * app.buildOptionItem(SELECTION_KEY_TWO, + * ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2']) + * .setTitle('Number two'), + * ])); + * } + * + * function optionIntent (app) { + * if (app.getSelectedOption() === SELECTION_KEY_ONE) { + * app.tell('Number one is a great choice!'); + * } else { + * app.tell('Number two is a great choice!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.TEXT, welcomeIntent); + * actionMap.set(app.StandardIntents.OPTION, optionIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt Holding initial and + * no-input prompts. Cannot contain basic card. + * @param list List built with {@link AssistantApp#buildList|buildList}. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return The response that is sent to Assistant to ask user to provide input. + * @actionssdk + */ + askWithList(inputPrompt: object | SimpleResponse | RichResponse, list: List, dialogState?: object): express.Response | null; + + /** + * Asks to collect user's input with a carousel. + * + * @example + * const app = new ActionsSdkApp({request, response}); + * + * function welcomeIntent (app) { + * app.askWithCarousel('Which of these looks good?', + * app.buildCarousel() + * .addItems([ + * app.buildOptionItem(SELECTION_KEY_ONE, + * ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2']) + * .setTitle('Number one'), + * app.buildOptionItem(SELECTION_KEY_TWO, + * ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2']) + * .setTitle('Number two'), + * ])); + * } + * + * function optionIntent (app) { + * if (app.getSelectedOption() === SELECTION_KEY_ONE) { + * app.tell('Number one is a great choice!'); + * } else { + * app.tell('Number two is a great choice!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.TEXT, welcomeIntent); + * actionMap.set(app.StandardIntents.OPTION, optionIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt Holding initial and + * no-input prompts. Cannot contain basic card. + * @param carousel Carousel built with + * {@link AssistantApp#buildCarousel|buildCarousel}. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return The response that is sent to Assistant to ask user to provide input. + * @actionssdk + */ + askWithCarousel(inputPrompt: object | SimpleResponse | RichResponse, carousel: Carousel, dialogState?: object): express.Response | null; + + /** + * Tells Assistant to render the speech response and close the mic. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * + * const noInputs = [ + * `I didn't hear a number`, + * `If you're still there, what's the number?`, + * 'What is the number?' + * ]; + * + * function mainIntent (app) { + * const ssml = 'Hi! ' + + * 'I can read out an ordinal like ' + + * '123. Say a number.'; + * const inputPrompt = app.buildInputPrompt(true, ssml, noInputs); + * app.ask(inputPrompt); + * } + * + * function rawInput (app) { + * if (app.getRawInput() === 'bye') { + * app.tell('Goodbye!'); + * } else { + * const ssml = 'You said, ' + + * app.getRawInput() + ''; + * const inputPrompt = app.buildInputPrompt(true, ssml, noInputs); + * app.ask(inputPrompt); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, mainIntent); + * actionMap.set(app.StandardIntents.TEXT, rawInput); + * + * app.handleRequest(actionMap); + * + * @param textToSpeech Final response. + * Spoken response can be SSML. + * @return The HTTP response that is sent back to Assistant. + * @actionssdk + */ + tell(textToSpeech: string | SimpleResponse | RichResponse): express.Response | null; + + /** + * Builds the {@link https://developers.google.com/actions/reference/conversation#InputPrompt|InputPrompt object} + * from initial prompt and no-input prompts. + * + * The App needs one initial prompt to start the conversation. If there is no user response, + * the App re-opens the mic and renders the no-input prompts three times + * (one for each no-input prompt that was configured) to help the user + * provide the right response. + * + * Note: we highly recommend app to provide all the prompts required here in order to ensure a + * good user experience. + * + * @example + * const inputPrompt = app.buildInputPrompt(false, 'Welcome to action snippets! Say a number.', + * ['Say any number', 'Pick a number', 'What is the number?']); + * app.ask(inputPrompt); + * + * @param isSsml Indicates whether the text to speech is SSML or not. + * @param initialPrompt The initial prompt the App asks the user. + * @param noInputs Array of re-prompts when the user does not respond (max 3). + * @return. + * @actionssdk + */ + buildInputPrompt(isSsml: boolean, initialPrompt: string, noInputs?: string[]): object; +} diff --git a/types/actions-on-google/assistant-app.d.ts b/types/actions-on-google/assistant-app.d.ts new file mode 100644 index 0000000000..58d933baf2 --- /dev/null +++ b/types/actions-on-google/assistant-app.d.ts @@ -0,0 +1,1545 @@ +import * as express from 'express'; + +import { BasicCard, Carousel, ImageDisplays, List, OptionItem, RichResponse } from './response-builder'; +import { ActionPaymentTransactionConfig, Cart, GooglePaymentTransactionConfig, LineItem, + Location, Order, OrderUpdate, TransactionDecision, TransactionValues } from './transactions'; + +// +// Note: These enums are exported due to limitations with Typescript and this +// library. If you try to import and access them they'll end up null at runtime. +// Either access them through an AssistantApp instance or AssistantApp.prototype. +// + +/** + * List of standard intents that the app provides. + * @actionssdk + * @dialogflow + */ +export enum StandardIntents { + /** App fires MAIN intent for queries like [talk to $app]. */ + MAIN, + /** App fires TEXT intent when action issues ask intent. */ + TEXT, + /** App fires PERMISSION intent when action invokes askForPermission. */ + PERMISSION, + /** App fires OPTION intent when user chooses from options provided. */ + OPTION, + /** App fires TRANSACTION_REQUIREMENTS_CHECK intent when action sets up transaction. */ + TRANSACTION_REQUIREMENTS_CHECK, + /** App fires DELIVERY_ADDRESS intent when action asks for delivery address. */ + DELIVERY_ADDRESS, + /** App fires TRANSACTION_DECISION intent when action asks for transaction decision. */ + TRANSACTION_DECISION, + /** App fires CONFIRMATION intent when requesting affirmation from user. */ + CONFIRMATION, + /** App fires DATETIME intent when requesting date/time from user. */ + DATETIME, + /** App fires SIGN_IN intent when requesting sign-in from user. */ + SIGN_IN, + /** App fires NO_INPUT intent when user doesn't provide input. */ + NO_INPUT, + /** App fires CANCEL intent when user exits app mid-dialog. */ + CANCEL, + /** App fires NEW_SURFACE intent when requesting handoff to a new surface from user. */ + NEW_SURFACE, + /** App fires REGISTER_UPDATE intent when requesting user to register for proactive updates. */ + REGISTER_UPDATE, + /** App receives CONFIGURE_UPDATES intent to indicate a REGISTER_UPDATE intent should be sent. */ + CONFIGURE_UPDATES +} + +/** + * List of supported permissions the app supports. + * @actionssdk + * @dialogflow + */ +export enum SupportedPermissions { + /** + * The user's name as defined in the + * {@link https://developers.google.com/actions/reference/conversation#UserProfile|UserProfile object} + */ + NAME, + /** + * The location of the user's current device, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Location|Location object}. + */ + DEVICE_PRECISE_LOCATION, + /** + * City and zipcode corresponding to the location of the user's current device, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Location|Location object}. + */ + DEVICE_COARSE_LOCATION, + /** + * Confirmation to receive proactive content at any time from the app. + */ + UPDATE +} + +/** + * List of built-in argument names. + * @actionssdk + * @dialogflow + */ +export enum BuiltInArgNames { + /** + * Permission granted argument. + */ + PERMISSION_GRANTED, + /** + * Option selected argument. + */ + OPTION, + /** + * Transaction requirements check result argument. + */ + TRANSACTION_REQ_CHECK_RESULT, + /** + * Delivery address value argument. + */ + DELIVERY_ADDRESS_VALUE, + /** + * Transactions decision argument. + */ + TRANSACTION_DECISION_VALUE, + /** + * Confirmation argument. + */ + CONFIRMATION, + /** + * DateTime argument. + */ + DATETIME, + /** + * Sign in status argument. + */ + SIGN_IN, + /** + * Reprompt count for consecutive NO_INPUT intents. + */ + REPROMPT_COUNT, + /** + * Flag representing finality of NO_INPUT intent. + */ + IS_FINAL_REPROMPT, + /** + * New surface value argument. + */ + NEW_SURFACE, + /** Update registration value argument. */ + REGISTER_UPDATE +} + +/** + * List of possible conversation stages, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}. + * @actionssdk + * @dialogflow + * @deprecated Use {@link ConversationTypes} instead. + */ +export type ConversationStages = ConversationTypes; + +/** + * List of possible conversation types, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}. + * @actionssdk + * @dialogflow + */ +export enum ConversationTypes { + /** + * Unspecified conversation state. + */ + UNSPECIFIED, + /** + * A new conversation. + */ + NEW, + /** + * An active (ongoing) conversation. + */ + ACTIVE, +} + +/** + * List of surface capabilities supported by the app. + * @actionssdk + * @dialogflow + */ +export enum SurfaceCapabilities { + /** + * The ability to output audio. + */ + AUDIO_OUTPUT, + /** + * The ability to output on a screen + */ + SCREEN_OUTPUT, +} + +/** + * List of possible user input types. + * @actionssdk + * @dialogflow + */ +export enum InputTypes { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Input given by touch. + */ + TOUCH, + /** + * Input given by voice (spoken). + */ + VOICE, + /** + * Input given by keyboard (typed). + */ + KEYBOARD +} + +/** + * List of possible sign in result status values. + * @actionssdk + * @dialogflow + */ +export enum SignInStatus { + /** + * Unknown status. + */ + UNSPECIFIED, + /** + * User successfully completed the account linking. + */ + OK, + /** + * Cancelled or dismissed account linking. + */ + CANCELLED, + /** + * System or network error. + */ + ERROR +} + +/** + * Possible update trigger time context frequencies. + */ +export enum TimeContextFrequency { + DAILY +} + +/** + * User provided date/time info. + */ +export interface DateTime { + date: { + year: number; + month: number; + day: number; + }; + time: { + hours: number; + minutes: number; + seconds: number; + nanos: number; + }; +} + +/** + * User's permissioned name info. + */ +export interface UserName { + /** User's display name. */ + displayName: string; + /** User's given name. */ + givenName: string; + /** User's family name. */ + familyName: string; +} + +/** + * User's permissioned device location. + */ +export interface DeviceLocation { + /** {latitude, longitude}. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ + coordinates: object; + /** Full, formatted street address. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ + address: string; + /** Zip code. Requested with SupportedPermissions.DEVICE_COARSE_LOCATION. */ + zipCode: string; + /** Device city. Requested with SupportedPermissions.DEVICE_COARSE_LOCATION. */ + city: string; +} + +/** + * User object. + */ +export interface User { + /** Random string ID for Google user. */ + userId: string; + /** + * User name information. Null if not requested with + * {@link AssistantApp#askForPermission|askForPermission(SupportedPermissions.NAME)}. + */ + userName: UserName; + /** Unique Oauth2 token. Only available with account linking. */ + accessToken: string; + /** + * Timestamp for the last access from the user. + * Retrieve using app.getLastSeen() to get a Date object or null if never seen. + */ + lastSeen: string; + /** + * A string persistent across sessions. + * Retrieved and set using app.userStorage which allows you to store it like an JSON object + * which is abstracted for convenience by the client library. + */ + userStorage: string; +} + +/** + * Actions on Google Surface. + */ +export interface Surface { + /** Capabilities of the surface. */ + capabilities: Capability[]; +} + +/** + * Surface capability. + */ +export interface Capability { + /** Name of the capability. */ + name: SurfaceCapabilities; +} + +/** + * Intent Argument. For incoming intents, the argument value can be retrieved + * using {@link AssistantApp#getArgument}. + */ +export interface IntentArgument { + /** Name of the argument. */ + name: string; + /** Text value of the argument. */ + textValue: string; +} + +/** + * The Actions on Google client library AssistantApp base class. + * + * This class contains the methods that are shared between platforms to support the conversation API + * protocol from Assistant. It also exports the 'State' class as a helper to represent states by + * name. + */ +export class AssistantApp { + /** + * The session state. + */ + state: string; + + /** + * The session data in JSON format. + */ + data: object; + + /** + * The data persistent across sessions in JSON format. + * It exists in the same context as getUser().userId + * + * @example + * // Actions SDK + * const app = new ActionsSdkApp({request: request, response: response}); + * app.userStorage.someProperty = 'someValue'; + * // Dialogflow + * const app = new DialogflowApp({request: request, response: response}); + * app.userStorage.someProperty = 'someValue'; + */ + userStorage: object; + + /** + * List of standard intents that the app provides. + * @actionssdk + * @dialogflow + */ + readonly StandardIntents: typeof StandardIntents; + + /** + * List of supported permissions the app supports. + * @actionssdk + * @dialogflow + */ + readonly SupportedPermissions: typeof SupportedPermissions; + + /** + * List of built-in argument names. + * @actionssdk + * @dialogflow + */ + readonly BuiltInArgNames: typeof BuiltInArgNames; + + /** + * List of possible conversation stages, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}. + * @actionssdk + * @dialogflow + * @deprecated Use {@link ConversationTypes} instead. + */ + readonly ConversationStages: typeof ConversationTypes; + + /** + * List of possible conversation types, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}. + * @actionssdk + * @dialogflow + */ + readonly ConversationTypes: typeof ConversationTypes; + + /** + * List of surface capabilities supported by the app. + * @actionssdk + * @dialogflow + */ + readonly SurfaceCapabilities: typeof SurfaceCapabilities; + + /** + * List of possible user input types. + * @actionssdk + * @dialogflow + */ + readonly InputTypes: typeof InputTypes; + + /** + * List of possible sign in result status values. + * @actionssdk + * @dialogflow + */ + readonly SignInStatus: typeof SignInStatus; + + /** + * Values related to supporting {@link ImageDisplays}. + */ + readonly ImageDisplays: typeof ImageDisplays; + + /** + * Values related to supporting {@link Transactions}. + */ + readonly Transactions: typeof TransactionValues; + + /** + * Possible update trigger time context frequencies. + */ + readonly TimeContextFrequency: typeof TimeContextFrequency; + + // --------------------------------------------------------------------------- + // Public APIs + // --------------------------------------------------------------------------- + + /** + * Handles the incoming Assistant request using a handler or Map of handlers. + * Each handler can be a function callback or Promise. + * + * @example + * // Actions SDK + * const app = new ActionsSdkApp({request: request, response: response}); + * + * const noInputs = [ + * `I didn't hear a number`, + * `If you're still there, what's the number?`, + * 'What is the number?' + * ]; + * + * function mainIntent (app) { + * const ssml = 'Hi! ' + + * 'I can read out an ordinal like ' + + * '123. Say a number.'; + * const inputPrompt = app.buildInputPrompt(true, ssml, noInputs); + * app.ask(inputPrompt); + * } + * + * function rawInput (app) { + * if (app.getRawInput() === 'bye') { + * app.tell('Goodbye!'); + * } else { + * const ssml = 'You said, ' + + * app.getRawInput() + ''; + * const inputPrompt = app.buildInputPrompt(true, ssml, noInputs); + * app.ask(inputPrompt); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, mainIntent); + * actionMap.set(app.StandardIntents.TEXT, rawInput); + * + * app.handleRequest(actionMap); + * + * // Dialogflow + * const app = new DialogflowApp({request: req, response: res}); + * const NAME_ACTION = 'make_name'; + * const COLOR_ARGUMENT = 'color'; + * const NUMBER_ARGUMENT = 'number'; + * + * function makeName (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * const color = app.getArgument(COLOR_ARGUMENT); + * app.tell('Alright, your silly name is ' + + * color + ' ' + number + + * '! I hope you like it. See you next time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(NAME_ACTION, makeName); + * app.handleRequest(actionMap); + * + * @param handler The handler (or Map of handlers) for the request. + * @actionssdk + * @dialogflow + */ + handleRequest(handler: ((app: AssistantApp) => any) | (Map any>)): void; + + /** + * Asynchronously handles the incoming Assistant request using a handler or Map of handlers. + * Each handler can be a function callback or Promise. + * + * @example + * // Actions SDK + * const app = new ActionsSdkApp({request: request, response: response}); + * + * const noInputs = [ + * `I didn't hear a number`, + * `If you're still there, what's the number?`, + * 'What is the number?' + * ]; + * + * function mainIntent (app) { + * const ssml = 'Hi! ' + + * 'I can read out an ordinal like ' + + * '123. Say a number.'; + * const inputPrompt = app.buildInputPrompt(true, ssml, noInputs); + * app.ask(inputPrompt); + * } + * + * function rawInput (app) { + * if (app.getRawInput() === 'bye') { + * app.tell('Goodbye!'); + * } else { + * const ssml = 'You said, ' + + * app.getRawInput() + ''; + * const inputPrompt = app.buildInputPrompt(true, ssml, noInputs); + * app.ask(inputPrompt); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, mainIntent); + * actionMap.set(app.StandardIntents.TEXT, rawInput); + * + * app.handleRequestAsync(actionMap) + * .then( + * (result) => { + * // handle the result + * }) + * .catch( + * (reason) => { + * // handle an error + * }); + * + * // Dialogflow + * const app = new DialogflowApp({request: req, response: res}); + * const NAME_ACTION = 'make_name'; + * const COLOR_ARGUMENT = 'color'; + * const NUMBER_ARGUMENT = 'number'; + * + * function makeName (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * const color = app.getArgument(COLOR_ARGUMENT); + * app.tell('Alright, your silly name is ' + + * color + ' ' + number + + * '! I hope you like it. See you next time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(NAME_ACTION, makeName); + * + * app.handleRequestAsync(actionMap) + * .then( + * (result) => { + * // handle the result + * }) + * .catch( + * (reason) => { + * // handle an error + * }); + * + * @param handler The handler (or Map of handlers) for the request. + * @return Promise to resolve the result of the handler that was invoked. + * @actionssdk + * @dialogflow + */ + handleRequestAsync(handler: ((app: AssistantApp) => any) | (Map any>)): Promise; + + /** + * Equivalent to {@link AssistantApp#askForPermission|askForPermission}, + * but allows you to prompt the user for more than one permission at once. + * + * Notes: + * + * * The order in which you specify the permission prompts does not matter - + * it is controlled by the Assistant to provide a consistent user experience. + * * The user will be able to either accept all permissions at once, or none. + * If you wish to allow them to selectively accept one or other, make several + * dialog turns asking for each permission independently with askForPermission. + * * Asking for DEVICE_COARSE_LOCATION and DEVICE_PRECISE_LOCATION at once is + * equivalent to just asking for DEVICE_PRECISE_LOCATION + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * const REQUEST_PERMISSION_ACTION = 'request_permission'; + * const GET_RIDE_ACTION = 'get_ride'; + * + * function requestPermission (app) { + * const permission = [ + * app.SupportedPermissions.NAME, + * app.SupportedPermissions.DEVICE_PRECISE_LOCATION + * ]; + * app.askForPermissions('To pick you up', permissions); + * } + * + * function sendRide (app) { + * if (app.isPermissionGranted()) { + * const displayName = app.getUserName().displayName; + * const address = app.getDeviceLocation().address; + * app.tell('I will tell your driver to pick up ' + displayName + + * ' at ' + address); + * } else { + * // Response shows that user did not grant permission + * app.tell('Sorry, I could not figure out where to pick you up.'); + * } + * } + * const actionMap = new Map(); + * actionMap.set(REQUEST_PERMISSION_ACTION, requestPermission); + * actionMap.set(GET_RIDE_ACTION, sendRide); + * app.handleRequest(actionMap); + * + * @param context Context why the permission is being asked; it's the TTS + * prompt prefix (action phrase) we ask the user. + * @param permissions Array of permissions App supports, each of + * which comes from AssistantApp.SupportedPermissions. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return A response is sent to Assistant to ask for the user's permission. + * For any invalid input, we return null. + * @actionssdk + * @dialogflow + */ + askForPermissions(context: string, permissions: string[], dialogState?: object): express.Response | null; + + /** + * Prompts the user for permission to send proactive updates at any time. + * + * @example + * const app = new DialogflowApp({request, response}); + * const REQUEST_PERMISSION_ACTION = 'request.permission'; + * const PERMISSION_REQUESTED = 'permission.requested'; + * const SHOW_IMAGE = 'show.image'; + * + * function requestPermission (app) { + * app.askForUpdatePermission('show.image', [ + * { + * name: 'image_to_show', + * textValue: 'image_type_1' + * } + * ]); + * } + * + * function checkPermission (app) { + * if (app.isPermissionGranted()) { + * app.tell(`Great, I'll send an update whenever I notice a change`); + * } else { + * // Response shows that user did not grant permission + * app.tell('Alright, just let me know whenever you need the weather!'); + * } + * } + * + * function showImage (app) { + * showPicture(app.getArgument('image_to_show')); + * } + * + * const actionMap = new Map(); + * actionMap.set(REQUEST_PERMISSION_ACTION, requestPermission); + * actionMap.set(PERMISSION_REQUESTED, checkPermission); + * actionMap.set(SHOW_IMAGE, showImage); + * app.handleRequest(actionMap); + * + * @param intent If using Dialogflow, the action name of the intent + * to be triggered when the update is received. If using Actions SDK, the + * intent name to be triggered when the update is received. + * @param intentArguments The necessary arguments + * to fulfill the intent triggered on update. These can be retrieved using + * {@link AssistantApp#getArgument}. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return A response is sent to Assistant to ask for the user's permission. + * For any invalid input, we return null. + * @actionssdk + * @dialogflow + */ + askForUpdatePermission(intent: string, intentArguments: IntentArgument[], dialogState?: object): express.Response | null; + + /** + * Checks whether user is in transactable state. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const TXN_REQ_COMPLETE = 'txn.req.complete'; + * + * let transactionConfig = { + * deliveryAddressRequired: false, + * type: app.Transactions.PaymentType.BANK, + * displayName: 'Checking-1234' + * }; + * function welcomeIntent (app) { + * app.askForTransactionRequirements(transactionConfig); + * } + * + * function txnReqCheck (app) { + * if (app.getTransactionRequirementsResult() === app.Transactions.ResultType.OK) { + * // continue cart building flow + * } else { + * // don't continue cart building + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(TXN_REQ_COMPLETE, txnReqCheck); + * app.handleRequest(actionMap); + * + * @param + * transactionConfig Configuration for the transaction. Includes payment + * options and order options. Optional if order has no payment or + * delivery. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForTransactionRequirements(transactionConfig?: ActionPaymentTransactionConfig | GooglePaymentTransactionConfig, dialogState?: object): express.Response | null; + + /** + * Asks user to confirm transaction information. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const TXN_COMPLETE = 'txn.complete'; + * + * let transactionConfig = { + * deliveryAddressRequired: false, + * type: app.Transactions.PaymentType.BANK, + * displayName: 'Checking-1234' + * }; + * + * let order = app.buildOrder(); + * // fill order cart + * + * function welcomeIntent (app) { + * app.askForTransaction(order, transactionConfig); + * } + * + * function txnComplete (app) { + * // respond with order update + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(TXN_COMPLETE, txnComplete); + * app.handleRequest(actionMap); + * + * @param order Order built with buildOrder(). + * @param + * transactionConfig Configuration for the transaction. Includes payment + * options and order options. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response + * @dialogflow + */ + askForTransactionDecision(order: Order, transactionConfig: ActionPaymentTransactionConfig | GooglePaymentTransactionConfig, dialogState?: object): express.Response | null; + + /** + * Asks the Assistant to guide the user to grant a permission. For example, + * if you want your app to get access to the user's name, you would invoke + * the askForPermission method with a context containing the reason for the request, + * and the AssistantApp.SupportedPermissions.NAME permission. With this, the Assistant will ask + * the user, in your agent's voice, the following: '[Context with reason for the request], + * I'll just need to get your name from Google, is that OK?'. + * + * Once the user accepts or denies the request, the Assistant will fire another intent: + * app.StandardIntents.PERMISSION with a boolean argument: app.BuiltInArgNames.PERMISSION_GRANTED + * and, if granted, the information that you requested. + * + * Read more: + * + * * {@link https://developers.google.com/actions/reference/conversation#ExpectedIntent| + * Supported Permissions} + * * Check if the permission has been granted with + * {@link AssistantApp#isPermissionGranted|isPermissionsGranted} + * * {@link AssistantApp#getDeviceLocation|getDeviceLocation} + * * {@link AssistantApp#getUserName|getUserName} + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * const REQUEST_PERMISSION_ACTION = 'request_permission'; + * const GET_RIDE_ACTION = 'get_ride'; + * + * function requestPermission (app) { + * const permission = app.SupportedPermissions.NAME; + * app.askForPermission('To pick you up', permission); + * } + * + * function sendRide (app) { + * if (app.isPermissionGranted()) { + * const displayName = app.getUserName().displayName; + * app.tell('I will tell your driver to pick up ' + displayName); + * } else { + * // Response shows that user did not grant permission + * app.tell('Sorry, I could not figure out who to pick up.'); + * } + * } + * const actionMap = new Map(); + * actionMap.set(REQUEST_PERMISSION_ACTION, requestPermission); + * actionMap.set(GET_RIDE_ACTION, sendRide); + * app.handleRequest(actionMap); + * + * @param context Context why permission is asked; it's the TTS + * prompt prefix (action phrase) we ask the user. + * @param permission One of the permissions Assistant supports, each of + * which comes from AssistantApp.SupportedPermissions. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return A response is sent to the Assistant to ask for the user's permission; + * for any invalid input, we return null. + * @actionssdk + * @dialogflow + */ + askForPermission(context: string, permission: string, dialogState?: object): express.Response | null; + + /** + * Returns true if the request follows a previous request asking for + * permission from the user and the user granted the permission(s). Otherwise, + * false. Use with {@link AssistantApp#askForPermissions|askForPermissions}. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * // or + * const app = new DialogflowApp({request: request, response: response}); + * app.askForPermissions("To get you a ride", [ + * app.SupportedPermissions.NAME, + * app.SupportedPermissions.DEVICE_PRECISE_LOCATION + * ]); + * // ... + * // In response handler for subsequent intent: + * if (app.isPermissionGranted()) { + * // Use the requested permission(s) to get the user a ride + * } + * + * @return true if permissions granted. + * @dialogflow + * @actionssdk + */ + isPermissionGranted(): boolean; + + /** + * Asks user for delivery address. + * + * @example + * // For DialogflowApp: + * const app = new DialogflowApp({request, response}); + * const WELCOME_INTENT = 'input.welcome'; + * const DELIVERY_INTENT = 'delivery.address'; + * + * function welcomeIntent (app) { + * app.askForDeliveryAddress('To make sure I can deliver to you'); + * } + * + * function addressIntent (app) { + * const postalCode = app.getDeliveryAddress().postalAddress.postalCode; + * if (isInDeliveryZone(postalCode)) { + * app.tell('Great looks like you\'re in our delivery area!'); + * } else { + * app.tell('I\'m sorry it looks like we can\'t deliver to you.'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(DELIVERY_INTENT, addressIntent); + * app.handleRequest(actionMap); + * + * // For ActionsSdkApp: + * const app = new ActionsSdkApp({request, response}); + * const WELCOME_INTENT = app.StandardIntents.MAIN; + * const DELIVERY_INTENT = app.StandardIntents.DELIVERY_ADDRESS; + * + * function welcomeIntent (app) { + * app.askForDeliveryAddress('To make sure I can deliver to you'); + * } + * + * function addressIntent (app) { + * const postalCode = app.getDeliveryAddress().postalAddress.postalCode; + * if (isInDeliveryZone(postalCode)) { + * app.tell('Great looks like you\'re in our delivery area!'); + * } else { + * app.tell('I\'m sorry it looks like we can\'t deliver to you.'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(DELIVERY_INTENT, addressIntent); + * app.handleRequest(actionMap); + * + * @param reason Reason given to user for asking delivery address. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForDeliveryAddress(reason: string, dialogState?: object): express.Response | null; + + /** + * Asks user for a confirmation. + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const CONFIRMATION = 'confirmation'; + * + * function welcomeIntent (app) { + * app.askForConfirmation('Are you sure you want to do that?'); + * } + * + * function confirmation (app) { + * if (app.getUserConfirmation()) { + * app.tell('Great! I\'m glad you want to do it!'); + * } else { + * app.tell('That\'s okay. Let\'s not do it now.'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(CONFIRMATION, confirmation); + * app.handleRequest(actionMap); + * + * @param prompt The confirmation prompt presented to the user to + * query for an affirmative or negative response. If undefined or null, + * Google will use a generic yes/no prompt. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForConfirmation(prompt?: string, dialogState?: object): express.Response | null; + + /** + * Asks user for a timezone-agnostic date and time. + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const DATETIME = 'datetime'; + * + * function welcomeIntent (app) { + * app.askForDateTime('When do you want to come in?', + * 'Which date works best for you?', + * 'What time of day works best for you?'); + * } + * + * function datetime (app) { + * app.tell({speech: 'Great see you at your appointment!', + * displayText: 'Great, we will see you on ' + * + app.getDateTime().date.month + * + '/' + app.getDateTime().date.day + * + ' at ' + app.getDateTime().time.hours + * + (app.getDateTime().time.minutes || '')}); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(DATETIME, datetime); + * app.handleRequest(actionMap); + * + * @param initialPrompt The initial prompt used to ask for a + * date and time. If undefined or null, Google will use a generic + * prompt. + * @param datePrompt The prompt used to specifically ask for the + * date if not provided by user. If undefined or null, Google will use a + * generic prompt. + * @param timePrompt The prompt used to specifically ask for the + * time if not provided by user. If undefined or null, Google will use a + * generic prompt. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForDateTime(initialPrompt?: string, datePrompt?: string, timePrompt?: string, dialogState?: object): express.Response | null; + + /** + * Hands the user off to a web sign in flow. App sign in and OAuth credentials + * are set in the {@link https://console.actions.google.com|Actions Console}. + * Retrieve the access token in subsequent intents using + * app.getUser().accessToken. + * Works only for en-* locales. + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const SIGN_IN = 'sign.in'; + * + * function welcomeIntent (app) { + * app.askForSignIn(); + * } + * + * function signIn (app) { + * if (app.getSignInStatus() === app.SignInstatus.OK) { + * let accessToken = app.getUser().accessToken; + * app.ask('Great, thanks for signing in!'); + * } else { + * app.ask('I won\'t be able to save your data, but let\'s continue!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(SIGN_IN, signIn); + * app.handleRequest(actionMap); + * + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForSignIn(dialogState?: object): express.Response | null; + + /** + * Requests the user to switch to another surface during the conversation. + * Works only for en-* locales. + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const SHOW_IMAGE = 'show.image'; + * + * function welcomeIntent (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * showPicture(app); + * } else if (app.hasAvailableSurfaceCapabilities(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askForNewSurface('To show you an image', + * 'Check out this image', + * [app.SurfaceCapabilities.SCREEN_OUTPUT] + * ); + * } else { + * app.tell('This part of the app only works on screen devices. Sorry about that'); + * } + * } + * + * function showImage (app) { + * if (!app.isNewSurface()) { + * app.tell('Ok, I understand. You don't want to see pictures. Bye'); + * } else { + * showPicture(app, pictureType); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(SHOW_IMAGE, showImage); + * app.handleRequest(actionMap); + * + * @param context Context why new surface is requested; it's the TTS + * prompt prefix (action phrase) we ask the user. + * @param notificationTitle Title of the notification appearing on + * new surface device. + * @param capabilities The list of capabilities required in + * the surface. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @dialogflow + * @actionssdk + */ + askForNewSurface(context: string, notificationTitle: string, capabilities: SurfaceCapabilities[], dialogState?: object): express.Response | null; + + /** + * Requests the user to register for daily updates. + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const SHOW_IMAGE = 'show.image'; + * + * function welcomeIntent (app) { + * app.askToRegisterDailyUpdate('show.image', [ + * { + * name: 'image_to_show', + * textValue: 'image_type_1' + * } + * ]); + * } + * + * function showImage (app) { + * showPicture(app.getArgument('image_to_show')); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(SHOW_IMAGE, showImage); + * app.handleRequest(actionMap); + * + * @param intent If using Dialogflow, the action name of the intent + * to be triggered when the update is received. If using Actions SDK, the + * intent name to be triggered when the update is received. + * @param intentArguments The necessary arguments + * to fulfill the intent triggered on update. These can be retrieved using + * {@link AssistantApp#getArgument}. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @dialogflow + * @actionssdk + */ + askToRegisterDailyUpdate(intent: string, intentArguments: IntentArgument[], dialogState?: object): express.Response | null; + + /** + * Gets the {@link User} object. + * The user object contains information about the user, including + * a string identifier and personal information (requires requesting permissions, + * see {@link AssistantApp#askForPermissions|askForPermissions}). + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * // or + * const app = new ActionsSdkApp({request: request, response: response}); + * const userId = app.getUser().userId; + * + * @return Null if no value. + * @actionssdk + * @dialogflow + */ + getUser(): User; + + /** + * If granted permission to user's name in previous intent, returns user's + * display name, family name, and given name. If name info is unavailable, + * returns null. + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * const REQUEST_PERMISSION_ACTION = 'request_permission'; + * const SAY_NAME_ACTION = 'get_name'; + * + * function requestPermission (app) { + * const permission = app.SupportedPermissions.NAME; + * app.askForPermission('To know who you are', permission); + * } + * + * function sayName (app) { + * if (app.isPermissionGranted()) { + * app.tell('Your name is ' + app.getUserName().displayName)); + * } else { + * // Response shows that user did not grant permission + * app.tell('Sorry, I could not get your name.'); + * } + * } + * const actionMap = new Map(); + * actionMap.set(REQUEST_PERMISSION_ACTION, requestPermission); + * actionMap.set(SAY_NAME_ACTION, sayName); + * app.handleRequest(actionMap); + * @return Null if name permission is not granted. + * @actionssdk + * @dialogflow + */ + getUserName(): UserName; + + /** + * Gets the user locale. Returned string represents the regional language + * information of the user set in their Assistant settings. + * For example, 'en-US' represents US English. + * + * @example + * const app = new DialogflowApp({request, response}); + * const locale = app.getUserLocale(); + * + * @return User's locale, e.g. 'en-US'. Null if no locale given. + * @actionssdk + * @dialogflow + */ + getUserLocale(): string; + + /** + * Get the user's last seen time as a Date object. + * Not supported in V1. + * + * @example + * const app = new DialogflowApp({request, response}); + * const lastSeen = app.getLastSeen(); + * + * @return User's last seen date or null if never seen + */ + getLastSeen(): Date | null; + + /** + * If granted permission to device's location in previous intent, returns device's + * location (see {@link AssistantApp#askForPermissions|askForPermissions}). + * If device info is unavailable, returns null. + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * // or + * const app = new ActionsSdkApp({request: req, response: res}); + * app.askForPermission("To get you a ride", + * app.SupportedPermissions.DEVICE_PRECISE_LOCATION); + * // ... + * // In response handler for permissions fallback intent: + * if (app.isPermissionGranted()) { + * sendCarTo(app.getDeviceLocation().coordinates); + * } + * + * @return Null if location permission is not granted. + * @actionssdk + * @dialogflow + */ + getDeviceLocation(): DeviceLocation; + + /** + * Gets type of input used for this request. + * @return One of AssistantApp.InputTypes. + * Null if no input type given. + * @dialogflow + * @actionssdk + */ + getInputType(): number | string; + + /** + * Gets transactability of user. Only use after calling + * askForTransactionRequirements. Null if no result given. + * + * @return One of Transactions.ResultType. + * @dialogflow + * @actionssdk + */ + getTransactionRequirementsResult(): string; + + /** + * Gets order delivery address. Only use after calling askForDeliveryAddress. + * + * @return Delivery address information. Null if user + * denies permission, or no address given. + * @dialogflow + * @actionssdk + */ + getDeliveryAddress(): Location; + + /** + * Gets transaction decision information. Only use after calling + * askForTransactionDecision. + * + * @return Transaction decision data. Returns object with + * userDecision only if user declines. userDecision will be one of + * Transactions.ConfirmationDecision. Null if no decision given. + * @dialogflow + * @actionssdk + */ + getTransactionDecision(): TransactionDecision; + + /** + * Gets confirmation decision. Use after askForConfirmation. + * + * @return False if user replied with negative response. Null if no user + * confirmation decision given. + * @dialogflow + * @actionssdk + */ + getUserConfirmation(): boolean | null; + + /** + * Gets user provided date and time. Use after askForDateTime. + * + * @return Date and time given by the user. Null if no user + * date and time given. + * @dialogflow + * @actionssdk + */ + getDateTime(): DateTime; + + /** + * Gets status of user sign in request. + * + * @return Result of user sign in request. One of + * DialogflowApp.SignInStatus or ActionsSdkApp.SignInStatus + * Null if no sign in status. + * @dialogflow + * @actionssdk + */ + getSignInStatus(): string; + + /** + * Returns true if user device has a given surface capability. + * + * @param requestedCapability Must be one of {@link SurfaceCapabilities}. + * @return True if user device has the given capability. + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * const DESCRIBE_SOMETHING = 'DESCRIBE_SOMETHING'; + * + * function describe (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.tell(richResponseWithBasicCard); + * } else { + * app.tell('Let me tell you about ...'); + * } + * } + * const actionMap = new Map(); + * actionMap.set(DESCRIBE_SOMETHING, describe); + * app.handleRequest(actionMap); + * + * @dialogflow + * @actionssdk + */ + hasSurfaceCapability(requestedCapability: SurfaceCapabilities): boolean; + + /** + * Gets surface capabilities of user device. + * + * @return Supported surface capabilities, as defined in + * AssistantApp.SurfaceCapabilities. + * @dialogflow + * @actionssdk + */ + getSurfaceCapabilities(): SurfaceCapabilities[]; + + /** + * Returns the set of other available surfaces for the user. + * + * @return Empty if no available surfaces. + * @actionssdk + * @dialogflow + */ + getAvailableSurfaces(): Surface[]; + + /** + * Returns true if user has an available surface which includes all given + * capabilities. Available surfaces capabilities may exist on surfaces other + * than that used for an ongoing conversation. + * + * @param capabilities Must be one of + * {@link SurfaceCapabilities}. + * @return True if user has a capability available on some surface. + * + * @dialogflow + * @actionssdk + */ + hasAvailableSurfaceCapabilities(capabilities: SurfaceCapabilities | SurfaceCapabilities[]): boolean; + + /** + * Returns the result of the AskForNewSurface helper. + * + * @return True if user has triggered conversation on a new device + * following the NEW_SURFACE intent. + * @actionssdk + * @dialogflow + */ + isNewSurface(): boolean; + + /** + * Returns true if the app is being tested in sandbox mode. Enable sandbox + * mode in the (Actions console)[console.actions.google.com] to test + * transactions. + * + * @return True if app is being used in Sandbox mode. + * @dialogflow + * @actionssdk + */ + isInSandbox(): boolean; + + /** + * Returns the number of subsequent reprompts related to silent input from the + * user. This should be used along with the NO_INPUT intent to reprompt the + * user for input in cases where the Google Assistant could not pick up any + * speech. + * + * @example + * const app = new ActionsSdkApp({request, response}); + * + * function welcome (app) { + * app.ask('Welcome to your app!'); + * } + * + * function noInput (app) { + * if (app.getRepromptCount() === 0) { + * app.ask(`What was that?`); + * } else if (app.getRepromptCount() === 1) { + * app.ask(`Sorry I didn't catch that. Could you repeat yourself?`); + * } else if (app.isFinalReprompt()) { + * app.tell(`Okay let's try this again later.`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, welcome); + * actionMap.set(app.StandardIntents.NO_INPUT, noInput); + * app.handleRequest(actionMap); + * + * @return The current reprompt count. Null if no reprompt count + * available (e.g. not in the NO_INPUT intent). + * @dialogflow + * @actionssdk + */ + getRepromptCount(): number; + + /** + * Returns true if it is the final reprompt related to silent input from the + * user. This should be used along with the NO_INPUT intent to give the final + * response to the user after multiple silences and should be an app.tell + * which ends the conversation. + * + * @example + * const app = new ActionsSdkApp({request, response}); + * + * function welcome (app) { + * app.ask('Welcome to your app!'); + * } + * + * function noInput (app) { + * if (app.getRepromptCount() === 0) { + * app.ask(`What was that?`); + * } else if (app.getRepromptCount() === 1) { + * app.ask(`Sorry I didn't catch that. Could you repeat yourself?`); + * } else if (app.isFinalReprompt()) { + * app.tell(`Okay let's try this again later.`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, welcome); + * actionMap.set(app.StandardIntents.NO_INPUT, noInput); + * app.handleRequest(actionMap); + * + * @return True if in a NO_INPUT intent and this is the final turn + * of dialog. + * @dialogflow + * @actionssdk + */ + isFinalReprompt(): boolean; + + /** + * Returns true if user accepted update registration request. Used with + * {@link AssistantApp#askToRegisterDailyUpdate} + * + * @return True if user accepted update registration request. + * @dialogflow + * @actionssdk + */ + isUpdateRegistered(): boolean; + + // --------------------------------------------------------------------------- + // Response Builders + // --------------------------------------------------------------------------- + + /** + * Constructs RichResponse with chainable property setters. + * + * @param richResponse RichResponse to clone. + * @return Constructed RichResponse. + */ + buildRichResponse(richResponse?: RichResponse): RichResponse; + + /** + * Constructs BasicCard with chainable property setters. + * + * @param bodyText Body text of the card. Can be set using setTitle + * instead. + * @return Constructed BasicCard. + */ + buildBasicCard(bodyText?: string): BasicCard; + + /** + * Constructs List with chainable property setters. + * + * @param title A title to set for a new List. + * @return Constructed List. + */ + buildList(title?: string): List; + + /** + * Constructs Carousel with chainable property setters. + * + * @return Constructed Carousel. + */ + buildCarousel(): Carousel; + + /** + * Constructs OptionItem with chainable property setters. + * + * @param key A unique key to identify this option. This key will + * be returned as an argument in the resulting actions.intent.OPTION + * intent. + * @param synonyms A list of synonyms which the user may + * use to identify this option instead of the option key. + * @return Constructed OptionItem. + */ + buildOptionItem(key?: string, synonyms?: string | string[]): OptionItem; + + // --------------------------------------------------------------------------- + // Transaction Builders + // --------------------------------------------------------------------------- + + /** + * Constructs Order with chainable property setters. + * + * @param orderId Unique identifier for the order. + * @return Constructed Order. + */ + buildOrder(orderId: string): Order; + + /** + * Constructs Cart with chainable property setters. + * + * @param cartId Unique identifier for the cart. + * @return Constructed Cart. + */ + buildCart(cartId?: string): Cart; + + /** + * Constructs LineItem with chainable property setters. + * Because of a previous bug, the parameters are swapped compared to + * the LineItem constructor to prevent a breaking change. + * + * @param name Name of the line item. + * @param id Unique identifier for the item. + * @return Constructed LineItem. + */ + buildLineItem(name: string, id: string): LineItem; + + /** + * Constructs OrderUpdate with chainable property setters. + * + * @param orderId Unique identifier of the order. + * @param isGoogleOrderId True if the order ID is provided by + * Google. False if the order ID is app provided. + * @return Constructed OrderUpdate. + */ + buildOrderUpdate(orderId: string, isGoogleOrderId: boolean): OrderUpdate; +} diff --git a/types/actions-on-google/dialogflow-app.d.ts b/types/actions-on-google/dialogflow-app.d.ts new file mode 100644 index 0000000000..4eeda87e06 --- /dev/null +++ b/types/actions-on-google/dialogflow-app.d.ts @@ -0,0 +1,572 @@ +import * as express from 'express'; + +import { AssistantApp } from './assistant-app'; +import { Carousel, List, RichResponse, SimpleResponse } from './response-builder'; + +// --------------------------------------------------------------------------- +// Dialogflow support +// --------------------------------------------------------------------------- + +/** + * Dialogflow {@link https://dialogflow.com/docs/concept-contexts|Context}. + */ +export interface Context { + /** Full name of the context. */ + name: string; + /** + * Parameters carried within this context. + * See {@link https://dialogflow.com/docs/concept-actions#section-extracting-values-from-contexts|here}. + */ + parameters: object; + /** Remaining number of intents */ + lifespan: number; +} + +export interface DialogflowAppOptions { + /** Express HTTP request object. */ + request: express.Request; + /** Express HTTP response object. */ + response: express.Response; + /** + * Function callback when session starts. + * Only called if webhook is enabled for welcome/triggering intents, and + * called from Web Simulator or Google Home device (i.e., not Dialogflow simulator). + */ + sessionStarted?(): any; +} + +/** + * This is the class that handles the communication with Dialogflow's fulfillment API v1. + * Doesn't currently support Dialogflow's fulfillment API v2. + */ +export class DialogflowApp extends AssistantApp { + /** + * Constructor for DialogflowApp object. + * To be used in the Dialogflow fulfillment webhook logic. + * + * @example + * const DialogflowApp = require('actions-on-google').DialogflowApp; + * const app = new DialogflowApp({request: request, response: response, + * sessionStarted:sessionStarted}); + * + * @dialogflow + */ + constructor(options: DialogflowAppOptions); + + /** + * @deprecated + * Verifies whether the request comes from Dialogflow. + * + * @param key The header key specified by the developer in the + * Dialogflow Fulfillment settings of the app. + * @param value The private value specified by the developer inside the + * fulfillment header. + * @return True if the request comes from Dialogflow. + * @dialogflow + */ + isRequestFromApiAi(key: string, value: string): boolean; + + /** + * Verifies whether the request comes from Dialogflow. + * + * @param key The header key specified by the developer in the + * Dialogflow Fulfillment settings of the app. + * @param value The private value specified by the developer inside the + * fulfillment header. + * @return True if the request comes from Dialogflow. + * @dialogflow + */ + isRequestFromDialogflow(key: string, value: string): boolean; + + /** + * Get the current intent. Alternatively, using a handler Map with + * {@link AssistantApp#handleRequest|handleRequest}, + * the client library will automatically handle the incoming intents. + * 'Intent' in the Dialogflow context translates into the current action. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * + * function responseHandler (app) { + * const intent = app.getIntent(); + * switch (intent) { + * case WELCOME_INTENT: + * app.ask('Welcome to action snippets! Say a number.'); + * break; + * + * case NUMBER_INTENT: + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * break; + * } + * } + * + * app.handleRequest(responseHandler); + * + * @return Intent id or null if no value (action name). + * @dialogflow + */ + getIntent(): string; + + /** + * Get the argument value by name from the current intent. If the argument + * is included in originalRequest, and is not a text argument, the entire + * argument object is returned. + * + * Note: If incoming request is using an API version under 2 (e.g. 'v1'), + * the argument object will be in Proto2 format (snake_case, etc). + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * + * function welcomeIntent (app) { + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param argName Name of the argument. + * @return Argument value matching argName + * or null if no matching argument. + * @dialogflow + */ + getArgument(argName: string): object; + + /** + * Get the context argument value by name from the current intent. Context + * arguments include parameters collected in previous intents during the + * lifespan of the given context. If the context argument has an original + * value, usually representing the underlying entity value, that will be given + * as part of the return object. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * const OUT_CONTEXT = 'output_context'; + * const NUMBER_ARG = 'myNumberArg'; + * + * function welcomeIntent (app) { + * const parameters = {}; + * parameters[NUMBER_ARG] = '42'; + * app.setContext(OUT_CONTEXT, 1, parameters); + * app.ask('Welcome to action snippets! Ask me for your number.'); + * } + * + * function numberIntent (app) { + * const number = app.getContextArgument(OUT_CONTEXT, NUMBER_ARG); + * // number === { value: 42 } + * app.tell('Your number is ' + number.value); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param contextName Name of the context. + * @param argName Name of the argument. + * @return Object containing value property and optional original + * property matching context argument. Null if no matching argument. + * @dialogflow + */ + getContextArgument(contextName: string, argName: string): object; + + /** + * Returns the RichResponse constructed in Dialogflow response builder. + * + * @example + * const app = new App({request: req, response: res}); + * + * function tellFact (app) { + * let fact = 'Google was founded in 1998'; + * + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.ask(app.getIncomingRichResponse().addSimpleResponse('Here\'s a ' + + * 'fact for you. ' + fact + ' Which one do you want to hear about ' + + * 'next, Google\'s history or headquarters?')); + * } else { + * app.ask('Here\'s a fact for you. ' + fact + ' Which one ' + + * 'do you want to hear about next, Google\'s history or headquarters?'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set('tell.fact', tellFact); + * + * app.handleRequest(actionMap); + * + * @return RichResponse created in Dialogflow. If no RichResponse was + * created, an empty RichResponse is returned. + * @dialogflow + */ + getIncomingRichResponse(): RichResponse; + + /** + * Returns the List constructed in Dialogflow response builder. + * + * @example + * const app = new App({request: req, response: res}); + * + * function pickOption (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askWithList('Which of these looks good?', + * app.getIncomingList().addItems( + * app.buildOptionItem('another_choice', ['Another choice']). + * setTitle('Another choice'))); + * } else { + * app.ask('What would you like?'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set('pick.option', pickOption); + * + * app.handleRequest(actionMap); + * + * @return List created in Dialogflow. If no List was created, an empty + * List is returned. + * @dialogflow + */ + getIncomingList(): List; + + /** + * Returns the Carousel constructed in Dialogflow response builder. + * + * @example + * const app = new App({request: req, response: res}); + * + * function pickOption (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askWithCarousel('Which of these looks good?', + * app.getIncomingCarousel().addItems( + * app.buildOptionItem('another_choice', ['Another choice']). + * setTitle('Another choice').setDescription('Choose me!'))); + * } else { + * app.ask('What would you like?'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set('pick.option', pickOption); + * + * app.handleRequest(actionMap); + * + * @return Carousel created in Dialogflow. If no Carousel was created, + * an empty Carousel is returned. + * @dialogflow + */ + getIncomingCarousel(): Carousel; + + /** + * Returns the option key user chose from options response. + * + * @example + * const app = new App({request: req, response: res}); + * + * function pickOption (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askWithCarousel('Which of these looks good?', + * app.getIncomingCarousel().addItems( + * app.buildOptionItem('another_choice', ['Another choice']). + * setTitle('Another choice').setDescription('Choose me!'))); + * } else { + * app.ask('What would you like?'); + * } + * } + * + * function optionPicked (app) { + * app.ask('You picked ' + app.getSelectedOption()); + * } + * + * const actionMap = new Map(); + * actionMap.set('pick.option', pickOption); + * actionMap.set('option.picked', optionPicked); + * + * app.handleRequest(actionMap); + * + * @return Option key of selected item. Null if no option selected or + * if current intent is not OPTION intent. + * @dialogflow + */ + getSelectedOption(): string; + + /** + * Asks to collect the user's input. + * {@link https://developers.google.com/actions/policies/general-policies#user_experience|The guidelines when prompting the user for a response must be followed at all times}. + * + * NOTE: Due to a bug, if you specify the no-input prompts, + * the mic is closed after the 3rd prompt, so you should use the 3rd prompt + * for a bye message until the bug is fixed. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * + * function welcomeIntent (app) { + * app.ask('Welcome to action snippets! Say a number.', + * ['Say any number', 'Pick a number', 'We can stop here. See you soon.']); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt The input prompt + * response. + * @param noInputs Array of re-prompts when the user does not respond (max 3). + * @return HTTP response. + * @dialogflow + */ + ask(inputPrompt: string | SimpleResponse | RichResponse, noInputs?: string[]): express.Response | null; + + /** + * Asks to collect the user's input with a list. + * + * @example + * const app = new DialogflowApp({request, response}); + * const WELCOME_INTENT = 'input.welcome'; + * const OPTION_INTENT = 'option.select'; + * + * function welcomeIntent (app) { + * app.askWithList('Which of these looks good?', + * app.buildList('List title') + * .addItems([ + * app.buildOptionItem(SELECTION_KEY_ONE, + * ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2']) + * .setTitle('Title of First List Item'), + * app.buildOptionItem(SELECTION_KEY_TWO, + * ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2']) + * .setTitle('Title of Second List Item'), + * ])); + * } + * + * function optionIntent (app) { + * if (app.getSelectedOption() === SELECTION_KEY_ONE) { + * app.tell('Number one is a great choice!'); + * } else { + * app.tell('Number two is a great choice!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(OPTION_INTENT, optionIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt The input prompt + * response. + * @param.list List built with {@link AssistantApp#buildList|buildList} + * @return HTTP response. + * @dialogflow + */ + askWithList(inputPrompt: string | RichResponse | SimpleResponse, list: List): express.Response | null; + + /** + * Asks to collect the user's input with a carousel. + * + * @example + * const app = new DialogflowApp({request, response}); + * const WELCOME_INTENT = 'input.welcome'; + * const OPTION_INTENT = 'option.select'; + * + * function welcomeIntent (app) { + * app.askWithCarousel('Which of these looks good?', + * app.buildCarousel() + * .addItems([ + * app.buildOptionItem(SELECTION_KEY_ONE, + * ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2']) + * .setTitle('Number one'), + * app.buildOptionItem(SELECTION_KEY_TWO, + * ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2']) + * .setTitle('Number two'), + * ])); + * } + * + * function optionIntent (app) { + * if (app.getSelectedOption() === SELECTION_KEY_ONE) { + * app.tell('Number one is a great choice!'); + * } else { + * app.tell('Number two is a great choice!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(OPTION_INTENT, optionIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt The input prompt + * response. + * @param carousel Carousel built with + * {@link AssistantApp#buildCarousel|buildCarousel}. + * @return HTTP response. + * @dialogflow + */ + askWithCarousel(inputPrompt: string | RichResponse | SimpleResponse, carousel: Carousel): express.Response | null; + + /** + * Tells the Assistant to render the speech response and close the mic. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * + * function welcomeIntent (app) { + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param speechResponse Final response. + * Spoken response can be SSML. + * @return The response that is sent back to Assistant. + * @dialogflow + */ + tell(speechResponse: string | SimpleResponse | RichResponse): express.Response | null; + + /** + * Set a new context for the current intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const CONTEXT_NUMBER = 'number'; + * const NUMBER_ARGUMENT = 'myNumber'; + * + * function welcomeIntent (app) { + * app.setContext(CONTEXT_NUMBER); + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param name Name of the context. Dialogflow converts to lowercase. + * @param [lifespan=1] Context lifespan. + * @param parameters Context JSON parameters. + * @return Null if the context name is not defined. + * @dialogflow + */ + setContext(name: string, lifespan?: number, parameters?: any): null | undefined; + + /** + * Returns the incoming contexts for this intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const CONTEXT_NUMBER = 'number'; + * const NUMBER_ARGUMENT = 'myNumber'; + * + * function welcomeIntent (app) { + * app.setContext(CONTEXT_NUMBER); + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * let contexts = app.getContexts(); + * // contexts === [{ + * // name: 'number', + * // lifespan: 0, + * // parameters: { + * // myNumber: '23', + * // myNumber.original: '23' + * // } + * // }] + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @return Empty if no active contexts. + * @dialogflow + */ + getContexts(): Context[]; + + /** + * Returns the incoming context by name for this intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const CONTEXT_NUMBER = 'number'; + * const NUMBER_ARGUMENT = 'myNumber'; + * + * function welcomeIntent (app) { + * app.setContext(CONTEXT_NUMBER); + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * let context = app.getContext(CONTEXT_NUMBER); + * // context === { + * // name: 'number', + * // lifespan: 0, + * // parameters: { + * // myNumber: '23', + * // myNumber.original: '23' + * // } + * // } + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param name The name of the Context to retrieve. + * @return Context value matching name + * or null if no matching context. + * @dialogflow + */ + getContext(name: string): object; + + /** + * Gets the user's raw input query. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * app.tell('You said ' + app.getRawInput()); + * + * @return User's raw query or null if no value. + * @dialogflow + */ + getRawInput(): string; +} diff --git a/types/actions-on-google/index.d.ts b/types/actions-on-google/index.d.ts new file mode 100644 index 0000000000..23a2c1483d --- /dev/null +++ b/types/actions-on-google/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for actions-on-google 1.7 +// Project: https://github.com/actions-on-google/actions-on-google-nodejs +// Definitions by: Joel Hegg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/** + * The Actions on Google client library. + * https://developers.google.com/actions/ + */ + +import * as Transactions from './transactions'; +import * as Responses from './response-builder'; + +export { AssistantApp } from './assistant-app'; +export { ActionsSdkApp, ActionsSdkAppOptions } from './actions-sdk-app'; +export { DialogflowApp, DialogflowAppOptions } from './dialogflow-app'; +export { Transactions }; +export { Responses }; +// Backwards compatibility +export { AssistantApp as Assistant } from './assistant-app'; +export { ActionsSdkApp as ActionsSdkAssistant } from './actions-sdk-app'; +export { DialogflowApp as ApiAiAssistant } from './dialogflow-app'; +export { DialogflowApp as ApiAiApp } from './dialogflow-app'; diff --git a/types/actions-on-google/response-builder.d.ts b/types/actions-on-google/response-builder.d.ts new file mode 100644 index 0000000000..4ebb9b3007 --- /dev/null +++ b/types/actions-on-google/response-builder.d.ts @@ -0,0 +1,443 @@ +/** + * A collection of response builders. + */ + +import { OrderUpdate } from './transactions'; + +/** + * List of possible options to display the image in a BasicCard. + * When the aspect ratio of an image is not the same as the surface, + * this attribute changes how the image is displayed in the card. + */ +export enum ImageDisplays { + /** + * Pads the gaps between the image and image frame with a blurred copy of the + * same image. + */ + DEFAULT, + /** + * Fill the gap between the image and image container with white bars. + */ + WHITE, + /** + * Image is centered and resized so the image fits perfectly in the container. + */ + CROPPED +} + +/** + * Simple Response type. + */ +export interface SimpleResponse { + /** Speech to be spoken to user. SSML allowed. */ + speech: string; + /** Optional text to be shown to user */ + displayText?: string; +} + +/** + * Suggestions to show with response. + */ +export interface Suggestion { + /** Text of the suggestion. */ + title: string; +} + +/** + * Link Out Suggestion. Used in rich response as a suggestion chip which, when + * selected, links out to external URL. + */ +export interface LinkOutSuggestion { + /** Text shown on the suggestion chip. */ + title: string; + /** String URL to open. */ + url: string; +} + +/** + * Image type shown on visual elements. + */ +export interface Image { + /** Image source URL. */ + url: string; + /** Text to replace for image for accessibility. */ + accessibilityText: string; + /** Width of the image. */ + width: number; + /** Height of the image. */ + height: number; +} + +/** + * Basic Card Button. Shown below basic cards. Open a URL when selected. + */ +export interface Button { + /** Text shown on the button. */ + title: string; + /** Action to take when selected. */ + openUrlAction: { + /** String URL to open. */ + url: string; + }; +} + +/** + * Option info. Provides unique identifier for a given OptionItem. + */ +export interface OptionInfo { + /** Unique string ID for this option. */ + key: string; + /** Synonyms that can be used by the user to indicate this option if they do not use the key. */ + synonyms: string[]; +} + +export interface StructuredResponse { + orderUpdate: OrderUpdate; +} + +export interface ItemBasicCard { + basicCard: BasicCard; +} + +export interface ItemSimpleResponse { + simpleResponse: SimpleResponse; +} + +export interface ItemStructuredResponse { + structuredResponse: StructuredResponse; +} + +export type RichResponseItem = ItemBasicCard | ItemSimpleResponse | ItemStructuredResponse; + +/** + * Class for initializing and constructing Rich Responses with chainable interface. + */ +export class RichResponse { + /** + * Constructor for RichResponse. Accepts optional RichResponse to clone. + * + * @param richResponse Optional RichResponse to clone. + */ + constructor(richResponse?: RichResponse); + + /** + * Ordered list of either SimpleResponse objects or BasicCard objects. + * First item must be SimpleResponse. There can be at most one card. + */ + items: RichResponseItem[]; + + /** + * Ordered list of text suggestions to display. Optional. + */ + suggestions: Suggestion[]; + + /** + * Link Out Suggestion chip for this rich response. Optional. + */ + linkOutSuggestion?: LinkOutSuggestion; + + /** + * Adds a SimpleResponse to list of items. + * + * @param simpleResponse Simple response to present to + * user. If just a string, display text will not be set. + * @return Returns current constructed RichResponse. + */ + addSimpleResponse(simpleResponse: string | SimpleResponse): RichResponse; + + /** + * Adds a BasicCard to list of items. + * + * @param basicCard Basic card to include in response. + * @return Returns current constructed RichResponse. + */ + addBasicCard(basicCard: BasicCard): RichResponse; + + /** + * Adds a single suggestion or list of suggestions to list of items. + * + * @param suggestions Either a single string suggestion + * or list of suggestions to add. + * @return Returns current constructed RichResponse. + */ + addSuggestions(suggestions: string | string[]): RichResponse; + + /** + * Returns true if the given suggestion text is valid to be added to the suggestion list. A valid + * text string is not longer than 25 characters. + * @param suggestionText Text to validate as suggestion. + * @return True if the text is valid, false otherwise.s + */ + isValidSuggestionText(suggestionText: string): boolean; + + /** + * Sets the suggestion link for this rich response. The destination site must be verified + * (https://developers.google.com/actions/console/brand-verification). + * + * @param destinationName Name of the link out destination. + * @param suggestionUrl - String URL to open when suggestion is used. + * @return Returns current constructed RichResponse. + */ + addSuggestionLink(destinationName: string, suggestionUrl: string): RichResponse; + + /** + * Adds an order update to this response. Use after a successful transaction + * decision to confirm the order. + * + * @param orderUpdate OrderUpdate object to add. + * @return Returns current constructed RichResponse. + */ + addOrderUpdate(orderUpdate: OrderUpdate): RichResponse; +} + +/** + * Class for initializing and constructing Basic Cards with chainable interface. + */ +export class BasicCard { + /** + * Constructor for BasicCard. Accepts optional BasicCard to clone. + * + * @param basicCard Optional BasicCard to clone. + */ + constructor(basicCard?: BasicCard); + + /** + * Title of the card. Optional. + */ + title?: string; + + /** + * Body text to show on the card. Required, unless image is present. + */ + formattedText: string; + + /** + * Subtitle of the card. Optional. + */ + subtitle?: string; + + /** + * Image to show on the card. Optional. + */ + image?: Image; + + /** + * Ordered list of buttons to show below card. Optional. + */ + buttons: Button[]; + + /** + * Sets the title for this Basic Card. + * + * @param title Title to show on card. + * @return Returns current constructed BasicCard. + */ + setTitle(title: string): BasicCard; + + /** + * Sets the subtitle for this Basic Card. + * + * @param subtitle Subtitle to show on card. + * @return Returns current constructed BasicCard. + */ + setSubtitle(subtitle: string): BasicCard; + + /** + * Sets the body text for this Basic Card. + * + * @param bodyText Body text to show on card. + * @return Returns current constructed BasicCard. + */ + setBodyText(bodyText: string): BasicCard; + + /** + * Sets the image for this Basic Card. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for + * accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed BasicCard. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): BasicCard; + + /** + * Sets the display options for the image in this Basic Card. + * Use one of the image display constants. If none is chosen, + * ImageDisplays.DEFAULT will be enforced. + * + * @param option The option for displaying the image. + * @return Returns current constructed BasicCard. + */ + setImageDisplay(option: ImageDisplays): BasicCard; + + /** + * Adds a button below card. + * + * @param text Text to show on button. + * @param url URL to open when button is selected. + * @return Returns current constructed BasicCard. + */ + addButton(text: string, url: string): BasicCard; +} + +/** + * Class for initializing and constructing Lists with chainable interface. + */ +export class List { + /** + * Constructor for List. Accepts optional List to clone, string title, or + * list of items to copy. + * + * @param list Either a list to clone, a title + * to set for a new List, or an array of OptionItem to initialize a new + * list. + */ + constructor(list?: List | string | OptionItem[]); + + /** + * Title of the list. Optional. + */ + title?: string; + + /** + * List of 2-20 items to show in this list. Required. + */ + items: OptionItem[]; + + /** + * Sets the title for this List. + * + * @param title Title to show on list. + * @return Returns current constructed List. + */ + setTitle(title: string): List; + + /** + * Adds a single item or list of items to the list. + * + * @param optionItems OptionItems to add. + * @return Returns current constructed List. + */ + addItems(optionItems: OptionItem | OptionItem[]): List; +} + +/** + * Class for initializing and constructing Carousel with chainable interface. + */ +export class Carousel { + /** + * Constructor for Carousel. Accepts optional Carousel to clone or list of + * items to copy. + * + * @param carousel Either a carousel to clone + * or an array of OptionItem to initialize a new carousel + */ + constructor(carousel?: Carousel | OptionItem[]); + + /** + * List of 2-20 items to show in this carousel. Required. + */ + items: OptionItem[]; + + /** + * Adds a single item or list of items to the carousel. + * + * @param optionItems OptionItems to add. + * @return Returns current constructed Carousel. + */ + addItems(optionItems: OptionItem | OptionItem[]): Carousel; +} + +/** + * Class for initializing and constructing Option Items with chainable interface. + */ +export class OptionItem { + /** + * Constructor for OptionItem. Accepts optional OptionItem to clone. + * + * @param optionItem Optional OptionItem to clone. + */ + constructor(optionItem?: OptionItem); + + /** + * Option info of the option item. Required. + */ + optionInfo: OptionInfo; + + /** + * Title of the option item. Required. + */ + title: string; + + /** + * Description text of the item. Optional. + */ + description?: string; + + /** + * Image to show on item. Optional. + */ + image?: Image; + + /** + * Sets the title for this Option Item. + * + * @param title Title to show on item. + * @return Returns current constructed OptionItem. + */ + setTitle(title: string): OptionItem; + + /** + * Sets the description for this Option Item. + * + * @param description Description to show on item. + * @return Returns current constructed OptionItem. + */ + setDescription(description: string): OptionItem; + + /** + * Sets the image for this Option Item. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for + * accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed OptionItem. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): OptionItem; + + /** + * Sets the key for the OptionInfo of this Option Item. This will be returned + * as an argument in the resulting actions.intent.OPTION intent. + * + * @param key Key to uniquely identify this item. + * @return Returns current constructed OptionItem. + */ + setKey(key: string): OptionItem; + + /** + * Adds a single synonym or list of synonyms to item. + * + * @param synonyms Either a single string synonyms + * or list of synonyms to add. + * @return Returns current constructed OptionItem. + */ + addSynonyms(synonyms: string | string[]): OptionItem; +} + +/** + * Check if given text contains SSML. + * @param text Text to check. + * @return True if text contains SSML, false otherwise. + */ +export function isSsml(text: string): boolean; + +/** + * Check if given text contains SSML, allowing for whitespace padding. + * @param text Text to check. + * @return True if text contains possibly whitespace padded SSML, false otherwise. + */ +export function isPaddedSsml(text: string): boolean; diff --git a/types/actions-on-google/transactions.d.ts b/types/actions-on-google/transactions.d.ts new file mode 100644 index 0000000000..59e6cd9b37 --- /dev/null +++ b/types/actions-on-google/transactions.d.ts @@ -0,0 +1,1063 @@ +/** + * A collection of Transaction related constants, utility functions, and + * builders. + */ + +import { Image } from './response-builder'; + +/** + * Price type. + */ +export interface Price { + /** One of Transaction.PriceType. */ + type: TransactionValues.PriceType; + amount: { + /** Currency code of price. */ + currencyCode: string; + /** Unit count of price. */ + units: number; + /** Partial unit count of price. */ + nanos?: number; + }; +} + +/** + * Order rejection info. + */ +export interface RejectionInfo { + /** One of Transaction.ReasonType. */ + type: TransactionValues.ReasonType; + /** Reason for the order rejection. */ + reason: string; +} + +/** + * Order receipt info. + */ +export interface ReceiptInfo { + /** Action provided order ID. Used when the order has been received by the integrator. */ + confirmedActionOrderId: string; +} + +/** + * Order cancellation info. + */ +export interface CancellationInfo { + /** Reason for the cancellation. */ + reason: string; +} + +/** + * Order transit info. + */ +export interface TransitInfo { + /** UTC timestamp of the transit update as an RFC 3339 string. */ + updatedTime: string; +} + +/** + * Order fulfillment info. + */ +export interface FulfillmentInfo { + /** UTC timestamp of the fulfillment update as an RFC 3339 string. */ + deliveryTime: string; +} + +/** + * Order return info. + */ +export interface ReturnInfo { + /** Reason for the return. */ + reason: string; +} + +/** + * Transaction config for transactions not involving a Google provided + * payment instrument. + */ +export interface ActionPaymentTransactionConfig { + /** True if delivery address is required for the transaction. */ + deliveryAddressRequired: boolean; + /** One of Transactions.PaymentType. */ + type: TransactionValues.PaymentType; + /** The name of the instrument displayed on receipt. For example, for card payment, could be "VISA-1234". */ + displayName: string; + customerInfoOptions?: CustomerInfoOptions; +} + +/** + * Transaction config for transactions involving a Google provided payment + * instrument. + */ +export interface GooglePaymentTransactionConfig { + /** True if delivery address is required for the transaction. */ + deliveryAddressRequired: boolean; + /** Tokenization parameters provided by payment gateway. */ + tokenizationParameters: object; + /** List of accepted card networks. Must be any number of Transactions.CardNetwork. */ + cardNetworks: TransactionValues.CardNetwork[]; + /** True if prepaid cards are not allowed for transaction. */ + prepaidCardDisallowed: boolean; + /** The type of tokenization. Default is {@see TransactionValues.PaymentMethodTokenizationType.PAYMENT_GATEWAY}. */ + tokenizationType: string; + customerInfoOptions?: CustomerInfoOptions; +} + +/** + * Customer information requested as part of the transaction + */ +export interface CustomerInfoOptions { + customerInfoProperties: string[]; +} + +/** + * Generic Location type. + */ +export interface Location { + postalAddress: { + regionCode: string; + languageCode: string; + postalCode: string; + administrativeArea: string; + locality: string; + addressLines: string[]; + recipients: string; + }; + phoneNumber: string; + notes: string; +} + +/** + * Decision and order information returned when calling getTransactionDecision(). + */ +export interface TransactionDecision { + /** One of Transactions.ConfirmationDecision. */ + userDecision: TransactionValues.TransactionUserDecision; + checkResult: { + /** One of Transactions.ResultType. */ + resultType: TransactionValues.ResultType; + }; + order: { + /** The proposed order used in the transaction decision. */ + finalOrder: Order; + /** Order ID assigned by Google. */ + googleOrderId: string; + /** User visible order ID set in proposed order. */ + actionOrderId: string; + orderDate: { + seconds: string; + nanos: number; + }; + paymentInfo: object; + customerInfo: { + /** Customer email. */ + email: string; + }; + }; + /** + * The delivery address if user requested. + * Will appear if userDecision is Transactions.DELIVERY_ADDRESS_UPDATED. + */ + deliveryAddress: Location; +} + +/** + * Values related to supporting transactions + */ +export namespace TransactionValues { + /** + * List of transaction card networks available when paying with Google. + */ + enum CardNetwork { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * American Express. + */ + AMEX, + /** + * Discover. + */ + DISCOVER, + /** + * Master Card. + */ + MASTERCARD, + /** + * Visa. + */ + VISA, + /** + * JCB. + */ + JCB + } + + /** + * List of possible item types. + * @deprecated Use {@link TransactionValues.LineItemType} instead. + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export import ItemType = LineItemType; + + /** + * List of possible item types. + */ + enum LineItemType { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Regular. + */ + REGULAR, + /** + * Tax. + */ + TAX, + /** + * Discount + */ + DISCOUNT, + /** + * Gratuity + */ + GRATUITY, + /** + * Delivery + */ + DELIVERY, + /** + * Subtotal + */ + SUBTOTAL, + /** + * Fee. For everything else, there's fee. + */ + FEE + } + + /** + * List of price types. + */ + enum PriceType { + /** + * Unknown. + */ + UNKNOWN, + /** + * Estimate. + */ + ESTIMATE, + /** + * Actual. + */ + ACTUAL + } + + /** + * List of possible item types. + */ + enum PaymentType { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Payment card. + */ + PAYMENT_CARD, + /** + * Bank. + */ + BANK, + /** + * Loyalty program. + */ + LOYALTY_PROGRAM, + /** + * On order fulfillment, such as cash on delivery. + */ + ON_FULFILLMENT, + /** + * Gift card. + */ + GIFT_CARD + } + + /** + * List of customer information properties that can be requested. + */ + enum CustomerInfoProperties { + CUSTOMER_INFO_PROPERTY_UNSPECIFIED, + EMAIL + } + + /** + * List of possible order confirmation user decisions + * @deprecated Use {@link TransactionValues.TransactionUserDecision} instead. + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export import ConfirmationDecision = TransactionUserDecision; + + /** + * List of possible order confirmation user decisions + */ + enum TransactionUserDecision { + /** + * Unspecified user decision. + */ + UNKNOWN_USER_DECISION, + /** + * Order was approved by user. + */ + ACCEPTED, + /** + * Order was declined by user. + */ + REJECTED, + /** + * Order was not declined, but the delivery address was updated during + * confirmation. + */ + DELIVERY_ADDRESS_UPDATED, + /** + * Order was not declined, but the cart was updated during confirmation. + */ + CART_CHANGE_REQUESTED + } + + /** + * List of possible order states. + */ + enum OrderState { + /** + * Order was created at the integrator's system. + */ + CREATED, + /** + * Order was rejected. + */ + REJECTED, + /** + * Order was confirmed by integrator and is active. + */ + CONFIRMED, + /** + * User cancelled the order. + */ + CANCELLED, + /** + * Order is being delivered. + */ + IN_TRANSIT, + /** + * User performed a return. + */ + RETURNED, + /** + * User received what was ordered. + */ + FULFILLED + } + + /** + * List of possible actions to take on the order. + * @deprecated Use {@link TransactionValues.ActionType} instead. + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export import OrderAction = ActionType; + + /** + * List of possible actions to take on the order. + */ + enum ActionType { + /** + * Unknown action. + */ + UNKNOWN, + /** + * View details. + */ + VIEW_DETAILS, + /** + * Modify order. + */ + MODIFY, + /** + * Cancel order. + */ + CANCEL, + /** + * Return order. + */ + RETURN, + /** + * Exchange order. + */ + EXCHANGE, + /** + * Email. + */ + EMAIL, + /** + * Call. + */ + CALL, + /** + * Reorder. + */ + REORDER, + /** + * Review. + */ + REVIEW, + /** + * Customer Service. + */ + CUSTOMER_SERVICE + } + + /** + * List of possible types of order rejection. + * @deprecated Use {@link TransactionValues.ReasonType} instead. + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export import RejectionType = ReasonType; + + /** + * List of possible types of order rejection. + */ + enum ReasonType { + /** + * Unknown + */ + UNKNOWN, + /** + * Payment was declined. + */ + PAYMENT_DECLINED + } + + /** + * List of possible order state objects. + */ + enum OrderStateInfo { + /** + * Information about order rejection. Used with {@link RejectionInfo}. + */ + REJECTION, + /** + * Information about order receipt. Used with {@link ReceiptInfo}. + */ + RECEIPT, + /** + * Information about order cancellation. Used with {@link CancellationInfo}. + */ + CANCELLATION, + /** + * Information about in-transit order. Used with {@link TransitInfo}. + */ + IN_TRANSIT, + /** + * Information about order fulfillment. Used with {@link FulfillmentInfo}. + */ + FULFILLMENT, + /** + * Information about order return. Used with {@link ReturnInfo}. + */ + RETURN + } + + /** + * List of possible order transaction requirements check result types. + */ + enum ResultType { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * OK to continue transaction. + */ + OK, + /** + * User is expected to take action, e.g. enable payments, to continue + * transaction. + */ + USER_ACTION_REQUIRED, + /** + * Transactions are not supported on current device/surface. + */ + ASSISTANT_SURFACE_NOT_SUPPORTED, + /** + * Transactions are not supported for current region/country. + */ + REGION_NOT_SUPPORTED + } + + /** + * List of possible user decisions to give delivery address. + * @deprecated Use {@link TransactionValues.DeliveryAddressUserDecision} instead. + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export import DeliveryAddressDecision = DeliveryAddressUserDecision; + + /** + * List of possible user decisions to give delivery address. + */ + enum DeliveryAddressUserDecision { + /** + * Unknown. + */ + UNKNOWN, + /** + * User granted delivery address. + */ + ACCEPTED, + /** + * User denied to give delivery address. + */ + REJECTED + } + + /** + * List of possible order location types. + * @deprecated Use {@link TransactionValues.OrderLocationType} instead. + */ + // tslint:disable-next-line: strict-export-declare-modifiers + export import LocationType = OrderLocationType; + + /** + * List of possible order location types. + */ + enum OrderLocationType { + /** + * Unknown. + */ + UNKNOWN, + /** + * Delivery location for an order. + */ + DELIVERY, + /** + * Business location of order provider. + */ + BUSINESS, + /** + * Origin of the order. + */ + ORIGIN, + /** + * Destination of the order. + */ + DESTINATION, + /** + * Pick up location of the order. + */ + PICK_UP + } + + /** + * List of possible order time types. + */ + enum TimeType { + /** + * Unknown. + */ + UNKNOWN, + /** + * Date of delivery for the order. + */ + DELIVERY_DATE, + /** + * Estimated Time of Arrival for order. + */ + ETA, + /** + * Reservation time. + */ + RESERVATION_SLOT + } + + /** + * List of possible tokenization types for the payment method + */ + enum PaymentMethodTokenizationType { + /** + * Unspecified tokenization type. + */ + UNSPECIFIED_TOKENIZATION_TYPE, + /** + * Use external payment gateway tokenization API to tokenize selected payment method. + */ + PAYMENT_GATEWAY + } +} + +/** + * Class for initializing and constructing Order with chainable interface. + */ +export class Order { + /** + * Constructor for Order. + * + * @param orderId Unique identifier for the order. + */ + constructor(orderId: string); + + /** + * ID for the order. Required. + */ + id: string; + + /** + * Cart for the order. + */ + cart?: Cart; + + /** + * Items not held in the order cart. + */ + otherItems: LineItem[]; + + /** + * Image for the order. + */ + image?: Image; + + /** + * TOS for the order. + */ + termsOfServiceUrl?: string; + + /** + * Total price for the order. + */ + totalPrice?: Price; + + /** + * Extensions for this order. Used for vertical-specific order attributes, + * like times and locations. + */ + extension?: object; + + /** + * Set the cart for this order. + * + * @param cart Cart for this order. + * @return Returns current constructed Order. + */ + setCart(cart: Cart): Order; + + /** + * Adds a single item or list of items to the non-cart items list. + * + * @param items Line Items to add. + * @return Returns current constructed Order. + */ + addOtherItems(items: LineItem | LineItem[]): Order; + + /** + * Sets the image for this order. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for + * accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed Order. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): Order; + + /** + * Set the TOS for this order. + * + * @param url String URL of the TOS. + * @return Returns current constructed Order. + */ + setTermsOfService(url: string): Order; + + /** + * Sets the total price for this order. + * + * @param priceType One of TransactionValues.PriceType. + * @param currencyCode Currency code of price. + * @param units Unit count of price. + * @param nanos Partial unit count of price. + * @return Returns current constructed Order. + */ + setTotalPrice(priceType: TransactionValues.PriceType, currencyCode: string, units: number, nanos?: number): Order; + + /** + * Adds an associated location to the order. Up to 2 locations can be added. + * + * @param type One of TransactionValues.OrderLocationType. + * @param location Location to add. + * @return Returns current constructed Order. + */ + addLocation(type: TransactionValues.OrderLocationType, location: Location): Order; + + /** + * Sets an associated time to the order. + * + * @param type One of TransactionValues.TimeType. + * @param time Time to add. Time should be ISO 8601 representation + * of time value. Could be date, datetime, or duration. + * @return Returns current constructed Order. + */ + setTime(type: TransactionValues.TimeType, time: string): Order; +} + +/** + * Class for initializing and constructing Cart with chainable interface. + */ +export class Cart { + /** + * Constructor for Cart. + * + * @param cartId Optional unique identifier for the cart. + */ + constructor(cartId?: string); + + /** + * ID for the cart. Optional. + */ + id?: string; + + /** + * Merchant providing the cart. + */ + merchant?: object; + + /** + * Optional notes about the cart. + */ + notes?: string; + + /** + * Items held in the order cart. + */ + lineItems: LineItem[]; + + /** + * Non-line items. + */ + otherItems: LineItem[]; + + /** + * Set the merchant for this cart. + * + * @param id Merchant ID. + * @param name Name of the merchant. + * @return Returns current constructed Cart. + */ + setMerchant(id: string, name: string): Cart; + + /** + * Set the notes for this cart. + * + * @param notes Notes. + * @return Returns current constructed Cart. + */ + setNotes(notes: string): Cart; + + /** + * Adds a single item or list of items to the cart. + * + * @param items Line Items to add. + * @return Returns current constructed Cart. + */ + addLineItems(items: LineItem | LineItem[]): Cart; + + /** + * Adds a single item or list of items to the non-items list of this cart. + * + * @param items Line Items to add. + * @return Returns current constructed Cart. + */ + addOtherItems(items: LineItem | LineItem[]): Cart; +} + +/** + * Class for initializing and constructing LineItem with chainable interface. + */ +export class LineItem { + /** + * Constructor for LineItem. + * + * @param lineItemId Unique identifier for the item. + * @param name Name of the item. + */ + constructor(lineItemId: string, name: string); + + /** + * Item ID. + */ + id: string; + + /** + * Name of the item. + */ + name: string; + + /** + * Item price. + */ + price?: Price; + + /** + * Sublines for current item. Only valid if item type is REGULAR. + */ + subLines?: Array; + + /** + * Image of the item. + */ + image?: Image; + + /** + * Type of the item. One of TransactionValues.LineItemType. + */ + type?: TransactionValues.LineItemType; + + /** + * Quantity of the item. + */ + quantity?: number; + + /** + * Description for the item. + */ + description?: string; + + /** + * Offer ID for the item. + */ + offerId?: string; + + /** + * Adds a single item or list of items or notes to the sublines. Only valid + * if item type is REGULAR. + * + * @param items Sublines to add. + * @return Returns current constructed LineItem. + */ + addSublines(items: string | LineItem | Array): LineItem; + + /** + * Sets the image for this item. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for + * accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed LineItem. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): LineItem; + + /** + * Sets the price of this item. + * + * @param priceType One of TransactionValues.PriceType. + * @param currencyCode Currency code of price. + * @param units Unit count of price. + * @param nanos Partial unit count of price. + * @return Returns current constructed LineItem. + */ + setPrice(priceType: TransactionValues.PriceType, currencyCode: string, units: number, nanos?: number): LineItem; + + /** + * Set the type of the item. + * + * @param type Type of the item. One of TransactionValues.LineItemType. + * @return Returns current constructed LineItem. + */ + setType(type: TransactionValues.LineItemType): LineItem; + + /** + * Set the quantity of the item. + * + * @param quantity Quantity of the item. + * @return Returns current constructed LineItem. + */ + setQuantity(quantity: number): LineItem; + + /** + * Set the description of the item. + * + * @param description Description of the item. + * @return Returns current constructed LineItem. + */ + setDescription(description: string): LineItem; + + /** + * Set the Offer ID of the item. + * + * @param offerId Offer ID of the item. + * @return Returns current constructed LineItem. + */ + setOfferId(offerId: string): LineItem; +} + +/** + * Class for initializing and constructing OrderUpdate with chainable interface. + */ +export class OrderUpdate { + /** + * Constructor for OrderUpdate. + * + * @param orderId Unique identifier of the order. + * @param isGoogleOrderId True if the order ID is provided by + * Google. False if the order ID is app provided. + */ + constructor(orderId: string, isGoogleOrderId: boolean); + + /** + * Google provided identifier of the order. + */ + googleOrderId?: string; + + /** + * App provided identifier of the order. + */ + actionOrderId?: string; + + /** + * State of the order. + */ + orderState?: object; + + /** + * Updates for items in the order. Mapped by item id to state or price. + */ + lineItemUpdates: object; + + /** + * UTC timestamp of the order update as an RFC 3339 string. + */ + updateTime?: string; + + /** + * Actionable items presented to the user to manage the order. + */ + orderManagementActions: object[]; + + /** + * Notification content to the user for the order update. + */ + userNotification?: object; + + /** + * Updated total price of the order. + */ + totalPrice?: Price; + + /** + * Set the Google provided order ID of the order. + * + * @param orderId Google provided order ID. + * @return Returns current constructed OrderUpdate. + */ + setGoogleOrderId(orderId: string): OrderUpdate; + + /** + * Set the Action provided order ID of the order. + * + * @param orderId Action provided order ID. + * @return Returns current constructed OrderUpdate. + */ + setActionOrderId(orderId: string): OrderUpdate; + + /** + * Set the state of the order. + * + * @param state One of TransactionValues.OrderState. + * @param label Label for the order state. + * @return Returns current constructed OrderUpdate. + */ + setOrderState(state: TransactionValues.OrderState, label: string): OrderUpdate; + + /** + * Set the update time of the order. + * + * @param seconds Seconds since Unix epoch. + * @param nanos Partial time units. It is rounded to the nearest millisecond. + * @return Returns current constructed OrderUpdate. + */ + setUpdateTime(seconds: number, nanos?: number): OrderUpdate; + + /** + * Set the user notification content of the order update. + * + * @param title Title of the notification. + * @param text Text of the notification. + * @return Returns current constructed OrderUpdate. + */ + setUserNotification(title: string, text: object): OrderUpdate; + + /** + * Sets the total price for this order. + * + * @param priceType One of TransactionValues.PriceType. + * @param currencyCode Currency code of price. + * @param units Unit count of price. + * @param nanos Partial unit count of price. + * @return Returns current constructed OrderUpdate. + */ + setTotalPrice(priceType: TransactionValues.PriceType, currencyCode: string, units: number, nanos?: number): OrderUpdate; + + /** + * Adds an actionable item for the user to manage the order. + * + * @param type One of TransactionValues.ActionType. + * @param label Button label. + * @param url URL to open when button is clicked. + * @return Returns current constructed OrderUpdate. + */ + addOrderManagementAction(type: TransactionValues.ActionType, label: string, url: string): OrderUpdate; + + /** + * Adds a single price update for a particular line item in the order. + * + * @param itemId Line item ID for the order item updated. + * @param priceType One of TransactionValues.PriceType. + * @param currencyCode Currency code of new price. + * @param units Unit count of new price. + * @param nanos Partial unit count of new price. + * @param reason Reason for the price change. Required unless a + * reason for this line item change was already declared in + * addLineItemStateUpdate. + * @return Returns current constructed OrderUpdate. + */ + addLineItemPriceUpdate(itemId: string, priceType: TransactionValues.PriceType, currencyCode: string, units: number, nanos?: number, reason?: string): OrderUpdate; + + /** + * Adds a single state update for a particular line item in the order. + * + * @param itemId Line item ID for the order item updated. + * @param state One of TransactionValues.OrderState. + * @param label Label for the new item state. + * @param reason Reason for the price change. This will overwrite + * any reason given in addLineitemPriceUpdate. + * @return Returns current constructed OrderUpdate. + */ + addLineItemStateUpdate(itemId: string, state: TransactionValues.OrderState, label: string, reason?: string): OrderUpdate; + + /** + * Sets some extra information about the order. Takes an order update info + * type, and any accompanying data. This should only be called once per + * order update. + * + * @param type One of TransactionValues.OrderStateInfo. + * @param data Proper Object matching the data necessary for the info + * type. For instance, for the TransactionValues.OrderStateInfo.RECEIPT info + * type, use the {@link ReceiptInfo} data type. + * @return Returns current constructed OrderUpdate. + */ + setInfo(type: string, data: object): OrderUpdate; +} diff --git a/types/actions-on-google/tsconfig.json b/types/actions-on-google/tsconfig.json new file mode 100644 index 0000000000..6682b5c194 --- /dev/null +++ b/types/actions-on-google/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "assistant-app.d.ts", + "actions-sdk-app.d.ts", + "dialogflow-app.d.ts", + "response-builder.d.ts", + "transactions.d.ts", + "actions-on-google-tests.ts" + ] +} diff --git a/types/artyom.js/tslint.json b/types/actions-on-google/tslint.json similarity index 100% rename from types/artyom.js/tslint.json rename to types/actions-on-google/tslint.json diff --git a/types/activex-access/package.json b/types/activex-access/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-access/package.json +++ b/types/activex-access/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-adodb/package.json b/types/activex-adodb/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-adodb/package.json +++ b/types/activex-adodb/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-dao/package.json b/types/activex-dao/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-dao/package.json +++ b/types/activex-dao/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-excel/package.json b/types/activex-excel/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-excel/package.json +++ b/types/activex-excel/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-infopath/package.json b/types/activex-infopath/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-infopath/package.json +++ b/types/activex-infopath/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-libreoffice/tslint.json b/types/activex-libreoffice/tslint.json index 098cdac415..8e56cb082c 100644 --- a/types/activex-libreoffice/tslint.json +++ b/types/activex-libreoffice/tslint.json @@ -3,6 +3,8 @@ "rules": { "interface-name": [false], "ban-types": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, "no-unnecessary-qualifier": false } } \ No newline at end of file diff --git a/types/activex-msforms/package.json b/types/activex-msforms/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-msforms/package.json +++ b/types/activex-msforms/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-mshtml/package.json b/types/activex-mshtml/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-mshtml/package.json +++ b/types/activex-mshtml/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-msxml2/package.json b/types/activex-msxml2/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-msxml2/package.json +++ b/types/activex-msxml2/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-office/package.json b/types/activex-office/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-office/package.json +++ b/types/activex-office/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-outlook/package.json b/types/activex-outlook/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-outlook/package.json +++ b/types/activex-outlook/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-powerpoint/package.json b/types/activex-powerpoint/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-powerpoint/package.json +++ b/types/activex-powerpoint/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-scripting/package.json b/types/activex-scripting/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-scripting/package.json +++ b/types/activex-scripting/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-stdole/package.json b/types/activex-stdole/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-stdole/package.json +++ b/types/activex-stdole/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-vbide/package.json b/types/activex-vbide/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-vbide/package.json +++ b/types/activex-vbide/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-wia/package.json b/types/activex-wia/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-wia/package.json +++ b/types/activex-wia/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-word/package.json b/types/activex-word/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-word/package.json +++ b/types/activex-word/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/adal-angular/adal-angular-tests.ts b/types/adal-angular/adal-angular-tests.ts new file mode 100644 index 0000000000..272591d56e --- /dev/null +++ b/types/adal-angular/adal-angular-tests.ts @@ -0,0 +1,84 @@ +import AuthenticationContext, { + AuthenticationContextOptions, + TokenCallback, + UserCallback +} from "adal-angular"; + +const onLogin: TokenCallback = (errorDescription, idToken, error) => { + if (error) { + console.error(errorDescription, error); + return; + } + if (config.popUp) { + authenticationContext.getUser(onUser); + } +}; + +const onToken: TokenCallback = (errorDesc, token, error) => { + if (error) { + console.error(error); + return; + } + console.log('Making request with token:', token); +}; + +const onUser: UserCallback = (error, user) => { + if (error) { + console.error(error); + return; + } + acquireAnAccessToken(); +}; + +const acquireAnAccessToken = () => { + const resourceId = "https://graph.microsoft.net"; + authenticationContext.acquireToken( + resourceId, + (errorDesc, token, error) => { + if (error) { + if (config.popUp) { + authenticationContext.acquireTokenPopup( + resourceId, + null, + null, + onToken + ); + } else { + authenticationContext.acquireTokenRedirect( + resourceId, + null, + null + ); + } + } else { + onToken(errorDesc, token, error); + } + } + ); +}; + +const config: AuthenticationContextOptions = { + clientId: "7cee0f68-5051-41f6-9e45-80463d21d65d", + redirectUri: "http://localhost:16969/", + instance: "https://login.microsoftonline.com/", + tenant: "contoso.onmicrosoft.com", + extraQueryParameter: "nux=1", + correlationId: "123", + popUp: true, + cacheLocation: "localStorage", + callback: onLogin +}; + +const authenticationContext = new AuthenticationContext(config); + +if (authenticationContext.isCallback(window.location.hash)) { + authenticationContext.handleWindowCallback(); +} else if (authenticationContext.getCachedUser() == null) { + authenticationContext.login(); +} else { + acquireAnAccessToken(); +} + +setTimeout(() => { + authenticationContext.logOut(); +}, 60000); diff --git a/types/adal-angular/index.d.ts b/types/adal-angular/index.d.ts new file mode 100644 index 0000000000..00dc813ee8 --- /dev/null +++ b/types/adal-angular/index.d.ts @@ -0,0 +1,277 @@ +// Type definitions for adal-angular 1.0 +// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js#readme +// Definitions by: Daniel Perez Alvarez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export enum LoggingLevel { + ERROR = 0, + WARNING = 1, + INFO = 2, + VERBOSE = 3 +} + +export type RequestType = "LOGIN" | "RENEW_TOKEN" | "UNKNOWN"; + +export type ResponseType = "id_token token" | "token"; + +export interface RequestInfo { + /** + * Object comprising of fields such as id_token/error, session_state, state, e.t.c. + */ + parameters: any; + /** + * Request type. + */ + requestType: RequestType; + /** + * Whether state is valid. + */ + stateMatch: boolean; + /** + * Unique guid used to match the response with the request. + */ + stateResponse: string; + /** + * Whether `requestType` contains `id_token`, `access_token` or error. + */ + valid: boolean; +} + +export interface UserInfo { + /** + * Username assigned from UPN or email. + */ + userName: string; + /** + * Properties parsed from `id_token`. + */ + profile: any; +} + +export type TokenCallback = ( + errorDesc: string | null, + token: string, + error: any +) => void; + +export type UserCallback = (errorDesc: string | null, user: UserInfo) => void; + +export interface AuthenticationContextOptions { + /** + * Client ID assigned to your app by Azure Active Directory. + */ + clientId: string; + /** + * Endpoint at which you expect to receive tokens.Defaults to `window.location.href`. + */ + redirectUri: string; + /** + * Azure Active Directory instance. Defaults to `https://login.microsoftonline.com/`. + */ + instance?: string; + /** + * Your target tenant. Defaults to `common`. + */ + tenant?: string; + /** + * Query parameters to add to the authentication request. + */ + extraQueryParameter?: string; + /** + * Unique identifier used to map the request with the response. Defaults to RFC4122 version 4 guid (128 bits). + */ + correlationId?: string; + /** + * User defined function of handling the navigation to Azure AD authorization endpoint in case of login. + */ + displayCall?: (url: string) => void; + /** + * Set this to true to enable login in a popup winodow instead of a full redirect. Defaults to `false`. + */ + popUp?: boolean; + /** + * Set this to the resource to request on login. Defaults to `clientId`. + */ + loginResource?: string; + /** + * Set this to redirect the user to a custom login page. + */ + localLoginUrl?: string; + /** + * Redirects to start page after login. Defaults to `true`. + */ + navigateToLoginRequestUrl?: boolean; + /** + * Set this to redirect the user to a custom logout page. + */ + logOutUri?: string; + /** + * Redirects the user to postLogoutRedirectUri after logout. Defaults to `redirectUri`. + */ + postLogoutRedirectUri?: string; + /** + * Sets browser storage to either 'localStorage' or sessionStorage'. Defaults to `sessionStorage`. + */ + cacheLocation?: "localStorage" | "sessionStorage"; + /** + * Array of keywords or URIs. Adal will attach a token to outgoing requests that have these keywords or URIs. + */ + endpoints?: { [resource: string]: string }; + /** + * Array of keywords or URIs. Adal will not attach a token to outgoing requests that have these keywords or URIs. + */ + anonymousEndpoints?: string[]; + /** + * If the cached token is about to be expired in the expireOffsetSeconds (in seconds), Adal will renew the token instead of using the cached token. Defaults to 300 seconds. + */ + expireOffsetSeconds?: number; + /** + * The number of milliseconds of inactivity before a token renewal response from AAD should be considered timed out. Defaults to 6 seconds. + */ + loadFrameTimeout?: number; + /** + * Callback to be invoked when a token is acquired. + */ + callback?: TokenCallback; +} + +export default class AuthenticationContext { + constructor(options: AuthenticationContextOptions); + /** + * Initiates the login process by redirecting the user to Azure AD authorization endpoint. + */ + login(): void; + /** + * Returns whether a login is in progress. + */ + loginInProgress(): boolean; + /** + * Gets token for the specified resource from the cache. + * @param resource A URI that identifies the resource for which the token is requested. + */ + getCachedToken(resource: string): string; + /** + * If user object exists, returns it. Else creates a new user object by decoding `id_token` from the cache. + */ + getCachedUser(): UserInfo; + /** + * Adds the passed callback to the array of callbacks for the specified resource. + * @param resource A URI that identifies the resource for which the token is requested. + * @param expectedState A unique identifier (guid). + * @param callback The callback provided by the caller. It will be called with token or error. + */ + registerCallback( + expectedState: string, + resource: string, + callback: TokenCallback + ): void; + /** + * Acquires token from the cache if it is not expired. Otherwise sends request to AAD to obtain a new token. + * @param resource Resource URI identifying the target resource. + * @param callback The callback provided by the caller. It will be called with token or error. + */ + acquireToken(resource: string, callback: TokenCallback): void; + /** + * Acquires token (interactive flow using a popup window) by sending request to AAD to obtain a new token. + * @param resource Resource URI identifying the target resource. + * @param extraQueryParameters Query parameters to add to the authentication request. + * @param claims Claims to add to the authentication request. + * @param callback The callback provided by the caller. It will be called with token or error. + */ + acquireTokenPopup( + resource: string, + extraQueryParameters: string | null | undefined, + claims: string | null | undefined, + callback: TokenCallback + ): void; + /** + * Acquires token (interactive flow using a redirect) by sending request to AAD to obtain a new token. In this case the callback passed in the authentication request constructor will be called. + * @param resource Resource URI identifying the target resource. + * @param extraQueryParameters Query parameters to add to the authentication request. + * @param claims Claims to add to the authentication request. + */ + acquireTokenRedirect( + resource: string, + extraQueryParameters?: string | null, + claims?: string | null + ): void; + /** + * Redirects the browser to Azure AD authorization endpoint. + * @param urlNavigate URL of the authorization endpoint. + */ + promptUser(urlNavigate: string): void; + /** + * Clears cache items. + */ + clearCache(): void; + /** + * Clears cache items for a given resource. + * @param resource Resource URI identifying the target resource. + */ + clearCacheForResource(resource: string): void; + /** + * Redirects user to logout endpoint. After logout, it will redirect to `postLogoutRedirectUri` if added as a property on the config object. + */ + logOut(): void; + /** + * Calls the passed in callback with the user object or error message related to the user. + * @param callback The callback provided by the caller. It will be called with user or error. + */ + getUser(callback: UserCallback): void; + /** + * Checks if the URL fragment contains access token, id token or error description. + * @param hash Hash passed from redirect page. + */ + isCallback(hash: string): boolean; + /** + * Gets login error. + */ + getLoginError(): string; + /** + * Creates a request info object from the URL fragment and returns it. + */ + getRequestInfo(hash: string): RequestInfo; + /** + * Saves token or error received in the response from AAD in the cache. In case of `id_token`, it also creates the user object. + */ + saveTokenFromHash(requestInfo: RequestInfo): void; + /** + * Gets resource for given endpoint if mapping is provided with config. + * @param endpoint Resource URI identifying the target resource. + */ + getResourceForEndpoint(resource: string): string; + /** + * This method must be called for processing the response received from AAD. It extracts the hash, processes the token or error, saves it in the cache and calls the callbacks with the result. + * @param hash Hash fragment of URL. Defaults to `window.location.hash`. + */ + handleWindowCallback(hash?: string): void; + + /** + * Checks the logging Level, constructs the log message and logs it. Users need to implement/override this method to turn on logging. + * @param level Level can be set 0, 1, 2 and 3 which turns on 'error', 'warning', 'info' or 'verbose' level logging respectively. + * @param message Message to log. + * @param error Error to log. + */ + log(level: LoggingLevel, message: string, error: any): void; + /** + * Logs messages when logging level is set to 0. + * @param message Message to log. + * @param error Error to log. + */ + error(message: string, error: any): void; + /** + * Logs messages when logging level is set to 1. + * @param message Message to log. + */ + warn(message: string): void; + /** + * Logs messages when logging level is set to 2. + * @param message Message to log. + */ + info(message: string): void; + /** + * Logs messages when logging level is set to 3. + * @param message Message to log. + */ + verbose(message: string): void; +} diff --git a/types/adal-angular/tsconfig.json b/types/adal-angular/tsconfig.json new file mode 100644 index 0000000000..9052e3fc04 --- /dev/null +++ b/types/adal-angular/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "adal-angular-tests.ts" + ] +} \ No newline at end of file diff --git a/types/askmethat-rating/tslint.json b/types/adal-angular/tslint.json similarity index 100% rename from types/askmethat-rating/tslint.json rename to types/adal-angular/tslint.json diff --git a/types/adal/adal-angular.d.ts b/types/adal/adal-angular.d.ts deleted file mode 100644 index 28d9682f19..0000000000 --- a/types/adal/adal-angular.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Type definitions for ADAL.JS 1.0.8 -// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js -// Definitions by: mmaitre314 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/// - -declare namespace adal { - - interface AdalAuthenticationServiceProvider { - init(configOptions: Config, httpProvider: angular.IHttpProvider): void; - } - - interface UserInfo { - isAuthenticated: boolean, - userName: string, - loginError: string, - profile: any - } - - interface AdalAuthenticationService { - - config: Config; - userInfo: UserInfo, - - login(): void; - loginInProgress(): boolean; - logOut(): void; - getCachedToken(resource: string): string; - acquireToken(resource: string): angular.IPromise; - getUser(): angular.IPromise; - getResourceForEndpoint(endpoint: string): string, - clearCache(): void; - clearCacheForResource(resource: string): void; - info(message: string): void; - verbose(message: string): void; - } - -} \ No newline at end of file diff --git a/types/adal/index.d.ts b/types/adal/index.d.ts deleted file mode 100644 index a51933b734..0000000000 --- a/types/adal/index.d.ts +++ /dev/null @@ -1,179 +0,0 @@ -// Type definitions for ADAL.JS 1.0.14 -// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js -// Definitions by: mmaitre314 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -declare var AuthenticationContext: adal.AuthenticationContextStatic; -declare var Logging: adal.Logging; - -declare module 'adal' { - export const AuthenticationContext: adal.AuthenticationContextStatic; - export const Logging: adal.Logging; -} - -declare namespace adal { - - interface Config { - tenant?: string; - clientId: string; - redirectUri?: string; - instance?: string; - endpoints?: any; // If you need to send CORS api requests. - popUp?: boolean; - localLoginUrl?: string; - displayCall?: (urlNavigate: string) => any; - postLogoutRedirectUri?: string; // redirect url after succesful logout operation - cacheLocation?: string; - anonymousEndpoints?: string[]; - expireOffsetSeconds?: number; - correlationId?: string; - loginResource?: string; - resource?: string; - extraQueryParameter?: string; - navigateToLoginRequestUrl?: boolean; - logOutUri?: string; - isAngular?: boolean; - } - - interface User { - userName: string; - profile: any; - } - - interface RequestInfo { - valid: boolean; - parameters: any; - stateMatch: boolean; - stateResponse: string; - requestType: string; - } - - interface Logging { - log: (message: string) => void; - level: LoggingLevel; - } - - enum LoggingLevel { - ERROR = 0, - WARNING = 1, - INFO = 2, - VERBOSE = 3 - } - - interface AuthenticationContextStatic { - new (config: Config): AuthenticationContext; - } - - interface AuthenticationContext { - - instance: string; - config: Config; - - /** - * Gets initial Idtoken for the app backend - * Saves the resulting Idtoken in localStorage. - */ - login(): void; - - /** - * Indicates whether login is in progress now or not. - */ - loginInProgress(): boolean; - - /** - * Gets token for the specified resource from local storage cache - * @param {string} resource A URI that identifies the resource for which the token is valid. - * @returns {string} token if exists and not expired or null - */ - getCachedToken(resource: string): string; - - /** - * Retrieves and parse idToken from localstorage - * @returns {User} user object - */ - getCachedUser(): User; - - registerCallback(expectedState: string, resource: string, callback: (message: string, token: string) => any): void; - - /** - * Acquire token from cache if not expired and available. Acquires token from iframe if expired. - * @param {string} resource ResourceUri identifying the target resource - * @param {requestCallback} callback - */ - acquireToken(resource: string, callback: (message: string, token: string) => any): void; - - /** - * Redirect the Browser to Azure AD Authorization endpoint - * @param {string} urlNavigate The authorization request url - */ - promptUser(urlNavigate: string): void; - - /** - * Clear cache items. - */ - clearCache(): void; - - /** - * Clear cache items for a resource. - */ - clearCacheForResource(resource: string): void; - - /** - * Logout user will redirect page to logout endpoint. - * After logout, it will redirect to post_logout page if provided. - */ - logOut(): void; - - /** - * Gets a user profile - * @param {requestCallback} callback - The callback that handles the response. - */ - getUser(callback: (message: string, user?: User) => any): void; - - /** - * Checks if hash contains access token or id token or error_description - * @param {string} hash - Hash passed from redirect page - * @returns {Boolean} - */ - isCallback(hash: string): boolean; - - /** - * Gets login error - * @returns {string} error message related to login - */ - getLoginError(): string; - - /** - * Gets requestInfo from given hash. - * @returns {RequestInfo} for appropriate hash. - */ - getRequestInfo(hash: string): RequestInfo; - - /** - * Saves token from hash that is received from redirect. - */ - saveTokenFromHash(requestInfo: RequestInfo): void; - - /** - * Gets resource for given endpoint if mapping is provided with config. - * @param {string} endpoint - API endpoint - * @returns {string} resource for this API endpoint - */ - getResourceForEndpoint(endpoint: string): string; - - /** - * Handles redirection after login operation. - * Gets access token from url and saves token to the (local/session) storage - * or saves error in case unsuccessful login. - */ - handleWindowCallback(): void; - - log(level: number, message: string, error: any): void; - error(message: string, error: any): void; - warn(message: string): void; - info(message: string): void; - verbose(message: string): void; - } - -} diff --git a/types/adal/test/angular.ts b/types/adal/test/angular.ts deleted file mode 100644 index 64ab64c898..0000000000 --- a/types/adal/test/angular.ts +++ /dev/null @@ -1,46 +0,0 @@ - - -// Code samples from: -// - https://github.com/AzureAD/azure-activedirectory-library-for-js -// - https://github.com/Azure-Samples/active-directory-angularjs-singlepageapp - -// Variable provided by AngularJS -var $httpProvider: angular.IHttpProvider = null; -var adalAuthenticationServiceProvider: adal.AdalAuthenticationServiceProvider = null; -var adalAuthenticationService: adal.AdalAuthenticationService = null; - -var endpoints = { - "https://yourhost/api": "b6a68585-5287-45b2-ba82-383ba1f60932", -}; -adalAuthenticationServiceProvider.init({ - tenant: "52d4b072-9470-49fb-8721-bc3a1c9912a1", - clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e", - endpoints: endpoints - }, - $httpProvider -); - -adalAuthenticationServiceProvider.init({ - clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e" - }, - $httpProvider -); - -adalAuthenticationServiceProvider.init( - { - clientId: 'cb68f72f...', - cacheLocation: 'localStorage' - }, - $httpProvider // pass http provider to inject request interceptor to attach tokens -); - -adalAuthenticationServiceProvider.init({ - tenant: 'Enter your tenant name here e.g. contoso.onmicrosoft.com', - clientId: 'Enter your client ID here e.g. e9a5a8b6-8af7-4719-9821-0deef255f68e', - extraQueryParameter: 'nux=1' - }, - $httpProvider -); - -adalAuthenticationService.login(); -adalAuthenticationService.logOut(); diff --git a/types/adal/test/index.ts b/types/adal/test/index.ts deleted file mode 100644 index 32a6715222..0000000000 --- a/types/adal/test/index.ts +++ /dev/null @@ -1,24 +0,0 @@ - - -var endpoints = { - "https://yourhost/api": "b6a68585-5287-45b2-ba82-383ba1f60932", -}; - -var config : adal.Config = { - tenant: "52d4b072-9470-49fb-8721-bc3a1c9912a1", // Optional by default, it sends common - clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e", // Required - endpoints: endpoints // If you need to send CORS api requests. -}; - -var auth = new AuthenticationContext(config); - -Logging.log = (message: string) => { - console.log(message); -} - -Logging.level = 4; - -auth.info("Logging message"); - -var userName: string = auth.getCachedUser().userName;var postLogoutRedirectUrl = auth.config.postLogoutRedirectUri; -var isValidRequest = auth.getRequestInfo('hash').valid; \ No newline at end of file diff --git a/types/adal/tsconfig.json b/types/adal/tsconfig.json deleted file mode 100644 index a024918b3a..0000000000 --- a/types/adal/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "adal-angular.d.ts", - "test/index.ts", - "test/angular.ts" - ] -} \ No newline at end of file diff --git a/types/add-zero/add-zero-tests.ts b/types/add-zero/add-zero-tests.ts new file mode 100644 index 0000000000..ac0509d26d --- /dev/null +++ b/types/add-zero/add-zero-tests.ts @@ -0,0 +1,3 @@ +import addZero from "add-zero"; + +addZero(5, 2); diff --git a/types/add-zero/index.d.ts b/types/add-zero/index.d.ts new file mode 100644 index 0000000000..907364a62d --- /dev/null +++ b/types/add-zero/index.d.ts @@ -0,0 +1,6 @@ +// Type definitions for add-zero 1.0 +// Project: https://github.com/rafaelrinaldi/add-zero#readme +// Definitions by: Giles Roadnight +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default function addZero(value: string | number, digits?: number): string; diff --git a/types/add-zero/tsconfig.json b/types/add-zero/tsconfig.json new file mode 100644 index 0000000000..e71d235cdf --- /dev/null +++ b/types/add-zero/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", + "add-zero-tests.ts" + ] +} diff --git a/types/aurelia-knockout/tslint.json b/types/add-zero/tslint.json similarity index 100% rename from types/aurelia-knockout/tslint.json rename to types/add-zero/tslint.json diff --git a/types/add2home/tslint.json b/types/add2home/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/add2home/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/adm-zip/tslint.json b/types/adm-zip/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/adm-zip/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/adone/glosses/collections.d.ts b/types/adone/glosses/collections.d.ts index c21c13abb9..178921136d 100644 --- a/types/adone/glosses/collections.d.ts +++ b/types/adone/glosses/collections.d.ts @@ -455,7 +455,6 @@ declare namespace adone { * Writes a 32bit le float * * @param offset Offset to write to - * @returns {this} */ writeFloatLE(value: number, offset?: number): this; @@ -802,8 +801,7 @@ declare namespace adone { * Resizes this ByteArray to be backed by a buffer of at least the given capacity. * Will do nothing if already that large or larger. * - * @param {number} capacity Capacity required - * @returns {this} + * @param capacity Capacity required */ resize(capacity: number): this; @@ -1654,6 +1652,7 @@ declare namespace adone { * Ends the stream */ end(chunk?: Buffer): void; + end(chunk?: () => void): void; /** * Returns the byte at the specified index @@ -1679,8 +1678,8 @@ declare namespace adone { * Returns a new BufferList object containing the bytes within the range specified. * No copies will be performed. All buffers in the result share memory with the original list. * - * @param {number} start slice from - * @param {number} end slice to + * @param start slice from + * @param end slice to */ shallowSlice(start?: number, end?: number): BufferList; @@ -1705,11 +1704,11 @@ declare namespace adone { destroy(): void; then( - onfulfilled?: ((value: Buffer) => T1 | PromiseLike) | undefined | null, - onrejected?: ((reason: any) => T2 | PromiseLike) | undefined | null + onfulfilled?: ((value: Buffer) => T1 | PromiseLike) | null, + onrejected?: ((reason: any) => T2 | PromiseLike) | null ): PromiseLike; - catch(onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): PromiseLike; + catch(onrejected?: ((reason: any) => T | PromiseLike) | null): PromiseLike; } /** diff --git a/types/adone/glosses/datetime.d.ts b/types/adone/glosses/datetime.d.ts index 417f706d95..5ce320f613 100644 --- a/types/adone/glosses/datetime.d.ts +++ b/types/adone/glosses/datetime.d.ts @@ -731,9 +731,6 @@ declare namespace adone { */ creationData(): DatetimeCreationData; - /** - * - */ parsingFlags(): DatetimeParsingFlags; /** diff --git a/types/adone/glosses/math/matrix.d.ts b/types/adone/glosses/math/matrix.d.ts index 0340929ed6..2b0e54e450 100644 --- a/types/adone/glosses/math/matrix.d.ts +++ b/types/adone/glosses/math/matrix.d.ts @@ -149,18 +149,18 @@ declare namespace adone.math { /** * Math.ceil the components of a vec2 * - * @param {vec2} out the receiving vector - * @param {vec2} a vector to ceil - * @returns {vec2} out + * @param out the receiving vector + * @param a vector to ceil + * @returns out */ function ceil(out: I.vec2, a: I.vec2 | number[]): I.vec2; /** * Math.floor the components of a vec2 * - * @param {vec2} out the receiving vector - * @param {vec2} a vector to floor - * @returns {vec2} out + * @param out the receiving vector + * @param a vector to floor + * @returns out */ function floor(out: I.vec2, a: I.vec2 | number[]): I.vec2; @@ -187,9 +187,9 @@ declare namespace adone.math { /** * Math.round the components of a vec2 * - * @param {vec2} out the receiving vector - * @param {vec2} a vector to round - * @returns {vec2} out + * @param out the receiving vector + * @param a vector to round + * @returns out */ function round(out: I.vec2, a: I.vec2 | number[]): I.vec2; @@ -438,18 +438,18 @@ declare namespace adone.math { /** * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) * - * @param {vec2} a The first vector. - * @param {vec2} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function exactEquals(a: I.vec2 | number[], b: I.vec2 | number[]): boolean; /** * Returns whether or not the vectors have approximately the same elements in the same position. * - * @param {vec2} a The first vector. - * @param {vec2} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function equals(a: I.vec2 | number[], b: I.vec2 | number[]): boolean; } @@ -580,18 +580,18 @@ declare namespace adone.math { /** * Math.ceil the components of a vec3 * - * @param {vec3} out the receiving vector - * @param {vec3} a vector to ceil - * @returns {vec3} out + * @param out the receiving vector + * @param a vector to ceil + * @returns out */ function ceil(out: I.vec3, a: I.vec3 | number[]): I.vec3; /** * Math.floor the components of a vec3 * - * @param {vec3} out the receiving vector - * @param {vec3} a vector to floor - * @returns {vec3} out + * @param out the receiving vector + * @param a vector to floor + * @returns out */ function floor(out: I.vec3, a: I.vec3 | number[]): I.vec3; @@ -618,9 +618,9 @@ declare namespace adone.math { /** * Math.round the components of a vec3 * - * @param {vec3} out the receiving vector - * @param {vec3} a vector to round - * @returns {vec3} out + * @param out the receiving vector + * @param a vector to round + * @returns out */ function round(out: I.vec3, a: I.vec3 | number[]): I.vec3; @@ -773,26 +773,26 @@ declare namespace adone.math { /** * Performs a hermite interpolation with two control points * - * @param {vec3} out the receiving vector - * @param {vec3} a the first operand - * @param {vec3} b the second operand - * @param {vec3} c the third operand - * @param {vec3} d the fourth operand - * @param {number} t interpolation amount between the two inputs - * @returns {vec3} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param c the third operand + * @param d the fourth operand + * @param t interpolation amount between the two inputs + * @returns out */ function hermite(out: I.vec3, a: I.vec3 | number[], b: I.vec3 | number[], c: I.vec3 | number[], d: I.vec3 | number[], t: number): I.vec3; /** * Performs a bezier interpolation with two control points * - * @param {vec3} out the receiving vector - * @param {vec3} a the first operand - * @param {vec3} b the second operand - * @param {vec3} c the third operand - * @param {vec3} d the fourth operand - * @param {number} t interpolation amount between the two inputs - * @returns {vec3} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param c the third operand + * @param d the fourth operand + * @param t interpolation amount between the two inputs + * @returns out */ function bezier(out: I.vec3, a: I.vec3 | number[], b: I.vec3 | number[], c: I.vec3 | number[], d: I.vec3 | number[], t: number): I.vec3; @@ -884,7 +884,6 @@ declare namespace adone.math { * @param fn Function to call for each vector in the array * @param arg additional argument to pass to fn * @returns a - * @function */ function forEach(a: Float32Array, stride: number, offset: number, count: number, fn: (a: I.vec3 | number[], b: I.vec3 | number[], arg: any) => void, arg: any): Float32Array; @@ -898,7 +897,6 @@ declare namespace adone.math { * @param count Number of vec3s to iterate over. If 0 iterates over entire array * @param fn Function to call for each vector in the array * @returns a - * @function */ function forEach(a: Float32Array, stride: number, offset: number, count: number, fn: (a: I.vec3 | number[], b: I.vec3 | number[]) => void): Float32Array; @@ -922,18 +920,18 @@ declare namespace adone.math { /** * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) * - * @param {vec3} a The first vector. - * @param {vec3} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function exactEquals(a: I.vec3 | number[], b: I.vec3 | number[]): boolean; /** * Returns whether or not the vectors have approximately the same elements in the same position. * - * @param {vec3} a The first vector. - * @param {vec3} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function equals(a: I.vec3 | number[], b: I.vec3 | number[]): boolean; } @@ -1066,18 +1064,18 @@ declare namespace adone.math { /** * Math.ceil the components of a vec4 * - * @param {vec4} out the receiving vector - * @param {vec4} a vector to ceil - * @returns {vec4} out + * @param out the receiving vector + * @param a vector to ceil + * @returns out */ function ceil(out: I.vec4, a: I.vec4 | number[]): I.vec4; /** * Math.floor the components of a vec4 * - * @param {vec4} out the receiving vector - * @param {vec4} a vector to floor - * @returns {vec4} out + * @param out the receiving vector + * @param a vector to floor + * @returns out */ function floor(out: I.vec4, a: I.vec4 | number[]): I.vec4; @@ -1104,9 +1102,9 @@ declare namespace adone.math { /** * Math.round the components of a vec4 * - * @param {vec4} out the receiving vector - * @param {vec4} a vector to round - * @returns {vec4} out + * @param out the receiving vector + * @param a vector to round + * @returns out */ function round(out: I.vec4, a: I.vec4 | number[]): I.vec4; @@ -1294,7 +1292,6 @@ declare namespace adone.math { * @param fn Function to call for each vector in the array * @param arg additional argument to pass to fn * @returns a - * @function */ function forEach(a: Float32Array, stride: number, offset: number, count: number, fn: (a: I.vec4 | number[], b: I.vec4 | number[], arg: any) => void, arg: any): Float32Array; @@ -1308,7 +1305,6 @@ declare namespace adone.math { * @param count Number of vec4s to iterate over. If 0 iterates over entire array * @param fn Function to call for each vector in the array * @returns a - * @function */ function forEach(a: Float32Array, stride: number, offset: number, count: number, fn: (a: I.vec4 | number[], b: I.vec4 | number[]) => void): Float32Array; @@ -1324,18 +1320,18 @@ declare namespace adone.math { /** * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) * - * @param {vec4} a The first vector. - * @param {vec4} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function exactEquals(a: I.vec4 | number[], b: I.vec4 | number[]): boolean; /** * Returns whether or not the vectors have approximately the same elements in the same position. * - * @param {vec4} a The first vector. - * @param {vec4} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function equals(a: I.vec4 | number[], b: I.vec4 | number[]): boolean; } @@ -1383,23 +1379,23 @@ declare namespace adone.math { /** * Create a new mat2 with the given values * - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m10 Component in column 1, row 0 position (index 2) - * @param {number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out A new 2x2 matrix + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m10 Component in column 1, row 0 position (index 2) + * @param m11 Component in column 1, row 1 position (index 3) + * @returns out A new 2x2 matrix */ function fromValues(m00: number, m01: number, m10: number, m11: number): I.mat2; /** * Set the components of a mat2 to the given values * - * @param {mat2} out the receiving matrix - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m10 Component in column 1, row 0 position (index 2) - * @param {number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out + * @param out the receiving matrix + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m10 Component in column 1, row 0 position (index 2) + * @param m11 Component in column 1, row 1 position (index 3) + * @returns out */ function set(out: I.mat2, m00: number, m01: number, m10: number, m11: number): I.mat2; @@ -1485,9 +1481,9 @@ declare namespace adone.math { * mat2.identity(dest); * mat2.rotate(dest, dest, rad); * - * @param {mat2} out mat2 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat2} out + * @param out mat2 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromRotation(out: I.mat2, rad: number): I.mat2; @@ -1498,9 +1494,9 @@ declare namespace adone.math { * mat2.identity(dest); * mat2.scale(dest, dest, vec); * - * @param {mat2} out mat2 receiving operation result - * @param {vec2} v Scaling vector - * @returns {mat2} out + * @param out mat2 receiving operation result + * @param v Scaling vector + * @returns out */ function fromScaling(out: I.mat2, v: I.vec2 | number[]): I.mat2; @@ -1532,69 +1528,69 @@ declare namespace adone.math { /** * Adds two mat2's * - * @param {mat2} out the receiving matrix - * @param {mat2} a the first operand - * @param {mat2} b the second operand - * @returns {mat2} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function add(out: I.mat2, a: I.mat2, b: I.mat2): I.mat2; /** * Subtracts matrix b from matrix a * - * @param {mat2} out the receiving matrix - * @param {mat2} a the first operand - * @param {mat2} b the second operand - * @returns {mat2} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function subtract(out: I.mat2, a: I.mat2, b: I.mat2): I.mat2; /** * Subtracts matrix b from matrix a * - * @param {mat2} out the receiving matrix - * @param {mat2} a the first operand - * @param {mat2} b the second operand - * @returns {mat2} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function sub(out: I.mat2, a: I.mat2, b: I.mat2): I.mat2; /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * - * @param {mat2} a The first matrix. - * @param {mat2} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function exactEquals(a: I.mat2, b: I.mat2): boolean; /** * Returns whether or not the matrices have approximately the same elements in the same position. * - * @param {mat2} a The first matrix. - * @param {mat2} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function equals(a: I.mat2, b: I.mat2): boolean; /** * Multiply each element of the matrix by a scalar. * - * @param {mat2} out the receiving matrix - * @param {mat2} a the matrix to scale - * @param {number} b amount to scale the matrix's elements by - * @returns {mat2} out + * @param out the receiving matrix + * @param a the matrix to scale + * @param b amount to scale the matrix's elements by + * @returns out */ function multiplyScalar(out: I.mat2, a: I.mat2, b: number): I.mat2; /** * Adds two mat2's after multiplying each element of the second operand by a scalar value. * - * @param {mat2} out the receiving vector - * @param {mat2} a the first operand - * @param {mat2} b the second operand - * @param {number} scale the amount to scale b's elements by before adding - * @returns {mat2} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b's elements by before adding + * @returns out */ function multiplyScalarAndAdd(out: I.mat2, a: I.mat2, b: I.mat2, scale: number): I.mat2; } @@ -1642,27 +1638,27 @@ declare namespace adone.math { /** * Create a new mat2d with the given values * - * @param {number} a Component A (index 0) - * @param {number} b Component B (index 1) - * @param {number} c Component C (index 2) - * @param {number} d Component D (index 3) - * @param {number} tx Component TX (index 4) - * @param {number} ty Component TY (index 5) - * @returns {mat2d} A new mat2d + * @param a Component A (index 0) + * @param b Component B (index 1) + * @param c Component C (index 2) + * @param d Component D (index 3) + * @param tx Component TX (index 4) + * @param ty Component TY (index 5) + * @returns A new mat2d */ function fromValues(a: number, b: number, c: number, d: number, tx: number, ty: number): I.mat2d; /** * Set the components of a mat2d to the given values * - * @param {mat2d} out the receiving matrix - * @param {number} a Component A (index 0) - * @param {number} b Component B (index 1) - * @param {number} c Component C (index 2) - * @param {number} d Component D (index 3) - * @param {number} tx Component TX (index 4) - * @param {number} ty Component TY (index 5) - * @returns {mat2d} out + * @param out the receiving matrix + * @param a Component A (index 0) + * @param b Component B (index 1) + * @param c Component C (index 2) + * @param d Component D (index 3) + * @param tx Component TX (index 4) + * @param ty Component TY (index 5) + * @returns out */ function set(out: I.mat2d, a: number, b: number, c: number, d: number, tx: number, ty: number): I.mat2d; @@ -1740,9 +1736,9 @@ declare namespace adone.math { * mat2d.identity(dest); * mat2d.rotate(dest, dest, rad); * - * @param {mat2d} out mat2d receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat2d} out + * @param out mat2d receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromRotation(out: I.mat2d, rad: number): I.mat2d; @@ -1753,9 +1749,9 @@ declare namespace adone.math { * mat2d.identity(dest); * mat2d.scale(dest, dest, vec); * - * @param {mat2d} out mat2d receiving operation result - * @param {vec2} v Scaling vector - * @returns {mat2d} out + * @param out mat2d receiving operation result + * @param v Scaling vector + * @returns out */ function fromScaling(out: I.mat2d, v: I.vec2 | number[]): I.mat2d; @@ -1766,9 +1762,9 @@ declare namespace adone.math { * mat2d.identity(dest); * mat2d.translate(dest, dest, vec); * - * @param {mat2d} out mat2d receiving operation result - * @param {vec2} v Translation vector - * @returns {mat2d} out + * @param out mat2d receiving operation result + * @param v Translation vector + * @returns out */ function fromTranslation(out: I.mat2d, v: I.vec2 | number[]): I.mat2d; @@ -1791,69 +1787,69 @@ declare namespace adone.math { /** * Adds two mat2d's * - * @param {mat2d} out the receiving matrix - * @param {mat2d} a the first operand - * @param {mat2d} b the second operand - * @returns {mat2d} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function add(out: I.mat2d, a: I.mat2d, b: I.mat2d): I.mat2d; /** * Subtracts matrix b from matrix a * - * @param {mat2d} out the receiving matrix - * @param {mat2d} a the first operand - * @param {mat2d} b the second operand - * @returns {mat2d} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function subtract(out: I.mat2d, a: I.mat2d, b: I.mat2d): I.mat2d; /** * Subtracts matrix b from matrix a * - * @param {mat2d} out the receiving matrix - * @param {mat2d} a the first operand - * @param {mat2d} b the second operand - * @returns {mat2d} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function sub(out: I.mat2d, a: I.mat2d, b: I.mat2d): I.mat2d; /** * Multiply each element of the matrix by a scalar. * - * @param {mat2d} out the receiving matrix - * @param {mat2d} a the matrix to scale - * @param {number} b amount to scale the matrix's elements by - * @returns {mat2d} out + * @param out the receiving matrix + * @param a the matrix to scale + * @param b amount to scale the matrix's elements by + * @returns out */ function multiplyScalar(out: I.mat2d, a: I.mat2d, b: number): I.mat2d; /** * Adds two mat2d's after multiplying each element of the second operand by a scalar value. * - * @param {mat2d} out the receiving vector - * @param {mat2d} a the first operand - * @param {mat2d} b the second operand - * @param {number} scale the amount to scale b's elements by before adding - * @returns {mat2d} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b's elements by before adding + * @returns out */ function multiplyScalarAndAdd(out: I.mat2d, a: I.mat2d, b: I.mat2d, scale: number): I.mat2d; /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * - * @param {mat2d} a The first matrix. - * @param {mat2d} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function exactEquals(a: I.mat2d, b: I.mat2d): boolean; /** * Returns whether or not the matrices have approximately the same elements in the same position. * - * @param {mat2d} a The first matrix. - * @param {mat2d} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function equals(a: I.mat2d, b: I.mat2d): boolean; } @@ -1876,9 +1872,9 @@ declare namespace adone.math { /** * Copies the upper-left 3x3 values into the given mat3. * - * @param {mat3} out the receiving 3x3 matrix - * @param {mat4} a the source 4x4 matrix - * @returns {mat3} out + * @param out the receiving 3x3 matrix + * @param a the source 4x4 matrix + * @returns out */ function fromMat4(out: I.mat3, a: I.mat4): I.mat3; @@ -1902,33 +1898,33 @@ declare namespace adone.math { /** * Create a new mat3 with the given values * - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m02 Component in column 0, row 2 position (index 2) - * @param {number} m10 Component in column 1, row 0 position (index 3) - * @param {number} m11 Component in column 1, row 1 position (index 4) - * @param {number} m12 Component in column 1, row 2 position (index 5) - * @param {number} m20 Component in column 2, row 0 position (index 6) - * @param {number} m21 Component in column 2, row 1 position (index 7) - * @param {number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} A new mat3 + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m02 Component in column 0, row 2 position (index 2) + * @param m10 Component in column 1, row 0 position (index 3) + * @param m11 Component in column 1, row 1 position (index 4) + * @param m12 Component in column 1, row 2 position (index 5) + * @param m20 Component in column 2, row 0 position (index 6) + * @param m21 Component in column 2, row 1 position (index 7) + * @param m22 Component in column 2, row 2 position (index 8) + * @returns A new mat3 */ function fromValues(m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): I.mat3; /** * Set the components of a mat3 to the given values * - * @param {mat3} out the receiving matrix - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m02 Component in column 0, row 2 position (index 2) - * @param {number} m10 Component in column 1, row 0 position (index 3) - * @param {number} m11 Component in column 1, row 1 position (index 4) - * @param {number} m12 Component in column 1, row 2 position (index 5) - * @param {number} m20 Component in column 2, row 0 position (index 6) - * @param {number} m21 Component in column 2, row 1 position (index 7) - * @param {number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} out + * @param out the receiving matrix + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m02 Component in column 0, row 2 position (index 2) + * @param m10 Component in column 1, row 0 position (index 3) + * @param m11 Component in column 1, row 1 position (index 4) + * @param m12 Component in column 1, row 2 position (index 5) + * @param m20 Component in column 2, row 0 position (index 6) + * @param m21 Component in column 2, row 1 position (index 7) + * @param m22 Component in column 2, row 2 position (index 8) + * @returns out */ function set(out: I.mat3, m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): I.mat3; @@ -2032,9 +2028,9 @@ declare namespace adone.math { * mat3.identity(dest); * mat3.translate(dest, dest, vec); * - * @param {mat3} out mat3 receiving operation result - * @param {vec2} v Translation vector - * @returns {mat3} out + * @param out mat3 receiving operation result + * @param v Translation vector + * @returns out */ function fromTranslation(out: I.mat3, v: I.vec2 | number[]): I.mat3; @@ -2045,9 +2041,9 @@ declare namespace adone.math { * mat3.identity(dest); * mat3.rotate(dest, dest, rad); * - * @param {mat3} out mat3 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat3} out + * @param out mat3 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromRotation(out: I.mat3, rad: number): I.mat3; @@ -2058,9 +2054,9 @@ declare namespace adone.math { * mat3.identity(dest); * mat3.scale(dest, dest, vec); * - * @param {mat3} out mat3 receiving operation result - * @param {vec2} v Scaling vector - * @returns {mat3} out + * @param out mat3 receiving operation result + * @param v Scaling vector + * @returns out */ function fromScaling(out: I.mat3, v: I.vec2 | number[]): I.mat3; @@ -2068,7 +2064,7 @@ declare namespace adone.math { * Copies the values from a mat2d into a mat3 * * @param out the receiving matrix - * @param {mat2d} a the matrix to copy + * @param a the matrix to copy * @returns out */ function fromMat2d(out: I.mat3, a: I.mat2d): I.mat3; @@ -2112,69 +2108,69 @@ declare namespace adone.math { /** * Adds two mat3's * - * @param {mat3} out the receiving matrix - * @param {mat3} a the first operand - * @param {mat3} b the second operand - * @returns {mat3} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function add(out: I.mat3, a: I.mat3, b: I.mat3): I.mat3; /** * Subtracts matrix b from matrix a * - * @param {mat3} out the receiving matrix - * @param {mat3} a the first operand - * @param {mat3} b the second operand - * @returns {mat3} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function subtract(out: I.mat3, a: I.mat3, b: I.mat3): I.mat3; /** * Subtracts matrix b from matrix a * - * @param {mat3} out the receiving matrix - * @param {mat3} a the first operand - * @param {mat3} b the second operand - * @returns {mat3} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function sub(out: I.mat3, a: I.mat3, b: I.mat3): I.mat3; /** * Multiply each element of the matrix by a scalar. * - * @param {mat3} out the receiving matrix - * @param {mat3} a the matrix to scale - * @param {number} b amount to scale the matrix's elements by - * @returns {mat3} out + * @param out the receiving matrix + * @param a the matrix to scale + * @param b amount to scale the matrix's elements by + * @returns out */ function multiplyScalar(out: I.mat3, a: I.mat3, b: number): I.mat3; /** * Adds two mat3's after multiplying each element of the second operand by a scalar value. * - * @param {mat3} out the receiving vector - * @param {mat3} a the first operand - * @param {mat3} b the second operand - * @param {number} scale the amount to scale b's elements by before adding - * @returns {mat3} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b's elements by before adding + * @returns out */ function multiplyScalarAndAdd(out: I.mat3, a: I.mat3, b: I.mat3, scale: number): I.mat3; /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * - * @param {mat3} a The first matrix. - * @param {mat3} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function exactEquals(a: I.mat3, b: I.mat3): boolean; /** * Returns whether or not the matrices have approximately the same elements in the same position. * - * @param {mat3} a The first matrix. - * @param {mat3} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function equals(a: I.mat3, b: I.mat3): boolean; } @@ -2214,23 +2210,23 @@ declare namespace adone.math { /** * Create a new mat4 with the given values * - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m02 Component in column 0, row 2 position (index 2) - * @param {number} m03 Component in column 0, row 3 position (index 3) - * @param {number} m10 Component in column 1, row 0 position (index 4) - * @param {number} m11 Component in column 1, row 1 position (index 5) - * @param {number} m12 Component in column 1, row 2 position (index 6) - * @param {number} m13 Component in column 1, row 3 position (index 7) - * @param {number} m20 Component in column 2, row 0 position (index 8) - * @param {number} m21 Component in column 2, row 1 position (index 9) - * @param {number} m22 Component in column 2, row 2 position (index 10) - * @param {number} m23 Component in column 2, row 3 position (index 11) - * @param {number} m30 Component in column 3, row 0 position (index 12) - * @param {number} m31 Component in column 3, row 1 position (index 13) - * @param {number} m32 Component in column 3, row 2 position (index 14) - * @param {number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} A new mat4 + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m02 Component in column 0, row 2 position (index 2) + * @param m03 Component in column 0, row 3 position (index 3) + * @param m10 Component in column 1, row 0 position (index 4) + * @param m11 Component in column 1, row 1 position (index 5) + * @param m12 Component in column 1, row 2 position (index 6) + * @param m13 Component in column 1, row 3 position (index 7) + * @param m20 Component in column 2, row 0 position (index 8) + * @param m21 Component in column 2, row 1 position (index 9) + * @param m22 Component in column 2, row 2 position (index 10) + * @param m23 Component in column 2, row 3 position (index 11) + * @param m30 Component in column 3, row 0 position (index 12) + * @param m31 Component in column 3, row 1 position (index 13) + * @param m32 Component in column 3, row 2 position (index 14) + * @param m33 Component in column 3, row 3 position (index 15) + * @returns A new mat4 */ function fromValues( m00: number, @@ -2254,24 +2250,24 @@ declare namespace adone.math { /** * Set the components of a mat4 to the given values * - * @param {mat4} out the receiving matrix - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m02 Component in column 0, row 2 position (index 2) - * @param {number} m03 Component in column 0, row 3 position (index 3) - * @param {number} m10 Component in column 1, row 0 position (index 4) - * @param {number} m11 Component in column 1, row 1 position (index 5) - * @param {number} m12 Component in column 1, row 2 position (index 6) - * @param {number} m13 Component in column 1, row 3 position (index 7) - * @param {number} m20 Component in column 2, row 0 position (index 8) - * @param {number} m21 Component in column 2, row 1 position (index 9) - * @param {number} m22 Component in column 2, row 2 position (index 10) - * @param {number} m23 Component in column 2, row 3 position (index 11) - * @param {number} m30 Component in column 3, row 0 position (index 12) - * @param {number} m31 Component in column 3, row 1 position (index 13) - * @param {number} m32 Component in column 3, row 2 position (index 14) - * @param {number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} out + * @param out the receiving matrix + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m02 Component in column 0, row 2 position (index 2) + * @param m03 Component in column 0, row 3 position (index 3) + * @param m10 Component in column 1, row 0 position (index 4) + * @param m11 Component in column 1, row 1 position (index 5) + * @param m12 Component in column 1, row 2 position (index 6) + * @param m13 Component in column 1, row 3 position (index 7) + * @param m20 Component in column 2, row 0 position (index 8) + * @param m21 Component in column 2, row 1 position (index 9) + * @param m22 Component in column 2, row 2 position (index 10) + * @param m23 Component in column 2, row 3 position (index 11) + * @param m30 Component in column 3, row 0 position (index 12) + * @param m31 Component in column 3, row 1 position (index 13) + * @param m32 Component in column 3, row 2 position (index 14) + * @param m33 Component in column 3, row 3 position (index 15) + * @returns out */ function set( out: I.mat4, @@ -2424,9 +2420,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.translate(dest, dest, vec); * - * @param {mat4} out mat4 receiving operation result - * @param {vec3} v Translation vector - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param v Translation vector + * @returns out */ function fromTranslation(out: I.mat4, v: I.vec3 | number[]): I.mat4; @@ -2437,9 +2433,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.scale(dest, dest, vec); * - * @param {mat4} out mat4 receiving operation result - * @param {vec3} v Scaling vector - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param v Scaling vector + * @returns out */ function fromScaling(out: I.mat4, v: I.vec3 | number[]): I.mat4; @@ -2450,10 +2446,10 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.rotate(dest, dest, rad, axis); * - * @param {mat4} out mat4 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @param {vec3} axis the axis to rotate around - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param rad the angle to rotate the matrix by + * @param axis the axis to rotate around + * @returns out */ function fromRotation(out: I.mat4, rad: number, axis: I.vec3 | number[]): I.mat4; @@ -2464,9 +2460,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.rotateX(dest, dest, rad); * - * @param {mat4} out mat4 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromXRotation(out: I.mat4, rad: number): I.mat4; @@ -2477,9 +2473,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.rotateY(dest, dest, rad); * - * @param {mat4} out mat4 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromYRotation(out: I.mat4, rad: number): I.mat4; @@ -2490,9 +2486,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.rotateZ(dest, dest, rad); * - * @param {mat4} out mat4 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromZRotation(out: I.mat4, rad: number): I.mat4; @@ -2518,9 +2514,9 @@ declare namespace adone.math { * matrix. If a matrix is built with fromRotationTranslation, * the returned vector will be the same as the translation vector * originally supplied. - * @param {vec3} out Vector to receive translation component - * @param {mat4} mat Matrix to be decomposed (input) - * @return {vec3} out + * @param out Vector to receive translation component + * @param mat Matrix to be decomposed (input) + * @return out */ function getTranslation(out: I.vec3, mat: I.mat4): I.vec3; @@ -2529,9 +2525,9 @@ declare namespace adone.math { * If a matrix is built with fromRotationTranslationScale with a * normalized Quaternion parameter, the returned vector will be * the same as the scaling vector originally supplied. - * @param {vec3} out Vector to receive scaling factor component - * @param {mat4} mat Matrix to be decomposed (input) - * @return {vec3} out + * @param out Vector to receive scaling factor component + * @param mat Matrix to be decomposed (input) + * @return out */ function getScaling(out: I.vec3, mat: I.mat4): I.vec3; @@ -2540,9 +2536,9 @@ declare namespace adone.math { * of a transformation matrix. If a matrix is built with * fromRotationTranslation, the returned quaternion will be the * same as the quaternion originally supplied. - * @param {quat} out Quaternion to receive the rotation component - * @param {mat4} mat Matrix to be decomposed (input) - * @return {quat} out + * @param out Quaternion to receive the rotation component + * @param mat Matrix to be decomposed (input) + * @return out */ function getRotation(out: I.quat, mat: I.mat4): I.quat; @@ -2578,22 +2574,22 @@ declare namespace adone.math { * mat4.scale(dest, scale) * mat4.translate(dest, negativeOrigin); * - * @param {mat4} out mat4 receiving operation result - * @param {quat} q Rotation quaternion - * @param {vec3} v Translation vector - * @param {vec3} s Scaling vector - * @param {vec3} o The origin vector around which to scale and rotate - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param q Rotation quaternion + * @param v Translation vector + * @param s Scaling vector + * @param o The origin vector around which to scale and rotate + * @returns out */ function fromRotationTranslationScaleOrigin(out: I.mat4, q: I.quat, v: I.vec3 | number[], s: I.vec3 | number[], o: I.vec3 | number[]): I.mat4; /** * Calculates a 4x4 matrix from the given quaternion * - * @param {mat4} out mat4 receiving operation result - * @param {quat} q Quaternion to create matrix from + * @param out mat4 receiving operation result + * @param q Quaternion to create matrix from * - * @returns {mat4} out + * @returns out */ function fromQuat(out: I.mat4, q: I.quat): I.mat4; @@ -2630,11 +2626,11 @@ declare namespace adone.math { * This is primarily useful for generating projection matrices to be used * with the still experimental WebVR API. * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out + * @param out mat4 frustum matrix will be written into + * @param fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out */ function perspectiveFromFieldOfView( out: I.mat4, @@ -2692,69 +2688,69 @@ declare namespace adone.math { /** * Adds two mat4's * - * @param {mat4} out the receiving matrix - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @returns {mat4} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function add(out: I.mat4, a: I.mat4, b: I.mat4): I.mat4; /** * Subtracts matrix b from matrix a * - * @param {mat4} out the receiving matrix - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @returns {mat4} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function subtract(out: I.mat4, a: I.mat4, b: I.mat4): I.mat4; /** * Subtracts matrix b from matrix a * - * @param {mat4} out the receiving matrix - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @returns {mat4} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function sub(out: I.mat4, a: I.mat4, b: I.mat4): I.mat4; /** * Multiply each element of the matrix by a scalar. * - * @param {mat4} out the receiving matrix - * @param {mat4} a the matrix to scale - * @param {number} b amount to scale the matrix's elements by - * @returns {mat4} out + * @param out the receiving matrix + * @param a the matrix to scale + * @param b amount to scale the matrix's elements by + * @returns out */ function multiplyScalar(out: I.mat4, a: I.mat4, b: number): I.mat4; /** * Adds two mat4's after multiplying each element of the second operand by a scalar value. * - * @param {mat4} out the receiving vector - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @param {number} scale the amount to scale b's elements by before adding - * @returns {mat4} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b's elements by before adding + * @returns out */ function multiplyScalarAndAdd(out: I.mat4, a: I.mat4, b: I.mat4, scale: number): I.mat4; /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * - * @param {mat4} a The first matrix. - * @param {mat4} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function exactEquals(a: I.mat4, b: I.mat4): boolean; /** * Returns whether or not the matrices have approximately the same elements in the same position. * - * @param {mat4} a The first matrix. - * @param {mat4} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function equals(a: I.mat4, b: I.mat4): boolean; } @@ -2779,7 +2775,6 @@ declare namespace adone.math { * * @param a quaternion to clone * @returns a new quaternion - * @function */ function clone(a: I.quat): I.quat; @@ -2791,7 +2786,6 @@ declare namespace adone.math { * @param z Z component * @param w W component * @returns a new quaternion - * @function */ function fromValues(x: number, y: number, z: number, w: number): I.quat; @@ -2801,7 +2795,6 @@ declare namespace adone.math { * @param out the receiving quaternion * @param a the source quaternion * @returns out - * @function */ function copy(out: I.quat, a: I.quat): I.quat; @@ -2814,7 +2807,6 @@ declare namespace adone.math { * @param z Z component * @param w W component * @returns out - * @function */ function set(out: I.quat, x: number, y: number, z: number, w: number): I.quat; @@ -2832,10 +2824,10 @@ declare namespace adone.math { * * Both vectors are assumed to be unit length. * - * @param {quat} out the receiving quaternion. - * @param {vec3} a the initial vector - * @param {vec3} b the destination vector - * @returns {quat} out + * @param out the receiving quaternion. + * @param a the initial vector + * @param b the destination vector + * @returns out */ function rotationTo(out: I.quat, a: I.vec3 | number[], b: I.vec3 | number[]): I.quat; @@ -2857,10 +2849,10 @@ declare namespace adone.math { * axes. Each axis is a vec3 and is expected to be unit length and * perpendicular to all other specified axes. * - * @param {vec3} view the vector representing the viewing direction - * @param {vec3} right the vector representing the local "right" direction - * @param {vec3} up the vector representing the local "up" direction - * @returns {quat} out + * @param view the vector representing the viewing direction + * @param right the vector representing the local "right" direction + * @param up the vector representing the local "up" direction + * @returns out */ function setAxes(out: I.quat, view: I.vec3 | number[], right: I.vec3 | number[], up: I.vec3 | number[]): I.quat; @@ -2897,9 +2889,9 @@ declare namespace adone.math { * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by * [0, 0, 1] and 270. This method favors the latter. - * @param {vec3} out_axis Vector receiving the axis of rotation - * @param {quat} q Quaternion to be decomposed - * @return {number} Angle, in radians, of the rotation + * @param out_axis Vector receiving the axis of rotation + * @param q Quaternion to be decomposed + * @return Angle, in radians, of the rotation */ function getAxisAngle(out_axis: I.vec3 | number[], q: I.quat): number; @@ -2910,7 +2902,6 @@ declare namespace adone.math { * @param a the first operand * @param b the second operand * @returns out - * @function */ function add(out: I.quat, a: I.quat, b: I.quat): I.quat; @@ -2941,7 +2932,6 @@ declare namespace adone.math { * @param a the vector to scale * @param b amount to scale the vector by * @returns out - * @function */ function scale(out: I.quat, a: I.quat, b: number): I.quat; @@ -2950,7 +2940,6 @@ declare namespace adone.math { * * @param a vector to calculate length of * @returns length of a - * @function */ function length(a: I.quat): number; @@ -2959,7 +2948,6 @@ declare namespace adone.math { * * @param a vector to calculate length of * @returns length of a - * @function */ function len(a: I.quat): number; @@ -2968,7 +2956,6 @@ declare namespace adone.math { * * @param a vector to calculate squared length of * @returns squared length of a - * @function */ function squaredLength(a: I.quat): number; @@ -2977,7 +2964,6 @@ declare namespace adone.math { * * @param a vector to calculate squared length of * @returns squared length of a - * @function */ function sqrLen(a: I.quat): number; @@ -2987,7 +2973,6 @@ declare namespace adone.math { * @param out the receiving quaternion * @param a quaternion to normalize * @returns out - * @function */ function normalize(out: I.quat, a: I.quat): I.quat; @@ -2997,7 +2982,6 @@ declare namespace adone.math { * @param a the first operand * @param b the second operand * @returns dot product of a and b - * @function */ function dot(a: I.quat, b: I.quat): number; @@ -3009,7 +2993,6 @@ declare namespace adone.math { * @param b the second operand * @param t interpolation amount between the two inputs * @returns out - * @function */ function lerp(out: I.quat, a: I.quat, b: I.quat, t: number): I.quat; @@ -3027,13 +3010,13 @@ declare namespace adone.math { /** * Performs a spherical linear interpolation with two control points * - * @param {quat} out the receiving quaternion - * @param {quat} a the first operand - * @param {quat} b the second operand - * @param {quat} c the third operand - * @param {quat} d the fourth operand - * @param {number} t interpolation amount - * @returns {quat} out + * @param out the receiving quaternion + * @param a the first operand + * @param b the second operand + * @param c the third operand + * @param d the fourth operand + * @param t interpolation amount + * @returns out */ function sqlerp(out: I.quat, a: I.quat, b: I.quat, c: I.quat, d: I.quat, t: number): I.quat; @@ -3103,7 +3086,6 @@ declare namespace adone.math { * @param out the receiving quaternion * @param m rotation matrix * @returns out - * @function */ function fromMat3(out: I.quat, m: I.mat3): I.quat; @@ -3121,18 +3103,18 @@ declare namespace adone.math { /** * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) * - * @param {quat} a The first vector. - * @param {quat} b The second vector. - * @returns {boolean} True if the quaternions are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the quaternions are equal, false otherwise. */ function exactEquals(a: I.quat, b: I.quat): boolean; /** * Returns whether or not the quaternions have approximately the same elements in the same position. * - * @param {quat} a The first vector. - * @param {quat} b The second vector. - * @returns {boolean} True if the quaternions are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the quaternions are equal, false otherwise. */ function equals(a: I.quat, b: I.quat): boolean; } diff --git a/types/adone/glosses/math/simd.d.ts b/types/adone/glosses/math/simd.d.ts index a90d761036..57f19e5eb3 100644 --- a/types/adone/glosses/math/simd.d.ts +++ b/types/adone/glosses/math/simd.d.ts @@ -53,41 +53,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ swizzle(a: Float32x4, l1: number, l2: number, l3: number, l4: number): Float32x4; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ shuffle(a: Float32x4, b: Float32x4, l1: number, l2: number, l3: number, l4: number): Float32x4; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Float32x4. Throws a TypeError otherwise. - * @param a */ check(a: Float32x4): Float32x4; /** * Creates a new SIMD.Float32x4 data type with all lanes set to a given value. - * @param n */ splat(n: number): Float32x4; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -121,16 +107,8 @@ declare namespace adone.math { div(a: Float32x4, b: Float32x4): Float32x4; - /** - * - * @param a - */ neg(a: Float32x4): Float32x4; - /** - * - * @param a - */ abs(a: Float32x4): Float32x4; min(a: Float32x4, b: Float32x4): Float32x4; @@ -143,16 +121,8 @@ declare namespace adone.math { reciprocalApproximation(a: Float32x4, b: Float32x4): Float32x4; - /** - * - * @param a - */ reciprocalSqrtApproximation(a: Float32x4): Float32x4; - /** - * - * @param a - */ sqrt(a: Float32x4): Float32x4; /** @@ -310,41 +280,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ swizzle(a: Int32x4, l1: number, l2: number, l3: number, l4: number): Int32x4; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ shuffle(a: Int32x4, b: Int32x4, l1: number, l2: number, l3: number, l4: number): Int32x4; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Int32x4. Throws a TypeError otherwise. - * @param a */ check(a: Int32x4): Int32x4; /** * Creates a new SIMD.Int32x4 data type with all lanes set to a given value. - * @param n */ splat(n: number): Int32x4; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -384,10 +340,6 @@ declare namespace adone.math { mul(a: Int32x4, b: Int32x4): Int32x4; - /** - * - * @param a - */ neg(a: Int32x4): Int32x4; /** @@ -565,49 +517,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 */ swizzle(a: Int16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Int16x8; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 */ shuffle(a: Int16x8, b: Int16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Int16x8; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Int16x8. Throws a TypeError otherwise. - * @param a */ check(a: Int16x8): Int16x8; /** * Creates a new SIMD.Int16x8 data type with all lanes set to a given value. - * @param n */ splat(n: number): Int16x8; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -647,10 +577,6 @@ declare namespace adone.math { mul(a: Int16x8, b: Int16x8): Int16x8; - /** - * - * @param a - */ neg(a: Int16x8): Int16x8; /** @@ -803,23 +729,6 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 - * @param l9 - * @param l10 - * @param l11 - * @param l12 - * @param l13 - * @param l14 - * @param l15 - * @param l16 */ swizzle( a: Int8x16, @@ -843,24 +752,6 @@ declare namespace adone.math { /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 - * @param l9 - * @param l10 - * @param l11 - * @param l12 - * @param l13 - * @param l14 - * @param l15 - * @param l16 */ shuffle( a: Int8x16, @@ -885,20 +776,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Int8x16. Throws a TypeError otherwise. - * @param a */ check(a: Int8x16): Int8x16; /** * Creates a new SIMD.Int8x16 data type with all lanes set to a given value. - * @param n */ splat(n: number): Int8x16; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -938,10 +826,6 @@ declare namespace adone.math { mul(a: Int8x16, b: Int8x16): Int8x16; - /** - * - * @param a - */ neg(a: Int8x16): Int8x16; /** @@ -1065,41 +949,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ swizzle(a: Uint32x4, l1: number, l2: number, l3: number, l4: number): Uint32x4; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ shuffle(a: Uint32x4, b: Uint32x4, l1: number, l2: number, l3: number, l4: number): Uint32x4; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Uint32x4. Throws a TypeError otherwise. - * @param a */ check(a: Uint32x4): Uint32x4; /** * Creates a new SIMD.Uint32x4 data type with all lanes set to a given value. - * @param n */ splat(n: number): Uint32x4; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1314,49 +1184,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 */ swizzle(a: Uint16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Uint16x8; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 */ shuffle(a: Uint16x8, b: Uint16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Uint16x8; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Uint16x8. Throws a TypeError otherwise. - * @param a */ check(a: Uint16x8): Uint16x8; /** * Creates a new SIMD.Uint16x8 data type with all lanes set to a given value. - * @param n */ splat(n: number): Uint16x8; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1546,23 +1394,6 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 - * @param l9 - * @param l10 - * @param l11 - * @param l12 - * @param l13 - * @param l14 - * @param l15 - * @param l16 */ swizzle( a: Uint8x16, @@ -1586,24 +1417,6 @@ declare namespace adone.math { /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 - * @param l9 - * @param l10 - * @param l11 - * @param l12 - * @param l13 - * @param l14 - * @param l15 - * @param l16 */ shuffle( a: Uint8x16, @@ -1628,20 +1441,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Uint8x16. Throws a TypeError otherwise. - * @param a */ check(a: Uint8x16): Uint8x16; /** * Creates a new SIMD.Uint8x16 data type with all lanes set to a given value. - * @param n */ splat(n: number): Uint8x16; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1802,20 +1612,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Bool32x4. Throws a TypeError otherwise. - * @param a */ check(a: Bool32x4): Bool32x4; /** * Creates a new SIMD.Bool32x4 data type with all lanes set to a given value. - * @param n */ splat(n: boolean): Bool32x4; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1823,13 +1630,11 @@ declare namespace adone.math { /** * If all lane values are `true`, return `true`. - * @param a */ allTrue(a: Bool32x4): boolean; /** * If any lane values are `true`, return `true`. - * @param a */ anyTrue(a: Bool32x4): boolean; @@ -1888,20 +1693,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Bool16x8. Throws a TypeError otherwise. - * @param a */ check(a: Bool16x8): Bool16x8; /** * Creates a new SIMD.Bool16x8 data type with all lanes set to a given value. - * @param n */ splat(n: boolean): Bool16x8; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1909,13 +1711,11 @@ declare namespace adone.math { /** * If all lane values are `true`, return `true`. - * @param a */ allTrue(a: Bool16x8): boolean; /** * If any lane values are `true`, return `true`. - * @param a */ anyTrue(a: Bool16x8): boolean; @@ -1998,20 +1798,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Bool8x16. Throws a TypeError otherwise. - * @param a */ check(a: Bool8x16): Bool8x16; /** * Creates a new SIMD.Bool8x16 data type with all lanes set to a given value. - * @param n */ splat(n: boolean): Bool8x16; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -2019,13 +1816,11 @@ declare namespace adone.math { /** * If all lane values are `true`, return `true`. - * @param a */ allTrue(a: Bool8x16): boolean; /** * If any lane values are `true`, return `true`. - * @param a */ anyTrue(a: Bool8x16): boolean; diff --git a/types/adone/glosses/promise.d.ts b/types/adone/glosses/promise.d.ts index d0f59b0340..cdfe0ec2f5 100644 --- a/types/adone/glosses/promise.d.ts +++ b/types/adone/glosses/promise.d.ts @@ -47,8 +47,8 @@ declare namespace adone { /** * Converts a function that returns promises to a node.js style callback function * - * @param {Function} fn Function - * @returns {Promise} the original promise + * @param fn Function + * @returns the original promise */ export function callbackify(fn: () => Promise): (callback: (err?: any, result?: R) => void) => Promise; export function callbackify(fn: (a: T) => Promise): (a: T, callback: (err?: any, result?: R) => void) => Promise; diff --git a/types/aframe/aframe-tests.ts b/types/aframe/aframe-tests.ts index 439d314f4a..5af66a09d1 100644 --- a/types/aframe/aframe-tests.ts +++ b/types/aframe/aframe-tests.ts @@ -1,5 +1,4 @@ // Global - const threeCamera = new AFRAME.THREE.Camera(); AFRAME.TWEEN.Easing; @@ -42,9 +41,18 @@ entity.addEventListener('child-detached', (event) => { const Component = AFRAME.registerComponent('test', {}); // Scene - const scene = document.querySelector('a-scene'); scene.hasLoaded; // System const system = scene.systems['systemName']; + +// Register Custom Geometry +AFRAME.registerGeometry('a-test-geometry', { + schema: { + groupIndex: { default: 0 } + }, + init(data) { + this.geometry = new THREE.Geometry(); + } +}); diff --git a/types/aframe/index.d.ts b/types/aframe/index.d.ts index f1f5cd7a20..803318a754 100644 --- a/types/aframe/index.d.ts +++ b/types/aframe/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for AFRAME 0.5 +// Type definitions for AFRAME 0.7 // Project: https://aframe.io/ // Definitions by: Paul Shannon +// Roberto Ritger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -40,7 +41,7 @@ declare namespace AFrame { primitives: { [ key: string ]: Entity }; registerComponent(name: string, component: ComponentDefinition): ComponentConstructor; registerElement(name: string, element: ANode): void; - registerGeometry(name: string, geometery: THREE.Geometry): Geometry; + registerGeometry(name: string, geometry: GeometryDefinition): Geometry; registerPrimitive(name: string, primitive: PrimitiveDefinition): void; registerShader(name: string, shader: any): void; registerSystem(name: string, definition: SystemDefinition): void; @@ -101,7 +102,7 @@ declare namespace AFrame { name: string; schema: Schema; - init(): void; + init(data?: any): void; pause(): void; play(): void; remove(): void; @@ -124,7 +125,7 @@ declare namespace AFrame { multiple?: boolean; schema?: Schema; - init?(): void; + init?(data?: any): void; pause?(): void; play?(): void; remove?(): void; @@ -222,6 +223,10 @@ declare namespace AFrame { [ key: string ]: any; } + interface GeometryDefinition extends ComponentDefinition { + geometry?: THREE.Geometry; + } + interface GeometryDescriptor { Geometry: Geometry; schema: Schema; diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index d170a6f6f1..426b187d7c 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -113,8 +113,8 @@ declare class Agenda extends EventEmitter { * @param options The options for the job. * @param handler The handler to execute. */ - define(name: string, handler: (job?: Agenda.Job, done?: (err?: Error) => void) => void): void; - define(name: string, options: Agenda.JobOptions, handler: (job?: Agenda.Job, done?: (err?: Error) => void) => void): void; + define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; + define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; /** * Runs job name at the given interval. Optionally, data and options can be passed in. diff --git a/types/agenda/tslint.json b/types/agenda/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/agenda/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/alertify/tslint.json b/types/alertify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/alertify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/alexa-sdk/index.d.ts b/types/alexa-sdk/index.d.ts index 1c39755b2d..02def0b4d6 100644 --- a/types/alexa-sdk/index.d.ts +++ b/types/alexa-sdk/index.d.ts @@ -4,15 +4,85 @@ // Huw // pascalwhoop // Ben +// rk-7 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 export function handler(event: RequestBody, context: Context, callback?: (err: any, response: any) => void): AlexaObject; export function CreateStateHandler(state: string, obj: any): any; export let StateString: string; - export type ConfirmationStatuses = "NONE" | "DENIED" | "CONFIRMED"; export type DialogStates = "STARTED" | "IN_PROGRESS" | "COMPLETED"; +export type ListItemObjectStatus = "active" | "completed"; +export type ListObjectState = "active" | "archived"; +export type ImageSourceSize = "X_SMALL" | "SMALL" | "MEDIUM" | "LARGE" | "X_LARGE"; +export type TemplateBackButtonVisibility = "HIDDEN" | "VISIBLE"; +export type TemplateType = "BodyTemplate1" | "BodyTemplate2" | "BodyTemplate3" | "BodyTemplate6" | "BodyTemplate6" | "ListTemplate1" | "ListTemplate2"; +export type AudioPlayerActivity = "IDLE" | "PAUSED" | "PLAYING" | "BUFFER_UNDERRUN" | "FINISHED" | "STOPPED"; +export type CardType = "Standard" | "Simple" | "LinkAccount" | "AskForPermissionsConsent"; +export type HintType = "PlainText"; +export type DirectiveTypes = "AudioPlayer.Play" | "AudioPlayer.Stop" | "AudioPlayer.ClearQueue" | "Display.RenderTemplate" | "Hint" | "VideoApp.Launch"; +export type TextContentType = "PlainText" | "RichText"; + +//#region Types +export interface CardImage { + /** + * Recommended size (in px): 720w x 480h + */ + smallImageUrl: string; + /** + * Recommended size (in px): 1200w x 800h + */ + largeImageUrl: string; +} +export interface ImageSource { + url: string; + widthPixels?: number; + heightPixels?: number; + /** + * Recommended sizes for the following dimensions (in px): + * 480 x 320 for X_SMALL, + * 720 x 480 for SMALL, + * 960 x 640 for MEDIUM, + * 1200 x 800 for LARGE, + * 1920 x 1280 for X_LARGE + */ + size?: ImageSourceSize; +} +export interface Image { + contentDescription: string; + sources: ImageSource[]; +} +export interface TextField { + text: string; + type: string; +} +export interface TextContent { + primaryText?: TextField; + secondaryText?: TextField; + tertiaryText?: TextField; +} +export interface ListItem { + image?: Image; + token: string; + textContent?: TextContent; +} + +export interface Template { + title?: string; + token: string; + backgroundImage?: Image; + /** + * Visibility of the back button. + */ + backButton?: TemplateBackButtonVisibility; + /** + * Template type. + */ + type: TemplateType; + image?: Image; + listItems?: ListItem[]; +} export interface AlexaObject extends Handler { _event: any; @@ -38,12 +108,16 @@ export interface Handler { emitWithState: any; state: any; handler: any; + i18n: any; + locale: any; event: RequestBody; attributes: any; context: any; + callback: (param: any) => void; name: any; isOverriden: any; t: (token: string, ...args: any[]) => void; + response: ResponseBuilder; } export interface Context { @@ -55,8 +129,28 @@ export interface Context { functionVersion: string; invokeid: string; awsRequestId: string; + System?: System; + AudioPlayer?: AudioPlayer; +} +export interface Application { + applicationId: string; + [key: string]: string; +} +export interface System { + apiAccessToken: string; + apiEndpoint: string; + application: Application; + device: any; + user: any; +} +export interface AudioPlayer { + token: string; + offsetInMilliseconds: number; + /** + * Player activity + */ + playerActivity: AudioPlayerActivity; } - export interface RequestBody { version: string; session: Session; @@ -66,20 +160,22 @@ export interface RequestBody { export interface Session { new: boolean; sessionId: string; - attributes: any; - application: SessionApplication; + attributes: { [key: string]: any }; + application: Application; user: SessionUser; } - -export interface SessionApplication { - applicationId: string; -} - export interface SessionUser { userId: string; accessToken?: string; + permissions: Permissions; +} +export interface Permissions { + /** + * @deprecated + */ + consentToken: string; + [key: string]: string; } - export interface LaunchRequest extends Request { } export interface IntentRequest extends Request { @@ -144,7 +240,8 @@ export interface Response { outputSpeech?: OutputSpeech; card?: Card; reprompt?: Reprompt; - shouldEndSession: boolean; + directives?: any; + shouldEndSession?: boolean; } export interface OutputSpeech { @@ -154,18 +251,682 @@ export interface OutputSpeech { } export interface Card { - type: "Simple" | "Standard" | "LinkAccount"; + type: CardType; title?: string; content?: string; text?: string; - image?: Image; -} - -export interface Image { - smallImageUrl: string; - largeImageUrl: string; + image?: CardImage; } export interface Reprompt { outputSpeech: OutputSpeech; } + +export interface ApiClientOptions { + hostname: string; + port: string; + path: string; + protocol: string; + headers: string; + method: string; +} +export interface ApiClientResponse { + statusCode: string; + statusText: string; + body: object; + headers: object; +} +/** + * Todo-ListItem class + * Refer https://developer.amazon.com/docs/custom-skills/access-the-alexa-shopping-and-to-do-lists.html + */ +export interface ListItemObject { + /** + * item id (String, limit 60 characters) + */ + id: string; + /** + * item value (String, limit is 256 characters) + */ + value: string; + /** + * item status + */ + status?: ListItemObjectStatus; + /** + * item version (Positive integer) + */ + version?: number | string; + /** + * created time (ISO 8601 time format with time zone) + */ + createdTime: Date; + /** + * updated time (ISO 8601 time format with time zone) + */ + updatedTime: Date; + /** + * URL to retrieve the item (String) + */ + href?: string; +} +/** + * Todo-List class + * Refer https://developer.amazon.com/docs/custom-skills/access-the-alexa-shopping-and-to-do-lists.html + */ +export interface ListObject { + /** + * list id (String) + */ + listId: string; + /** + * list name (String) + */ + name: string; + /** + * state + * "active" or "archived" (Enum) + */ + state?: ListObjectState; + /** + * Possibly status of the list (or state?) + * Fetched from commit eebba0d at https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/ + * File path: alexa-skills-kit-sdk-for-nodejs/lib/services/listManagementService.js + */ + status?: string; + /** + * list version (Positive integer) + */ + version?: number; + /** + * Urls to active and completed items + * href is lint to the items having certain status. + * The status can be "active" or "completed". + */ + statusMap: { href: string; status: ListItemObjectStatus; }; + /** + * Items that belong to this list. + */ + items: ListItemObject[]; +} +//#endregion + +//#region templateBuilders +/** + * Generates templates for Echo Show device. + */ +export namespace templateBuilders { + interface SetTextContent> { + setTextContent(primaryText: TextField, secondaryText?: TextField, tertiaryText?: TextField): T; + } + interface SetListItems> { + setListItems(listItems: ListItem[]): T; + } + /** + * Refer https://developer.amazon.com/docs/custom-skills/display-interface-reference.html#image-sizes + */ + abstract class TemplateBuilder> { + template: Template; + constructor(); + + /** + * Sets the title of the template + * @param title title + * @returns TemplateBuilder + */ + setTitle(title: string): T; + + /** + * Sets the token of the template + * @param token token + * @returns TemplateBuilder + */ + setToken(token: string): T; + + /** + * Sets the background image of the template + * @param image image + * @returns TemplateBuilder + */ + setBackgroundImage(image: Image): T; + + /** + * Sets the backButton behavior + * @param backButtonBehavior "VISIBLE" or "HIDDEN" + * @returns TemplateBuilder + */ + setBackButtonBehavior(backButtonBehavior: string): T; + + /** + * Builds the template JSON object + * @returns Template + */ + build(): Template; + } + /** + * Used to build a list of ListItems for ListTemplate + */ + class ListItemBuilder { + constructor(); + items: ListItem[]; + /** + * Add an item to the list of template + * @param image image + * @param token token + * @param primaryText primaryText + * @param secondaryText secondaryText + * @param tertiaryText tertiaryText + */ + addItem(image: Image, token: string, primaryText: TextField, secondaryText?: TextField, tertiaryText?: TextField): ListItemBuilder; + + build(): ListItem[]; + } + /** + * Used to create BodyTemplate1 objects + */ + class BodyTemplate1Builder extends TemplateBuilder implements SetTextContent { + constructor(); + /** + * Sets the text content for the template + * @param primaryText primaryText + * @param secondaryText secondaryText + * @param tertiaryText tertiaryText + * @returns BodyTemplate1Builder + */ + setTextContent(primaryText: TextField, secondaryText?: TextField, tertiaryText?: TextField): BodyTemplate1Builder; + } + /** + * Used to create BodyTemplate2 objects + */ + class BodyTemplate2Builder extends TemplateBuilder implements SetTextContent { + constructor(); + + /** + * Sets the image for the template + * @param image image + * @returns BodyTemplate2Builder + */ + setImage(image: Image): BodyTemplate2Builder; + + /** + * Sets the text content for the template + * @param primaryText primaryText + * @param secondaryText secondaryText + * @param tertiaryText tertiaryText + * @returns BodyTemplate2Builder + */ + setTextContent(primaryText: TextField, secondaryText?: TextField, tertiaryText?: TextField): BodyTemplate2Builder; + } + /** + * Used to create BodyTemplate3 objects + */ + class BodyTemplate3Builder extends TemplateBuilder implements SetTextContent { + constructor(); + + /** + * Sets the image for the template + * @param image image + * @returns BodyTemplate3Builder + */ + setImage(image: Image): BodyTemplate3Builder; + + /** + * Sets the text content for the template + * @param primaryText primaryText + * @param secondaryText secondaryText + * @param tertiaryText tertiaryText + * @returns BodyTemplate3Builder + */ + setTextContent(primaryText: TextField, secondaryText?: TextField, tertiaryText?: TextField): BodyTemplate3Builder; + } + /** + * Used to create BodyTemplate6 objects + */ + class BodyTemplate6Builder extends TemplateBuilder implements SetTextContent { + constructor(); + + /** + * Sets the image for the template + * @param image image + * @returns BodyTemplate6Builder + */ + setImage(image: Image): BodyTemplate6Builder; + + /** + * Sets the text content for the template + * @param primaryText primaryText + * @param secondaryText secondaryText + * @param tertiaryText tertiaryText + * @returns BodyTemplate6Builder + */ + setTextContent(primaryText: TextField, secondaryText?: TextField, tertiaryText?: TextField): BodyTemplate6Builder; + } + /** + * Used to create BodyTemplate7 objects + */ + class BodyTemplate7Builder extends TemplateBuilder { + constructor(); + + /** + * Sets the image for the template + * @param image image + * @returns BodyTemplate7Builder + */ + setImage(image: Image): BodyTemplate7Builder; + } + /** + * Used to create ListTemplate1 objects + */ + class ListTemplate1Builder extends TemplateBuilder implements SetListItems { + constructor(); + + /** + * Set the items for the list + * @param listItems listItems + * @returns ListTemplate1Builder + */ + setListItems(listItems: ListItem[]): ListTemplate1Builder; + } + /** + * Used to create ListTemplate2 objects + */ + class ListTemplate2Builder extends TemplateBuilder implements SetListItems { + constructor(); + + /** + * Set the items for the list + * @param listItems listItems + * @returns ListTemplate2Builder + */ + setListItems(listItems: ListItem[]): ListTemplate2Builder; + } +} +//#endregion + +//#region services +export namespace services { + interface ApiClient { + /** + * Make a POST API call to the specified uri with headers and optional body + * @param uri http(s?) endpoint to call + * @param headers Key value pair of headers + * @param body post body to send + * @returns Promise + */ + post(uri: string, headers: object, body?: string): Promise; + /** + * Make a PUT API call to the specified uri with headers and optional body + * @param uri http(s?) endpoint to call + * @param headers Key value pair of headers + * @param body post body to send + * @returns Promise + */ + put(uri: string, headers: object, body?: string): Promise; + /** + * Make a GET API call to the specified uri with headers + * @param uri http(s?) endpoint to call + * @param headers key value pair of headers + * @returns Promise + */ + get(uri: string, headers: object): Promise; + /** + * Make a DELETE API call to the specified uri with headers + * @param uri http(s?) endpoint to call + * @param headers key value pair of headers + * @returns Promise + */ + delete(uri: string, headers: object): Promise; + } + class DeviceAddressService { + /** + * Create an instance of DeviceAddressService + * @param [apiClient=new ApiClient()] ApiClient + */ + constructor(apiClient: ApiClient); + + /** + * Get full address information from Alexa Device Address API + * @param deviceId deviceId from Alexa request + * @param apiEndpoint API apiEndpoint from Alexa request + * @param token bearer token for device address permission + * @returns Promise + */ + getFullAddress(deviceId: string, apiEndpoint: string, token: string): Promise; + + /** + * Get country and postal information from Alexa Device Address API + * @param deviceId deviceId from Alexa request + * @param apiEndpoint API apiEndpoint from Alexa request + * @param token bearer token for device address permission + * @returns Promise + */ + getCountryAndPostalCode(deviceId: string, apiEndpoint: string, token: string): Promise; + } + class DirectiveService { + /** + * Creates an instance of DirectiveService. + * @param [apiClient=new ApiClient()] ApiClient + */ + constructor(apiClient: ApiClient); + + /** + * Send the specified directiveObj to Alexa directive service + * + * @param directive directive to send to service + * @param apiEndpoint API endpoint from Alexa request + * @param token bearer token for directive service + * @returns Promise + */ + enqueue(directive: object, apiEndpoint: string, token: string): Promise; + } + class ListManagementService { + /** + * Create an instance of ListManagementService + * @param apiClient apiClient + */ + constructor(apiClient: ApiClient); + + /** + * Set apiEndpoint address, default is "https://api.amazonalexa.com" + * @param apiEndpoint apiEndpoint + * @returns void + */ + setApiEndpoint(apiEndpoint: string): void; + + /** + * Get currently set apiEndpoint address + * @returns string + */ + getApiEndpoint(): string; + + /** + * Retrieve the metadata for all customer lists, including the customer's default lists + * @param token bearer token for list management permission + * @returns Promise + */ + getListsMetadata(token: string): Promise; + + /** + * Create a custom list. The new list name must be different than any existing list name + * @param listObject listObject + * @param token bearer token for list management permission + * @returns Promise + */ + createList(listObject: ListObject, token: string): Promise; + + /** + * Retrieve list metadata including the items in the list with requested status + * @param listId unique Id associated with the list + * @param itemStatus itemsStatus can be either "active" or "completed" + * @param token bearer token for list management permission + * @returns Promise + */ + getList(listId: string, itemStatus: ListItemObjectStatus, token: string): Promise; + + /** + * Update a custom list. Only the list name or state can be updated + * @param listId unique Id associated with the list + * @param listObject listObject + * @param token bearer token for list management permission + * @returns Promise + */ + updateList(listId: string, listObject: ListObject, token: string): Promise; + + /** + * Delete a custom list + * @param listId unique Id associated with the list + * @param token bearer token for list management permission + * @returns Promise + */ + deleteList(listId: string, token: string): Promise; + + /** + * Create an item in an active list or in a default list + * @param listId unique Id associated with the list + * @param listItemObject listItemObject + * @param token bearer token for list management permission + * @returns Promise + */ + createListItem(listId: string, listItemObject: ListItemObject, token: string): Promise; + + /** + * Retrieve single item within any list by listId and itemId + * @param listId unique Id associated with the list + * @param itemId unique Id associated with the item + * @param token bearer token for list management permission + * @returns Promise + */ + getListItem(listId: string, itemId: string, token: string): Promise; + + /** + * Update an item value or item status + * @param listId unique Id associated with the list + * @param itemId unique Id associated with the item + * @param listItemObject listItemObject + * @param token bearer token for list management permission + * @returns Promise + */ + updateListItem(listId: string, itemId: string, listItemObject: ListItemObject, token: string): Promise; + + /** + * Delete an item in the specified list + * @param listId unique Id associated with the list + * @param itemId unique Id associated with the item + * @param token bearer token for list management permission + * @returns Promise + */ + deleteListItem(listId: string, itemId: string, token: string): Promise; + } +} +//#endregion + +//#region ResponseBuilder +/** + * Responsible for building JSON responses as per the Alexa skills kit interface + * https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#response-body-syntax + */ +export class ResponseBuilder { + constructor(alexaHandler: Handler); + + /** + * Have Alexa say the provided speechOutput to the user + * @param speechOutput speechOutput + * @returns ResponseBuilder + */ + speak(speechOutput: string): ResponseBuilder; + + /** + * Have alexa listen for speech from the user. If the user doesn't respond within 8 seconds + * then have alexa reprompt with the provided reprompt speech + * @param repromptSpeech repromptSpeech + * @returns ResponseBuilder + */ + listen(repromptSpeech: string): ResponseBuilder; + + /** + * Render a card with the following title, content and image + * @param cardTitle cardTitle + * @param cardContent cardContent + * @param cardImage cardImage + * @returns ResponseBuilder + */ + cardRenderer(cardTitle: string, cardContent: string, cardImage: CardImage): ResponseBuilder; + + /** + * Render a link account card + * @returns ResponseBuilder + */ + linkAccountCard(): ResponseBuilder; + + /** + * Render a askForPermissionsConsent card + * @param permissions permissions + * @returns ResponseBuilder + */ + askForPermissionsConsentCard(permissions: [{ [key: string]: string }]): ResponseBuilder; + + /** + * Creates a play, stop or clearQueue audioPlayer directive depending on the directive type passed in. + * @deprecated - use audioPlayerPlay, audioPlayerStop, audioPlayerClearQueue instead + * @param directiveType directiveType + * @param behavior behavior + * @param url url + * @param token token + * @param expectedPreviousToken expectedPreviousToken + * @param offsetInMilliseconds offsetInMilliseconds + * @returns ResponseBuilder + */ + audioPlayer(directiveType: string, behavior: string, url: string, token: string, expectedPreviousToken: string, offsetInMilliseconds: number): ResponseBuilder; + + /** + * Creates an AudioPlayer play directive + * @param behavior Describes playback behavior. Accepted values: + * REPLACE_ALL: Immediately begin playback of the specified stream, and replace current and enqueued streams. + * ENQUEUE: Add the specified stream to the end of the current queue. This does not impact the currently playing stream. + * REPLACE_ENQUEUED: Replace all streams in the queue. This does not impact the currently playing stream. + * @param url Identifies the location of audio content at a remote HTTPS location. + * The audio file must be hosted at an Internet-accessible HTTPS endpoint. HTTPS is required, and the domain hosting the + * files must present a valid, trusted SSL certificate. Self-signed certificates cannot be used. + * The supported formats for the audio file include AAC/MP4, MP3, HLS, PLS and M3U. Bitrates: 16kbps to 384 kbps. + * @param token A token that represents the audio stream. This token cannot exceed 1024 characters + * @param expectedPreviousToken A token that represents the expected previous stream. + * This property is required and allowed only when the playBehavior is ENQUEUE. This is used to prevent potential race conditions + * if requests to progress through a playlist and change tracks occur at the same time. + * @param offsetInMilliseconds The timestamp in the stream from which Alexa should begin playback. + * Set to 0 to start playing the stream from the beginning. Set to any other value to start playback from that associated point in the stream + * @returns ResponseBuilder + */ + audioPlayerPlay(behavior: string, url: string, token: string, expectedPreviousToken: string, offsetInMilliseconds: number): ResponseBuilder; + + /** + * Creates an AudioPlayer Stop directive - Stops the current audio Playback + * @returns ResponseBuilder + */ + audioPlayerStop(): ResponseBuilder; + + /** + * Creates an AudioPlayer ClearQueue directive - clear the queue without stopping the currently playing stream, + * or clear the queue and stop any currently playing stream. + * @param clearBehavior Describes the clear queue behavior. Accepted values: + * CLEAR_ENQUEUED: clears the queue and continues to play the currently playing stream + * CLEAR_ALL: clears the entire playback queue and stops the currently playing stream (if applicable). + * @returns ResponseBuilder + */ + audioPlayerClearQueue(clearBehavior: string): ResponseBuilder; + + /** + * Creates a Display RenderTemplate Directive + * Use a template builder to generate a template object + * @param template template + * @returns ResponseBuilder + */ + renderTemplate(template: Template): ResponseBuilder; + + /** + * Creates a hint directive - show a hint on the screen of the echo show + * @param hintText text to show on the hint + * @param hintType (optional) Default value : PlainText + * @returns ResponseBuilder + */ + hint(hintText: string, hintType?: HintType): ResponseBuilder; + + /** + * Creates a VideoApp play directive to play a video + * @param source Identifies the location of video content at a remote HTTPS location. + * The video file must be hosted at an Internet-accessible HTTPS endpoint. + * @param metadata (optional) Contains an object that provides the + * information that can be displayed on VideoApp. + * @returns ResponseBuilder + */ + playVideo(source: string, metadata?: { title: string, subtitle: string }): ResponseBuilder; +} +//#endregion + +//#region directives +export namespace directives { + class VoicePlayerSpeakDirective { + header: { requestId: string }; + directive: { type: string, speech: string }; + /** + * Creates an instance of VoicePlayerSpeakDirective. + * @param requestId - requestId from which the call is originated from + * @param speechContent - Contents of the speech directive either in plain text or SSML. + */ + constructor(requestId: string, speechContent: string); + } +} +//#endregion + +//#region utils +export namespace utils { + namespace ImageUtils { + /** + * Creates an image object with a single source + * These images may be in either JPEG or PNG formats, with the appropriate file extensions. + * An image cannot be larger than 2 MB + * You must host the images at HTTPS URLs that are publicly accessible. + * widthPixels and heightPixels are optional - Do not include them unless they are exactly correct. + * By default, for Echo Show, size takes the value X_SMALL. If the other size values are included, + * then the order of precedence for displaying images begins with X_LARGE and proceeds downward, + * which means that larger images will be downscaled for display on Echo Show if provided. + * example : ImageUtils.makeImage("https://url/to/my/img.png", 300, 400, "SMALL", "image description") + * @param url url of the image + * @param widthPixels (optional) width of the image in pixels + * @param heightPixels (optional) height of the image in pixels + * @param size size of the image (X_SMALL, SMALL, MEDIUM, LARGE, X_LARGE) + * @param description text used to describe the image in a screen reader + * @returns Image + */ + function makeImage(url: string, widthPixels?: number, heightPixels?: number, size?: ImageSourceSize, description?: string): Image; + /** + * Creates an image object with a multiple sources, source images are provided as an array of image objects + * These images may be in either JPEG or PNG formats, with the appropriate file extensions. + * An image cannot be larger than 2 MB + * You must host the images at HTTPS URLs that are publicly accessible. + * widthPixels and heightPixels are optional - Do not include them unless they are exactly correct. + * By default, for Echo Show, size takes the value X_SMALL. If the other size values are included, + * then the order of precedence for displaying images begins with X_LARGE and proceeds downward, + * which means that larger images will be downscaled for display on Echo Show if provided. + * example : + * let imgArr = [ + * { "https://url/to/my/small.png", 300, 400, "SMALL" }, + * { "https://url/to/my/large.png", 900, 1200, "LARGE" }, + * ] + * ImageUtils.makeImage(imgArr, "image description") + * + * @param imgArr Array of Image + * @param description text used to describe the image in a screen reader + * @returns Image + */ + function makeImages(imgArr: Array<{ url: string, widthPixels?: number, heightPixels?: number, size: ImageSourceSize }>, description: string): Image; + } + /** + * Utility methods for building TextField objects + */ + namespace TextUtils { + /** + * Creates a plain TextField object with contents : text + * @param text contents of plain text object + * @returns TextField + */ + function makePlainText(text: string): TextField; + + /** + * Creates a rich TextField object with contents : text + * @param text text + * @returns TextField + */ + function makeRichText(text: string): TextField; + + /** + * Creates a textContent + * @param primaryText primary Text + * @param secondaryText secondary Text + * @param tertiaryText tertiary Text + * @returns TextContent + */ + function makeTextContent(primaryText: { type: TextContentType, text: string }, + secondaryText: { type: TextContentType, text: string }, tertiaryText: { type: TextContentType, text: string }): TextContent; + } +} +//#endregion diff --git a/types/alexa-sdk/tsconfig.json b/types/alexa-sdk/tsconfig.json index acc11c8263..d1932fa469 100644 --- a/types/alexa-sdk/tsconfig.json +++ b/types/alexa-sdk/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "alexa-sdk-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/alexa-sdk/tslint.json b/types/alexa-sdk/tslint.json index 78f1939ba2..32a9916641 100644 --- a/types/alexa-sdk/tslint.json +++ b/types/alexa-sdk/tslint.json @@ -1,10 +1,11 @@ -{ "extends": "dtslint/dt.json", - "rules": { - "object-literal-shorthand": false, - "object-literal-key-quote": false, - "no-empty-interface": false, - "prefer-method-signature": false, - "object-literal-key-quotes": false, - "no-any": false - } +{ + "extends": "dtslint/dt.json", + "rules": { + "object-literal-shorthand": false, + "object-literal-key-quote": false, + "no-empty-interface": false, + "prefer-method-signature": false, + "object-literal-key-quotes": false, + "no-any": false + } } diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index dfcf27c94f..0814b0fc03 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -1,144 +1,153 @@ -import * as algoliasearch from "algoliasearch"; -import { ClientOptions, SynonymOption, AlgoliaUserKeyOptions, SearchSynonymOptions, AlgoliaResponse, - AlgoliaSecuredApiOptions, AlgoliaIndexSettings, AlgoliaQueryParameters, AlgoliaIndex } from "algoliasearch"; +import * as algoliasearch from 'algoliasearch'; +import { + ClientOptions, + SynonymOption, + AlgoliaApiKeyOptions, + SearchSynonymOptions, + AlgoliaResponse, + AlgoliaSecuredApiOptions, + AlgoliaIndexSettings, + AlgoliaQueryParameters, + AlgoliaIndex, +} from 'algoliasearch'; let _algoliaResponse: AlgoliaResponse = { - hits: [{}, {}], - page: 0, - nbHits: 12, - nbPages: 6, - hitsPerPage: 2, - processingTimeMS: 32, - query: "", - params: "", + hits: [{}, {}], + page: 0, + nbHits: 12, + nbPages: 6, + hitsPerPage: 2, + processingTimeMS: 32, + query: '', + params: '', }; let _clientOptions: ClientOptions = { - timeout: 12, - protocol: "", - httpAgent: "", + timeout: 12, + protocol: '', + httpAgent: '', }; let _synonymOption: SynonymOption = { - forwardToSlaves: false, - replaceExistingSynonyms: false, + forwardToReplicas: false, + replaceExistingSynonyms: false, }; -let _algoliaUserKeyOptions: AlgoliaUserKeyOptions = { - validity: 0, - maxQueriesPerIPPerHour: 0, - indexes: [""], - queryParameters: { attributesToRetrieve: ["algolia"] }, - description: "", +let _algoliaApiKeyOptions: AlgoliaApiKeyOptions = { + validity: 0, + maxQueriesPerIPPerHour: 0, + indexes: [''], + queryParameters: { attributesToRetrieve: ['algolia'] }, + description: '', }; let _searchSynonymOptions: SearchSynonymOptions = { - query: "", - page: 0, - type: "", - hitsPerPage: 0, + query: '', + page: 0, + type: '', + hitsPerPage: 0, }; let _algoliaSecuredApiOptions: AlgoliaSecuredApiOptions = { - filters: "", - validUntil: 0, - restrictIndices: "", - userToken: "", + filters: '', + validUntil: 0, + restrictIndices: '', + userToken: '', }; let _algoliaIndexSettings: AlgoliaIndexSettings = { - attributesToIndex: [""], - attributesForFaceting: [""], - unretrievableAttributes: [""], - attributesToRetrieve: [""], - ranking: [""], - customRanking: [""], - slaves: [""], - maxValuesPerFacet: "", - attributesToHighlight: [""], - attributesToSnippet: [""], - highlightPreTag: "", - highlightPostTag: "", - snippetEllipsisText: "", - restrictHighlightAndSnippetArrays: false, - hitsPerPage: 0, - minWordSizefor1Typo: 0, - minWordSizefor2Typos: 0, - typoTolerance: false, - allowTyposOnNumericTokens: false, - ignorePlurals: false, - disableTypoToleranceOnAttributes: "", - separatorsToIndex: "", - queryType: "", - removeWordsIfNoResults: "", - advancedSyntax: false, - optionalWords: [""], - removeStopWords: [""], - disablePrefixOnAttributes: [""], - disableExactOnAttributes: [""], - exactOnSingleWordQuery: "", - alternativesAsExact: false, - attributeForDistinct: "", - distinct: false, - numericAttributesToIndex: [""], - allowCompressionOfIntegerArray: false, - altCorrections: [{}], - minProximity: 0, - placeholders: "", + attributesToIndex: [''], + attributesForFaceting: [''], + unretrievableAttributes: [''], + attributesToRetrieve: [''], + ranking: [''], + customRanking: [''], + replicas: [''], + maxValuesPerFacet: '', + attributesToHighlight: [''], + attributesToSnippet: [''], + highlightPreTag: '', + highlightPostTag: '', + snippetEllipsisText: '', + restrictHighlightAndSnippetArrays: false, + hitsPerPage: 0, + minWordSizefor1Typo: 0, + minWordSizefor2Typos: 0, + typoTolerance: false, + allowTyposOnNumericTokens: false, + ignorePlurals: false, + disableTypoToleranceOnAttributes: '', + separatorsToIndex: '', + queryType: '', + removeWordsIfNoResults: '', + advancedSyntax: false, + optionalWords: [''], + removeStopWords: [''], + disablePrefixOnAttributes: [''], + disableExactOnAttributes: [''], + exactOnSingleWordQuery: '', + alternativesAsExact: false, + attributeForDistinct: '', + distinct: false, + numericAttributesToIndex: [''], + allowCompressionOfIntegerArray: false, + altCorrections: [{}], + minProximity: 0, + placeholders: '', }; let _algoliaQueryParameters: AlgoliaQueryParameters = { - query: "", - filters: "", - attributesToRetrieve: [""], - restrictSearchableAttributes: [""], - facets: "", - maxValuesPerFacet: "", - attributesToHighlight: [""], - attributesToSnippet: [""], - highlightPreTag: "", - highlightPostTag: "", - snippetEllipsisText: "", - restrictHighlightAndSnippetArrays: false, - hitsPerPage: 0, - page: 0, - offset: 0, - length: 0, - minWordSizefor1Typo: 0, - minWordSizefor2Typos: 0, - typoTolerance: false, - allowTyposOnNumericTokens: false, - ignorePlurals: false, - disableTypoToleranceOnAttributes: "", - aroundLatLng: "", - aroundLatLngViaIP: "", - aroundRadius: "", - aroundPrecision: 0, - minimumAroundRadius: 0, - insideBoundingBox: "", - queryType: "", - insidePolygon: "", - removeWordsIfNoResults: "", - advancedSyntax: false, - optionalWords: [""], - removeStopWords: [""], - disableExactOnAttributes: [""], - exactOnSingleWordQuery: "", - alternativesAsExact: true, - distinct: 0, - getRankingInfo: false, - numericAttributesToIndex: [""], - numericFilters: [""], - tagFilters: "", - facetFilters: "", - analytics: false, - analyticsTags: [""], - synonyms: true, - replaceSynonymsInHighlight: false, - minProximity: 0, + query: '', + filters: '', + attributesToRetrieve: [''], + restrictSearchableAttributes: [''], + facets: '', + maxValuesPerFacet: '', + attributesToHighlight: [''], + attributesToSnippet: [''], + highlightPreTag: '', + highlightPostTag: '', + snippetEllipsisText: '', + restrictHighlightAndSnippetArrays: false, + hitsPerPage: 0, + page: 0, + offset: 0, + length: 0, + minWordSizefor1Typo: 0, + minWordSizefor2Typos: 0, + typoTolerance: false, + allowTyposOnNumericTokens: false, + ignorePlurals: false, + disableTypoToleranceOnAttributes: '', + aroundLatLng: '', + aroundLatLngViaIP: '', + aroundRadius: 0, + aroundPrecision: 0, + minimumAroundRadius: 0, + insideBoundingBox: [[0]], + queryType: '', + insidePolygon: [[0]], + removeWordsIfNoResults: '', + advancedSyntax: false, + optionalWords: [''], + removeStopWords: [''], + disableExactOnAttributes: [''], + exactOnSingleWordQuery: '', + alternativesAsExact: true, + distinct: 0, + getRankingInfo: false, + numericAttributesToIndex: [''], + numericFilters: [''], + tagFilters: '', + facetFilters: '', + analytics: false, + analyticsTags: [''], + synonyms: true, + replaceSynonymsInHighlight: false, + minProximity: 0, }; -let index: AlgoliaIndex = algoliasearch("", "").initIndex(""); +let index: AlgoliaIndex = algoliasearch('', '').initIndex(''); -let search = index.search({query: ""}); - index.search({query: ""}, (err, res) => {}); +let search = index.search({ query: '' }); +index.search({ query: '' }, (err, res) => {}); diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 2f94b2c907..c56b0f8a9f 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1,1527 +1,1936 @@ -// Type definitions for algoliasearch-client-js 3.18.1 +// Type definitions for algoliasearch-client-js 3.24.8 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle // Haroen Viaene +// Aurélien Hervé // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare namespace algoliasearch { - interface AlgoliaResponse { - /** - * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hits: any[]; - /** - * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - page: number; - /** - * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbHits: number; - /** - * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbPages: number; - /** - * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hitsPerPage: number; - /** - * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - processingTimeMS: number; - /** - * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - query: string; - /** - * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - params: string; - } - /* - Interface for the algolia client object - */ - interface AlgoliaClient { - /** - * Initialization of the index - * @param name: index name - * return algolia index object - * https://github.com/algolia/algoliasearch-client-js#init-index---initindex - */ - initIndex(name: string): AlgoliaIndex; - /** - * Query on multiple index - * @param queries index name, query and query parameters - * @param cb callback(err, res) - * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries - */ - search(queries: { indexName: string, query: string, options: AlgoliaQueryParameters }, cb: (err: Error, res: any) => void): void; - /** - * Query on multiple index - * @param queries index name, query and query parameters - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries - */ - search(queries: { indexName: string, query: string, options: AlgoliaQueryParameters }): Promise; - /** - * clear browser cache - * https://github.com/algolia/algoliasearch-client-js#cache - */ - clearCache(): void; - /** - * kill alive connections - * https://github.com/algolia/algoliasearch-client-js#keep-alive - */ - destroy(): void; - /** - * List all your indices along with their associated information (number of entries, disk size, etc.) - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes - */ - listIndexes(cb: (err: Error, res: any) => void): void; - /** - * List all your indices along with their associated information (number of entries, disk size, etc.) - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes - */ - listIndexes(): Promise; - /** - * Delete a specific index - * @param name - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex - */ - deleteIndex(name: string, cb: (err: Error, res: any) => void): void; - /** - * Delete a specific index - * @param name - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex - */ - deleteIndex(name: string): Promise; - /** - * Copy an index from a specific index to a new one - * @param from origin index - * @param to destination index - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex - */ - copyIndex(from: string, to: string, cb: (err: Error, res: any) => void): void; - /** - * Copy an index from a specific index to a new one - * @param from origin index - * @param to destination index - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex - */ - copyIndex(from: string, to: string): Promise; - /** - * Move index to a new one (and will overwrite the original one) - * @param from origin index - * @param to destination index - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex - */ - moveIndex(from: string, to: string, cb: (err: Error, res: any) => void): void; - /** - * Move index to a new one (and will overwrite the original one) - * @param from origin index - * @param to destination index - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex - */ - moveIndex(from: string, to: string): Promise; - /** - * Generate a public API key - * @param key api key - * @param filters - * https://github.com/algolia/algoliasearch-client-js#generate-key---generatesecuredapikey - */ - generateSecuredApiKey(key: string, filters: AlgoliaSecuredApiOptions): void; - /** - * Perform multiple operations with one API call to reduce latency - * @param action - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - batch(action: AlgoliaAction, cb: (err: Error, res: any) => void): void; - /** - * Perform multiple operations with one API call to reduce latency - * @param action - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - batch(action: AlgoliaAction): Promise; - /** - * Lists global API Keys - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - listUserKeys(cb: (err: Error, res: any) => void): void; - /** - * Lists global API Keys - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - listUserKeys(): Promise; - /** - * Add global API Keys - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Add global API Key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Add global API Keys - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options?: AlgoliaUserKeyOptions): Promise; - /** - * Update global API key - * @param key - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Update global API key - * @param key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Update global API key - * @param key - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options?: AlgoliaUserKeyOptions): Promise; - /** - * Gets the rights of a global key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - getUserKeyACL(key: string, cb: (err: Error, res: any) => void): void; - /** - * Gets the rights of a global key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - getUserKeyACL(key: string): Promise; - /** - * Deletes a global key - * @param key - * @param cb(err,res) - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string, cb: (err: Error, res: any) => void): void; - /** - * Deletes a global key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string): Promise; - /** - * Get 1000 last events - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - getLogs(options: LogsOptions, cb: (err: Error, res: any) => void): void; - /** - * Get 1000 last events - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - getLogs(options: LogsOptions): Promise; - } + interface AlgoliaResponse { /** - * Interface for the index algolia object + * Contains all the hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format */ - interface AlgoliaIndex { - /** - * Gets a specific object - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Gets specific attributes from an object - * @param objectID - * @param attributes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, attributes: string[], cb: (err: Error, res: any) => void): void; - /** - * Gets a list of objects - * @param objectIDs - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; - /** - * Add a specific object - * @param object without objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Add a list of objects - * @param object with objectID - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Add list of objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Add or replace a specific object - * @param object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Add or replace several objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Update parameters of a specific object - * @param object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Update parameters of a list of objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Delete a specific object - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObject(objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Delete a list of objects - * @param objectIDs - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; - /** - * Delete objects that matches the query - * @param query - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, cb: (err: Error, res: any) => void): void; - /** - * Delete objects that matches the query - * @param query - * @param params of the object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, params: {}, cb: (err: Error, res: any) => void): void; - /** - * Wait for an indexing task to be compete - * @param taskID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask - */ - waitTask(taskID: number, cb: (err: Error, res: any) => void): void; - /** - * Get an index settings - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings - */ - getSettings(cb: (err: Error, res: any) => void): void; - /** - * Set an index settings - * @param settings - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings - */ - setSettings(settings: AlgoliaIndexSettings, cb: (err: Error, res: any) => void): void; - /** - * Clear cache of an index - * https://github.com/algolia/algoliasearch-client-js#cache - */ - clearCache(): void; - /** - * Clear an index content - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex - */ - clearIndex(cb: (err: Error, res: any) => void): void; - /** - * Save a synonym object - * @param synonym - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - saveSynonym(synonym: AlgoliaSynonym, options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Save a synonym object - * @param synonyms - * @param options - * @param cb(err, res) - */ - batchSynonyms(synonyms: AlgoliaSynonym[], options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Delete a specific synonym - * @param identifier - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - deleteSynonym(identifier: string, options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Clear all synonyms of an index - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms - */ - clearSynonyms(options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Get a specific synonym - * @param identifier - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym - */ - getSynonym(identifier: string, cb: (err: Error, res: any) => void): void; - /** - * Search a synonyms - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - searchSynonyms(options: SearchSynonymOptions, cb: (err: Error, res: any) => void): void; - /** - * List index user keys - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys - */ - listUserKeys(cb: (err: Error, res: any) => void): void; - /** - * Add key for this index - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Add key for this index - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Update a key for this index - * @param key - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Update a key for this index - * @param key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Gets the rights of an index specific key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getuserkeyacl - */ - getUserKeyACL(key: string, cb: (err: Error, res: any) => void): void; - /** - * Deletes an index specific key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string, cb: (err: Error, res: any) => void): void; - /** - * Gets specific attributes from an object - * @param objectID - * @param attributes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, attributes?: string[]): Promise ; - /** - * Gets a list of objects - * @param objectIDs - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObjects(objectIDs: string[]): Promise ; - /** - * Add a list of objects - * @param object with objectID - * @param objectID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, objectID?: string): Promise ; - /** - * Add list of objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObjects(objects: [{}]): Promise ; - /** - * Add or replace a specific object - * @param object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObject(object: {}): Promise ; - /** - * Add or replace several objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObjects(objects: [{}]): Promise ; - /** - * Update parameters of a specific object - * @param object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObject(object: {}): Promise ; - /** - * Update parameters of a list of objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObjects(objects: [{}]): Promise ; - /** - * Delete a specific object - * @param objectID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObject(objectID: string): Promise ; - /** - * Delete a list of objects - * @param objectIDs - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObjects(objectIDs: string[]): Promise ; - /** - * Delete objects that matches the query - * @param query - * @param params of the object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, params?: {}): Promise ; - /** - * Wait for an indexing task to be compete - * @param taskID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask - */ - waitTask(taskID: number): Promise ; - /** - * Get an index settings - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings - */ - getSettings(): Promise ; - /** - * Set an index settings - * @param settings - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings - */ - setSettings(settings: AlgoliaIndexSettings): Promise ; - /** - * Search in an index - * @param params query parameter - * return {Promise} - * @param err() error callback - * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search - */ - search(params: AlgoliaQueryParameters): Promise ; - /** - * Search in an index - * @param params query parameter - * @param cb(err, res) - * @param err() error callback - * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search - */ - search(params: AlgoliaQueryParameters, cb: (err: Error, res: any) => void): void; - /** - * Browse an index - * @param query - * @param cb(err, content) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browse(query: string, cb: (err: Error, res: any) => void): void; - /** - * Browse an index - * @param query - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browse(query: string): Promise; - /** - * Browse an index from a cursor - * @param cursor - * @param cb(err, content) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseFrom(cursor: string, cb: (err: Error, res: any) => void): void; - /** - * Browse an index from a cursor - * @param cursor - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseFrom(cursor: string): Promise; - /** - * Browse an entire index - * return Promise - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseAll(): Promise; - /** - * Clear an index content - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex - */ - clearIndex(): Promise ; - /** - * Save a synonym object - * @param synonym - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - saveSynonym(synonym: AlgoliaSynonym, options: SynonymOption): Promise ; - /** - * Save a synonym object - * @param synonyms - * @param options - * return {Promise} - */ - batchSynonyms(synonyms: AlgoliaSynonym[], options: SynonymOption): Promise ; - /** - * Delete a specific synonym - * @param identifier - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - deleteSynonym(identifier: string, options: SynonymOption): Promise ; - /** - * Clear all synonyms of an index - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms - */ - clearSynonyms(options: SynonymOption): Promise ; - /** - * Get a specific synonym - * @param identifier - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym - */ - getSynonym(identifier: string): Promise ; - /** - * Search a synonyms - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - searchSynonyms(options: SearchSynonymOptions): Promise ; - /** - * List index user keys - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys - */ - listUserKeys(): Promise ; - /** - * Add key for this index - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options?: AlgoliaUserKeyOptions): Promise ; - /** - * Update a key for this index - * @param key - * @param scopes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[]): Promise ; - /** - * Update a key for this index - * @param key - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions): Promise ; - /** - * Gets the rights of an index specific key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getuserkeyacl - */ - getUserKeyACL(key: string): Promise ; - /** - * Deletes an index specific key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string): Promise ; - } - /* - Interface describing available options when initializing a client - */ - interface ClientOptions { - /** - * Timeout for requests to our servers, in milliseconds - * default: 15s (node), 2s (browser) - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - timeout?: number; - /** - * Protocol to use when communicating with algolia - * default: current protocol(browser), https(node) - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - protocol?: string; - /** - * (node only) httpAgent instance to use when communicating with Algolia servers. - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - httpAgent?: any; - /** - * read: array of read hosts to use to call Algolia servers, computed automatically - * write: array of read hosts to use to call Algolia servers, computed automatically - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - hosts?: { read?: string[], write?: string[] }; - } - /* - Interface describing options available for gettings the logs - */ - interface LogsOptions { - /** - * Specify the first entry to retrieve (0-based, 0 is the most recent log entry). - * default: 0 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - offset?: number; - /** - * Specify the maximum number of entries to retrieve starting at the offset. - * default: 10 - * maximum: 1000 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - length?: number; - /** - * @deprecated - * Retrieve only logs with an HTTP code different than 200 or 201 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - onlyErrors?: boolean; - /** - * Specify the type of logs to retrieve - * 'query' Retrieve only the queries - * 'build' Retrieve only the build operations - * 'error' Retrieve only the errors (same as onlyErrors parameters) - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - type?: string; - } + hits: any[]; /** - * Describe the action object used for batch operation + * Current page + * https://github.com/algolia/algoliasearch-client-js#response-format */ - interface AlgoliaAction { - /** - * Type of the batch action - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - action: "addObject" | "updateObject" | "partialUpdateObject" | "partialUpdateObjectNoCreate" | "deleteObject" | "delete" | "clear"; - /** - * Name of the index where the bact will be performed - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ + page: number; + /** + * Number of total hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbHits: number; + /** + * Number of pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + nbPages: number; + /** + * Number of hits per pages + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + hitsPerPage: number; + /** + * Engine processing time (excluding network transfer) + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + processingTimeMS: number; + /** + * Query used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + query: string; + /** + * GET parameters used to perform the search + * https://github.com/algolia/algoliasearch-client-js#response-format + */ + params: string; + } + interface AlgoliaMultiResponse { + results: AlgoliaResponse[]; + } + /* + Interface for the algolia client object + */ + interface AlgoliaClient { + /** + * Initialization of the index + * @param name: index name + * return algolia index object + * https://github.com/algolia/algoliasearch-client-js#init-index---initindex + */ + initIndex(name: string): AlgoliaIndex; + /** + * Query on multiple index + * @param queries index name, query and query parameters + * @param cb callback(err, res) + * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries + */ + search( + queries: { indexName: string; - /** - * Object - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - body: {}; - } - /** - * Describes the option used when creating user key - */ - interface AlgoliaUserKeyOptions { - /** - * Add a validity period. The key will be valid for a specific period of time (in seconds). - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - validity?: number; - /** - * Specify the maximum number of API calls allowed from an IP address per hour - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - maxQueriesPerIPPerHour?: number; - /** - * Specify the maximum number of hits this API key can retrieve in one call - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - maxHitsPerQuery?: boolean; - /** - * Specify the list of targeted indices - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - indexes?: string[]; - /** - * Specify the list of referers - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - referers?: string[]; - /** - * Specify the list of query parameters - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - queryParameters?: AlgoliaQueryParameters; - /** - * Specify a description to describe where the key is used. - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - description?: string; - } - /** - * Describes option used when making operation on synonyms - */ - interface SynonymOption { - /** - * You can forward all settings updates to the slaves of an index - * https://github.com/algolia/algoliasearch-client-js#slave-settings - */ - forwardToSlaves?: boolean; - /** - * Replace all existing synonyms on the index with the content of the batch - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - replaceExistingSynonyms?: boolean; - } - /** - * Describes options used when searching for synonyms - */ - interface SearchSynonymOptions { - /** - * The actual search query to find synonyms - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - query?: string; - /** - * The page to fetch when browsing through several pages of results - * default: 100 - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - page?: number; - /** - * Restrict the search to a specific type of synonym - * Use an empty string to search all types (default behavior) - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - type?: string; - /** - * Number of hits per page - * default: 100 - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - hitsPerPage?: number; - } - interface AlgoliaBrowseResponse { - cursor?: string; - hits: any[]; - params: string; query: string; - processingTimeMS: number; - } + params: AlgoliaQueryParameters; + }[], + cb: (err: Error, res: AlgoliaMultiResponse) => void + ): void; /** - * Describes a synonym object + * Query on multiple index + * @param queries index name, query and query parameters + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries */ - interface AlgoliaSynonym { + search(queries: { + indexName: string; + query: string; + params: AlgoliaQueryParameters; + }[]): Promise; + /** + * clear browser cache + * https://github.com/algolia/algoliasearch-client-js#cache + */ + clearCache(): void; + /** + * kill alive connections + * https://github.com/algolia/algoliasearch-client-js#keep-alive + */ + destroy(): void; + /** + * Add a header to be sent with all upcoming requests + */ + setExtraHeader(name: string, value: string): void; + /** + * Get the value of an extra header + */ + getExtraHeader(name: string): string; + /** + * remove an extra header for all upcoming requests + */ + unsetExtraHeader(name: string): void; + /** + * List all your indices along with their associated information (number of entries, disk size, etc.) + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes + */ + listIndexes(cb: (err: Error, res: any) => void): void; + /** + * List all your indices along with their associated information (number of entries, disk size, etc.) + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes + */ + listIndexes(): Promise; + /** + * Delete a specific index + * @param name + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex + */ + deleteIndex(name: string, cb: (err: Error, res: any) => void): void; + /** + * Delete a specific index + * @param name + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex + */ + deleteIndex(name: string): Promise; + /** + * Copy an index from a specific index to a new one + * @param from origin index + * @param to destination index + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex + */ + copyIndex( + from: string, + to: string, + cb: (err: Error, res: any) => void + ): void; + /** + * Copy an index from a specific index to a new one + * @param from origin index + * @param to destination index + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex + */ + copyIndex(from: string, to: string): Promise; + /** + * Move index to a new one (and will overwrite the original one) + * @param from origin index + * @param to destination index + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex + */ + moveIndex( + from: string, + to: string, + cb: (err: Error, res: any) => void + ): void; + /** + * Move index to a new one (and will overwrite the original one) + * @param from origin index + * @param to destination index + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex + */ + moveIndex(from: string, to: string): Promise; + /** + * Generate a public API key + * @param key api key + * @param filters + * https://github.com/algolia/algoliasearch-client-js#generate-key---generatesecuredapikey + */ + generateSecuredApiKey( + key: string, + filters: AlgoliaSecuredApiOptions + ): string; + /** + * Perform multiple operations with one API call to reduce latency + * @param action + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + batch(action: AlgoliaAction[], cb: (err: Error, res: any) => void): void; + /** + * Perform multiple operations with one API call to reduce latency + * @param action + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + batch(action: AlgoliaAction[]): Promise; + /** + * Lists global API Keys + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + listApiKeys(cb: (err: Error, res: any) => void): void; + /** + * Lists global API Keys + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + listApiKeys(): Promise; + /** + * Add global API Keys + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey(scopes: string[], cb: (err: Error, res: any) => void): void; + /** + * Add global API Key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey( + scopes: string[], + options: AlgoliaApiKeyOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Add global API Keys + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey(scopes: string[], options?: AlgoliaApiKeyOptions): Promise; + /** + * Update global API key + * @param key + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + cb: (err: Error, res: any) => void + ): void; + /** + * Update global API key + * @param key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + options: AlgoliaApiKeyOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Update global API key + * @param key + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + options?: AlgoliaApiKeyOptions + ): Promise; + /** + * Gets the rights of a global key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + getApiKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Gets the rights of a global key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + getApiKey(key: string): Promise; + /** + * Deletes a global key + * @param key + * @param cb(err,res) + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey + */ + deleteApiKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Deletes a global key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey + */ + deleteApiKey(key: string): Promise; + /** + * Get 1000 last events + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + getLogs(options: LogsOptions, cb: (err: Error, res: any) => void): void; + /** + * Get 1000 last events + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + getLogs(options: LogsOptions): Promise; + } + /** + * Interface for the index algolia object + */ + interface AlgoliaIndex { + /** + * Gets a specific object + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject(objectID: string, cb: (err: Error, res: any) => void): void; + /** + * Gets specific attributes from an object + * @param objectID + * @param attributes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject( + objectID: string, + attributes: string[], + cb: (err: Error, res: any) => void + ): void; + /** + * Gets a list of objects + * @param objectIDs + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; + /** + * Add a specific object + * @param object without objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Add a list of objects + * @param object with objectID + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject( + object: {}, + objectID: string, + cb: (err: Error, res: any) => void + ): void; + /** + * Add list of objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObjects(objects: [{}], cb: (err: Error, res: any) => void): void; + /** + * Add or replace a specific object + * @param object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Add or replace several objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObjects(objects: object[], cb: (err: Error, res: any) => void): void; + /** + * Update parameters of a specific object + * @param object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Update parameters of a list of objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObjects( + objects: [{}], + cb: (err: Error, res: any) => void + ): void; + /** + * Delete a specific object + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObject(objectID: string, cb: (err: Error, res: any) => void): void; + /** + * Delete a list of objects + * @param objectIDs + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObjects( + objectIDs: string[], + cb: (err: Error, res: any) => void + ): void; + /** + * Delete objects that matches the query + * @param query + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery(query: string, cb: (err: Error, res: any) => void): void; + /** + * Delete objects that matches the query + * @param query + * @param params of the object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery( + query: string, + params: {}, + cb: (err: Error, res: any) => void + ): void; + /** + * Delete objects that matches the query + * @param query + * @param params of the object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deleteby + */ + deleteBy(params: {}, cb: (err: Error, res: any) => void): void; + /** + * Wait for an indexing task to be compete + * @param taskID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask + */ + waitTask(taskID: number, cb: (err: Error, res: any) => void): void; + /** + * Get an index settings + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings + */ + getSettings(cb: (err: Error, res: any) => void): void; + /** + * Set an index settings + * @param settings + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings + */ + setSettings( + settings: AlgoliaIndexSettings, + cb: (err: Error, res: any) => void + ): void; + /** + * Clear cache of an index + * https://github.com/algolia/algoliasearch-client-js#cache + */ + clearCache(): void; + /** + * Clear an index content + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex + */ + clearIndex(cb: (err: Error, res: any) => void): void; + /** + * Save a synonym object + * @param synonym + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + saveSynonym( + synonym: AlgoliaSynonym, + options: SynonymOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Save a synonym object + * @param synonyms + * @param options + * @param cb(err, res) + */ + batchSynonyms( + synonyms: AlgoliaSynonym[], + options: SynonymOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Delete a specific synonym + * @param identifier + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + deleteSynonym( + identifier: string, + options: SynonymOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Clear all synonyms of an index + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms + */ + clearSynonyms( + options: SynonymOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Get a specific synonym + * @param identifier + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym + */ + getSynonym(identifier: string, cb: (err: Error, res: any) => void): void; + /** + * Search a synonyms + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + searchSynonyms( + options: SearchSynonymOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Save a rule object + * @param rule + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#save-rule---saverule + */ + saveRule( + rule: AlgoliaRule, + options: RuleOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Save a rule object + * @param rules + * @param options + * @param cb(err, res) + */ + batchRules( + rules: AlgoliaRule[], + options: RuleOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Delete a specific rule + * @param identifier + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#batch-rules---batchrules + */ + deleteRule( + identifier: string, + options: RuleOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Clear all rules of an index + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#clear-all-rules---clearrules + */ + clearRules(options: RuleOption, cb: (err: Error, res: any) => void): void; + /** + * Get a specific rule + * @param identifier + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-rule---getrule + */ + getRule(identifier: string, cb: (err: Error, res: any) => void): void; + /** + * Search a rules + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#search-rules---searchrules + */ + searchRules( + options: SearchRuleOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * List index user keys + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys + */ + listApiKeys(cb: (err: Error, res: any) => void): void; + /** + * Add key for this index + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey(scopes: string[], cb: (err: Error, res: any) => void): void; + /** + * Add key for this index + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey( + scopes: string[], + options: AlgoliaApiKeyOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Update a key for this index + * @param key + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + cb: (err: Error, res: any) => void + ): void; + /** + * Update a key for this index + * @param key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + options: AlgoliaApiKeyOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Gets the rights of an index specific key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getapikeyacl + */ + getApiKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Deletes an index specific key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey + */ + deleteApiKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Gets specific attributes from an object + * @param objectID + * @param attributes + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject(objectID: string, attributes?: string[]): Promise; + /** + * Gets a list of objects + * @param objectIDs + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObjects(objectIDs: string[]): Promise; + /** + * Add a list of objects + * @param object with objectID + * @param objectID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject(object: {}, objectID?: string): Promise; + /** + * Add list of objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObjects(objects: [{}]): Promise; + /** + * Add or replace a specific object + * @param object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObject(object: {}): Promise; + /** + * Add or replace several objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObjects(objects: object[]): Promise; + /** + * Update parameters of a specific object + * @param object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObject(object: {}): Promise; + /** + * Update parameters of a list of objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObjects(objects: [{}]): Promise; + /** + * Delete a specific object + * @param objectID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObject(objectID: string): Promise; + /** + * Delete a list of objects + * @param objectIDs + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObjects(objectIDs: string[]): Promise; + /** + * Delete objects that matches the query + * @param query + * @param params of the object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery(query: string, params?: {}): Promise; + /** + * Delete objects that matches the query + * @param params of the search + * return {Promise} + * https://www.algolia.com/doc/api-reference/api-methods/delete-by-query/ + */ + deleteBy(params: {}): Promise; + /** + * Wait for an indexing task to be compete + * @param taskID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask + */ + waitTask(taskID: number): Promise; + /** + * Get an index settings + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings + */ + getSettings(): Promise; + /** + * Set an index settings + * @param settings + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings + */ + setSettings(settings: AlgoliaIndexSettings): Promise; + /** + * Search in an index + * @param params query parameter + * return {Promise} + * @param err() error callback + * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search + */ + search(params: AlgoliaQueryParameters): Promise; + /** + * Search in an index + * @param params query parameter + * @param cb(err, res) + * @param err() error callback + * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search + */ + search( + params: AlgoliaQueryParameters, + cb: (err: Error, res: AlgoliaResponse) => void + ): void; + /** + * Search in an index + * @param params query parameter + * return {Promise} + * @param err() error callback + * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ + */ + searchForFacetValues({ + facetName, + facetQuery, + ...qp, + }: { + facetName: string; + facetQuery: string; + } & AlgoliaQueryParameters): Promise; + /** + * Search in an index + * @param params query parameter + * @param cb(err, res) + * @param err() error callback + * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ + */ + searchForFacetValues( + { + facetName, + facetQuery, + ...qp, + }: { + facetName: string; + facetQuery: string; + } & AlgoliaQueryParameters, + cb: (err: Error, res: any) => void + ): void; + /** + * Browse an index + * @param query + * @param cb(err, content) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string, cb: (err: Error, res: any) => void): void; + /** + * Browse an index + * @param query + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string): Promise; + /** + * Browse an index from a cursor + * @param cursor + * @param cb(err, content) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseFrom(cursor: string, cb: (err: Error, res: any) => void): void; + /** + * Browse an index from a cursor + * @param cursor + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseFrom(cursor: string): Promise; + /** + * Browse an entire index + * return Promise + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseAll(): Promise; + /** + * Clear an index content + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex + */ + clearIndex(): Promise; + /** + * Save a synonym object + * @param synonym + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + saveSynonym(synonym: AlgoliaSynonym, options: SynonymOption): Promise; + /** + * Save a synonym object + * @param synonyms + * @param options + * return {Promise} + */ + batchSynonyms( + synonyms: AlgoliaSynonym[], + options: SynonymOption + ): Promise; + /** + * Delete a specific synonym + * @param identifier + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + deleteSynonym(identifier: string, options: SynonymOption): Promise; + /** + * Clear all synonyms of an index + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms + */ + clearSynonyms(options: SynonymOption): Promise; + /** + * Get a specific synonym + * @param identifier + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym + */ + getSynonym(identifier: string): Promise; + /** + * Search a synonyms + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + searchSynonyms(options: SearchSynonymOptions): Promise; + /** + * Save a rule object + * @param rule + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#save-rule---saverule + */ + saveRule(rule: AlgoliaRule, options: RuleOption): Promise; + /** + * Save a rule object + * @param rules + * @param options + * return {Promise} + */ + batchRules(rules: AlgoliaRule[], options: RuleOption): Promise; + /** + * Delete a specific rule + * @param identifier + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#batch-rules---batchrules + */ + deleteRule(identifier: string, options: RuleOption): Promise; + /** + * Clear all query rules of an index + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#clear-all-rules---clearrules + */ + clearRules(options: RuleOption): Promise; + /** + * Get a specific query rule + * @param identifier + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-rule---getrule + */ + getRule(identifier: string): Promise; + /** + * Search for query rules + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#search-rules---searchrules + */ + searchRules(options: SearchRuleOptions): Promise; + /** + * List index user keys + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys + */ + listApiKeys(): Promise; + /** + * Add key for this index + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey(scopes: string[], options?: AlgoliaApiKeyOptions): Promise; + /** + * Update a key for this index + * @param key + * @param scopes + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey(key: string, scopes: string[]): Promise; + /** + * Update a key for this index + * @param key + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + options: AlgoliaApiKeyOptions + ): Promise; + /** + * Gets the rights of an index specific key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getapikeyacl + */ + getApiKey(key: string): Promise; + /** + * Deletes an index specific key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey + */ + deleteApiKey(key: string): Promise; + } + /* +Interface describing available options when initializing a client +*/ + interface ClientOptions { + /** + * Timeout for requests to our servers, in milliseconds + * default: 15s (node), 2s (browser) + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + timeout?: number; + /** + * Protocol to use when communicating with algolia + * default: current protocol(browser), https(node) + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + protocol?: string; + /** + * (node only) httpAgent instance to use when communicating with Algolia servers. + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + httpAgent?: any; + /** + * read: array of read hosts to use to call Algolia servers, computed automatically + * write: array of read hosts to use to call Algolia servers, computed automatically + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + hosts?: { read?: string[]; write?: string[] }; + } + /* +Interface describing options available for gettings the logs +*/ + interface LogsOptions { + /** + * Specify the first entry to retrieve (0-based, 0 is the most recent log entry). + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + offset?: number; + /** + * Specify the maximum number of entries to retrieve starting at the offset. + * default: 10 + * maximum: 1000 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + length?: number; + /** + * @deprecated + * Retrieve only logs with an HTTP code different than 200 or 201 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + onlyErrors?: boolean; + /** + * Specify the type of logs to retrieve + * 'query' Retrieve only the queries + * 'build' Retrieve only the build operations + * 'error' Retrieve only the errors (same as onlyErrors parameters) + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + type?: string; + } + /** + * Describe the action object used for batch operation + */ + interface AlgoliaAction { + /** + * Type of the batch action + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + action: + | 'addObject' + | 'updateObject' + | 'partialUpdateObject' + | 'partialUpdateObjectNoCreate' + | 'deleteObject' + | 'delete' + | 'clear'; + /** + * Name of the index where the bact will be performed + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + indexName: string; + /** + * Object + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + body: {}; + } + /** + * Describes the option used when creating user key + */ + interface AlgoliaApiKeyOptions { + /** + * Add a validity period. The key will be valid for a specific period of time (in seconds). + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + validity?: number; + /** + * Specify the maximum number of API calls allowed from an IP address per hour + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + maxQueriesPerIPPerHour?: number; + /** + * Specify the maximum number of hits this API key can retrieve in one call + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + maxHitsPerQuery?: boolean; + /** + * Specify the list of targeted indices + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + indexes?: string[]; + /** + * Specify the list of referers + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + referers?: string[]; + /** + * Specify the list of query parameters + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + queryParameters?: AlgoliaQueryParameters; + /** + * Specify a description to describe where the key is used. + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + description?: string; + } + /** + * Describes option used when making operation on synonyms + */ + interface SynonymOption { + /** + * You can forward all settings updates to the replicas of an index + * https://github.com/algolia/algoliasearch-client-js#replica-settings + */ + forwardToReplicas?: boolean; + /** + * Replace all existing synonyms on the index with the content of the batch + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + replaceExistingSynonyms?: boolean; + } + /** + * Describes options used when searching for synonyms + */ + interface SearchSynonymOptions { + /** + * The actual search query to find synonyms + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + query?: string; + /** + * The page to fetch when browsing through several pages of results + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + page?: number; + /** + * Restrict the search to a specific type of synonym + * Use an empty string to search all types (default behavior) + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + type?: string; + /** + * Number of hits per page + * default: 100 + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + hitsPerPage?: number; + } + /** + * Describes option used when making operation on query rules + */ + interface RuleOption { + /** + * You can forward all settings updates to the replicas of an index + * https://github.com/algolia/algoliasearch-client-js#replica-settings + */ + forwardToReplicas?: boolean; + /** + * Replace all existing query rules on the index with the content of the batch + */ + clearExistingRules?: boolean; + } + /** + * Describes options used when searching for query rules + */ + interface SearchRuleOptions { + /** + * The actual search query to find synonyms + */ + query?: string; + /** + * When specified, restricts matches to rules with a specific anchoring type. + * When omitted, all anchoring types may match. + */ + anchoring?: string; + /** + * When specified, restricts matches to contextual rules with a specific context (exact match). + * When omitted, any generic or contextual rule (with any context) may match. + */ + context?: string; + /** + * Requested page (zero-based) + * default: 0 + */ + page?: number; + /** + * Number of hits per page + * default: 20 + */ + hitsPerPage?: number; + } + interface AlgoliaBrowseResponse { + cursor?: string; + hits: any[]; + params: string; + query: string; + processingTimeMS: number; + } + /** + * Describes a synonym object + */ + interface AlgoliaSynonym { + /** + * ObjectID of the synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + objectID: string; + /** + * Type of synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + type: 'synonym' | 'oneWaySynonym'; + /** + * Values used for the synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + synonyms: string[]; + } + /** + * Describes a query rule object + */ + interface AlgoliaRule { + /** + * ObjectID of the synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + objectID: string; + /** + * Condition of the rule + */ + condition: { + /** + * Query pattern + * syntax: https://www.algolia.com/doc/rest-api/query-rules/?language=php#query-pattern-syntax + */ + pattern: string; + /** + * Whether the pattern must match the beginning or the end of the query string, or both, or none. + */ + anchoring: 'is' | 'startsWith' | 'endsWith' | 'contains'; + /** + * Rule context (format: [A-Za-z0-9_-]+). + * When specified, the rule is contextual and applies only when the same context is specified + * at query time (using the ruleContexts parameter). + * When absent, the rule is generic and always applies + * (provided that its other conditions are met, of course). + */ + context?: string; + }; + /** + * Consequence of the rule. At least one of the following must be used: + */ + consequence: { + params?: { /** - * ObjectID of the synonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + * When a string, it replaces the entire query string. + * When an object, describes incremental edits to be made to the query string. + */ + query?: + | string + | { + /** + * Tokens (literals or placeholders) from the query pattern + * that should be removed from the query string. + */ + remove: string[]; + }; + /** + * Names of facets to which automatic filtering must be applied; + * they must match the facet name of a facet value placeholder in the query pattern. + */ + automaticFacetFilters?: string[]; + /** + * Same as automaticFacetFilters, but for optionalFacetFilters. + * The same syntax as query parameters can be used to specify a score: facetName. + */ + automaticOptionalFacetFilters?: string[]; + }; + /** + * Objects to promote as hits. Each object must contain the following fields + */ + promote?: { + /** + * Unique identifier of the object to promote */ objectID: string; /** - * Type of synonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + * Promoted rank for the object (zero-based) */ - type: "synonym" | "oneWaySynonym"; - /** - * Values used for the synonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - synonyms: string[]; - } + position: number; + }[]; + /** + * Custom JSON object that will be appended to the userData array in the response. + * This object is not interpreted by the API. It is limited to 1kB of minified JSON. + */ + userData?: {}; + }; /** - * Describes the options used when generating new api keys + * This field is intended for rule management purposes, + * in particular to ease searching for rules and presenting them to human readers. + * It is not interpreted by the API. */ - interface AlgoliaSecuredApiOptions { - /** - * Filter the query with numeric, facet or/and tag filters - * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters-1 - */ - filters?: string; - /** - * Defines the expiration date of the API key - * https://github.com/algolia/algoliasearch-client-js#valid-until - */ - validUntil?: number; - /** - * Restricts the key to a list of index names allowed for the secured API key - * https://github.com/algolia/algoliasearch-client-js#index-restriction - */ - restrictIndices?: string; - /** - * Allows you to restrict a single user to performing a maximum of N API calls per hour - * https://github.com/algolia/algoliasearch-client-js#user-rate-limiting - */ - userToken?: string; - } - + description?: string; + } + /** + * Describes the options used when generating new api keys + */ + interface AlgoliaSecuredApiOptions { /** - * Describes the settings available for configure your index + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://github.com/algolia/algoliasearch-client-js#filters-1 */ - interface AlgoliaIndexSettings { - /** - * The list of attributes you want index - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoindex - */ - attributesToIndex?: string[]; - /** - * The list of attributes you want to use for faceting - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributesforfaceting - */ - attributesForFaceting?: string[]; - /** - * The list of attributes that cannot be retrieved at query time - * default: null - * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes - */ - unretrievableAttributes?: string[]; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * Controls the way results are sorted - * default: ['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'] - * https://github.com/algolia/algoliasearch-client-js#ranking - */ - ranking?: string[]; - /** - * Lets you specify part of the ranking - * default: [] - * https://github.com/algolia/algoliasearch-client-js#customranking - */ - customRanking?: string[]; - /** - * The list of indices on which you want to replicate all write operations - * default: [] - * https://github.com/algolia/algoliasearch-client-js#slaves - */ - slaves?: string[]; - /** - * Limit the number of facet values returned for each facet - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet - */ - maxValuesPerFacet?: string; - /** - * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight - */ - attributesToHighlight?: string[]; - /** - * Default list of attributes to snippet alongside the number of words to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet - */ - attributesToSnippet?: string[]; - /** - * Specify the string that is inserted before the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag - */ - highlightPreTag?: string; - /** - * Specify the string that is inserted after the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext - */ - snippetEllipsisText?: string; - /** - * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets - * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Pagination parameter used to select the number of hits per page - * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage - */ - hitsPerPage?: number; - /** - * The minimum number of characters needed to accept one typo - * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo - */ - minWordSizefor1Typo?: number; - /** - * The minimum number of characters needed to accept two typos. - * default: 8 - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - minWordSizefor2Typos?: number; - /** - * This option allows you to control the number of typos allowed in the result set - * default: true - * 'true' The typo tolerance is enabled and all matching hits are retrieved (default behavior). - * 'false' The typo tolerance is disabled. All results with typos will be hidden. - * 'min' Only keep results with the minimum number of typos. For example, if one result matches without typos, then all results with typos will be hidden. - * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#typotolerance - */ - typoTolerance?: any; - /** - * If set to false, disables typo tolerance on numeric tokens (numbers). - * default: true - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens - */ - allowTyposOnNumericTokens?: boolean; - /** - * If set to true, plural won't be considered as a typo - * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals - */ - ignorePlurals?: boolean; - /** - * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes - */ - disableTypoToleranceOnAttributes?: string; - /** - * Specify the separators (punctuation characters) to index. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#separatorstoindex - */ - separatorsToIndex?: string; - /** - * Selects how the query words are interpreted - * default: 'prefixLast' - * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. - * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). - * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype - */ - queryType?: any; - /** - * This option is used to select a strategy in order to avoid having an empty result page - * default: 'none' - * 'lastWords' When a query does not return any results, the last word will be added as optional - * 'firstWords' When a query does not return any results, the first word will be added as optional - * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional - * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults - */ - removeWordsIfNoResults?: string; - /** - * Enables the advanced query syntax - * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax - */ - advancedSyntax?: boolean; - /** - * A string that contains the comma separated list of words that should be considered as optional when found in the query - * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords - */ - optionalWords?: string[]; - /** - * Remove stop words from the query before executing it - * default: false - * true|false: enable or disable stop words for all 41 supported languages; or - * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords - */ - removeStopWords?: string[]; - /** - * List of attributes on which you want to disable prefix matching - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableprefixonattributes - */ - disablePrefixOnAttributes?: string[]; - /** - * List of attributes on which you want to disable the computation of exact criteria - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes - */ - disableExactOnAttributes?: string[]; - /** - * This parameter control how the exact ranking criterion is computed when the query contains one word - * default: attribute - * 'none': no exact on single word query - * 'word': exact set to 1 if the query word is found in the record - * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery - */ - exactOnSingleWordQuery?: string; - /** - * Specify the list of approximation that should be considered as an exact match in the ranking formula - * default: ['ignorePlurals', 'singleWordSynonym'] - * 'ignorePlurals': alternative words added by the ignorePlurals feature - * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") - * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact - */ - alternativesAsExact?: any; - /** - * The name of the attribute used for the Distinct feature - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributefordistinct - */ - attributeForDistinct?: string; - /** - * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct - */ - distinct?: any; - /** - * All numerical attributes are automatically indexed as numerical filters - * default '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex - */ - numericAttributesToIndex?: string[]; - /** - * Allows compression of big integer arrays. - * default: false - * https://github.com/algolia/algoliasearch-client-js#allowcompressionofintegerarray - */ - allowCompressionOfIntegerArray?: boolean; - /** - * Specify alternative corrections that you want to consider. - * default: [] - * https://github.com/algolia/algoliasearch-client-js#altcorrections - */ - altCorrections?: [{}]; - /** - * Configure the precision of the proximity ranking criterion - * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity - */ - minProximity?: number; - /** - * This is an advanced use-case to define a token substitutable by a list of words without having the original token searchable - * default: '' - * https://github.com/algolia/algoliasearch-client-js#placeholders - */ - placeholders?: any; - } + filters?: string; + /** + * Defines the expiration date of the API key + * https://github.com/algolia/algoliasearch-client-js#valid-until + */ + validUntil?: number; + /** + * Restricts the key to a list of index names allowed for the secured API key + * https://github.com/algolia/algoliasearch-client-js#index-restriction + */ + restrictIndices?: string; + /** + * Allows you to restrict a single user to performing a maximum of N API calls per hour + * https://github.com/algolia/algoliasearch-client-js#user-rate-limiting + */ + userToken?: string; + } - interface AlgoliaQueryParameters { - /** - * Query string used to perform the search - * default: '' - * https://github.com/algolia/algoliasearch-client-js#query - */ - query?: string; - /** - * Filter the query with numeric, facet or/and tag filters - * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters - */ - filters?: string; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * List of attributes you want to use for textual search - * default: attributeToIndex - * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes - */ - restrictSearchableAttributes?: string[]; - /** - * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes - * default: "" - * https://github.com/algolia/algoliasearch-client-js#facets - */ - facets?: string; - /** - * Limit the number of facet values returned for each facet. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet - */ - maxValuesPerFacet?: string; - /** - * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight - */ - attributesToHighlight?: string[]; - /** - * Default list of attributes to snippet alongside the number of words to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet - */ - attributesToSnippet?: string[]; - /** - * Specify the string that is inserted before the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag - */ - highlightPreTag?: string; - /** - * Specify the string that is inserted after the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext - */ - snippetEllipsisText?: string; - /** - * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets - * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Pagination parameter used to select the number of hits per page - * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage - */ - hitsPerPage?: number; - /** - * Pagination parameter used to select the page to retrieve. - * default: 0 - * https://github.com/algolia/algoliasearch-client-js#page - */ - page?: number; - /** - * Offset of the first hit to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#offset - */ - offset?: number; - /** - * Number of hits to return. - * default: null - * https://github.com/algolia/algoliasearch-client-js#length - */ - length?: number; - /** - * The minimum number of characters needed to accept one typo. - * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo - */ - minWordSizefor1Typo?: number; - /** - * The minimum number of characters needed to accept two typo. - * fault: 8 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos - */ - minWordSizefor2Typos?: number; - /** - * This option allows you to control the number of typos allowed in the result set: - * default: true - * 'true' The typo tolerance is enabled and all matching hits are retrieved - * 'false' The typo tolerance is disabled. All results with typos will be hidden. - * 'min' Only keep results with the minimum number of typos - * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos - */ - typoTolerance?: boolean; - /** - * If set to false, disables typo tolerance on numeric tokens (numbers). - * default: - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens - */ - allowTyposOnNumericTokens?: boolean; - /** - * If set to true, plural won't be considered as a typo - * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals - */ - ignorePlurals?: boolean; - /** - * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes - */ - disableTypoToleranceOnAttributes?: string; - /** - * Search for entries around a given location - * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlng - */ - aroundLatLng?: string; - /** - * Search for entries around a given latitude/longitude automatically computed from user IP address. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip - */ - aroundLatLngViaIP?: string; - /** - * Control the radius associated with a geo search. Defined in meters. - * default: null - * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area - * https://github.com/algolia/algoliasearch-client-js#aroundradius - */ - aroundRadius?: any; - /** - * Control the precision of a geo search - * default: null - * https://github.com/algolia/algoliasearch-client-js#aroundprecision - */ - aroundPrecision?: number; - /** - * Define the minimum radius used for a geo search when aroundRadius is not set. - * default: null - * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius - */ - minimumAroundRadius?: number; - /** - * Search entries inside a given area defined by the two extreme points of a rectangle - * default: null - * https://github.com/algolia/algoliasearch-client-js#insideboundingbox - */ - insideBoundingBox?: string; - /** - * Selects how the query words are interpreted - * default: 'prefixLast' - * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. - * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). - * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype - */ - queryType?: any; - /** - * Search entries inside a given area defined by a set of points - * defauly: '' - * https://github.com/algolia/algoliasearch-client-js#insidepolygon - */ - insidePolygon?: string; - /** - * This option is used to select a strategy in order to avoid having an empty result page - * default: 'none' - * 'lastWords' When a query does not return any results, the last word will be added as optional - * 'firstWords' When a query does not return any results, the first word will be added as optional - * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional - * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults - */ - removeWordsIfNoResults?: string; - /** - * Enables the advanced query syntax - * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax - */ - advancedSyntax?: boolean; - /** - * A string that contains the comma separated list of words that should be considered as optional when found in the query - * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords - */ - optionalWords?: string[]; - /** - * Remove stop words from the query before executing it - * default: false - * true|false: enable or disable stop words for all 41 supported languages; or - * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords - */ - removeStopWords?: string[]; - /** - * List of attributes on which you want to disable the computation of exact criteria - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes - */ - disableExactOnAttributes?: string[]; - /** - * This parameter control how the exact ranking criterion is computed when the query contains one word - * default: attribute - * 'none': no exact on single word query - * 'word': exact set to 1 if the query word is found in the record - * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery - */ - exactOnSingleWordQuery?: string; - /** - * Specify the list of approximation that should be considered as an exact match in the ranking formula - * default: ['ignorePlurals', 'singleWordSynonym'] - * 'ignorePlurals': alternative words added by the ignorePlurals feature - * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") - * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact - */ - alternativesAsExact?: any; - /** - * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. - * https://github.com/algolia/algoliasearch-client-js#distinct - */ - distinct?: any; - /** - * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. - * default: false - * https://github.com/algolia/algoliasearch-client-js#getrankinginfo - */ - getRankingInfo?: boolean; - /** - * All numerical attributes are automatically indexed as numerical filters - * default: '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex - */ - numericAttributesToIndex?: string[]; - /** - * @deprecated please use filters instead - * A string that contains the comma separated list of numeric filters you want to apply. - * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated - */ - numericFilters?: string[]; - /** - * @deprecated - * Filter the query by a set of tags. - * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated - */ - tagFilters?: string; - /** - * @deprecated - * Filter the query by a set of facets. - * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated - */ - facetFilters?: string; - /** - * If set to false, this query will not be taken into account in the analytics feature. - * default true - * https://github.com/algolia/algoliasearch-client-js#analytics - */ - analytics?: boolean; - /** - * If set, tag your query with the specified identifiers - * default: null - * https://github.com/algolia/algoliasearch-client-js#analyticstags - */ - analyticsTags?: string[]; - /** - * If set to false, the search will not use the synonyms defined for the targeted index. - * default: true - * https://github.com/algolia/algoliasearch-client-js#synonyms - */ - synonyms?: boolean; - /** - * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. - * default: true - * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight - */ - replaceSynonymsInHighlight?: boolean; - /** - * Configure the precision of the proximity ranking criterion - * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity - */ - minProximity?: number; - } + /** + * Describes the settings available for configure your index + */ + interface AlgoliaIndexSettings { + /** + * The list of attributes you want index + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoindex + */ + attributesToIndex?: string[]; + /** + * The list of attributes you want to use for faceting + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributesforfaceting + */ + attributesForFaceting?: string[]; + /** + * The list of attributes that cannot be retrieved at query time + * default: null + * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes + */ + unretrievableAttributes?: string[]; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + */ + attributesToRetrieve?: string[]; + /** + * Controls the way results are sorted + * default: ['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'] + * https://github.com/algolia/algoliasearch-client-js#ranking + */ + ranking?: string[]; + /** + * Lets you specify part of the ranking + * default: [] + * https://github.com/algolia/algoliasearch-client-js#customranking + */ + customRanking?: string[]; + /** + * The list of indices on which you want to replicate all write operations + * default: [] + * https://github.com/algolia/algoliasearch-client-js#replicas + */ + replicas?: string[]; + /** + * Limit the number of facet values returned for each facet + * default: "" + * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + */ + maxValuesPerFacet?: string; + /** + * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + */ + attributesToHighlight?: string[]; + /** + * Default list of attributes to snippet alongside the number of words to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + */ + attributesToSnippet?: string[]; + /** + * Specify the string that is inserted before the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightpretag + */ + highlightPreTag?: string; + /** + * Specify the string that is inserted after the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + * default: … + * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + */ + snippetEllipsisText?: string; + /** + * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets + * default: false + * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + */ + restrictHighlightAndSnippetArrays?: boolean; + /** + * Pagination parameter used to select the number of hits per page + * default: 20 + * https://github.com/algolia/algoliasearch-client-js#hitsperpage + */ + hitsPerPage?: number; + /** + * The minimum number of characters needed to accept one typo + * default: 4 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + */ + minWordSizefor1Typo?: number; + /** + * The minimum number of characters needed to accept two typos. + * default: 8 + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + minWordSizefor2Typos?: number; + /** + * This option allows you to control the number of typos allowed in the result set + * default: true + * 'true' The typo tolerance is enabled and all matching hits are retrieved (default behavior). + * 'false' The typo tolerance is disabled. All results with typos will be hidden. + * 'min' Only keep results with the minimum number of typos. For example, if one result matches without typos, then all results with typos will be hidden. + * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. + * https://github.com/algolia/algoliasearch-client-js#typotolerance + */ + typoTolerance?: any; + /** + * If set to false, disables typo tolerance on numeric tokens (numbers). + * default: true + * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + */ + allowTyposOnNumericTokens?: boolean; + /** + * If set to true, plural won't be considered as a typo + * default: false + * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + */ + ignorePlurals?: boolean; + /** + * List of attributes on which you want to disable typo tolerance + * default: "" + * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + */ + disableTypoToleranceOnAttributes?: string; + /** + * Specify the separators (punctuation characters) to index. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#separatorstoindex + */ + separatorsToIndex?: string; + /** + * Selects how the query words are interpreted + * default: 'prefixLast' + * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. + * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). + * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. + * https://github.com/algolia/algoliasearch-client-js#querytype + */ + queryType?: any; + /** + * This option is used to select a strategy in order to avoid having an empty result page + * default: 'none' + * 'lastWords' When a query does not return any results, the last word will be added as optional + * 'firstWords' When a query does not return any results, the first word will be added as optional + * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional + * 'none' No specific processing is done when a query does not return any results + * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + */ + removeWordsIfNoResults?: string; + /** + * Enables the advanced query syntax + * default: false + * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + */ + advancedSyntax?: boolean; + /** + * A string that contains the comma separated list of words that should be considered as optional when found in the query + * default: [] + * https://github.com/algolia/algoliasearch-client-js#optionalwords + */ + optionalWords?: string[]; + /** + * Remove stop words from the query before executing it + * default: false + * true|false: enable or disable stop words for all 41 supported languages; or + * a list of language ISO codes (as a comma-separated string) for which stop words should be enable + * https://github.com/algolia/algoliasearch-client-js#removestopwords + */ + removeStopWords?: string[]; + /** + * List of attributes on which you want to disable prefix matching + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableprefixonattributes + */ + disablePrefixOnAttributes?: string[]; + /** + * List of attributes on which you want to disable the computation of exact criteria + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + */ + disableExactOnAttributes?: string[]; + /** + * This parameter control how the exact ranking criterion is computed when the query contains one word + * default: attribute + * 'none': no exact on single word query + * 'word': exact set to 1 if the query word is found in the record + * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query + * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + */ + exactOnSingleWordQuery?: string; + /** + * Specify the list of approximation that should be considered as an exact match in the ranking formula + * default: ['ignorePlurals', 'singleWordSynonym'] + * 'ignorePlurals': alternative words added by the ignorePlurals feature + * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") + * 'multiWordsSynonym': multiple-words synonym + * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + */ + alternativesAsExact?: any; + /** + * The name of the attribute used for the Distinct feature + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributefordistinct + */ + attributeForDistinct?: string; + /** + * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. + * https://github.com/algolia/algoliasearch-client-js#distinct + */ + distinct?: any; + /** + * All numerical attributes are automatically indexed as numerical filters + * default '' + * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + */ + numericAttributesToIndex?: string[]; + /** + * Allows compression of big integer arrays. + * default: false + * https://github.com/algolia/algoliasearch-client-js#allowcompressionofintegerarray + */ + allowCompressionOfIntegerArray?: boolean; + /** + * Specify alternative corrections that you want to consider. + * default: [] + * https://github.com/algolia/algoliasearch-client-js#altcorrections + */ + altCorrections?: [{}]; + /** + * Configure the precision of the proximity ranking criterion + * default: 1 + * https://github.com/algolia/algoliasearch-client-js#minproximity + */ + minProximity?: number; + /** + * This is an advanced use-case to define a token substitutable by a list of words without having the original token searchable + * default: '' + * https://github.com/algolia/algoliasearch-client-js#placeholders + */ + placeholders?: any; + } + + interface AlgoliaQueryParameters { + /** + * Query string used to perform the search + * default: '' + * https://github.com/algolia/algoliasearch-client-js#query + */ + query?: string; + /** + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://github.com/algolia/algoliasearch-client-js#filters + */ + filters?: string; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + */ + attributesToRetrieve?: string[]; + /** + * List of attributes you want to use for textual search + * default: attributeToIndex + * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes + */ + restrictSearchableAttributes?: string[]; + /** + * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes + * default: "" + * https://github.com/algolia/algoliasearch-client-js#facets + */ + facets?: string; + /** + * Limit the number of facet values returned for each facet. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + */ + maxValuesPerFacet?: string; + /** + * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + */ + attributesToHighlight?: string[]; + /** + * Default list of attributes to snippet alongside the number of words to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + */ + attributesToSnippet?: string[]; + /** + * Specify the string that is inserted before the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightpretag + */ + highlightPreTag?: string; + /** + * Specify the string that is inserted after the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + * default: … + * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + */ + snippetEllipsisText?: string; + /** + * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets + * default: false + * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + */ + restrictHighlightAndSnippetArrays?: boolean; + /** + * Pagination parameter used to select the number of hits per page + * default: 20 + * https://github.com/algolia/algoliasearch-client-js#hitsperpage + */ + hitsPerPage?: number; + /** + * Pagination parameter used to select the page to retrieve. + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#page + */ + page?: number; + /** + * Offset of the first hit to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#offset + */ + offset?: number; + /** + * Number of hits to return. + * default: null + * https://github.com/algolia/algoliasearch-client-js#length + */ + length?: number; + /** + * The minimum number of characters needed to accept one typo. + * default: 4 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + */ + minWordSizefor1Typo?: number; + /** + * The minimum number of characters needed to accept two typo. + * fault: 8 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + */ + minWordSizefor2Typos?: number; + /** + * This option allows you to control the number of typos allowed in the result set: + * default: true + * 'true' The typo tolerance is enabled and all matching hits are retrieved + * 'false' The typo tolerance is disabled. All results with typos will be hidden. + * 'min' Only keep results with the minimum number of typos + * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + */ + typoTolerance?: boolean; + /** + * If set to false, disables typo tolerance on numeric tokens (numbers). + * default: + * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + */ + allowTyposOnNumericTokens?: boolean; + /** + * If set to true, plural won't be considered as a typo + * default: false + * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + */ + ignorePlurals?: boolean; + /** + * List of attributes on which you want to disable typo tolerance + * default: "" + * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + */ + disableTypoToleranceOnAttributes?: string; + /** + * Search for entries around a given location + * default: "" + * https://github.com/algolia/algoliasearch-client-js#aroundlatlng + */ + aroundLatLng?: string; + /** + * Search for entries around a given latitude/longitude automatically computed from user IP address. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip + */ + aroundLatLngViaIP?: string; + /** + * Control the radius associated with a geo search. Defined in meters. + * default: null + * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area + * https://github.com/algolia/algoliasearch-client-js#aroundradius + */ + aroundRadius?: number | 'all'; + /** + * Control the precision of a geo search + * default: null + * https://github.com/algolia/algoliasearch-client-js#aroundprecision + */ + aroundPrecision?: number; + /** + * Define the minimum radius used for a geo search when aroundRadius is not set. + * default: null + * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius + */ + minimumAroundRadius?: number; + /** + * Search entries inside a given area defined by the two extreme points of a rectangle + * default: null + * https://github.com/algolia/algoliasearch-client-js#insideboundingbox + */ + insideBoundingBox?: number[][]; + /** + * Selects how the query words are interpreted + * default: 'prefixLast' + * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. + * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). + * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. + * https://github.com/algolia/algoliasearch-client-js#querytype + */ + queryType?: any; + /** + * Search entries inside a given area defined by a set of points + * defauly: '' + * https://github.com/algolia/algoliasearch-client-js#insidepolygon + */ + insidePolygon?: number[][]; + /** + * This option is used to select a strategy in order to avoid having an empty result page + * default: 'none' + * 'lastWords' When a query does not return any results, the last word will be added as optional + * 'firstWords' When a query does not return any results, the first word will be added as optional + * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional + * 'none' No specific processing is done when a query does not return any results + * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + */ + removeWordsIfNoResults?: string; + /** + * Enables the advanced query syntax + * default: false + * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + */ + advancedSyntax?: boolean; + /** + * A string that contains the comma separated list of words that should be considered as optional when found in the query + * default: [] + * https://github.com/algolia/algoliasearch-client-js#optionalwords + */ + optionalWords?: string[]; + /** + * Remove stop words from the query before executing it + * default: false + * true|false: enable or disable stop words for all 41 supported languages; or + * a list of language ISO codes (as a comma-separated string) for which stop words should be enable + * https://github.com/algolia/algoliasearch-client-js#removestopwords + */ + removeStopWords?: string[]; + /** + * List of attributes on which you want to disable the computation of exact criteria + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + */ + disableExactOnAttributes?: string[]; + /** + * This parameter control how the exact ranking criterion is computed when the query contains one word + * default: attribute + * 'none': no exact on single word query + * 'word': exact set to 1 if the query word is found in the record + * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query + * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + */ + exactOnSingleWordQuery?: string; + /** + * Specify the list of approximation that should be considered as an exact match in the ranking formula + * default: ['ignorePlurals', 'singleWordSynonym'] + * 'ignorePlurals': alternative words added by the ignorePlurals feature + * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") + * 'multiWordsSynonym': multiple-words synonym + * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + */ + alternativesAsExact?: any; + /** + * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. + * https://github.com/algolia/algoliasearch-client-js#distinct + */ + distinct?: any; + /** + * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. + * default: false + * https://github.com/algolia/algoliasearch-client-js#getrankinginfo + */ + getRankingInfo?: boolean; + /** + * All numerical attributes are automatically indexed as numerical filters + * default: '' + * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + */ + numericAttributesToIndex?: string[]; + /** + * @deprecated please use filters instead + * A string that contains the comma separated list of numeric filters you want to apply. + * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated + */ + numericFilters?: string[]; + /** + * @deprecated + * Filter the query by a set of tags. + * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated + */ + tagFilters?: string; + /** + * @deprecated + * Filter the query by a set of facets. + * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated + */ + facetFilters?: string; + /** + * If set to false, this query will not be taken into account in the analytics feature. + * default true + * https://github.com/algolia/algoliasearch-client-js#analytics + */ + analytics?: boolean; + /** + * If set, tag your query with the specified identifiers + * default: null + * https://github.com/algolia/algoliasearch-client-js#analyticstags + */ + analyticsTags?: string[]; + /** + * If set to false, the search will not use the synonyms defined for the targeted index. + * default: true + * https://github.com/algolia/algoliasearch-client-js#synonyms + */ + synonyms?: boolean; + /** + * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. + * default: true + * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight + */ + replaceSynonymsInHighlight?: boolean; + /** + * Configure the precision of the proximity ranking criterion + * default: 1 + * https://github.com/algolia/algoliasearch-client-js#minproximity + */ + minProximity?: number; + } } -declare function algoliasearch(applicationId: string, apiKey: string, options?: algoliasearch.ClientOptions): algoliasearch.AlgoliaClient; +declare function algoliasearch( + applicationId: string, + apiKey: string, + options?: algoliasearch.ClientOptions +): algoliasearch.AlgoliaClient; export = algoliasearch; diff --git a/types/algoliasearch/tsconfig.json b/types/algoliasearch/tsconfig.json index 3358732ba3..4d7e52dd8b 100644 --- a/types/algoliasearch/tsconfig.json +++ b/types/algoliasearch/tsconfig.json @@ -1,23 +1,16 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "algoliasearch-tests.ts" - ] -} \ No newline at end of file + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "algoliasearch-tests.ts"] +} diff --git a/types/algoliasearch/tslint.json b/types/algoliasearch/tslint.json new file mode 100644 index 0000000000..886f1a8b6c --- /dev/null +++ b/types/algoliasearch/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/alt/tslint.json b/types/alt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/alt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/amazon-product-api/amazon-product-api-tests.ts b/types/amazon-product-api/amazon-product-api-tests.ts index 0a02153236..37682a11aa 100644 --- a/types/amazon-product-api/amazon-product-api-tests.ts +++ b/types/amazon-product-api/amazon-product-api-tests.ts @@ -3,7 +3,7 @@ declare var process: { env: any }; import amazon = require('amazon-product-api'); -var client = amazon.createClient({ +let client = amazon.createClient({ awsId: process.env.AWS_ACCESS_KEY_ID, awsSecret: process.env.AWS_SECRET, awsTag: process.env.AWS_ASSOCIATE_TAG @@ -12,7 +12,7 @@ var client = amazon.createClient({ // Item Search -var searchQuery = { +let searchQuery = { director: 'Quentin Tarantino', actor: 'Samuel L. Jackson', searchIndex: 'DVD', @@ -37,11 +37,11 @@ client.itemSearch(searchQuery, (err, results) => { // Item Lookup -var lookupQuery = { +let lookupQuery = { itemId: 'B00008OE6I', idType: 'ASIN', responseGroup: 'OfferFull', - Condition: 'All' + condition: 'All' }; client.itemLookup(lookupQuery).then((results) => { @@ -58,9 +58,22 @@ client.itemLookup(lookupQuery, (err, results) => { console.log(getResultCount(results) + " lookup results"); }); +let lookupQueryWithItemIdArray = { + itemId: ['B00008OE6I', 'B00008OE6E'], + idType: 'ASIN', + responseGroup: 'OfferFull', + condition: 'All' +}; + +client.itemLookup(lookupQueryWithItemIdArray).then((results) => { + console.log(getResultCount(results) + " lookup results"); +}).catch(function(err){ + console.log(err); +}); + // Browse Node Lookup -var nodeLookupQuery = { +let nodeLookupQuery = { browseNodeId: '2625373011' }; @@ -81,4 +94,4 @@ client.browseNodeLookup(nodeLookupQuery, (err, results) => { function getResultCount(results: Object[]) { return results != undefined ? results.length : 0; -} \ No newline at end of file +} diff --git a/types/amazon-product-api/index.d.ts b/types/amazon-product-api/index.d.ts index 797adf45f4..34bafd04f4 100644 --- a/types/amazon-product-api/index.d.ts +++ b/types/amazon-product-api/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for amazon-product-api // Project: https://github.com/t3chnoboy/amazon-product-api -// Definitions by: Matti Lehtinen +// Definitions by: Matti Lehtinen , Alex Leon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,10 +15,35 @@ interface IAmazonProductQueryCallback { (err: string, results: Object[]): void; } +interface IItemSearchOptions { + condition?: string; + keywords?: string; + responseGroup?: string; + searchIndex?: string; + itemPage?: number; + sort?: string; +} + +interface IItemLookupOptions { + condition?: string; + idType?: string; + includeReviewsSummary?: boolean; + itemId?: string | string[]; + responseGroup?: string; + searchIndex?: string; + truncateReviewsAt?: number; + variationPage?: string; +} + +interface IBrowseNodeLookupOptions { + browseNodeId?: string; + responseGroup?: string; +} + interface IAmazonProductClient { - itemSearch(query: any, callback?: IAmazonProductQueryCallback): Promise; - itemLookup(query: any, callback?: IAmazonProductQueryCallback): Promise; - browseNodeLookup(query: any, callback?: IAmazonProductQueryCallback): Promise; + itemSearch(query: IItemSearchOptions, callback?: IAmazonProductQueryCallback): Promise; + itemLookup(query: IItemLookupOptions, callback?: IAmazonProductQueryCallback): Promise; + browseNodeLookup(query: IBrowseNodeLookupOptions, callback?: IAmazonProductQueryCallback): Promise; } export declare function createClient(credentials: ICredentials): IAmazonProductClient; diff --git a/types/amazon-product-api/tslint.json b/types/amazon-product-api/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/amazon-product-api/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/amcharts/AmAngularGauge.d.ts b/types/amcharts/AmAngularGauge.d.ts new file mode 100644 index 0000000000..d4199f83cd --- /dev/null +++ b/types/amcharts/AmAngularGauge.d.ts @@ -0,0 +1,629 @@ +import AmBalloon from "./AmBalloon"; +import AmChart from "./AmChart"; +import AmLegend from "./AmLegend"; +import ExportSettings from "./ExportSettings"; +import GaugeArrow from "./GaugeArrow"; +import GaugeAxis from "./GaugeAxis"; +import Label from "./Label"; +import Title from "./Title"; + +/** + * AmAngularGauge Extension for AmChart to create gauge charts. + */ +export default class AmAngularGauge extends AmChart { + /** + * When enabled, chart adds aria-label attributes to columns, bullets or map objects. + * You can control values of these labels using properties like accessibleLabel of AmGraph. + * Note, not all screen readers support these tags. + * We tested this mostly with NVDA Screen reader. + * WAI-ARIA is now official W3 standard, so in future more readers will handle this well. + * We will be improving accessibility on our charts, so we would be glad to hear your feedback. + * @default true + */ + accessible: boolean; + + /** + * Description which will be added to node of SVG element. + * Most of the screen readers will read this description. + */ + accessibleDescription: string; + + /** + * Description which is added to of a SVG element. Some of the screen readers will read this description. + */ + accessibleTitle: string; + + /** + * Specifies, if class names should be added to chart elements. + * @default false + */ + addClassNames: boolean; + + /** + * Uses the whole space of the canvas to draw the gauge. + * @default true + */ + adjustSize: boolean; + + /** + * Array of Labels. Example of label object, with all possible properties: + * { + * "x": 20, + * "y": 20, + * "text": "this is label", + * "align": "left", + * "size": 12, + * "color": "#CC0000", + * "alpha": 1, + * "rotation": 0, + * "bold": true, + * "url": "http://www.amcharts.com" + * } + * @default [] + */ + allLabels: [Label]; + + /** + * Array of arrows. + */ + arrows: [GaugeArrow]; + + /** + * If you set it to true the chart will automatically monitor changes of display style of chart’s container + * (or any of it’s parents) and will render chart correctly if it is changed from none to block. + * We recommend setting it to true if you change this style at a run time, as it affects performance a bit. + * @default false + */ + autoDisplay: boolean; + + /** + * Set this to false if you don't want chart to resize itself whenever its parent container size changes. + * @default true + */ + autoResize: boolean; + + /** + * If you set it to true and your chart div (or any of the parent div) has css scale applied, + * the chart will position mouse at a correct position. + * Default value is false because this operation consumes some CPU and quite a + * few people are using css transfroms. + * @default false + */ + autoTransform: boolean; + + /** + * Array of axes. + * @default [GaugeAxis] + */ + axes: [GaugeAxis]; + + /** + * Opacity of background. Set it to >0 value if you want backgroundColor to work. + * However we recommend changing div's background-color style for changing background color. + * @default 0 + */ + backgroundAlpha: number; + + /** + * Background color. You should set backgroundAlpha to >0 value in order background to be visible. + * We recommend setting background color directly on a chart's DIV instead of using this property. + * @default #FFFFFF + */ + backgroundColor: string; + + /** + * The chart creates AmBalloon class itself. + * If you want to customize balloon, get balloon instance using this property, + * and then change balloon's properties. + * @default AmBalloon + */ + balloon: AmBalloon; + + /** + * Opacity of chart's border. Value range is 0 - 1. + * @default 0 + */ + borderAlpha: number; + + /** + * Color of chart's border. You should set borderAlpha >0 in order border to be visible. + * We recommend setting border color directly on a chart's DIV instead of using this property. + * @default #000000 + */ + borderColor: string; + + /** + * This prefix is added to all class names which are added to all visual elements of a chart + * in case addClassNames is set to true. + * @default amcharts + */ + classNamePrefix: string; + + /** + * In case you use gauge to create a clock, set this to true. + * @default false + */ + clockWiseOnly: boolean; + + /** + * Text color. + * @default #000000 + */ + color: string; + + /** + * Non-commercial version only. Specifies position of link to amCharts site. + * Allowed values are: top-left, top-right, bottom-left and bottom-right. + * @default 'top - left' + */ + creditsPosition: string; + + /** + * A config object for Data Loader plugin. Please refer to the following page for more information. + */ + dataLoader: object; + + /** + * Array of data objects, for example: + * [ + * {country:"US", value:524}, + * {country:"UK", value:624}, + * {country:"Lithuania", value:824} + * ] + * You can have any number of fields and use any field names. + * In case of AmMap, data provider should be MapData object. + * The data set data. + * Important: if you are using date/time-based category axis, the data points needs to come pre-ordered + * in ascending order. Data with incorrect order might result in visual and functional glitches on the chart. + */ + dataProvider: [object]; + + /** + * Decimal separator. + * @default "." + */ + decimalSeparator: string; + + /** + * Using this property you can add any additional information to SVG, like SVG filters or clip paths. + * The structure of this object should be identical to XML structure of a object you are adding, + * only in JSON format. + */ + defs: object; + + /** + * Export config. Specifies how export to image/data export/print/annotate menu will look and behave. + * You can find a lot of examples in amcharts/plugins/export folder. More details can be found here. + */ + export: ExportSettings; + + /** + * Gauge face opacity. + * @default 0 + */ + faceAlpha: number; + + /** + * Gauge face border opacity. + * @default 0 + */ + faceBorderAlpha: number; + + /** + * Gauge face border color. + * @default #555555 + */ + faceBorderColor: string; + + /** + * Gauge face border width. + * @default 1 + */ + faceBorderWidth: number; + + /** + * Gauge face color, requires faceAlpha > 0 + * @default #FAFAFA + */ + faceColor: string; + + /** + * Gauge face image-pattern. + * Example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4} + * fontFamily String Verdana Font family. + * fontSize Number 11 Font size. + */ + facePattern: object; + + /** + * Gauge's horizontal position in pixel, origin is the center. Centered by default. + */ + gaugeX: number; + + /** + * Gauge's vertical position in pixel, origin is the center. Centered by default. + */ + gaugeY: number; + + /** + * If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. + * Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result. + * @default false + */ + handDrawn: boolean; + + /** + * Defines by how many pixels hand-drawn line (when handDrawn is set to true) will fluctuate. + * @default 2 + */ + handDrawScatter: number; + + /** + * Defines by how many pixels line thickness will fluctuate (when handDrawn is set to true). + * @default 1 + */ + handDrawThickness: number; + + /** + * Time, in milliseconds after which balloon is hidden if the user rolls-out of the object. + * Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas. + * Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class. + * @default 150 + */ + hideBalloonTime: number; + + /** + * Allows changing language easily. + * Note, you should include language js file from amcharts/lang or ammap/lang folder and then use + * variable name used in this file, like chart.language = "de"; Note, for maps this works differently - + * you use language only for country names, as there are no other strings in the maps application. + */ + language: string; + + /** + * Legend of a chart. + */ + legend: AmLegend; + + /** + * Read-only. Reference to the div of the legend. + */ + legendDiv: HTMLElement; + + /** + * You can add listeners of events using this property. + * Example: listeners = [{"event":"dataUpdated", "method":handleEvent}]; + * @default [Object] + */ + listeners: [object]; + + /** + * Bottom spacing between chart and container. + * @default 10 + */ + marginBottom: number; + + /** + * Left-hand spacing between chart and container. + * @default 10 + */ + marginLeft: number; + + /** + * Right-hand spacing between chart and container. + * @default 10 + */ + marginRight: number; + + /** + * Top spacing between chart and container. + * @default 10 + */ + marginTop: number; + + /** + * Minimum radius of a gauge. + * @default 10 + */ + minRadius: number; + + /** + * This setting affects touch-screen devices only. + * If a chart is on a page, and panEventsEnabled are set to true, the page won't move if + * the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device, + * the user won’t be able to move the page at all. + * If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users, + * you should set panEventsEnabled to true, otherwise - false. + * @default true + */ + panEventsEnabled: boolean; + + /** + * Specifies absolute or relative path to amCharts files, i.e."amcharts/". (where all.js files are located) + * If relative URLs are used, they will be relative to the current web page, displaying the chart. + * You can also set path globally, using global JavaScript variable AmCharts_path.If this variable is set, + * and "path" is not set in chart config, the chart will assume the path from the global variable. + * This allows setting amCharts path globally. + * I.e.: + * let AmCharts_path = "/libs/amcharts/"; + * "path" parameter will be used by the charts to locate it's files, like images, plugins or patterns. + * @default 'amcharts/' + */ + path: string; + + /** + * Specifies path to the folder where images like resize grips, lens and similar are. + * IMPORTANT: Since V3.14.12, you should use "path" to point to amCharts directory instead. + * The "pathToImages" will be automatically set and does not need to be in the chart config, + * unless you keep your images separately from other amCharts files. + */ + pathToImages: string; + + /** + * Precision of percent values. -1 means percent values won't be rounded at all and show as they are. + * @default 2 + */ + percentPrecision: number; + + /** + * Precision of values. -1 means values won't be rounded at all and show as they are. + * @default -1 + */ + precision: number; + + /** + * Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. + * Prefixes are used on value axes and in the legend. + * To enable prefixes, set usePrefixes property to true. + * @default [ + * {"number": 1e+3, "prefix": "k"}, + * {"number": 1e+6, "prefix": "M"}, + * {"number": 1e+9, "prefix": "G"}, + * {"number": 1e+12, "prefix": "T"}, + * {"number": 1e+15, "prefix": "P"}, + * {"number": 1e+18, "prefix": "E"}, + * {"number": 1e+21, "prefix": "Z"}, + * {"number": 1e+24, "prefix": "Y"} + * ] + */ + prefixesOfBigNumbers: [{ number: number; prefix: string }]; + + /** + * Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. + * Prefixes are used on value axes and in the legend. + * To enable prefixes, set usePrefixes property to true. + * @default [ + * {"number": 1e-24, "prefix": "y"}, + * {"number": 1e-21, "prefix": "z"}, + * {"number": 1e-18, "prefix": "a"}, + * {"number": 1e-15, "prefix": "f"}, + * {"number": 1e-12, "prefix": "p"}, + * {"number": 1e-9, "prefix": "n"}, + * {"number": 1e-6, "prefix": "μ"}, + * {"number": 1e-3, "prefix": "m"} + * ] + */ + prefixesOfSmallNumbers: [{ number: number; prefix: string }]; + + /** + * If processTimeout is > 0, 1000 data items will be parsed at a time, + * then the chart will make pause and continue parsing data until it finishes. + * @default 1000 + */ + processCount: number; + + /** + * If you set it to 1 millisecond or some bigger value, chart will be built in chunks instead of all at once. + * This is useful if you work with a lot of data and the initial build of the chart takes a lot of time, + * which freezes the whole web application by not allowing other processes to do their + * job while the chart is busy. + * @default 0 + */ + processTimeout: number; + + /** + * A config object for Responsive plugin. Please refer to the following page for more information. + */ + responsive: object; + + /** + * Duration of arrow animation. + * @default 1 + */ + startDuration: number; + + /** + * Transition effect of the arrows, possible effects: easeOutSine, easeInSine, elastic, bounce. + * @default easeInSine + */ + startEffect: string; + + /** + * Charts will use SVG icons (some are loaded from images folder and some are drawn inline) + * if browser supports SVG. his makes icons look good on retina displays on all resolutions. + * @default true + */ + svgIcons: boolean; + + /** + * Charts which require gestures like swipe (charts with scrollbar/cursor) or pinch (maps) used to prevent + * regular page scrolling and could result page to stick to the same spot if the chart occupied whole screen. + * Now, in order these gestures to start working user has to touch the chart/maps once. + * Regular touch events like touching on the bar/slice/map area do not require the first tap and will + * show balloons and perform other tasks as usual. + * If you have a map or chart which occupies full screen and your page does not require scrolling, + * set tapToActivate to false – this will bring old behavior back. + * @default true + */ + tapToActivate: boolean; + + /** + * Theme of a chart. Config files of themes can be found in amcharts/themes/ folder. + * More info about using themes. + * @default none + */ + theme: string; + + /** + * Thousands separator. + * @default , + */ + thousandsSeparator: string; + + /** + * Array of Title objects. + * @default [] + */ + titles: [Title]; + + /** + * If you set it to 200 (milliseconds) or so, the chart will fire clickGraphItem or clickSlice (AmSlicedChart) + * or clickMapObject only if user holds his/her finger for 0.2 seconds (200 ms) on the + * column/bullet/slice/map object. + * @default 0 + */ + touchClickDuration: number; + + /** + * Type of a chart. Required when creating chart using JSON. + * Possible types are: serial, pie, xy, radar, funnel, gauge, map, gantt, stock. + */ + type: string; + + /** + * If true, prefixes will be used for big and small numbers. + * You can set arrays of prefixes via prefixesOfSmallNumbers and prefixesOfBigNumbers properties. + * @default false + */ + usePrefixes: boolean; + + /** + * Read-only. Indicates current version of a script. + */ + version: string; + + /** + * Adds arrow to the chart. + */ + addArrow(arrow: GaugeArrow): void; + + /** + * Adds axis to angular gauge. + */ + addAxis(axis: GaugeAxis): void; + + /** + * Adds a label on a chart. You can use it for labeling axes, adding chart title, + * etc. x and y coordinates can be set in number, percent, or a number with ! in front of it - + * coordinate will be calculated from right or bottom instead of left or top. + */ + addLabel( + x: number, + y: number, + text: string, + align: string, + size: number, + color: string, + rotation: number, + alpha: number, + bold: boolean, + url: string, + ): void; + + /** + * Adds a legend to the chart. By default, you don't need to create div for your legend, + * however if you want it to be positioned in some different way, + * you can create div anywhere you want and pass id or reference to your div as a second parameter. + * NOTE: This method will not work on StockPanel. + */ + addLegend(legend: AmLegend, legendDivId?: string): void; + /** + * Adds a legend to the chart. + * By default, you don't need to create div for your legend, + * however if you want it to be positioned in some different way, + * you can create div anywhere you want and pass id or reference to your div as a second parameter. + * NOTE: This method will not work on StockPanel. + * @param legend - The legend. + * @param legendDiv - Legend div (optional). + */ + addLegend(legend: AmLegend, legendDiv: HTMLElement): void; + + /** + * Adds event listener to the object. + */ + addListener( + type: string, + handler: ( + e: { + type: string; + chart: AmChart; + }, + ) => void, + ): void; + + /** + * Adds title to the top of the chart. Pie, Radar positions are updated so that they won't overlap. + * Plot area of Serial/XY chart is also updated unless autoMargins property is set to false. + * You can add any number of titles - each of them will be placed in a new line. + * To remove titles, simply clear titles array: chart.titles = []; and call chart.validateNow() method. + */ + addTitle(text: string, size: number, color: string, alpha: number, bold: boolean): void; + + /** + * Clears the chart area, intervals, etc. + */ + clear(): void; + + /** + * Removes all labels added to the chart. + */ + clearLabels(): void; + + /** + * Use this method to force the chart to resize to it's current container size. + */ + invalidateSize(): void; + + /** + * This method allows to create charts with a single config. + */ + makeChart(container: string, config: any, delay: number): AmChart; + + /** + * Removes arrow from the chart. + */ + removeArrow(arrow: GaugeArrow): void; + + /** + * Removes axis from the chart. + */ + removeAxis(axis: GaugeAxis): void; + + /** + * Removes chart's legend. + */ + removeLegend(): void; + + /** + * Removes event listener from chart object. + */ + removeListener(chart: AmChart, type: string, handler: any): void; + + /** + * This method should be called after data in your data provider changed or a new array was set to dataProvider. + * After calling this method the chart will parse data and redraw. + */ + validateData(): void; + + /** + * This method should be called after you changed one or more properties of any class. + * The chart will redraw after this method is called. + * Both attributes, validateData and skipEvents are optional (false by default). + */ + validateNow(): void; + + /** + * Adds chart to the specified DIV. + */ + write(container: string | HTMLDivElement): void; +} diff --git a/types/amcharts/AmBalloon.d.ts b/types/amcharts/AmBalloon.d.ts new file mode 100644 index 0000000000..1549b72a18 --- /dev/null +++ b/types/amcharts/AmBalloon.d.ts @@ -0,0 +1,107 @@ +/** + * AmBalloon is the class which generates balloons (datatips). + * Balloon follows the mouse when you roll-over the pie slice/line bullet/column/etc, chart indicator of + * serial charts displays value balloons and category balloon. + * Balloon instance is created by the chart automatically and can be accessed via "balloon" property of AmChart. + * Chart shows/hides and sets position for every balloon automatically, + * so all you need to do is to change balloon appearance, if you want to. + * @example + * let chart = new AmCharts.AmSerialChart(); + * // get balloon intance + * let balloon = chart.balloon; + * // set properties + * balloon.adjustBorderColor = true; + * balloon.color = "#000000"; + * balloon.cornerRadius = 5; + * balloon.fillColor = "#FFFFFF"; + */ +export default class AmBalloon { + /** + * If this is set to true, border color instead of background color will be changed + * when user rolls-over the slice, graph, etc. + */ + adjustBorderColor: boolean; + /** + * Balloon border opacity. Value range is 0 - 1. + * @default 1 + */ + borderAlpha: number; + /** + * Balloon border color. #FFFFFF + */ + borderColor: string; + /** + * Balloon border thickness. + * @default 2 + */ + borderThickness: number; + /** + * Color of text in the balloon. #FFFFFF + */ + color: string; + /** + * Balloon corner radius. + * @default 6 + */ + cornerRadius: number; + /** + * Balloon background opacity. + * @default 1 + */ + fillAlpha: number; + /** + * Balloon background color. Usually balloon background color is set by the chart. + * Only if "adjustBorderColor" is "true" this color will be used. + * @default "#CC0000" + */ + fillColor: string; + /** + * Size of text in the balloon. Chart's fontSize is used by default. + */ + fontSize: string; + /** + * Horizontal padding of the balloon. + * @default 8 + */ + horizontalPadding: number; + /** + * The width of the pointer (arrow) "root". Only used if cornerRadius is 0. + * @default 10 + */ + pointerWidth: number; + /** + * If cornerRadius of a balloon is >0, showBullet is set to true for value balloons when ChartCursor is used. + * If you don't want the bullet near the balloon, set it to false: chart.balloon.showBullet = false + */ + showBullet: boolean; + /** + * Text alignment, possible values "left", "middle" and "right" middle + */ + textAlign: string; + /** + * Color of the text shadow. #000000 + */ + textShadowColor: string; + /** + * Vertical padding of the balloon. + * @default 5 + */ + verticalPadding: number; + /** + * Hides balloon. + */ + hide(): void; + /** + * Defines a square within which the balloon should appear. + * Bounds are set by chart class, you don't need to call this method yourself. + */ + setBounds(left: number, top: number, right: number, bottom: number): void; + /** + * Sets coordinates the balloon should point to. + */ + setPosition(x: number, y: number): void; + /** + * Specifies the text which should be displayed. + */ + show(value: string): void; +} diff --git a/types/amcharts/AmChart.d.ts b/types/amcharts/AmChart.d.ts new file mode 100644 index 0000000000..927d054369 --- /dev/null +++ b/types/amcharts/AmChart.d.ts @@ -0,0 +1,358 @@ +import AmBalloon from "./AmBalloon"; +import AmLegend from "./AmLegend"; +import ExportSettings from "./ExportSettings"; +import Label from "./Label"; +import Title from "./Title"; + +/** + * AmChart is a base class of all charts. It can not be instantiated explicitly. + * AmCoordinateChart, AmPieChart and AmMap extend AmChart class. + */ +export default class AmChart { + /** + * used when constructing a chart with a theme + */ + constructor(theme?: any); + /** + * Specifies, if class names should be added to chart elements. + */ + addClassNames: boolean; + /** + * Array of Labels. Example of label object, with all possible properties: + * { + * "x": 20, + * "y": 20, + * "text": "this is label", + * "align": "left", + * "size": 12, + * "color": "#CC0000", + * "alpha": 1, + * "rotation": 0, + * "bold": true, + * "url": "http://www.amcharts.com" + * } + */ + allLabels: Label[]; + /** + * Set this to false if you don't want chart to resize itself whenever its parent container size changes. + */ + autoResize: boolean; + /** + * Opacity of background. Set it to >0 value if you want backgroundColor to work. + * However we recommend changing div's background-color style for changing background color. + */ + backgroundAlpha: number; + /** + * Background color. You should set backgroundAlpha to >0 value in order background to be visible. + * We recommend setting background color directly on a chart's DIV instead of using this property. + * @default "#FFFFFF" + */ + backgroundColor: string; + /** + * The chart creates AmBalloon class itself. + * If you want to customize balloon, get balloon instance using this property, + * and then change balloon's properties. + */ + balloon: AmBalloon; + /** + * Opacity of chart's border. Value range is 0 - 1. + */ + borderAlpha: number; + /** + * Color of chart's border. You should set borderAlpha >0 in order border to be visible. + * We recommend setting border color directly on a chart's DIV instead of using this property. + * @default #000000 + */ + borderColor: string; + /** + * This prefix is added to all class names which are added to all visual elements of a chart + * in case addClassNames is set to true. + */ + classNamePrefix: string; + /** + * Text color. #000000 + */ + color: string; + /** + * Non-commercial version only. Specifies position of link to amCharts site. + * Allowed values are: top-left, top-right, bottom-left and bottom-right. + * @default 'top-left' + */ + creditsPosition: string; + /** + * Array of data objects, for example: + * [{country:"US", value:524}, {country:"UK", value:624}, {country:"Lithuania", value:824}]. + * You can have any number of fields and use any field names. + * In case of AmMap, data provider should be MapData object. + */ + dataProvider: any[]; + /** + * Decimal separator. + * @default "." + */ + decimalSeparator: string; + /** + * Using this property you can add any additional information to SVG, like SVG filters or clip paths. + * The structure of this object should be identical to XML structure of a object you are adding, + * only in JSON format. + */ + defs: any; + /** + * Export config. Specifies how export to image/data export/print/annotate menu will look and behave. + * You can find a lot of examples in amcharts/plugins/export folder. + */ + export: ExportSettings; + /** + * Font family. Verdana + */ + fontFamily: string; + /** + * Font size. + * @default 11 + */ + fontSize: string; + /** + * If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. + * Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result. + * @default false + */ + handDrawn: boolean; + /** + * Defines by how many pixels hand-drawn line (when handDrawn is set to true) will fluctuate. + * @default 2 + */ + handDrawScatter: number; + /** + * Defines by how many pixels line thickness will fluctuate (when handDrawn is set to true). + * @default 1 + */ + handDrawThickness: number; + /** + * Time, in milliseconds after which balloon is hidden if the user rolls-out of the object. + * Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas. + * Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class. + * @default 150 + */ + hideBalloonTime: number; + /** + * Legend of a chart. + */ + legend: AmLegend; + /** + * Reference to the div of the legend. + */ + legendDiv: HTMLElement; + /** + * You can add listeners of events using this property. Example: + * listeners = [{"event":"dataUpdated", "method":handleEvent}]; + */ + listerns: object[]; + /** + * This setting affects touch-screen devices only. + * If a chart is on a page, and panEventsEnabled are set to true, the page won't move + * if the user touches the chart first. + * If a chart is big enough and occupies all the screen of your touch device, + * the user won’t be able to move the page at all. That's why the default value is "false". + * If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users, + * you should set panEventsEnabled to true. + */ + panEventsEnabled: boolean; + /** + * Specifies absolute or relative path to amCharts files, i.e. "amcharts/". (where all .js files are located) + * If relative URLs are used, they will be relative to the current web page, displaying the chart. + * You can also set path globally, using global JavaScript variable AmCharts_path. + * If this variable is set, and "path" is not set in chart config, the chart will assume the path from the + * global variable. This allows setting amCharts path globally. I.e.: + * let AmCharts_path = "/libs/amcharts/"; + * "path" parameter will be used by the charts to locate it's files, like images, plugins or patterns. + */ + path: string; + /** + * Specifies path to the folder where images like resize grips, lens and similar are. + * IMPORTANT: Since V3.14.12, you should use "path" to point to amCharts directory instead. + * The "pathToImages" will be automatically set and does not need to be in the chart config, + * unless you keep your images separately from other amCharts files. + */ + pathToImages: string; + /** + * Precision of percent values. -1 means percent values won't be rounded at all and show as they are. + * @default 2 + */ + percentPrecision: number; + /** + * Precision of values. -1 means values won't be rounded at all and show as they are. + * @default 1 + */ + precision: number; + /** + * Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. + * Prefixes are used on value axes and in the legend. + * To enable prefixes, set usePrefixes property to true. + * [ + * {number:1e+3,prefix:"k"}, + * {number:1e+6,prefix:"M"}, + * {number:1e+9,prefix:"G"}, + * {number:1e+12,prefix:"T"}, + * {number:1e+15,prefix:"P"}, + * {number:1e+18,prefix:"E"}, + * {number:1e+21,prefix:"Z"}, + * {number:1e+24,prefix:"Y"} + * ] + */ + prefixesOfBigNumbers: any[]; + /** + * Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. + * Prefixes are used on value axes and in the legend. + * To enable prefixes, set usePrefixes property to true. + * [ + * {number:1e-24, prefix:"y"}, + * {number:1e-21, prefix:"z"}, + * {number:1e-18, prefix:"a"}, + * {number:1e-15, prefix:"f"}, + * {number:1e-12, prefix:"p"}, + * {number:1e-9, prefix:"n"}, + * {number:1e-6, prefix:"μ"}, + * {number:1e-3, prefix:"m"} + * ] + */ + prefixesOfSmallNumbers: any[]; + /** + * Theme of a chart. Config files of themes can be found in amcharts/themes/ folder. + * More info about using themes. + */ + theme: string; + /** + * Thousands separator. + * @default "." + */ + thousandsSeparator: string; + /** + * Array of Title objects. + */ + titles: Title[]; + /** + * Type of a chart. Required when creating chart using JSON. + * Possible types are: serial, pie, xy, radar, funnel, gauge, map, stock. + */ + type: string; + /** + * If true, prefixes will be used for big and small numbers. + * You can set arrays of prefixes via prefixesOfSmallNumbers and prefixesOfBigNumbers properties. + */ + usePrefixes: boolean; + /** + * Read-only. Indicates current version of a script. + */ + version: string; + /** + * Adds a label on a chart. + * You can use it for labeling axes, adding chart title, etc. x and y coordinates can be set in + * number, percent, or a number with ! in front of it - + * coordinate will be calculated from right or bottom instead of left or top. + * x - horizontal coordinate + * y - vertical coordinate + * text - label's text + * align - alignment (left/right/center) + * size - text size + * color - text color + * rotation - angle of rotation + * alpha - label alpha + * bold - specifies if text is bold (true/false), + * url - url + */ + addLabel( + x: number | string, + y: number | string, + text: string, + align: string, + size?: number, + color?: string, + rotation?: number, + alpha?: number, + bold?: boolean, + url?: string, + ): any; + /** + * Adds a legend to the chart. + * By default, you don't need to create div for your legend, + * however if you want it to be positioned in some different way, + * you can create div anywhere you want and pass id or reference to your div as a second parameter. + * (NOTE: This method will not work on StockPanel.) + * @param legend - The legend. + * @param legendDivId - Id of the legend div (optional). + */ + addLegend(legend: AmLegend, legendDivId?: string): void; + /** + * Adds a legend to the chart. + * By default, you don't need to create div for your legend, + * however if you want it to be positioned in some different way, + * you can create div anywhere you want and pass id or reference to your div as a second parameter. + * (NOTE: This method will not work on StockPanel.) + * @param legend - The legend. + * @param legendDiv - Legend div (optional). + */ + addLegend(legend: AmLegend, legendDiv: HTMLElement): void; + + /** + * Adds title to the top of the chart. Pie, Radar positions are updated so that they won't overlap. + * Plot area of Serial/XY chart is also updated unless autoMargins property is set to false. + * You can add any number of titles - each of them will be placed in a new line. + * To remove titles, simply clear titles array: chart.titles = []; and call chart.validateNow() method. + * text - text of a title size - font size color - title color alpha - title opacity bold - + * boolean value indicating if title should be bold. + */ + addTitle(text: string, size: number, color: string, alpha: number, bold: boolean): void; + /** + * Clears the chart area, intervals, etc. + */ + clear(): void; + /** + * Removes all labels added to the chart. + */ + clearLabels(): void; + /** + * Use this method to force the chart to resize to it's current container size. + */ + invalidateSize(): void; + /** + * Removes chart's legend. + */ + removeLegend(): void; + /** + * This method should be called after data in your data provider changed or a new array was set to dataProvider. + * After calling this method the chart will parse data and redraw. + */ + validateData(): void; + /** + * This method should be called after you changed one or more properties of any class. + * The chart will redraw after this method is called. + */ + validateNow(): void; + + /** + * Adds chart to the specified DIV. + */ + write(container: string | HTMLDivElement): void; + + /** + * Adds event listener of the type "dataUpdated" or "init" to the object. + * @param type "dataUpdated" or "init". + * @param handler + * If the type is "dataUpdated". + * Dispatched when chart is build for the first time or after validateData() method was called. + * If the type is "init". Dispatched when chart is build for the first time. + */ + addListener( + type: string, + handler: ( + e: { + type: string; // Either "dataUpdated" or "init". + chart: AmChart; + }, + ) => void, + ): void; + /** + * Removes event listener from chart object. + */ + removeListener(chart: AmChart, type: string, handler: any): void; +} diff --git a/types/amcharts/AmCoordinateChart.d.ts b/types/amcharts/AmCoordinateChart.d.ts new file mode 100644 index 0000000000..6fea3b7209 --- /dev/null +++ b/types/amcharts/AmCoordinateChart.d.ts @@ -0,0 +1,151 @@ +import AmChart from "./AmChart"; +import AmGraph from "./AmGraph"; +import GraphDataItem from "./GraphDataItem"; +import Guide from "./Guide"; +import ValueAxis from "./ValueAxis"; + +/** + * AmCoordinateChart is a base class of AmRectangularChart. It can not be instantiated explicitly. + */ +export default class AmCoordinateChart extends AmChart { + /** + * Array, holding processed chart's data. + */ + chartData: object[]; + /** + * Specifies the colors of the graphs if the lineColor of a graph is not set. + * It there are more graphs then colors in this array, the chart picks random color. + * @default ['#FF6600','#FCD202','#B0DE09','#0D8ECF','#2A0CD0','#CD0D74','#CC0000','#00CC00', + * '#0000CC','#DDDDDD','#999999','#333333','#990000'] + */ + colors: string[]; + /** + * The array of graphs belonging to this chart. + * To add/remove graph use addGraph/removeGraph methods instead of adding/removing graphs directly to array. + */ + graphs: AmGraph[]; + /** + * Specifies if grid should be drawn above the graphs or below. Will not work properly with 3D charts. + * @default false + */ + gridAboveGraphs: boolean; + /** + * Instead of adding guides to the axes, you can push all of them to this array. + * In case guide has category or date defined, it will automatically will be assigned to the category axis. + * Otherwise to first value axis, unless you specify a different valueAxis for the guide. + */ + guides: Guide[]; + /** + * Specifies whether the animation should be sequenced or all objects should appear at once. + * @default true + */ + sequencedAnimation: boolean; + /** + * The initial opacity of the column/line. + * If you set startDuration to a value higher than 0, the columns/lines will fade in from startAlpha. + * Value range is 0 - 1. + * @default 1 + */ + startAlpha: number; + /** + * Duration of the animation, in seconds. + */ + startDuration: number; + /** + * Animation effect. + * Possible values are ">", "<", elastic" and "bounce". + * @default "elastic" + */ + startEffect: string; + /** + * Target of url. + * @default this + */ + urlTarget: any; + /** + * The array of value axes. + * To add/remove value axis use addValueAxis/removeValueAxis methods instead of + * adding/removing axes directly to array. + * Chart creates one value axis automatically, so if you need only one value axis, you don't need to create it. + */ + valueAxes: any[]; + /** + * Adds a graph to the chart. + */ + addGraph(graph: AmGraph): void; + /** + * Adds value axis to the chart. + * One value axis is created automatically, so if you don't want to change anything or add more value axes, + * you don't need to add it. + */ + addValueAxis(axis: ValueAxis): void; + /** + * You can trigger the animation of the chart. + */ + animateAgain(): void; + /** + * AmGraph Returns graph by id. + */ + getGraphById(graphId: string): AmGraph; + /** + * Returns value axis by id. + */ + getValueAxisById(axisId: string): ValueAxis; + /** + * Hide the graph (if it is visible). + * Usually this method is called from the Legend, when you click on the legend marker. + */ + hideGraph(graph: AmGraph): void; + /** + * Hide value balloon of a graph. + * Usually this method is called from the Legend, when you click on the legend text. + */ + hideGraphsBalloon(graph: AmGraph): void; + /** + * Highlight the graph. Usually this method is called from the Legend, when you roll-over the legend entry. + */ + highlightGraph(graph: AmGraph): void; + /** + * Removes graph from the chart. + */ + removeGraph(graph: AmGraph): void; + /** + * Removes value axis from the chart. + * When you remove value axis, all graphs assigned to this axis are also removed. + */ + removeValueAxis(axis: ValueAxis): void; + /** + * Show the graph (if it is hidden). + * Usually this method is called from the Legend, when you click on the legend marker. + */ + showGraph(graph: AmGraph): void; + /** + * Show value balloon of a graph. + * Usually this method is called from the Legend, when you click on the legend text. + */ + showGraphsBalloon(graph: AmGraph): void; + /** + * UnhighlightGraph the graph. + * Usually this method is called from the Legend, when you roll-out the legend entry. + */ + unhighlightGraph(graph: AmGraph): void; + /** + * Adds event listener of the type "clickGraphItem" or "doubleClickGraphItem" or + * "rightClickGraphItem" or "rollOutGraphItem" or "rollOverGraphItem" to the object. + * @param type Either "clickGraphItem" or "doubleClickGraphItem" or "rightClickGraphItem" + * or "rollOutGraphItem" or "rollOverGraphItem". + * @param handler Dispatched when user clicks on the data item (column/bullet) + */ + addListener( + type: string, + handler: ( + e: { + type: string; + graph: AmGraph; + item: GraphDataItem; + index: number; + chart: AmChart; + }, + ) => void, + ): void; +} diff --git a/types/amcharts/AmGraph.d.ts b/types/amcharts/AmGraph.d.ts new file mode 100644 index 0000000000..170806637b --- /dev/null +++ b/types/amcharts/AmGraph.d.ts @@ -0,0 +1,652 @@ +import AmBalloon from "./AmBalloon"; +import GraphDataItem from "./GraphDataItem"; +import ValueAxis from "./ValueAxis"; + +/** + * AmGraph class displays all types of graphs - line, column, step line, smoothed line, ohlc and candlestick. + * @example + * let chart = new AmCharts.AmSerialChart(); + * let graph = new AmCharts.AmGraph(); + * graph.valueField = 'value'; + * graph.type = 'column'; + * graph.fillAlphas = 1; + * chart.addGraph(graph); + */ +export default class AmGraph { + /** + * Text which screen readers will read if user rolls-over the bullet/column or sets focus using tab key + * (this is possible only if tabIndex property of AmGraph is set to some number). + * Text is added as aria-label tag. Note - not all screen readers and browsers support this. + * @default "[[title]] [[category]] [[value]]" + */ + accessibleLabel: string; + /** + * Name of the alpha field in your dataProvider. + */ + alphaField: string; + /** + * If you set this to true before chart is drawn, the animation of this graph won't be played. + * @default false + */ + animationPlayed: boolean; + /** + * Allows customizing graphs balloons individually (only when ChartCursor is used). + * Note: the balloon object is not created automatically, you should create it before setting properties + */ + balloon: AmBalloon; + /** + * Value balloon color. Will use graph or data item color if not set. + */ + balloonColor: string; + /** + * If you set some function, the graph will call it and pass GraphDataItem and AmGraph objects to it. + * This function should return a string which will be displayed in a balloon. + */ + balloonFunction(graphDataItem: GraphDataItem, amGraph: AmGraph): string; + /** + * Balloon text. + * You can use tags like + * [[value]], + * [[description]], + * [[percents]], + * [[open]], + * [[category]] + * or any other field name from your data provider. HTML tags can also be used. + * @default [[value]] + */ + balloonText: string; + /** + * Specifies if the line graph should be placed behind column graphs + * @default false + */ + behindColumns: boolean; + /** + * Type of the bullets. + * Possible values are: + * "none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", + * "bubble", "diamond", "xError", "yError" and "custom". + * @default "none" + */ + bullet: string; + /** + * Opacity of bullets. Value range is 0 - 1. + * @default 1 + */ + bulletAlpha: number; + /** + * bulletAxis value is used when you are building error chart. + * Error chart is a regular serial or XY chart with bullet type set to "xError" or "yError". + * The graph should know which axis should be used to determine the size of this bullet - + * that's when bulletAxis should be set. Besides that, you should also set graph.errorField. + * You can also use other bullet types with this feature too. + * For example, if you set bulletAxis for XY chart, the size of a bullet will change as you zoom the chart. + */ + bulletAxis: ValueAxis; + /** + * Bullet border opacity. + * @default 0 + */ + bulletBorderAlpha: number; + /** + * Bullet border color. Will use lineColor if not set. + */ + bulletBorderColor: string; + /** + * Bullet border thickness. + * @default 2 + */ + bulletBorderThickness: number; + /** + * Bullet color. Will use lineColor if not set. + */ + bulletColor: string; + /** + * Name of the bullet field in your dataProvider. + */ + bulletField: string; + /** + * Useful for touch devices - if you set it to 20 or so, the bullets of a graph will have + * invisible circle around the actual bullet (bullets should still be enabled), + * which will be easier to touch (bullets usually are smaller and hard to hit). + */ + bulletHitAreaSize: number; + /** + * Bullet offset. Distance from the actual data point to the bullet. + * Can be used to place custom bullets above the columns. + * @default 0 + */ + bulletOffset: number; + /** + * Bullet size. + * @default 8 + */ + bulletSize: number; + /** + * Name of the bullet size field in your dataProvider. + */ + bulletSizeField: string; + /** + * If this field is set and addClassNames is enabled, the chart will look for a class name string in + * data using this setting and apply additional class names to elements of the particular data points, + * such as bullets. + */ + classNameField: string; + /** + * Name of the close field (used by candlesticks and ohlc) in your dataProvider. + */ + closeField: string; + /** + * In case you want to place this graph's columns in front of other columns, set this to false. + * In case "true", the columns will be clustered next to each other. + * NOTE: clustering works only for graphs of type "column". + * @default true + */ + clustered: boolean; + /** + * Color of value labels. Will use chart's color if not set. + */ + color: string; + /** + * Name of the color field in your dataProvider. + */ + colorField: string; + /** + * You can use this property with non-stacked column graphs and specify order of columns of each category + * (starting from 0). + * Important: this feature does not work in stacked columns scenarios as well as with graph + * toggling enabled in legend. + */ + columnIndexField: string; + /** + * You can specify custom column width for each graph individually. + * Value range is 0 - 1 (we set relative width, not pixel width here). + */ + columnWidth: number; + /** + * Specifies whether to connect data points if data is missing. The default value is true. + * This feature does not work with XY chart. + * @default true + */ + connect: boolean; + /** + * Corner radius of column. It can be set both in pixels or in percents. + * The chart's depth and angle styles must be set to 0. The default value is 0. + * Note, cornerRadiusTop will be applied for all corners of the column, + * JavaScript charts do not have a possibility to set separate corner radius for top and bottom. + * As we want all the property names to be the same both on JS and Flex, we didn't change this too. + * @default 0 + */ + cornerRadiusTop: number; + /** + * If bulletsEnabled of ChartCurosor is true, a bullet on each graph follows the cursor. + * You can set opacity of each graphs bullet. In case you want to disable these bullets for a certain graph, + * set opacity to 0. + * @default 1 + */ + cursorBulletAlpha: number; + /** + * Path to the image of custom bullet. + */ + customBullet: string; + /** + * Name of the custom bullet field in your dataProvider. + */ + customBulletField: string; + /** + * Path to the image for legend marker. + */ + customMarker: string; + /** + * Dash length. If you set it to a value greater than 0, the graph line (or columns border) will be dashed. + * @default 0 + */ + dashLength: number; + /** + * Name of the dash length field in your dataProvider. + * This property adds a possibility to change graphs’ line from solid to dashed on any data point. + * You can also make columns border dashed using this setting. Note, this won't work with smoothedLineGraph. + */ + dashLengthField: string; + /** + * Used to format balloons if value axis is date-based. + * @default "MMM DD, YYYY" + */ + dateFormat: string; + /** + * Name of the description field in your dataProvider. + */ + descriptionField: string; + /** + * Name of error value field in your data provider. + */ + errorField: string; + /** + * Opacity of fill. Plural form is used to keep the same property names as our Flex charts'. + * Flex charts can accept array of numbers to generate gradients. + * Although you can set array here, only first value of this array will be used. + * @default 0 + */ + fillAlphas: number; + /** + * Fill color. Will use lineColor if not set. You can also set array of colors here. + */ + fillColors: string; + /** + * Name of the fill colors field in your dataProvider. + * This property adds a possibility to change line graphs’ fill color on any data point to create highlighted + * sections of the graph. Works only with AmSerialChart. + */ + fillColorsField: string; + /** + * XY chart only. If you set this property to id or reference of your X or Y axis, and the fillAlphas is > 0, + * the area between graph and axis will be filled with color, like in this demo. + */ + fillToAxis: ValueAxis; + /** + * You can set another graph here and if fillAlpha is >0, the area from this graph to fillToGraph will be filled + * (instead of filling the area to the X axis). + * This feature is not supported by smoothedLine graphs and Radar chart. + */ + fillToGraph: AmGraph; + /** + * Column width in pixels. + * If you set this property, columns will be of a fixed width and won't adjust to the available space. + */ + fixedColumnWidth: number; + /** + * Size of value labels text. Will use chart's fontSize if not set. + */ + fontSize: number; + /** + * If this is set `true`, the graph will always break the line if the distance in time between + * two adjacent data points is bigger than `gapPeriod x minPeriod`, even if `connect` is set to `true`. + * @default false + */ + forceGap: boolean; + /** + * Name of the gap field in your dataProvider. + * You can force graph to show gap at a desired data point using this feature. + * This feature does not work with XY chart. + */ + gapField: string; + /** + * Using this property you can specify when graph should display gap - + * if the time difference between data points is bigger than duration of minPeriod * gapPeriod, + * and connect property of a graph is set to false, graph will display gap. + * @default 1.1 + */ + gapPeriod: number; + /** + * Orientation of the gradient fills (only for "column" graph type). + * Possible values are "vertical" and "horizontal". + * @default "vertical" + */ + gradientOrientation: string; + /** + * Specifies whether the graph is hidden. + * Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead. + * @default false + */ + hidden: boolean; + /** + * If there are more data points than hideBulletsCount, the bullets will not be shown. + * 0 means the bullets will always be visible. + * @default 0 + */ + hideBulletsCount: number; + /** + * Name of the high field (used by candlesticks and ohlc) in your dataProvider. + */ + highField: string; + /** + * Unique id of a graph. + * It is not required to set one, unless you want to use this graph for as your scrollbar's graph and need + * to indicate which graph should be used. + */ + id: string; + /** + * Whether to include this graph when calculating min and max value of the axis. + * @default true + */ + includeInMinMax: boolean; + /** + * Data label text anchor. + * @default "auto" + */ + labelAnchor: string; + /** + * Name of label color field in data provider. + */ + labelColorField: string; + /** + * You can use it to format labels of data items in any way you want. + * Graph will call this function and pass reference to GraphDataItem and formatted text as attributes. + * This function should return string which will be displayed as label. + */ + labelFunction(value: number, valueText: string, valueAxis: ValueAxis): string; + labelFunction(valueText: string, data: Date, valueAxis: ValueAxis): string; + /** + * Offset of data label. + * @default 0 + */ + labelOffset: number; + /** + * Position of value label. Possible values are: "bottom", "top", "right", "left", "inside", "middle". + * Sometimes position is changed by the chart, depending on a graph type, rotation, etc. + * @default "top" + */ + labelPosition: string; + /** + * Rotation of a data label. + * @default 0 + */ + labelRotation: number; + /** + * Value label text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]]. + */ + labelText: string; + /** + * Legend marker opacity. Will use lineAlpha if not set. Value range is 0 - 1. + */ + legendAlpha: number; + /** + * Legend marker color. Will use lineColor if not set. + */ + legendColor: string; + /** + * It is called and the following attributes are passed: + * dataItem, formattedText, periodValues, periodPercentValues + * It should return hex color code which will be used for legend marker. + */ + legendColorFunction: object; + /** + * The text which will be displayed in the value portion of the legend when user is not hovering above + * any data point. The tags should be made out of two parts - the name of a field + * (value / open / close / high / low) + * and the value of the period you want to be show - + * open / close / high / low / sum / average / count. + * For example: [[value.sum]] + * means that sum of all data points of value field in the selected period will be displayed. + */ + legendPeriodValueText: string; + /** + * Legend value text. + * You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] + * You can also use custom fields from your dataProvider. If not set, uses Legend's valueText. + */ + legendValueText: string; + /** + * Opacity of the line (or column border). Value range is 0 - 1. + * @default 1 + */ + lineAlpha: number; + /** + * Color of the line (or column border). + * If you do not set any, the color from AmCoordinateChart.colors array will be used for each subsequent graph. + */ + lineColor: string; + /** + * Name of the line color field in your dataProvider. + * This property adds a possibility to change graphs’ line color on any data point to create highlighted + * sections of the graph. Works only with AmSerialChart. + */ + lineColorField: string; + /** + * Specifies thickness of the graph line (or column border). + * @default 1 + */ + lineThickness: number; + /** + * Name of the low field (used by candlesticks and ohlc) in your dataProvider. + */ + lowField: string; + /** + * Legend marker type. You can set legend marker (key) type for individual graphs. + * Possible values are: + * square, circle, diamond, triangleUp, triangleDown, triangleLeft, triangleDown, bubble, line, none. + */ + markerType: string; + /** + * Specifies size of the bullet which value is the biggest (XY chart). + * @default 50 + */ + maxBulletSize: number; + /** + * Specifies minimum size of the bullet (XY chart). + * @default 4 + */ + minBulletSize: number; + /** + * It is useful if you have really lots of data points. + * Based on this property the graph will omit some of the lines + * (if the distance between points is less that minDistance, in pixels). + * This will not affect the bullets or indicator in anyway, so the user will not see any difference + * (unless you set minValue to a bigger value, let say 5), + * but will increase performance as less lines will be drawn. + * By setting value to a bigger number you can also make your lines look less jagged. + * @default 1 + */ + minDistance: number; + /** + * If you use different colors for your negative values, a graph below zero line is filled with negativeColor. + * With this property you can define a different base value at which + * colors should be changed to negative colors. + * @default 0 + */ + negativeBase: number; + /** + * Fill opacity of negative part of the graph. Will use fillAlphas if not set. + */ + negativeFillAlphas: number; + /** + * Fill color of negative part of the graph. Will use fillColors if not set. + */ + negativeFillColors: string; + /** + * Opacity of the negative portion of the line (or column border). Value range is 0 - 1. + * @default 1 + */ + negativeLineAlpha: number; + /** + * Color of the line (or column) when the values are negative. + * In case the graph type is "candlestick" or "ohlc", "negativeLineColor" is used + * when close value is less then open value. + */ + negativeLineColor: string; + /** + * If you set it to true, column chart will begin new stack. + * This allows having Clustered and Stacked column/bar chart. + * @default false + */ + newStack: boolean; + /** + * In case you want to have a step line graph without risers, you should set this to true. + * @default false + */ + noStepRisers: boolean; + /** + * Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. + */ + openField: string; + /** + * Value of pattern should be object with url, width, height of an image, optionally it might have x, y, randomX + * and randomY values. + * For example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}. + * If you want to have individual patterns for each column, define patterns in data provider and set + * graph.patternField property. Check amcharts/patterns folder for some patterns. + * You can create your own patterns and use them. Note, x, y, randomX and randomY properties won't work + * with IE8 and older. 3D bar/Pie charts won't work properly with patterns. + */ + pattern: object; + /** + * Field name in your data provider which holds pattern information. + * Value of pattern should be object with url, width, height of an image, + * optionally it might have x, y, randomX and randomY values. + * For example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}. + * Check amcharts/patterns folder for some patterns. You can create your own patterns and use them. + * Note, x, y, randomX and randomY properties won't work with IE8 and older. + * 3D bar/Pie charts won't work properly with patterns. + */ + patternField: string; + /** + * This property can be used by step graphs - you can set how many periods one horizontal line should span. + * @default 1 + */ + periodSpan: number; + /** + * Specifies where data points should be placed - + * on the beginning of the period (day, hour, etc) or in the middle + * (only when parseDates property of categoryAxis is set to true). + * This setting affects Serial chart only. Possible values are "start", "middle" and "end" + * @default "middle" + */ + pointPosition: string; + /** + * Precision of values. Will use chart's precision if not set any. + */ + precision: number; + /** + * If this is set to true, candlesticks will be colored in a different manner - + * if current close is less than current open, the candlestick will be empty, otherwise - filled with color. + * If previous close is less than current close, the candlestick will use positive color, + * otherwise - negative color. + * @default false + */ + proCandlesticks: boolean; + /** + * Gantt chart only. Contains unmodified segment object from data provider. + */ + segmentData: object; + /** + * If graph's type is column and labelText is set, graph hides labels which do not fit into the column's + * space or go outside plot area. If you don't want these labels to be hidden, set this to true. + * @default false + */ + showAllValueLabels: boolean; + /** + * Specifies whether the value balloon of this graph is shown when mouse is over data item or chart's + * indicator is over some series. + * @default true + */ + showBalloon: boolean; + /** + * Specifies graphs value at which cursor is showed. This is only important for candlestick and ohlc charts, + * also if column chart has "open" value. + * Possible values are: "open", "close", "high", "low". + * "top" and "bottom" values will glue the balloon to top/bottom of the plot area. + * @default "close" + */ + showBalloonAt: string; + /** + * Works with candlestick graph type, you can set it to open, close, high, low. + * If you set it to high, the events will be shown at the tip of the high line. + * @default "close" + */ + showBulletsAt: string; + /** + * If you want mouse pointer to change to hand when hovering the graph, set this property to true. + * @default false + */ + showHandOnHover: boolean; + /** + * It can only be used together with topRadius (when columns look like cylinders). + * If you set it to true, the cylinder will be lowered down so that the center of it's bottom circle would be + * right on category axis. + * @default false + */ + showOnAxis: boolean; + /** + * If the value axis of this graph has stack types like "regular" or "100%" + * You can exclude this graph from stacking. + * @default true + */ + stackable: boolean; + /** + * Step graph only. Specifies to which direction step should be drawn. + * @default "right" + */ + stepDirection: string; + /** + * If you set it to false, the graph will not be hidden when user clicks on legend entry. + * @default true + */ + switchable: boolean; + /** + * In case you set it to some number, the chart will set focus on bullet/column (starting from first) + * when user clicks tab key. When a focus is set, screen readers like NVDA Screen reader will read label + * which is set using accessibleLabel property of AmGraph. Note, not all browsers and readers support this. + */ + tabIndex: number; + /** + * Graph title. + */ + title: string; + /** + * If you set this to 1, columns will become cylinders (must set depth3D and angle properties of a chart to >0 + * values in order this to be visible). you can make columns look like cones (set topRadius to 0) + * or even like some glasses (set to bigger than 1). We strongly recommend setting grid opacity to 0 + * in order this to look good. + */ + topRadius: number; + /** + * Type of the graph. + * Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". + * XY and Radar charts can only display "line" type graphs. + * @default "line" + */ + type: string; + /** + * Name of the url field in your dataProvider. + */ + urlField: string; + /** + * Target to open URLs in, i.e. _blank, _top, etc. + */ + urlTarget: string; + /** + * If set to true, the bullet border will take the same color as graph line. + * @default false + */ + useLineColorForBulletBorder: boolean; + /** + * If negativeLineColor and/or negativeFillColors are set and useNegativeColorIfDown is set to true + * (default is false), the line, step and column graphs will use these colors for lines, + * bullets or columns if previous value is bigger than current value. In case you set openField for the graph, + * the graph will compare current value with openField value instead of comparing to previous value. + * @default false + */ + useNegativeColorIfDown: boolean; + /** + * Specifies which value axis the graph will use. Will use the first value axis if not set. + * You can use reference to the real ValueAxis object or set value axis id. + * @default ValueAxis + */ + valueAxis: ValueAxis; + /** + * Name of the value field in your dataProvider. + */ + valueField: string; + /** + * Specifies whether this graph should be shown in the Legend. + * @default true + */ + visibleInLegend: boolean; + /** + * XY chart only. A horizontal value axis object to attach graph to. + * @default ValueAxis + */ + xAxis: ValueAxis; + /** + * XY chart only. Name of the x field in your dataProvider. + */ + xField: string; + /** + * XY chart only. A vertical value axis object to attach graph to. + * @default ValueAxis + */ + yAxis: ValueAxis; + /** + * XY chart only. Name of the y field in your dataProvider. + */ + yField: string; +} diff --git a/types/amcharts/AmLegend.d.ts b/types/amcharts/AmLegend.d.ts new file mode 100644 index 0000000000..0802fa32f3 --- /dev/null +++ b/types/amcharts/AmLegend.d.ts @@ -0,0 +1,247 @@ +import AmChart from "./AmChart"; + +/** + * AmLegend is the class that displays legend of the chart. + * Legend to the chart should be added using chart.addLegend(legend) method. + * @example + * let chart = new AmCharts.AmSerialChart(); + * let legend = new AmCharts.AmLegend(); + * chart.addLegend(legend); + */ +export default class AmLegend { + /** + * Alignment of legend entries. Possible values are: "left", "center", "right". left + */ + align: string; + /** + * Used if chart is Serial or XY. + * In case true, margins of the legend are adjusted and made equal to chart's margins. + * @default true + */ + autoMargins: boolean; + /** + * Opacity of legend's background. Value range is 0 - 1 + */ + backgroundAlpha: number; + /** + * Background color. You should set backgroundAlpha to >0 vallue in order background to be visible. + * @default "#FFFFFF" + */ + backgroundColor: string; + /** + * Opacity of chart's border. Value range is 0 - 1. + */ + borderAlpha: number; + /** + * Color of legend's border. You should set borderAlpha >0 in order border to be visible. + * @default "#000000" + */ + borderColor: string; + /** + * In case legend position is set to "absolute", you can set distance from bottom of the chart, in pixels. + */ + bottom: number; + /** + * Text color. Will use chart's color if not set. + */ + color: string; + /** + * This can be used by AmMap only. + * You can pass array of objects with title, color, markerType values, for example: + * [{title: "One", color: "#3366CC"},{title: "Two", color: "#FFCC33"}] + */ + data: any[]; + /** + * Specifies if each of legend entry should be equal to the most wide entry. + * Won't look good if legend has more than one line. + * @default true + */ + equalWidths: boolean; + /** + * Font size. Will use chart's font size if not set. + */ + fontSize: string; + /** + * Horizontal space between legend item and left/right border. + */ + horizontalGap: number; + /** + * The text which will be displayed in the legend. + * Tag [[title]] will be replaced with the title of the graph. [[title]] + */ + labelText: string; + /** + * In case legend position is set to "absolute", you can set distance from left side of the chart, in pixels. + */ + left: number; + /** + * Bottom margin. + */ + marginBottom: number; + /** + * Left margin. + * This property will be ignored if chart is Serial or XY + * and autoMargins property of the legend is true (default). + * @default 20 + */ + marginLeft: number; + /** + * Right margin. + * This property will be ignored if chart is Serial or XY + * and autoMargins property of the legend is true (default). + * @default 20 + */ + marginRight: number; + /** + * Top margin. + */ + marginTop: number; + /** + * Marker border opacity 1. + */ + markerBorderAlpha: number; + /** + * Marker border color. If not set, will use the same color as marker. + */ + markerBorderColor: string; + /** + * Thickness of the legend border. + * The default value (0) means the line will be a "hairline" (1 px). + * In case marker type is line, this style will be used for line thickness. + * @default 1 + */ + markerBorderThickness: number; + /** + * The color of the disabled marker (when the graph is hidden). #AAB3B3 + */ + markerDisabledColor: string; + /** + * Space between legend marker and legend text, in pixels. + * @default 5 + */ + markerLabelGap: number; + /** + * Size of the legend marker (key). + * @default 16 + */ + markerSize: number; + /** + * Shape of the legend marker (key). + * Possible values are: + * "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none". square + */ + markerType: string; + /** + * Maximum number of columns in the legend. + * If Legend's position is set to "right" or "left", maxColumns is automatically set to 1. + */ + maxColumns: number; + /** + * Position of a legend. Possible values are: "bottom", "top", "left", "right" and "absolute". + * In case "absolute", you should set left and top properties too. (this setting is ignored in Stock charts). + * In case legend is used with AmMap, position is set to "absolute" automatically. bottom + */ + position: string; + /** + * Specifies whether legend entries should be placed in reversed order. + */ + reversedOrder: boolean; + /** + * In case legend position is set to "absolute", you can set distance from right side of the chart, in pixels. + */ + right: number; + /** + * Legend item text color on roll-over. #CC0000 + */ + rollOverColor: string; + /** + * When you roll-over the legend entry, all other graphs can reduce their opacity, + * so that the graph you rolled-over would be distinguished. This style specifies the opacity of the graphs. + * @default 1 + */ + rollOverGraphAlpha: number; + /** + * You can use this property to turn all the legend entries off. + * @default true + */ + showEntries: boolean; + /** + * Horizontal space between legend items, in pixels. + * @default 10 + */ + spacing: number; + /** + * Whether showing/hiding of graphs by clicking on the legend marker is enabled or not. + * In case legend is used with AmMap, this is set to false automatically. + * @default true + */ + switchable: boolean; + /** + * Legend switch color. #FFFFFF + */ + switchColor: string; + /** + * Legend switch type (in case the legend is switchable). Possible values are "x" and "v". x + */ + switchType: string; + /** + * If true, clicking on the text will show/hide balloon of the graph. + * Otherwise it will show/hide graph/slice, if switchable is set to true. + */ + textClickEnabled: boolean; + /** + * In case legend position is set to "absolute", you can set distance from top of the chart, in pixels. + */ + top: number; + /** + * Legend markers can mirror graph’s settings, displaying a line and a real bullet as in the graph itself. + * Set this property to true if you want to enable this feature. + * Note, if you set graph colors in dataProvider, they will not be reflected in the marker. + * @default false + */ + useGraphSettings: boolean; + /** + * Specifies if legend labels should be use same color as corresponding markers. + */ + useMarkerColorForLabels: boolean; + /** + * Alignment of the value text. Possible values are "left" and "right". right + */ + valueAlign: string; + /** + * The text which will be displayed in the value portion of the legend. + * You can use tags like + * [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. [[value]] + */ + valueText: string; + /** + * Width of the value text. + * @default 80 + */ + valueWidth: number; + /** + * Vertical space between legend items also between legend border and first and last legend row. + * @default: 10 + */ + verticalGap: number; + /** + * Adds event listener of the type "clickLabel" or "clickMarker" or "hideItem" to the object. + * @param type Either "clickLabel" or "clickMarker" or "hideItem". + * @param handler The event handler. + */ + addListener( + type: string, + handler: ( + e: { + type: string; + dataItem: object; + chart: AmChart; + }, + ) => void, + ): void; + + /** + * Removes event listener from chart object. + */ + removeListener(chart: AmChart, type: string, handler: any): void; +} diff --git a/types/amcharts/AmPieChart.d.ts b/types/amcharts/AmPieChart.d.ts new file mode 100644 index 0000000000..0db5e23ee5 --- /dev/null +++ b/types/amcharts/AmPieChart.d.ts @@ -0,0 +1,314 @@ +import AmChart from "./AmChart"; +import Slice from "./Slice"; + +/** + * AmPieChart class creates pie/donut chart. + * In order to display pie chart you need to set at least these three properties + * dataProvider, titleField and valueField. + * @example + * let chartData = [{title:"Pie I have eaten",value:70},{title:"Pie I haven\'t eaten",value:30}]; + * let chart = new AmCharts.AmPieChart(); + * chart.valueField = "value"; + * chart.titleField = "title"; + * chart.dataProvider = chartData; + * chart.write("chartdiv"); + */ +export default class AmPieChart extends AmChart { + /** + * Name of the field in chart's dataProvider which holds slice's alpha. + */ + alphaField: string; + /** + * Pie lean angle (for 3D effect). Valid range is 0 - 90. + */ + angle: number; + /** + * Balloon text. The following tags can be used: + * [[value]], [[title]], [[percents]], [[description]]. [[title]]: [[percents]]% ([[value]])\n[[description]] + */ + balloonText: string; + /** + * Read-only. Array of Slice objects. + */ + chartData: any[]; + /** + * Name of the field in chart's dataProvider which holds slice's color. + */ + colorField: string; + /** + * Specifies the colors of the slices, if the slice color is not set. + * If there are more slices than colors in this array, the chart picks random color. + * [ + * "#FF0F00", "#FF6600", "#FF9E01", "#FCD202", "#F8FF01", "#B0DE09", "#04D215", "#0D8ECF", + * "#0D52D1", "#2A0CD0", "#8A0CCF", "#CD0D74", "#754DEB", "#DDDDDD", "#999999", "#333333", + * "#000000", "#57032A", "#CA9726", "#990000", "#4B0C25" + * ] + */ + colors: any[]; + /** + * Depth of the pie (for 3D effect). + */ + depth3D: number; + /** + * Name of the field in chart's dataProvider which holds a string with description. + */ + descriptionField: string; + /** + * Example: [-0.2,0.2]. Will make slices to be filled with color gradients. + */ + gradientRatio: number[]; + /** + * Opacity of the group slice. Value range is 0 - 1. + * @default 1 + */ + groupedAlpha: number; + /** + * Color of the group slice. The default value is not set - + * this means the next available color from "colors" array will be used. + */ + groupedColor: string; + /** + * Description of the group slice. + */ + groupedDescription: string; + /** + * If this is set to true, the group slice will be pulled out when the chart loads. + */ + groupedPulled: boolean; + /** + * Title of the group slice. Other + */ + groupedTitle: string; + /** + * If there is more than one slice whose percentage of the pie is less than this number, + * those slices will be grouped together into one slice. + * This is the "other" slice. It will always be the last slice in a pie. + */ + groupPercent: number; + /** + * Slices with percent less then hideLabelsPercent won't display labels. + * This is useful to avoid cluttering up the chart, if you have a lot of small slices. + * 0 means all labels will be shown. + */ + hideLabelsPercent: number; + /** + * Opacity of a hovered slice. Value range is 0 - 1. + * @default 1 + */ + hoverAlpha: number; + /** + * Inner radius of the pie, in pixels or percents. + */ + innerRadius: any; + /** + * The distance between the label and the slice, in pixels. + * You can use negative values to put the label on the slice. + * @default 30 + */ + labelRadius: number; + /** + * Name of the field in dataProvider which specifies the length of a tick. + * Note, the chart will not try to arrange labels automatically if this property is set. + */ + labelRadiusField: string; + /** + * Specifies whether data labels are visible. + * @default true + */ + labelsEnabled: boolean; + /** + * Label text. The following tags can be used: + * [[value]], [[title]], [[percents]], [[description]]. [[title]]: [[percents]]% + */ + labelText: string; + /** + * Label tick opacity. Value range is 0 - 1. 0.2 + */ + labelTickAlpha: number; + /** + * Label tick color. #000000 + */ + labelTickColor: string; + /** + * Bottom margin of the chart. + * @default 5 + */ + marginBottom: number; + /** + * Left margin of the chart. + */ + marginLeft: number; + /** + * Right margin of the chart. + */ + marginRight: number; + /** + * Top margin of the chart. + * @default 5 + */ + marginTop: number; + /** + * Minimum radius of the pie, in pixels. + * @default 10 + */ + minRadius: number; + /** + * Pie outline opacity. Value range is 0 - 1. + */ + outlineAlpha: number; + /** + * Pie outline color. #FFFFFF + */ + outlineColor: string; + /** + * Pie outline thickness. + * @default 1 + */ + outlineThickness: number; + /** + * Opacity of the slices. You can set the opacity of individual slice too. + * @default 1 + */ + pieAlpha: number; + /** + * Color of the first slice. All the other will be colored with darker or brighter colors. + */ + pieBaseColor: string; + /** + * Lightness increase of each subsequent slice. This is only useful if pieBaseColor is set. + * Use negative values for darker colors. Value range is from -255 to 255. + * @default 30 + */ + pieBrightnessStep: number; + /** + * You can set fixed position of a pie center, in pixels or in percents. + */ + pieX: any; + /** + * You can set fixed position of a pie center, in pixels or in percents. + */ + pieY: any; + /** + * Name of the field in chart's dataProvider which holds a boolean value + * telling the chart whether this slice must be pulled or not. + */ + pulledField: string; + /** + * Pull out duration, in seconds. + * @default 1 + */ + pullOutDuration: number; + /** + * Pull out effect. Possible values are ">", "<", elastic" and "bounce". bounce + */ + pullOutEffect: string; + /** + * If this is set to true, only one slice can be pulled out at a time. + * If the viewer clicks on a slice, any other pulled-out slice will be pulled in. + */ + pullOutOnlyOne: boolean; + /** + * Pull out radius, in pixels or percents 0.2 + */ + pullOutRadius: any; + /** + * Radius of a pie, in pixels or percents. By default, radius is calculated automatically. + */ + radius: any; + /** + * Specifies whether the animation should be sequenced or all slices should appear at once. + */ + sequencedAnimation: boolean; + /** + * Initial opacity of all slices. If you set startDuration higher than 0, slices will fade in from startAlpha. + * @default 1 + */ + startAlpha: number; + /** + * Angle of the first slice, in degrees. This will work properly only if "depth3D" is set to 0. + * If "depth3D" is greater than 0, then there can be two angles only: 90 and 270. Value range is 0-360. + * @default 90 + */ + startAngle: number; + /** + * Duration of the animation, in seconds. + * @default 1 + */ + startDuration: number; + /** + * Animation effect. Possible values are ">", "<", "elastic" and "bounce". bounce + */ + startEffect: string; + /** + * Radius of the positions from which the slices will fly in. + * @default 5 + */ + startRadius: any; + /** + * Name of the field in chart's dataProvider which holds slice's title. + */ + titleField: string; + /** + * Name of the field in chart's dataProvider + * which holds url which would be accessed if the user clicks on a slice. + */ + urlField: string; + /** + * If url is specified for a slice, it will be opened when user clicks on it. + * urlTarget specifies target of this url. Use _blank if you want url to be opened in a new window. _self + */ + urlTarget: string; + /** + * Name of the field in chart's dataProvider which holds slice's value. + */ + valueField: string; + /** + * Name of the field in chart's dataProvider which holds boolean variable + * defining whether this data item should have an entry in the legend. + */ + visibleInLegendField: string; + /** + * You can trigger the animation of the pie chart. + */ + animateAgain(): void; + /** + * You can trigger the click on a slice from outside. index - the number of a slice or Slice object. + */ + clickSlice(index: number): void; + /** + * Hides slice. index - the number of a slice or Slice object. + */ + hideSlice(index: number): void; + /** + * You can simulate roll-out of a slice from outside. index - the number of a slice or Slice object. + */ + rollOutSlice(index: number): void; + /** + * You can simulate roll-over a slice from outside. index - the number of a slice or Slice object. + */ + rollOverSlice(index: number): void; + /** + * Shows slice. index - the number of a slice or Slice object. + */ + showSlice(index: number): void; + /** + * Adds event listener of the type "clickSlice" or "pullInSlice" or "pullOutSlice" to the object. + * @param type Always "clickSlice" or "pullInSlice" or "pullOutSlice". + * @param handler + * If the type is "clickSlice", dispatched when user clicks on a slice. + * If the type is "pullInSlice", dispatched when user clicks on a slice and the slice is pulled-in. + * If the type is "pullOutSlice", dispatched when user clicks on a slice and the slice is pulled-out. + * If the type is "rollOutSlice", dispatched when user rolls-out of the slice. + * If the type is "rollOverSlice", dispatched when user rolls-over the slice. + */ + addListener( + type: string, + handler: ( + e: { + type: string; // Always "rollOverSlice". + dataItem: Slice; + chart: AmChart; + }, + ) => void, + ): void; +} diff --git a/types/amcharts/AmRadarChart.d.ts b/types/amcharts/AmRadarChart.d.ts new file mode 100644 index 0000000000..908178452d --- /dev/null +++ b/types/amcharts/AmRadarChart.d.ts @@ -0,0 +1,60 @@ +import AmCoordinateChart from "./AmCoordinateChart"; + +/** + * AmRadarChart is the class you have to use for radar and polar chart types. + * @example + * let chart; + * let chartData = [ + * {country:"Czech Republic",litres:156.90}, + * {country:"Ireland",litres:131.10}, + * {country:"Germany",litres:115.80}, + * {country:"Australia",litres:109.90}, + * {country:"Austria",litres:108.30}, + * {country:"UK",litres:99.00} + * ]; + * + * window.onload = function() { + * chart = new AmCharts.AmRadarChart(); + * chart.dataProvider = chartData; + * chart.categoryField = "country"; + * chart.startDuration = 2; + * + * let valueAxis = new AmCharts.ValueAxis(); + * valueAxis.axisAlpha = 0.15; + * valueAxis.minimum = 0; + * valueAxis.dashLength = 3; + * valueAxis.axisTitleOffset = 20; + * valueAxis.gridCount = 5; + * chart.addValueAxis(valueAxis); + * + * let graph = new AmCharts.AmGraph(); + * graph.valueField = "litres"; + * graph.bullet = "round"; + * graph.balloonText = "[[value]] litres of beer per year" + * chart.addGraph(graph); + * + * chart.write("chartdiv"); + * }; + */ +export default class AmRadarChart extends AmCoordinateChart { + /** + * Bottom margin of the chart. + */ + marginBottom: number; + /** + * Left margin of the chart. + */ + marginLeft: number; + /** + * Right margin of the chart. + */ + marginRight: number; + /** + * Top margin of the chart. + */ + marginTop: number; + /** + * Radius of a radar. 0.35 + */ + radius: any; +} diff --git a/types/amcharts/AmRectangularChart.d.ts b/types/amcharts/AmRectangularChart.d.ts new file mode 100644 index 0000000000..60e7443762 --- /dev/null +++ b/types/amcharts/AmRectangularChart.d.ts @@ -0,0 +1,171 @@ +import AmCoordinateChart from "./AmCoordinateChart"; +import ChartCursor from "./ChartCursor"; +import ChartScrollbar from "./ChartScrollbar"; +import TrendLine from "./TrendLine"; + +/** + * AmRectangularChart is a base class of AmSerialChart and AmXYChart. It can not be instantiated explicitly. + */ +export default class AmRectangularChart extends AmCoordinateChart { + /** + * The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0). + * @default 0 + */ + angle: number; + /** + * Space left from axis labels/title to the chart's outside border, if autoMargins set to true. + * @default 10 + */ + autoMarginOffset: number; + /** + * Specifies if margins of a chart should be calculated automatically so that labels of axes would fit. + * The chart will adjust only margins with axes. + * Other margins will use values set with marginRight, marginTop, marginLeft and marginBottom properties. + * @default true + */ + autoMargins: boolean; + /** + * Cursor of a chart. + */ + chartCursor: ChartCursor; + /** + * Chart scrollbar. + */ + chartScrollbar: ChartScrollbar; + /** + * The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0). + * @default 0 + */ + depth3D: number; + /** + * Number of pixels between the container's bottom border and plot area. + * This space can be used for bottom axis' values. + * If autoMargin is true and bottom side has axis, this property is ignored. + * @default 20 + */ + marginBottom: number; + /** + * Number of pixels between the container's left border and plot area. + * This space can be used for left axis' values. + * If autoMargin is true and left side has axis, this property is ignored. + * @default 20 + */ + marginLeft: number; + /** + * Number of pixels between the container's right border and plot area. + * This space can be used for Right axis' values. + * If autoMargin is true and right side has axis, this property is ignored. + * @default 20 + */ + marginRight: number; + /** + * Flag which should be set to false if you need margins to be recalculated on next chart.validateNow() call. + * @default false + */ + marginsUpdated: boolean; + /** + * Number of pixels between the container's top border and plot area. + * This space can be used for top axis' values. + * If autoMargin is true and top side has axis, this property is ignored. + * @default 20 + */ + marginTop: number; + /** + * The opacity of plot area's border. Value range is 0 - 1. + * @default 0 + */ + plotAreaBorderAlpha: number; + /** + * The color of the plot area's border. + * Note, the it is invisible by default, as plotAreaBorderAlpha default value is 0. + * Set it to a value higher than 0 to make it visible. + * @default '#000000' + */ + plotAreaBorderColor: string; + /** + * Opacity of plot area. Plural form is used to keep the same property names as our Flex charts'. + * Flex charts can accept array of numbers to generate gradients. + * Although you can set array here, only first value of this array will be used. + * @default 0 + */ + plotAreaFillAlphas: number; + /** + * You can set both one color if you need a solid color or array of colors to generate gradients, for example: + * ["#000000", "#0000CC"] + * @default '#FFFFFF' + */ + plotAreaFillColors: any; + /** + * If you are using gradients to fill the plot area, you can use this property to set gradient angle. + * The only allowed values are horizontal and vertical: 0, 90, 180, 270. + * @default 0 + */ + plotAreaGradientAngle: number; + /** + * Array of trend lines added to a chart. + * You can add trend lines to a chart using this array or access already existing trend lines + */ + trendLines: TrendLine[]; + /** + * Opacity of zoom-out button background. + * @default 0 + */ + zoomOutButtonAlpha: number; + /** + * Zoom-out button background color. + * @default '#e5e5e5' + */ + zoomOutButtonColor: string; + /** + * Name of zoom-out button image. In the images folder there is another lens image, called lensWhite.png. + * You might want to have white lens when background is dark. Or you can simply use your own image. + * @default lens.png + */ + zoomOutButtonImage: string; + /** + * Size of zoom-out button image + * @default: 17 + */ + zoomOutButtonImageSize: number; + /** + * Padding around the text and image. + * @default: 8 + */ + zoomOutButtonPadding: number; + /** + * Opacity of zoom-out button background when mouse is over it. + * @default: 1 + */ + zoomOutButtonRollOverAlpha: number; + /** + * Text in the zoom-out button. Show all + */ + zoomOutText: string; + + /** + * Adds a ChartCursor object to a chart + */ + addChartCursor(cursor: ChartCursor): void; + /** + * Adds a ChartScrollbar to a chart + */ + addChartScrollbar(scrollbar: ChartScrollbar): void; + /** + * Adds a TrendLine to a chart. + * You should call chart.validateNow() after this method is called in order the trend line to be visible. + */ + addTrendLine(trendLine: TrendLine): void; + /** + * Removes cursor from the chart + */ + removeChartCursor(): void; + /** + * Removes scrollbar from the chart + */ + removeChartScrollbar(): void; + /** + * Removes a trend line from a chart. + * You should call chart.validateNow() in order the changes to be visible. + */ + removeTrendLine(trendLine: TrendLine): void; +} diff --git a/types/amcharts/AmSerialChart.d.ts b/types/amcharts/AmSerialChart.d.ts new file mode 100644 index 0000000000..422bb78b3f --- /dev/null +++ b/types/amcharts/AmSerialChart.d.ts @@ -0,0 +1,130 @@ +import AmRectangularChart from "./AmRectangularChart"; +import CategoryAxis from "./CategoryAxis"; + +/** + * AmSerialChart is the class you have to use for majority of chart types. + * The supported chart types are: line, area, column, bar, step line, smoothed line, candlestick and OHLC. + * The chart can be rotated by 90 degrees so the column chart becomes bar chart. + * The chart supports simple and logarithmic scales, it can have multiple value axes. + * The chart can place data points at equal intervals or can parse dates and place data points + * at irregular intervals. + * @example + * let chartData = [{title:"sample 1",value:130},{title:"sample 2",value:26}]; + * + * let chart = new AmCharts.AmSerialChart(); + * chart.categoryField = "title"; + * chart.dataProvider = chartData; + * + * let graph = new AmCharts.AmGraph(); + * graph.valueField = "value"; + * graph.type = "column"; + * graph.fillAlphas = 1; + * chart.addGraph(graph); + * + * chart.write("chartdiv"); + */ +export default class AmSerialChart extends AmRectangularChart { + /** + * Date format of the graph balloon (if chart parses dates and you don't use chartCursor). + * @default 'MMM DD, YYYY' + */ + balloonDateFormat: string; + /** + * Read-only. Chart creates category axis itself. + * If you want to change some properties, you should get this axis from the chart and + * set properties to this object. + */ + categoryAxis: CategoryAxis; + /** + * Category field name tells the chart the name of the field in your dataProvider object + * which will be used for category axis values. + */ + categoryField: string; + /** + * The gap in pixels between two columns of the same category. + * @default 5 + */ + columnSpacing: number; + /** + * Space between 3D stacked columns. + * @default 0 + */ + columnSpacing3D: number; + /** + * Relative width of columns. Value range is 0 - 1. + * @default 0.8 + */ + columnWidth: number; + /** + * Read-only. If category axis parses dates endDate indicates date to which the chart is currently displayed. + */ + endDate: Date; + /** + * Read-only. Category index to which the chart is currently displayed. + */ + endIndex: number; + /** + * Maximum number of series allowed to select. + */ + maxSelectedSeries: number; + /** + * The longest time span allowed to select (in milliseconds) for example + * 259200000 will limit selection to 3 days. + */ + maxSelectedTime: number; + /** + * The shortest time span allowed to select (in milliseconds) for example + * 1000 will limit selection to 1 second. + * @default 0 + */ + minSelectedTime: number; + /** + * Specifies if scrolling of a chart with mouse wheel is enabled. + * If you press shift while rotating mouse wheel, the chart will zoom-in/out. + */ + mouseWheelScrollEnabled: boolean; + /** + * Specifies if zooming of a chart with mouse wheel is enabled. + * If you press shift while rotating mouse wheel, the chart will scroll. + */ + mouseWheelZoomEnabled: boolean; + /** + * If you set this to true, the chart will be rotated by 90 degrees (the columns will become bars). + */ + rotate: boolean; + /** + * Read-only. + * If category axis parses dates startDate indicates date from which the chart is currently displayed. + */ + startDate: Date; + /** + * Read-only. Category index from which the chart is currently displayed. + */ + startIndex: number; + /** + * Specifies if chart should zoom-out when data is updated. + * @default true + */ + zoomOutOnDataUpdate: boolean; + + /** + * Number Returns index of the specified category value. + */ + getCategoryIndexByValue(value: number): void; + /** + * Zooms out, charts shows all available data. + */ + zoomOut(): void; + /** + * Zooms the chart by the value of the category axis. + */ + zoomToCategoryValues(start: Date, end: Date): void; + /** + * Zooms the chart from one date to another. + */ + zoomToDates(start: Date, end: Date): void; + /** + * Zooms the chart by the index of the category. + */ + zoomToIndexes(start: Date, end: Date): void; +} diff --git a/types/amcharts/AmStockChart.d.ts b/types/amcharts/AmStockChart.d.ts new file mode 100644 index 0000000000..b4deec4f1c --- /dev/null +++ b/types/amcharts/AmStockChart.d.ts @@ -0,0 +1,198 @@ +import AmBalloon from "./AmBalloon"; +import AmChart from "./AmChart"; +import AmSerialChart from "./AmSerialChart"; +import CategoryAxesSettings from "./CategoryAxesSettings"; +import ChartCursorSettings from "./ChartCursorSettings"; +import ChartScrollbarSettings from "./ChartScrollbarSettings"; +import DataSet from "./DataSet"; +import DataSetSelector from "./DataSetSelector"; +import LegendSettings from "./LegendSettings"; +import PanelsSettings from "./PanelSettings"; +import PeriodSelector from "./PeriodSelector"; +import StockEvent from "./StockEvent"; +import StockGraph from "./StockGraph"; +import StockPanel from "./StockPanel"; +import ValueAxesSettings from "./ValueAxesSettings"; + +/** + * AmStockChart is a main class Stock chart. + */ +export default class AmStockChart { + /** + * Specifies if animation was already played. + * Animation is only played once, when chart is rendered for the first time. + * If you want the animation to be repeated, set this property to false. + */ + animationPlayed: boolean; + /** + * Balloon object. + */ + balloon: AmBalloon; + /** + * Settings for category axes. + */ + categoryAxesSettings: CategoryAxesSettings; + /** + * Indicates if the chart is created. + */ + chartCreated: boolean; + /** + * Chart cursor settings. + */ + chartCursorSettings: ChartCursorSettings; + /** + * Chart scrollbar settings. + */ + chartScrollbarSettings: ChartScrollbarSettings; + /** + * Array of colors used by data sets if no color was set explicitly on data set itself. + * [ + * #FF6600, "#FCD202", "#B0DE09", "#0D8ECF", "#2A0CD0", "#CD0D74", "#CC0000", + * "#00CC00", "#0000CC", "#DDDDDD", "#999999", "#333333", "#990000" + * ] + */ + colors: any[]; + /** + * Array of data sets selected for comparing. + */ + comparedDataSets: any[]; + /** + * Array of DataSets. + */ + dataSets: any[]; + /** + * DataSetSelector object. + * You can add it if you have more than one data set and want users to be able to select/compare them. + */ + dataSetSelector: DataSetSelector; + /** + * Current end date of the selected period, get only. + * To set start/end dates, use stockChart.zoom(startDate, endDate) method. + */ + endDate: Date; + /** + * Defines on which day week starts. 0 - Sunday, 1 - Monday.. + * @default 1 + */ + firstDayOfWeek: number; + /** + * If set to true the scope of the data view will be set to the end after data update. + */ + glueToTheEnd: boolean; + /** + * Legend settings. + */ + legendSettings: LegendSettings; + /** + * Data set selected as main. + */ + mainDataSet: DataSet; + /** + * Array of StockPanels (charts). + */ + panels: any[]; + /** + * Settings for stock panels. + */ + panelsSettings: PanelsSettings; + /** + * Period selector object. + * You can add it if you want user's to be able to enter date ranges or + * zoom chart with predefined period buttons. + */ + periodSelector: PeriodSelector; + /** + * Scrollbar's chart object, get only. + */ + scrollbarChart: AmSerialChart; + /** + * Current start date of the selected period, get only. + * To set start/end dates, use stockChart.zoom(startDate, endDate) method. + */ + startDate: Date; + /** + * Settings for stock events. + */ + stockEventsSettings: any; + /** + * Settings for value axes. + */ + valueAxesSettings: ValueAxesSettings; + /** + * read-only. Indicates current version of a script. + */ + version: string; + /** + * Specifies whether the chart should zoom-out when main data set is changed. + */ + zoomOutOnDataSetChange: boolean; + + /** + * Adds panel to the stock chart. Requires stockChart.validateNow() method to be called after this action. + */ + addPanel(panel: StockPanel): void; + /** + * Adds panel to the stock chart at a specified index. + * Requires stockChart.validateNow() method to be called after this action. + */ + addPanelAt(panel: StockPanel, index: number): void; + /** + * Destroys chart, all timeouts and listeners. + */ + clear(): void; + /** + * Hides event bullets. + */ + hideStockEvents(): void; + /** + * Removes panel from the stock chart. Requires stockChart.validateNow() method to be called after this action. + */ + removePanel(panel: StockPanel): void; + /** + * Shows event bullets. + */ + showStockEvents(): void; + /** + * Method which should be called after data was changed. + */ + validateData(): void; + /** + * Method which forces the stock chart to rebuild. Should be called after properties are changed. + */ + validateNow(): void; + /** + * Zooms chart to specified dates. startDate, endDate - Date objects. + */ + zoom(startDate: Date, endDate: Date): void; + /** + * Zooms out the chart. + */ + zoomOut(): void; + /** + * Adds event listener. + * @param type - One of + * "buildStarted", "clickStockEvent", "dataUpdated", "init", "panelRemoved", "rendered", "rollOutStockEvent", + * "rollOverStockEvent", "zoomed". + * @param handler - The event handler. + */ + addListener( + type: string, + handler: ( + e: { + chart: AmStockChart; + date?: Date; + endDate?: Date; + eventObject?: StockEvent; + graph?: StockGraph; + panel?: StockPanel; + period?: string; + startDate?: Date; + type: string; + }, + ) => void, + ): void; + /** + * Removes event listener from chart object. + */ + removeListener(chart: AmChart, type: string, handler: any): void; +} diff --git a/types/amcharts/AmXYChart.d.ts b/types/amcharts/AmXYChart.d.ts new file mode 100644 index 0000000000..04b61e7d86 --- /dev/null +++ b/types/amcharts/AmXYChart.d.ts @@ -0,0 +1,68 @@ +import AmRectangularChart from "./AmRectangularChart"; + +/** + * AmXYChart is the class you have to use for XY/Bubble/Scatter chart types. + * The chart supports simple and logarithmic scales, it can have multiple value axes. + * @example + * let chartData = [ + * {x:10, y:14, value:59}, + * {x:5, y:3, value:50}, + * {x:-10, y:-3, value:19}, + * {x:-6, y:5, value:65}, + * {x:15, y:-4, value:92}, + * {x:13, y:1, value:8}, + * {x:1, y:6, value:35} + * ]; + * + * let chart = new AmCharts.AmXYChart(); + * chart.pathToImages = "../../amcharts/javascript/images/"; + * chart.dataProvider = chartData; + * chart.marginLeft = 35; + * chart.startDuration = 1.5; + * + * let xAxis = new AmCharts.ValueAxis(); + * xAxis.position = "left"; + * xAxis.autoGridCount = true; + * chart.addValueAxis(xAxis); + * + * let yAxis = new AmCharts.ValueAxis(); + * yAxis.position = "bottom"; + * yAxis.autoGridCount = true; + * chart.addValueAxis(yAxis); + * + * let graph = new AmCharts.AmGraph(); + * graph.valueField = "value"; + * graph.xField = "x"; + * graph.yField = "y"; + * graph.lineAlpha = 0; + * graph.bullet = "round"; + * chart.addGraph(graph); + * + * let chartCursor = new AmCharts.ChartCursor(); + * chart.addChartCursor(chartCursor); + * + * let chartScrollbar = new AmCharts.ChartScrollbar(); + * chartScrollbar.hideResizeGrips = false; + * chart.addChartScrollbar(chartScrollbar); + * + * chart.write("chartdiv); + */ +export default class AmXYChart extends AmRectangularChart { + /** + * Specifies if Scrollbar of X axis (horizontal) should be hidden. + */ + hideXScrollbar: boolean; + /** + * Specifies if Scrollbar of Y axis (vertical) should be hidden. + */ + hideYScrollbar: boolean; + /** + * Maximum zoom factor of the chart. + * @default 20 + */ + maxZoomFactor: number; + /** + * Zooms out, charts shows all available data. + */ + zoomOut(): void; +} diff --git a/types/amcharts/AreasSettings.d.ts b/types/amcharts/AreasSettings.d.ts new file mode 100644 index 0000000000..88b309558a --- /dev/null +++ b/types/amcharts/AreasSettings.d.ts @@ -0,0 +1,92 @@ +/** + * AreasSettings is a class which holds common settings of all MapArea objects. + */ +export default class AreasSettings { + /** + * Opacity of areas. + * @default 1 + */ + alpha: number; + /** + * Specifies if the areas should be zoomed-in when user clicks on them, event if zoom properties are not set. + */ + autoZoom: boolean; + /** + * Text which is displayed in a roll-over balloon. You can use the following tags: + * [[title]], [[description]], [[value]] and [[percent]] [[title]] + */ + balloonText: string; + /** + * Color of the areas. + * @default "#FFCC00" + */ + color: string; + /** + * Color of area with highest value. + * Colors for areas with values less then highest will be colored with intermediate colors + * between color and colorSolid. + * Use colorSteps property of AmMap to change the number of intermediate colors. + * @default "#990000" + */ + colorSolid: string; + /** + * Height of a description window. + */ + descriptionWindowHeight: number; + /** + * Width of a description window. + * @default 250 + */ + descriptionWindowWidth: number; + /** + * X position of a description window. + */ + descriptionWindowX: number; + /** + * Y position of a description window. + */ + descriptionWindowY: number; + /** + * Opacity of area's outline. + * @default 1 + */ + outlineAlpha: number; + /** + * Color of area's outline. #FFFFFF + */ + outlineColor: string; + /** + * Thickness of area's outline. 0.5 + */ + outlineThickness: number; + /** + * Color of area when user rolls-over it. undefined + */ + rollOverColor: string; + /** + * Color of area's outline when user rolls-over it. #CC0000 + */ + rollOverOutlineColor: string; + /** + * Color of area which is currently selected. #CC0000 + */ + selectedColor: string; + /** + * Opacity of all areas which are in the map svg file, but not listed as areas in DataSet. + * @default 1 + */ + unlistedAreasAlpha: number; + /** + * Color of all areas which are in the map svg file, but not listed as areas in DataSet. #DDDDDD + */ + unlistedAreasColor: string; + /** + * Opacity of all areas' outline which are in the map svg file, but not listed as areas in DataSet. + * @default 1 + */ + unlistedAreasOutlineAlpha: number; + /** + * Color of all areas' outline which are in the map svg file, but not listed as areas in DataSet. #FFFFFF + */ + unlistedAreasOutlineColor: string; +} diff --git a/types/amcharts/AxisBase.d.ts b/types/amcharts/AxisBase.d.ts new file mode 100644 index 0000000000..67fd0dd333 --- /dev/null +++ b/types/amcharts/AxisBase.d.ts @@ -0,0 +1,148 @@ +import Guide from "./Guide"; + +/** + * AxisBase is the base class for ValueAxis and CategoryAxis. It can not be instantiated explicitly. + */ +export default class AxisBase { + /** + * Specifies whether number of gridCount is specified automatically, acoarding to the axis size. + * @default true + */ + autoGridCount: boolean; + /** + * Axis opacity. Value range is 0 - 1. + * @default 1 + */ + axisAlpha: number; + /** + * Axis color. #000000 + */ + axisColor: string; + /** + * Thickness of the axis. + * @default 1 + */ + axisThickness: number; + /** + * Color of axis value labels. Will use chart's color if not set. + */ + color: string; + /** + * Length of a dash. 0 means line is not dashed. + */ + dashLength: number; + /** + * Fill opacity. Every second space between grid lines can be filled with color. + * Set fillAlpha to a value greater than 0 to see the fills. + */ + fillAlpha: number; + /** + * Fill color. Every second space between grid lines can be filled with color. + * Set fillAlpha to a value greater than 0 to see the fills. + * @default "#FFFFFF" + */ + fillColor: string; + /** + * Size of value labels text. Will use chart's fontSize if not set. + */ + fontSize: string; + /** + * Opacity of grid lines. 0.2 + */ + gridAlpha: number; + /** + * Color of grid lines. #000000 + */ + gridColor: string; + /** + * Number of grid lines. In case this is value axis, or your categoryAxis parses dates, + * the number is approximate. The default value is 5. If you set autoGridCount to true, + * this property is ignored. + * @default 5 + */ + gridCount: number; + /** + * Thickness of grid lines. + * @default 1 + */ + gridThickness: number; + /** + * The array of guides belonging to this axis. + */ + guides: any[]; + /** + * If autoMargins of a chart is set to true, but you want this axis not to be measured when calculating margin, + * set ignoreAxisWidth to true. + */ + ignoreAxisWidth: boolean; + /** + * Specifies whether values should be placed inside or outside plot area. + */ + inside: boolean; + /** + * Frequency at which labels should be placed. Doesn't work for CategoryAxis if parseDates is set to true. + * @default 1 + */ + labelFrequency: number; + /** + * Rotation angle of a label. Only horizontal axis' values can be rotated. + * If you set this for vertical axis, the setting will be ignored. + */ + labelRotation: number; + /** + * Specifies whether axis displays category axis' labels and value axis' values. + * @default true + */ + labelsEnabled: boolean; + /** + * The distance of the axis to the plot area, in pixels. Negative values can also be used. + */ + offset: number; + /** + * Possible values are: "top", "bottom", "left", "right". + * If axis is vertical, default position is "left". + * If axis is horizontal, default position is "bottom". + */ + position: string; + /** + * Whether to show first axis label or not. + * @default true + */ + showFirstLabel: boolean; + /** + * Whether to show last axis label or not. + * @default true + */ + showLastLabel: boolean; + /** + * Length of the tick marks. + * @default 5 + */ + tickLength: number; + /** + * Title of the axis. + */ + title: string; + /** + * Specifies if title should be bold or not. + * @default true + */ + titleBold: boolean; + /** + * Color of axis title. Will use text color of chart if not set any. + */ + titleColor: string; + /** + * Font size of axis title. Will use font size of chart plus two pixels if not set any. + */ + titlefontSize: string; + + /** + * Adds guide to the axis. + */ + addGuide(guide: Guide): void; + /** + * Removes guide from the axis. + */ + removeGuide(guide: Guide): void; +} diff --git a/types/amcharts/CategoryAxesSettings.d.ts b/types/amcharts/CategoryAxesSettings.d.ts new file mode 100644 index 0000000000..f1ff10bda4 --- /dev/null +++ b/types/amcharts/CategoryAxesSettings.d.ts @@ -0,0 +1,135 @@ +/** + * CategoryAxesSettings settings set's settings common for all CategoryAxes of StockPanels. + * If you change a property after the chart is initialized, you should call stockChart.validateNow() method in + * order for it to work. If there is no default value specified, default value of CategoryAxis class will be used. + */ +export default class CategoryAxesSettings { + /** + * Specifies whether number of gridCount is specified automatically, according to the axis size. + * @default true + */ + autoGridCount: boolean; + /** + * Axis opacity. + */ + axisAlpha: number; + /** + * Axis color. + */ + axisColor: string; + /** + * Height of category axes. Set it to 0 if you set inside property to true. + * @default 28 + */ + axisHeight: number; + /** + * Thickness of the axis. + */ + axisThickness: number; + /** + * Text color. + */ + color: string; + /** + * Length of a dash. + */ + dashLength: number; + /** + * Date formats of different periods. + * Possible period values: + * fff - milliseconds, + * ss - seconds, + * mm - minutes, + * hh - hours, + * DD - days, + * MM - months, + * WW - weeks, + * YYYY - years + * Check this page for date formatting strings. + */ + dateFormats: any[]; + /** + * If you want data points to be placed at equal intervals (omiting dates with no data), + * set equalSpacing to true. + */ + equalSpacing: boolean; + /** + * Fill opacity. Every second space between grid lines can be filled with fillColor. + */ + fillAlpha: number; + /** + * Fill color. Every second space between grid lines can be filled with color. + * Set fillAlpha to a value greater than 0 to see the fills. + */ + fillColor: string; + /** + * Text size. + */ + fontSize: string; + /** + * Opacity of grid lines. + */ + gridAlpha: number; + /** + * Color of grid lines. + */ + gridColor: string; + /** + * Approximate number of grid lines. + * You should set autoGridCount to false in order this property not to be ignored. + * @default 10 + */ + gridCount: number; + /** + * Thickness of grid lines. + */ + gridThickness: number; + /** + * Periods to which data will be gruoped in case there are more data items in + * the selected period than specified in maxSeries property. + * ["ss", "10ss", "30ss", "mm", "10mm", "30mm", "hh", "DD", "WW", "MM", "YYYY"] + */ + groupToPeriods: any[]; + /** + * Specifies whether values should be placed inside or outside of plot area. + */ + inside: boolean; + /** + * Rotation angle of a label. + */ + labelRotation: number; + /** + * Maximum series shown at a time. + * In case there are more data points in the selection than maxSeries, + * the chart will group data to longer periods, for example - you have 250 days in the selection, + * and maxSeries is 150 - the chart will group data to weeks. + * @default 150 + */ + maxSeries: number; + /** + * Specifies the shortest period of your data. + * fff - millisecond, + * ss - second, + * mm - minute, + * hh - hour, + * DD - day, + * MM - month, + * YYYY - year + * @default "DD" + */ + minPeriod: string; + /** + * top or "bottom". + */ + position: string; + /** + * Specifies whether the graph should start on axis or not. + * In case you display columns, it is recommended to set this to false. + * startOnAxis can be set to true only if equalSpacing is set to true. + */ + startOnAxis: boolean; + /** + * Tick length. + */ + tickLength: number; +} diff --git a/types/amcharts/CategoryAxis.d.ts b/types/amcharts/CategoryAxis.d.ts new file mode 100644 index 0000000000..18510f0257 --- /dev/null +++ b/types/amcharts/CategoryAxis.d.ts @@ -0,0 +1,106 @@ +import AxisBase from "./AxisBase"; + +export default class CategoryAxis extends AxisBase { + /** + * When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, + * like month, in bold. Set this to false to disable the functionality. + * @default true + */ + boldPeriodBeginning: boolean; + /** + * Date formats of different periods. Possible period values: + * fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, WW - weeks, YYYY - years. + * Check this page for date formatting strings. + * [ + * {period:'fff',format:'JJ:NN:SS'}, + * {period:'ss',format:'JJ:NN:SS'}, + * {period:'mm',format:'JJ:NN'}, + * {period:'hh',format:'JJ:NN'}, + * {period:'DD',format:'MMM DD'}, + * {period:'WW',format:'MMM DD'}, + * {period:'MM',format:'MMM'}, + * {period:'YYYY',format:'YYYY'} + * ] + */ + dateFormats: any[]; + /** + * In case your category axis values are Date objects and parseDates is set to true, + * the chart will parse dates and will place your data points at irregular intervals. + * However if you want dates to be parsed (displayed on the axis, baloons, etc), + * but data points to be placed at equal intervals (omiting dates with no data), set equalSpacing to true. + */ + equalSpacing: boolean; + /** + * Field in data provider which specifies if the category value should always be shown. + * For example: categoryAxis.forceShowField = "forceShow"; + * Field in data provider which specifies if the category value should always be shown. + * For example: categoryAxis.forceShowField = "forceShow"; + * And in data: + * {category:"one", forceShow:true, value:100} + * Note, this works only when parseDates is set to false. + */ + forceShowField: string; + /** + * Specifies if a grid line is placed on the center of a cell or on the beginning of a cell. + * Possible values are: "start" and "middle" This setting doesn't work if parseDates is set to true. + * @default "middle" + */ + gridPosition: string; + /** + * Specifies if minor grid should be displayed. + * NOTE: If equalSpacing is set to true, this setting will be ignored. + * @default false + */ + minorGridEnabled: boolean; + /** + * Specifies the shortest period of your data. This should be set only if parseDates is set to "true". + * Possible period values: + * fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, YYYY - years. + * @default "DD" + */ + minPeriod: string; + /** + * In case your category axis values are Date objects, set this to true. + * In this case the chart will parse dates and will place your data points at irregular intervals. + * If you want dates to be parsed, but data points to be placed at equal intervals, + * set both parseDates and equalSpacing to true. + */ + parseDates: boolean; + /** + * Specifies whether the graph should start on axis or not. + * In case you display columns, it is recommended to set this to false. + * If parseDates is set to true, startOnAxis will allways be false, unless equalSpacing is set to true. + */ + startOnAxis: boolean; + /** + * Works only when parseDates is set to true and equalSpacing is false. + * If you set it to true, at the position where bigger period changes, + * category axis will display date strings of bot small and big period, in two rows. + * @default false + */ + twoLineMode: boolean; + /** + * Use line color for bullet + * @default false + */ + useLineColorForBulletBorder: boolean; + /** + * Number returns coordinate of a category. Works only if parseDates is false. + * If parseDates is true, use dateToCoordinate method. + */ + categoryToCoordinate(category: string): void; + /** + * date - Date object Returns Date of the coordinate, in case parseDates is set to true and + * equalSpacing is set to false. + */ + coordinateToDate(coordinate: number): void; + /** + * Number Returns coordinate of the date, in case parseDates is set to true. + * If parseDates is false, use categoryToCoordinate method. + */ + dateToCoordinate(date: Date): void; + /** + * Number Returns index of the category which is most close to specified coordinate. + */ + xToIndex(x: number): void; +} diff --git a/types/amcharts/ChartCursor.d.ts b/types/amcharts/ChartCursor.d.ts new file mode 100644 index 0000000000..f2523c150b --- /dev/null +++ b/types/amcharts/ChartCursor.d.ts @@ -0,0 +1,149 @@ +import AmChart from "./AmChart"; +import AmGraph from "./AmGraph"; + +/** + * ChartCursor is a class which displays a cursor which follows the mouse. + * In case of Serial chart it also shows value and category balloons. + * @example + * let chart = new AmCharts.AmSerialChart(); + * let chartCursor = new AmCharts.ChartCursor(); + * chart.addChartCursor(chartCursor); + */ +export default class ChartCursor { + /** + * Specifies if bullet for each graph will follow the cursor. + */ + bulletsEnabled: boolean; + /** + * Size of bullets, following the cursor. + * @default 8 + */ + bulletSize: number; + /** + * Opacity of the category balloon. + * @default 1 + */ + categoryBalloonAlpha: number; + /** + * Color of the category balloon. cursorColor is used if not set. + */ + categoryBalloonColor: string; + /** + * Category balloon date format (used only if category axis parses dates). + * Check this page for instructions on how to format dates. MMM DD, YYYY + */ + categoryBalloonDateFormat: string; + /** + * Specifies whether category balloon is enabled. + * @default true + */ + categoryBalloonEnabled: boolean; + /** + * Text color. #FFFFFF + */ + color: string; + /** + * Opacity of the cursor line. 1 + */ + cursorAlpha: number; + /** + * Color of the cursor line. #CC0000 + */ + cursorColor: string; + /** + * Specifies where the cursor line should be placed - on the beginning of the period (day, hour, etc) or + * in the middle (only when parseDates property of categoryAxis is set to true). + * If you want the cursor to follow mouse and not to glue to the nearest data point, set "mouse" here. + * Possible values are: "start", "middle", "mouse". + */ + cursorPosition: string; + /** + * Specifies whether cursor is enabled. + * @default true + */ + enabled: boolean; + /** + * If set to true, instead of a cursor line user will see a fill which width will always + * be equal to the width of one data item. + * Recommend setting cursorAlpha to 0.1 or some other small number if using this feature. + * @default false + */ + fullWidth: boolean; + /** + * If this is set to true, only one balloon at a time will be displayed. Note, this is quite CPU consuming. + */ + oneBalloonOnly: boolean; + /** + * If this is set to true, the user will be able to pan the chart (Serial only) instead of zooming. + */ + pan: boolean; + /** + * Opacity of the selection. + */ + selectionAlpha: number; + /** + * Specifies if cursor should only mark selected area but not zoom-in after user releases mouse button. + */ + selectWithoutZooming: boolean; + /** + * Specifies whether value balloons are enabled. + * In case they are not, the balloons might be displayed anyway, when the user rolls-over the column or bullet. + * @default true + */ + valueBalloonsEnabled: boolean; + /** + * Specifies if the user can zoom-in the chart. + * If pan is set to true, zoomable is switched to false automatically. + * @default true + */ + zoomable: boolean; + /** + * Indicates if currently user is selecting some chart area to zoom-in. + */ + zooming: boolean; + + /** + * Hides cursor. + */ + hideCursor(): void; + /** + * You can force cursor to appear at specified cateogry or date. + */ + showCursorAt(category: string | Date): void; + /** + * Adds event listener. + * @param type One of "changed", "draw", "moved", "onHideCursor", "onShowCursor", "panning", + * "selected", "zoomed", "zoomStarted". + * @param handler The event handler. + */ + addListener( + type: string, + handler: ( + e: { + chart: AmChart; + delta2X?: number; + delta2Y?: number; + deltaX?: number; + deltaY?: number; + end?: number; + finalX?: number; + finalY?: number; + index?: number; + initialX?: number; + initialY?: number; + mostCloseGraph?: AmGraph; + start?: number; + target?: ChartCursor; + type: string; + x?: number; + y?: number; + zooming?: boolean; + }, + ) => void, + ): void; + + /** + * Removes event listener from chart object. + */ + removeListener(chart: AmChart, type: string, handler: any): void; +} diff --git a/types/amcharts/ChartCursorSettings.d.ts b/types/amcharts/ChartCursorSettings.d.ts new file mode 100644 index 0000000000..b8664acc3c --- /dev/null +++ b/types/amcharts/ChartCursorSettings.d.ts @@ -0,0 +1,81 @@ +/** + * ChartCursorSettings settings set's settings for chart cursor. + * If you change a property after the chart is initialized, you should call stockChart.validateNow() method + * in order for it to work. If there is no default value specified, default value of ChartCursor class will be used. + */ +export default class ChartCursorSettings { + /** + * Specifies if bullet for each graph will follow the cursor. + */ + bulletsEnabled: boolean; + /** + * Size of bullets, following the cursor. + */ + bulletSize: number; + /** + * Opacity of the category balloon. + */ + categoryBalloonAlpha: number; + /** + * Color of the category balloon. + */ + categoryBalloonColor: string; + /** + * Array of date format objects. Date format object must have "period" and "format" items. + * Available periods are: + * fff - millisecond, + * ss - second, + * mm - minute, + * hh - hour, + * DD - date, + * WW - week, + * MM - month, + * YYYY - year + * [ + * {period:"YYYY", format:"YYYY"}, + * {period:"MM", format:"MMM, YYYY"}, + * {period:"WW", format:"MMM DD, YYYY"}, + * {period:"DD", format:"MMM DD, YYYY"}, + * {period:"hh", format:"JJ:NN"}, + * {period:"mm", format:"JJ:NN"}, + * {period:"ss", format:"JJ:NN:SS"}, + * {period:"fff", format:"JJ:NN:SS"} + * ] + */ + categoryBalloonDateFormats: any[]; + /** + * Specifies whether category balloon is enabled. + */ + categoryBalloonEnabled: boolean; + /** + * Opacity of the cursor line. + */ + cursorAlpha: number; + /** + * Color of the cursor line. + */ + cursorColor: string; + /** + * Possible values: "start", "middle" and "mouse". + */ + cursorPosition: string; + /** + * Set this to "false" if you don't want chart cursor to appear in your charts. + * @default true + */ + enabled: boolean; + /** + * If this is set to true, the user will be able to pan the chart instead of zooming. + */ + pan: boolean; + /** + * Specifies whether value balloons are enabled. + * In case they are not, the balloons might be displayed anyway, when the user rolls-over the column or bullet. + */ + valueBalloonsEnabled: boolean; + /** + * Specifies if the user can zoom-in the chart. + * If pan is set to true, zoomable is switched to false automatically. + */ + zoomable: boolean; +} diff --git a/types/amcharts/ChartScrollbar.d.ts b/types/amcharts/ChartScrollbar.d.ts new file mode 100644 index 0000000000..217d6763d9 --- /dev/null +++ b/types/amcharts/ChartScrollbar.d.ts @@ -0,0 +1,121 @@ +import AmGraph from "./AmGraph"; +import CategoryAxis from "./CategoryAxis"; + +/** + * ChartScrollbar class displays chart scrollbar. Supported by AmSerialChart and AmXYChart. + * @example + * let chart = new AmCharts.AmSerialChart(); + * let chartScrollbar = new AmCharts.ChartScrollbar(); + * chart.addChartScrollbar(chartScrollbar); + */ +export default class ChartScrollbar { + /** + * Specifies whether number of gridCount is specified automatically, acoarding to the axis size. + */ + autoGridCount: boolean; + /** + * Background opacity. + * @default 1 + */ + backgroundAlpha: number; + /** + * Background color of the scrollbar. + * @default #D4D4D4 + */ + backgroundColor: string; + /** + * Read-only. Category axis of the scrollbar. + */ + categoryAxis: CategoryAxis; + /** + * Text color. Will use chart's color if not set. + */ + color: string; + /** + * Specifies which graph will be displayed in the scrollbar. Only Serial chart's scrollbar can display a graph. + */ + graph: AmGraph; + /** + * Graph fill opacity. Value range is 0 - 1. 0.1 + */ + graphFillAlpha: number; + /** + * Graph fill color. #000000 + */ + graphFillColor: string; + /** + * Graph line opacity. Value range is 0 - 1. + */ + graphLineAlpha: number; + /** + * Graph line color. #000000 + */ + graphLineColor: string; + /** + * By default the graph type is the same as the original graph's type, + * however in case of "candlestick" or "ohlc" you might want to show line graph in the scrollbar. + * Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". + */ + graphType: string; + /** + * Grid opacity. Value range is 0 - 1. 0.7 + */ + gridAlpha: number; + /** + * Grid color. #FFFFFF + */ + gridColor: string; + /** + * The number of grid lines. + */ + gridCount: number; + /** + * Specifies whether resize grips are hidden when mouse is away from the scrollbar. + */ + hideResizeGrips: boolean; + /** + * Specifies whether scrollbar has a resize feature. + * @default true + */ + resizeEnabled: boolean; + /** + * Height (width, if chart is rotated) of a scrollbar. + * @default 20 + */ + scrollbarHeight: number; + /** + * Duration of scrolling, when the user clicks on scrollbar's background, in seconds. + * @default 2 + */ + scrollDuration: number; + /** + * Selected backround opacity. + * @default 1 + */ + selectedBackgroundAlpha: number; + /** + * Selected background color. #EFEFEF + */ + selectedBackgroundColor: string; + /** + * Selected graph's fill opacity. Value range is 0 - 1. 0.5 + */ + selectedGraphFillAlpha: number; + /** + * Selected graph's fill color. #000000 + */ + selectedGraphFillColor: string; + /** + * Selected graph's line opacity. Value range is 0 - 1. + */ + selectedGraphLineAlpha: number; + /** + * Selected graph's line color. #000000 + */ + selectedGraphLineColor: string; + /** + * Specifies if the chart should be updated while dragging/resizing the scrollbar or only at the moment + * when user releases mouse button. + */ + updateOnReleaseOnly: boolean; +} diff --git a/types/amcharts/ChartScrollbarSettings.d.ts b/types/amcharts/ChartScrollbarSettings.d.ts new file mode 100644 index 0000000000..a481792ea6 --- /dev/null +++ b/types/amcharts/ChartScrollbarSettings.d.ts @@ -0,0 +1,117 @@ +import AmGraph from "./AmGraph"; + +/** + * ChartScrollbarSettings settings set's settings for chart scrollbar. + * If you change a property after the chart is initialized, you should call stockChart.validateNow() method in + * order for it to work. If there is no default value specified, default value of ChartScrollbar class will be used. + */ +export default class ChartScrollbarSettings { + /** + * Specifies whether number of gridCount is specified automatically, according to the axis size. + * @default true + */ + autoGridCount: boolean; + /** + * Background opacity. + */ + backgroundAlpha: number; + /** + * Background color of the scrollbar. + */ + backgroundColor: string; + /** + * Text color. + */ + color: string; + /** + * Set false if you don't need scrollbar. + * @default true + */ + enabled: boolean; + /** + * Font size. + */ + fontSize: string; + /** + * Specifies which graph will be displayed in the scrollbar. + */ + graph: AmGraph; + /** + * Graph fill opacity. + */ + graphFillAlpha: number; + /** + * Graph fill color. + */ + graphFillColor: string; + /** + * Graph line opacity. + */ + graphLineAlpha: number; + /** + * Graph line color. + */ + graphLineColor: string; + /** + * Type of chart scrollbar's graph. + * By default the graph type is the same as the original graph's type, however in case of "candlestick" or + * "ohlc" you might want to show line graph in the scrollbar. + * Possible values are: line, column, step, smoothedLine, candlestick, ohlc. + */ + graphType: string; + /** + * Grid opacity. + */ + gridAlpha: number; + /** + * Grid color. + */ + gridColor: string; + /** + * Grid count. You should set autoGridCount to false in order this property to work. + */ + gridCount: number; + /** + * Height of scrollbar, in pixels. + * @default 40 + */ + height: number; + /** + * Specifies whether resize grips are hidden when mouse is away from the scrollbar. + */ + hideResizeGrips: boolean; + /** + * Duration of scrolling, when the user clicks on scrollbar's background, in seconds. + */ + scrollDuration: number; + /** + * Selected background opacity. + */ + selectedBackgroundAlpha: number; + /** + * Selected background color. + */ + selectedBackgroundColor: string; + /** + * Selected graph'sfill opacity. + */ + selectedGraphFillAlpha: number; + /** + * Selected graph'sfill color. + */ + selectedGraphFillColor: string; + /** + * Selected graph'sline opacity. + */ + selectedGraphLineAlpha: number; + /** + * Selected graph's line color. + */ + selectedGraphLineColor: string; + /** + * Specifies if the chart should be updated while dragging/resizing the scrollbar or only at the moment when + * user releases mouse button. Usefull when working with large data sets. + * @default true + */ + updateOnReleaseOnly: boolean; +} diff --git a/types/amcharts/DataSet.d.ts b/types/amcharts/DataSet.d.ts new file mode 100644 index 0000000000..a5a9690662 --- /dev/null +++ b/types/amcharts/DataSet.d.ts @@ -0,0 +1,50 @@ +import StockEvent from "./StockEvent"; + +/** + * DataSet is objects which holds all information about data. + */ +export default class DataSet { + /** + * Category field name in your dataProvider. + */ + categoryField: string; + /** + * Color of the data set. One of colors from AmStockChart.colors array will be used if not set. + */ + color: string; + /** + * Whether this data set is selected for comparing. + * If you change this property, you should call stockChart.validateData() method + * in order the changes to be applied. + */ + compared: boolean; + /** + * Data provider of the data set. + */ + dataProvider: any[]; + /** + * Array of field mappings. Field mapping is an object with fromField and toField properties. + * fromField is a name of your value field in dataProvider. + * toField might be chosen freely, it will be used to set value/open/close/high/low fields for the StockGraph. + * Example: {fromField:"val1", toField:"value"}. + */ + fieldMappings: any[]; + /** + * Specifies whether this data set should be visible in "compare to" list. + * @default true + */ + showInCompare: boolean; + /** + * Specifies whether this data set should be visible in "select" dropdown. + * @default true + */ + showInSelect: boolean; + /** + * Array of StockEvent objects. + */ + stockEvents: StockEvent[]; + /** + * DataSet title. + */ + title: string; +} diff --git a/types/amcharts/DataSetSelector.d.ts b/types/amcharts/DataSetSelector.d.ts new file mode 100644 index 0000000000..8dfb1ed905 --- /dev/null +++ b/types/amcharts/DataSetSelector.d.ts @@ -0,0 +1,33 @@ +/** + * DataSetSelector is a tool for selecting data set's as main and for comparing with main data set. + */ +export default class DataSetSelector { + /** + * Text displayed in the "compare to" combobox (when position is "top" or "bottom"). Select... + */ + comboBoxSelectText: string; + /** + * Text displayed near "compare to" list. Compare to: + */ + compareText: string; + /** + * The maximum height of the Compare to field in pixels. + * @default 150 + */ + listHeight: number; + /** + * Possible values: "right", "left", "top", "bottom". "top" and "bottom" positions has a limitation - + * only one data set can be selected for comparing. + * @default "left" + */ + position: string; + /** + * Text displayed near "Select" dropDown. Select: + */ + selectText: string; + /** + * Width of a Data set selector, when position is "left" or "right". + * @default 180 + */ + width: number; +} diff --git a/types/amcharts/ExportSettings.d.ts b/types/amcharts/ExportSettings.d.ts new file mode 100644 index 0000000000..f4422cfed2 --- /dev/null +++ b/types/amcharts/ExportSettings.d.ts @@ -0,0 +1,11 @@ +/** + * Seems like this is meant: https://github.com/amcharts/export + */ +export default class ExportSettings { + enabled: boolean; + libs: object; + menu: object; + config: any; + capture(config: any, callback: () => void): any; + toJPG(config: any, callback: (config: any) => void): any; +} diff --git a/types/amcharts/GaugeArrow.d.ts b/types/amcharts/GaugeArrow.d.ts new file mode 100644 index 0000000000..59d82e576f --- /dev/null +++ b/types/amcharts/GaugeArrow.d.ts @@ -0,0 +1,92 @@ +import GaugeAxis from "./GaugeAxis"; + +export default class GaugeArrow { + /** + * Opacity of an arrow. + * @default 1 + */ + alpha: number; + + /** + * Axis of the arrow. You can use reference to the axis or id of the axis. + * If you don't set any axis, the first axis of a chart will be used. + * @default GaugeAxis + */ + axis: GaugeAxis; + + /** + * Opacity of arrow border. + * @default 1 + */ + borderAlpha: number; + + /** + * In case you need the arrow to rotate only clock-wise, set this property to true. + * @default false + */ + clockWiseOnly: boolean; + + /** + * Color of an arrow. + * @default #000000 + */ + color: string; + + /** + * Unique id of an arrow. + */ + id: string; + + /** + * Inner radius of an arrow. + * @default 0 + */ + innerRadius: any; + + /** + * Opacity of a nail, holding the arrow. + * @default 1 + */ + nailAlpha: number; + + /** + * Opacity of nail border. + * @default 0 + */ + nailBorderAlpha: number; + + /** + * Thickness of nail border. + * @default 1 + */ + nailBorderThickness: number; + + /** + * Radius of a nail, holding the arrow. + * @default 8 + */ + nailRadius: number; + + /** + * Radius of an arrow. + * @default '90%' + */ + radius: any; + + /** + * Width of arrow root. + * @default 8 + */ + startWidth: number; + + /** + * Value to which the arrow should point at. + */ + value: number; + + /** + * Sets value for the arrow. + * Arrow will animate to this value if you do it after chart is written to it's container. + */ + setValue(value: number): void; +} diff --git a/types/amcharts/GaugeAxis.d.ts b/types/amcharts/GaugeAxis.d.ts new file mode 100644 index 0000000000..e9bcf979e4 --- /dev/null +++ b/types/amcharts/GaugeAxis.d.ts @@ -0,0 +1,312 @@ +import AmChart from "./AmChart"; +import GaugeBand from "./GaugeBand"; + +export default class GaugeAxis { + /** + * Axis opacity. + * @default 1 + */ + axisAlpha: number; + + /** + * Axis color. + * @default #000000 + */ + axisColor: string; + + /** + * Thickness of the axis outline. + * @default 1 + */ + axisThickness: number; + + /** + * Opacity of band fills. + * @default 1 + */ + bandAlpha: number; + + /** + * Example: [-0.2, 0, -0.2]. Will make bands to be filled with color gradients. + * Negative value means the color will be darker than the original, + * and positive number means the color will be lighter. + * @default [] + */ + bandGradientRatio: [number]; + + /** + * Opacity of band outlines. + * @default 0 + */ + bandOutlineAlpha: number; + + /** + * Color of band outlines. + * @default #000000 + */ + bandOutlineColor: string; + + /** + * Thickness of band outlines. + * @default 0 + */ + bandOutlineThickness: number; + + /** + * Array of bands - GaugeBand objects. Bands are used to draw color fills between specified values. + */ + bands: [GaugeBand]; + + /** + * Text displayed below the axis center. + */ + bottomText: string; + + /** + * Specifies if text should be bold. + * @default true + */ + bottomTextBold: boolean; + + /** + * Bottom text color. + */ + bottomTextColor: string; + + /** + * Font size of bottom text. + */ + bottomTextFontSize: number; + + /** + * Y offset of bottom text. + * @default 0 + */ + bottomTextYOffset: number; + + /** + * X position of the axis, relative to the center of the gauge. + * @default '0%' + */ + centerX: any; + + /** + * Y position of the axis, relative to the center of the gauge. + * @default '0%' + */ + centerY: any; + + /** + * Specifies labels color of the axis. + */ + color: string; + + /** + * Axis end angle. Valid values are from - 180 to 180. + * @default 120 + */ + endAngle: number; + + /** + * Axis end (max) value + */ + endValue: number; + + /** + * Font size for axis labels. + */ + fontSize: number; + + /** + * Number of grid lines. Note, GaugeAxis doesn't adjust gridCount, + * so you should check your values and choose a proper gridCount which would result grids at round numbers. + * @default 5 + */ + gridCount: number; + + /** + * Specifies if grid should be drawn inside or outside the axis. + * @default true + */ + gridInside: boolean; + + /** + * Unique id of an axis. + */ + id: any; + + /** + * Specifies if labels should be placed inside or outside the axis. + * @default true + */ + inside: boolean; + + /** + * Frequency of labels. + * @default 1 + */ + labelFrequency: number; + + /** + * You can use this function to format axis labels. + * This function is called and value is passed as a attribute: labelFunction(value); + */ + labelFunction: (value: number) => string; + + /** + * Distance from axis to the labels. + * @default 15 + */ + labelOffset: number; + + /** + * Specifies if labels on the axis should be shown. + * @default true + */ + labelsEnabled: boolean; + + /** + * You can add listeners of events using this property. + * Example: listeners = [{"event":"clickBand", "method":handleClick}]; + */ + listeners: object[]; + + /** + * Interval, at which minor ticks should be placed. + */ + minorTickInterval: number; + + /** + * Length of a minor tick. + * @default 5 + */ + minorTickLength: number; + + /** + * Axis radius. + * @default '95%' + */ + radius: any; + + /** + * Specifies if the first label should be shown. + * @default true + */ + showFirstLabel: boolean; + + /** + * Specifies if the last label should be shown. + * @default true + */ + showLastLabel: boolean; + + /** + * Axis start angle. Valid values are from - 180 to 180. + * @default -120 + */ + startAngle: number; + + /** + * Axis start (min) value. + * @default 0 + */ + startValue: number; + + /** + * Opacity of axis ticks. + * @default 1 + */ + tickAlpha: number; + + /** + * Color of axis ticks. + * @default #555555 + */ + tickColor: string; + + /** + * Length of a major tick. + * @default 10 + */ + tickLength: number; + + /** + * Tick thickness. + * @default 1 + */ + tickThickness: number; + + /** + * Text displayed above the axis center. + */ + topText: string; + + /** + * Specifies if text should be bold. + * @default true + */ + topTextBold: boolean; + + /** + * Color of top text. + */ + topTextColor: string; + + /** + * Font size of top text. + */ + topTextFontSize: number; + + /** + * Y offset of top text. + * @default 0 + */ + topTextYOffset: number; + + /** + * A string which can be placed next to axis labels. + */ + unit: string; + + /** + * Position of the unit. + * @default right + */ + unitPosition: string; + + /** + * Specifies if small and big numbers should use prefixes to make them more readable. + * @default false + */ + usePrefixes: boolean; + + /** + * Interval, at which ticks with values should be placed. + */ + valueInterval: number; + + /** + * Adds event listener to the object. + */ + addListener(type: string, handler: any): void; + + /** + * Removes event listener from chart object. + */ + removeListener(chart: AmChart, type: string, handler: any): void; + + /** + * Sets bottom text. + */ + setBottomText(text: string): void; + + /** + * Sets top text. + */ + setTopText(textstring: string): void; + + /** + * Returns angle of the value. + */ + value2angle(value: number): void; +} diff --git a/types/amcharts/GaugeBand.d.ts b/types/amcharts/GaugeBand.d.ts new file mode 100644 index 0000000000..dcbb9c6ddf --- /dev/null +++ b/types/amcharts/GaugeBand.d.ts @@ -0,0 +1,65 @@ +export default class GaugeBand { + /** + * Opacity of band fill. Will use axis.bandAlpha if not set any. + */ + alpha: number; + + /** + * When rolled-over, band will display balloon if you set some text for this property. + */ + balloonText: string; + + /** + * Color of a band. + */ + color: string; + + /** + * End value of a fill. + */ + endValue: number; + + /** + * Example: [-0.2, 0, -0.2]. Will make bands to be filled with color gradients. + * Negative value means the color will be darker than the original, + * and positive number means the color will be lighter. + * @default [] + */ + gradientRatio: [number]; + + /** + * Unique id of a band. + */ + id: string; + + /** + * Inner radius of a band. If not set any, the band will end with the end of minor ticks. + * Set 0 if you want the band to be drawn to the axis center. + */ + innerRadius: any; + + /** + * Band radius. If not set any, the band will start with the axis outline. + */ + radius: any; + + /** + * Start value of a fill. + */ + startValue: number; + + /** + * Gauge band can be clickable and can lead to some page. + */ + url: string; + + /** + * Sets end value for the band. + */ + setEndValue(value: number): void; + + /** + * Sets start value for the band. + */ + setStartValue(value: number): void; +} diff --git a/types/amcharts/GraphDataItem.d.ts b/types/amcharts/GraphDataItem.d.ts new file mode 100644 index 0000000000..94df08ad67 --- /dev/null +++ b/types/amcharts/GraphDataItem.d.ts @@ -0,0 +1,70 @@ +import SerialDataItem from "./SerialDataItem"; + +/** + * GraphDataItem holds all the information about the graph's data item. + * When working with a chart, you do not create GraphDataItem objects or change it's properties directly. + * GraphDataItem is passed to you by events when user interacts with data item on the chart. + * The list of properties below will help you to extract data item's value/coordinate/etc. + */ +export default class GraphDataItem { + /** + * Opacity of the data item. + */ + alpha: number; + /** + * Bullet type. + */ + bullet: string; + /** + * Bullet size. + */ + bulletSize: number; + /** + * Category value. + */ + category: string; + /** + * Color of the data item. + */ + color: string; + /** + * Custom bullet (path to file name). + */ + customBullet: string; + /** + * Original object from data provider. + */ + dataContext: object; + /** + * Description. + */ + description: string; + /** + * Array of colors of the data item, used by column and candlestick chart only. + */ + fillColors: any[]; + /** + * Object which holds percents when recalculateToPercents is set to true. + */ + percents: object; + /** + * SerialDataItem of this graphDataItem + */ + serialDataItem: SerialDataItem; + /** + * url + */ + url: string; + /** + * Object which holds values of the data item (value, open, close, low, high). + */ + values: object; + /** + * x coordinate of the data item. + */ + x: number; + /** + * y coordinate of the data item. + */ + y: number; +} diff --git a/types/amcharts/Guide.d.ts b/types/amcharts/Guide.d.ts new file mode 100644 index 0000000000..51d8c4443b --- /dev/null +++ b/types/amcharts/Guide.d.ts @@ -0,0 +1,123 @@ +import ValueAxis from "./ValueAxis"; + +/** + * Guides are straight vertical or horizontal lines or areas supported by AmSerialChart, AmXYChart and AmRadarChart. + * You can have guides both on value and category axes. + * To add/remove a guide to an axis, use axis.addGuide(guide)/axis.removeGuide(guide) methods. + * If you do not set properties such as dashLength, lineAlpha, lineColor, etc - values of the axis are used. + */ +export default class Guide { + /** + * If you set it to true, the guide will be displayed above the graphs. + */ + above: boolean; + /** + * Radar chart only. Specifies angle at which guide should start. Affects only fills, not lines. + */ + angle: number; + /** + * Baloon fill color. + */ + balloonColor: string; + /** + * The text which will be displayed if the user rolls-over the guide. + */ + balloonText: string; + /** + * Specifies if label should be bold or not. + */ + boldLabel: boolean; + /** + * Category of the guide (in case the guide is for category axis). + */ + category: string; + /** + * Dash length. + */ + dashLength: number; + /** + * Date of the guide (in case the guide is for category axis and parseDates is set to true). + */ + date: Date; + /** + * Works if a guide is added to CategoryAxis and this axis is non-date-based. + * If you set it to true, the guide will start (or be placed, if it's not a fill) on the + * beginning of the category cell and will end at the end of toCategory cell. + */ + expand: boolean; + /** + * Fill opacity. Value range is 0 - 1. + */ + fillAlpha: number; + /** + * Fill color. + */ + fillColor: string; + /** + * Font size of guide label. + */ + fontSize: string; + /** + * Unique id of a Guide. You don't need to set it, unless you want to. + */ + id: string; + /** + * Specifies whether label should be placed inside or outside plot area. + */ + inside: boolean; + /** + * The label which will be displayed near the guide. + */ + label: string; + /** + * Rotation angle of a guide label. + */ + labelRotation: number; + /** + * Line opacity. + */ + lineAlpha: number; + /** + * Line color. + */ + lineColor: string; + /** + * Line thickness. + */ + lineThickness: number; + /** + * Position of guide label. Possible values are "left" or "right" for horizontal axis + * and "top" or "bottom" for vertical axis. + */ + position: string; + /** + * Tick length. + */ + tickLength: number; + /** + * Radar chart only. Specifies angle at which guide should end. Affects only fills, not lines. + */ + toAngle: number; + /** + * To category of the guide (in case the guide is for category axis). + */ + toCategory: string; + /** + * To date of the guide (in case the guide is for category axis and parseDates is set to true). + * If you have both date and toDate, the space between these two dates can be filled with color. + */ + toDate: Date; + /** + * To value of the guide (in case the guide is for value axis). + */ + toValue: number; + /** + * Value of the guide (in case the guide is for value axis). + */ + value: number; + /** + * Value axis of a guide. As you can add guides directly to the chart, + * you might need to specify which which value axis should be used. + */ + valueAxis: ValueAxis; +} diff --git a/types/amcharts/ImagesSettings.d.ts b/types/amcharts/ImagesSettings.d.ts new file mode 100644 index 0000000000..ab4759536d --- /dev/null +++ b/types/amcharts/ImagesSettings.d.ts @@ -0,0 +1,97 @@ +/** + * ImagesSettings is a class which holds common settings of all MapImage objects. + */ +export default class ImagesSettings { + /** + * Opacity of the image. + * @default 1 + */ + alpha: number; + /** + * Text which is displayed in a roll-over balloon. You can use the following tags: + * [[title]], [[description]], [[value]] and [[percent]]. [[title]] + */ + balloonText: string; + /** + * Specifies if the image's center should be placed in the provided coordinates. + * If false, top-left corner will be at provided coordinates. + * @default true + */ + centered: boolean; + /** + * Color of image. + * This will affect only predefined images (with "type" property set) and images with svgPath set. + * This property won't affect bitmap images and loaded SVG images. + * @default "#000000" + */ + color: string; + /** + * Height of a description window. + */ + descriptionWindowHeight: number; + /** + * Width of a description window. + * @default 250 + */ + descriptionWindowWidth: number; + /** + * X position of a description window. + */ + descriptionWindowX: number; + /** + * Y position of a description window. + */ + descriptionWindowY: number; + /** + * Label color. #000000 + */ + labelColor: string; + /** + * Font size of a label. + * @default 11 + */ + labelfontSize: string; + /** + * Position of the label. Allowed values are: left, right, top, bottom and middle. right + */ + labelPosition: string; + /** + * Label roll-over color. #00CC00 + */ + labelRollOverColor: string; + /** + * Opacity of image outline. + * This will affect only predefined images (with "type" property set) and images with svgPath set. + * This property won't affect bitmap images and loaded SVG images. + */ + outlineAlpha: number; + /** + * Color of image outline. + * This will affect only predefined images (with "type" property set) and images with svgPath set. + * This property won't affect bitmap images and loaded SVG images. + */ + outlineColor: string; + /** + * Thickness of image outline. + * This will affect only predefined images (with "type" property set) and images with svgPath set. + * This property won't affect bitmap images and loaded SVG images. + * @default 1 + */ + outlineThickness: number; + /** + * Color of image when hovered. + * This will affect only predefined images (with "type" property set) and images with svgPath set. + * This property won't affect bitmap images and loaded SVG images. + */ + rollOverColor: string; + /** + * Scale of the image when hovered. Use value like 1.5 - 2 to enlarge image when user rolls-over it. + * @default 1 + */ + rollOverScale: number; + /** + * Scale of the image if it is selected. Use value like 1.5 - 2 to enlarge selected image. + * @default 1 + */ + selectedScale: number; +} diff --git a/types/amcharts/Label.d.ts b/types/amcharts/Label.d.ts new file mode 100644 index 0000000000..a539c76d88 --- /dev/null +++ b/types/amcharts/Label.d.ts @@ -0,0 +1,49 @@ +/** + * Creates a label on the chart which can be placed anywhere, multiple can be assigned. + */ +export default class Label { + /** + * @Default 'left' + */ + align: string; + /** + * @Default 1 + */ + alpha: number; + /** + * Specifies if label is bold or not. + */ + bold: boolean; + /** + * Color of a label + */ + color: string; + /** + * Unique id of a Label. You don't need to set it, unless you want to. + */ + id: string; + /** + * Rotation angle. + */ + rotation: number; + /** + * Text size + */ + size: number; + /** + * Text of a label + */ + text: string; + /** + * URL which will be access if user clicks on a label. + */ + url: string; + /** + * X position of a label. + */ + x: number | string; + /** + * y position of a label. + */ + y: number | string; +} diff --git a/types/amcharts/LegendSettings.d.ts b/types/amcharts/LegendSettings.d.ts new file mode 100644 index 0000000000..94b73bd430 --- /dev/null +++ b/types/amcharts/LegendSettings.d.ts @@ -0,0 +1,114 @@ +/** + * Common settings of legends. + * If you change a property after the chart is initialized, you should call stockChart.validateNow() method + * in order for it to work. If there is no default value specified, default value of StockLegend class will be used. + */ +export default class LegendSettings { + /** + * Alignment of legend entries. Possible values are: "left", "right" and "center". + */ + align: string; + /** + * Specifies if each legend entry should take the same space as the longest legend entry. + */ + equalWidths: boolean; + /** + * Horizontal space between legend item and left/right border. + */ + horizontalGap: number; + /** + * The text which will be displayed in the legend. Tag [[title]] will be replaced with the title of the graph. + */ + labelText: string; + /** + * Space below the last row of the legend, in pixels. + */ + marginBottom: number; + /** + * Space above the first row of the legend, in pixels. + */ + marginTop: number; + /** + * Opacity of marker border. + */ + markerBorderAlpha: number; + /** + * Marker border color. + */ + markerBorderColor: string; + /** + * Thickness of the legend border. + */ + markerBorderThickness: number; + /** + * The color of the disabled marker (when the graph is hidden). + */ + markerDisabledColor: string; + /** + * Space between legend marker and legend text, in pixels. + */ + markerLabelGap: number; + /** + * Size of the legend marker (key). + */ + markerSize: number; + /** + * Shape of the legend marker (key). + * Possible values are: + * "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none". + */ + markerType: string; + /** + * Specifies whether legend entries should be placed in reversed order. + */ + reversedOrder: boolean; + /** + * Legend item text color on roll-over. + */ + rollOverColor: string; + /** + * When you roll-over the legend entry, all other graphs can reduce their opacity, + * so that the graph you rolled-over would be distinguished. This property specifies the opacity of the graphs. + */ + rollOverGraphAlpha: number; + /** + * Whether showing/hiding of graphs by clicking on the legend marker is enabled or not. + */ + switchable: boolean; + /** + * Legend switch color. + */ + switchColor: string; + /** + * Legend switch type (in case the legend is switchable). Possible values are: "x" and "v". + */ + switchType: string; + /** + * Specifies whether the legend text is clickable or not. + * Clicking on legend text can show/hide value balloons if they are enabled. + */ + textClickEnabled: boolean; + /** + * Specifies if legend labels should be use same color as corresponding markers. + */ + useMarkerColorForLabels: boolean; + /** + * The text which will be displayed in the value portion of the legend when graph is comparable and + * at least one dataSet is selected for comparing. + * You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. + */ + valueTextComparing: string; + /** + * The text which will be displayed in the value portion of the legend. + * You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. + */ + valueTextRegular: string; + /** + * Width of the value text. Increase this value if your values do not fit in the allocated space. + */ + valueWidth: number; + /** + * Vertical space between legend items, in pixels. + */ + verticalGap: number; +} diff --git a/types/amcharts/PanelSettings.d.ts b/types/amcharts/PanelSettings.d.ts new file mode 100644 index 0000000000..471e146d62 --- /dev/null +++ b/types/amcharts/PanelSettings.d.ts @@ -0,0 +1,145 @@ +/** + * PanelsSettings settings set's settings for all StockPanels. + * If you change a property after the chart is initialized, + * you should call stockChart.validateNow() method in order for it to work. + * If there is no default value specified, default value of StockPanel class will be used. + */ +export default class PanelsSettings { + /** + * The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0). + */ + angle: number; + /** + * Opacity of panel background. Possible values are 1 and 0. Values like 0.5 will not make it half-transparent. + */ + backgroundAlpha: number; + /** + * Background color of panels. Set backgroundAlpha to > 0 value in order to make background visible. + * @default "#FFFFFF" + */ + backgroundColor: string; + /** + * The gap in pixels between two columns of the same category. + */ + columnSpacing: number; + /** + * Relative width of columns. Valid values 0 - 1. + */ + columnWidth: number; + /** + * The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0). + */ + depth3D: number; + /** + * Font family. + */ + fontFamily: string; + /** + * Font size. + */ + fontSize: string; + /** + * Number of pixels between the container's bottom border and plot area. + * @default 1 + */ + marginBottom: number; + /** + * Number of pixels between the container's left border and plot area. + * If your left valueAxis values ar not placed inside the plot area, + * you should set marginLeft to 80 or some close value. + */ + marginLeft: number; + /** + * Number of pixels between the container's left border and plot area. + * If your right valueAxis values ar not placed inside the plot area, + * you should set marginRight to 80 or some close value. + */ + marginRight: number; + /** + * Number of pixels between the container's top border and plot area. + */ + marginTop: number; + /** + * Gap between panels. + * @default 8 + */ + panelSpacing: number; + /** + * This setting affects touch-screen devices only. + * If a chart is on a page, and panEventsEnabled are set to true, + * the page won't move if the user touches the chart first. + * If a chart is big enough and occupies all the screen of your touch device, + * the user won’t be able to move the page at all. That's why the default value is "false". + * If you think that selecting or or panning the chart is a primary purpose of your chart users, + * you should set panEventsEnabled to true. + */ + panEventsEnabled: boolean; + /** + * The opacity of plot area's border. + */ + plotAreaBorderAlpha: number; + /** + * The color of the plot area's border. + */ + plotAreaBorderColor: string; + /** + * Opacity of plot area fill. + */ + plotAreaFillAlphas: number; + /** + * Specifies the colors used to tint the background gradient fill of the plot area. String or Array of Strings + */ + plotAreaFillColors: any; + /** + * Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. + * Prefixes are used on value axes and in the legend. + * To enable prefixes, set usePrefixes property to true. + * [ + * {number:1e+3,prefix:"k"}, + * {number:1e+6,prefix:"M"}, + * {number:1e+9,prefix:"G"}, + * {number:1e+12,prefix:"T"}, + * {number:1e+15,prefix:"P"}, + * {number:1e+18,prefix:"E"}, + * {number:1e+21,prefix:"Z"}, + * {number:1e+24,prefix:"Y"} + * ] + */ + prefixesOfBigNumbers: any[]; + /** + * Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. + * Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. + * [ + * {number:1e-24, prefix:"y"}, + * {number:1e-21, prefix:"z"}, + * {number:1e-18, prefix:"a"}, + * {number:1e-15, prefix:"f"}, + * {number:1e-12, prefix:"p"}, + * {number:1e-9, prefix:"n"}, + * {number:1e-6, prefix:"μ"}, + * {number:1e-3, prefix:"m"} + * ] + */ + prefixesOfSmallNumbers: any[]; + /** + * Specifies whether the animation should be sequenced or all objects should appear at once. + */ + sequencedAnimation: boolean; + /** + * The initial opacity of the column/line. + * If you set startDuration to a value higher than 0, the columns/lines will fade in from startAlpha. + */ + startAlpha: number; + /** + * Duration of the animation, in seconds. + */ + startDuration: number; + /** + * Possible values are: "linear", "<", ">" "<>", "elastic", "bounce". + */ + startEffect: string; + /** + * If true, prefixes will be used for big and small numbers. + */ + usePrefixes: boolean; +} diff --git a/types/amcharts/PeriodSelector.d.ts b/types/amcharts/PeriodSelector.d.ts new file mode 100644 index 0000000000..672fa0ba5b --- /dev/null +++ b/types/amcharts/PeriodSelector.d.ts @@ -0,0 +1,88 @@ +import AmChart from "./AmChart"; + +export default class PeriodSelector { + /** + * Date format of date input fields. + * Check [[http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateFormatter.html + * @default "DD-MM-YYYY" + */ + dateFormat: string; + /** + * Text displayed next to "from" date input field. From: + */ + fromText: string; + /** + * Specifies if period buttons with date range bigger than available data should be hidden. + * @default true + */ + hideOutOfScopePeriods: boolean; + /** + * Specifies whether period selector displays "from" and "to" date input fields. + * @default true + */ + inputFieldsEnabled: boolean; + /** + * Width of date input fields, in pixels. Works only if period selector is horizontal. + * @default 100 + */ + inputFieldWidth: number; + /** + * Array of predefined period objects. Period object has 4 properties - period, count, label and selected. + * Possible period values are: + * "ss" - seconds, + * "mm" - minutes, + * "hh" - hours, + * "DD" - days, + * "MM" - months, + * "YYYY" - years. + * Property "count" specifies how many periods this button will select. + * "label" will be displayed on a button. + * "selected" is a boolean which specifies if this button is selected when chart is initialized or not. + * Example: {period:"DD", count:10, label:"10 days", selected:false}. + */ + periods: any[]; + /** + * Text displayed next to predefined period buttons. Zoom: + */ + periodsText: string; + /** + * Possible values: "right", "left", "top", "bottom". bottom + */ + position: string; + /** + * Specifies whether predefined period buttons should select a period from the beginning or the end of the data. + */ + selectFromStart: boolean; + /** + * Text displayed next to "to" date input field. To: + */ + toText: string; + /** + * Width of a period selector, when position is "left" or "right". + * @default 180 + */ + width: number; + + /** + * Adds event listener to the object. + * @param handler - Dispatched when dates in period selector input fields are changed or + * user clicks on one of the predefined period buttons. + */ + addListener( + type: string, + handler: ( + e: { + type: string; + startDate: Date; + endDate: Date; + predefinedPeriod: string; + count: number; + }, + ) => void, + ): void; + + /** + * Removes event listener from chart object. + */ + removeListener(chart: AmChart, type: string, handler: any): void; +} diff --git a/types/amcharts/SerialDataItem.d.ts b/types/amcharts/SerialDataItem.d.ts new file mode 100644 index 0000000000..cd549a9791 --- /dev/null +++ b/types/amcharts/SerialDataItem.d.ts @@ -0,0 +1,26 @@ +/** + * SerialDataItem holds all the information about each series. + * When working with a chart, you do not create SerialDataItem objects or change it's properties directly. + * Consider properties of a SerialDataItem read-only - change values in chart's data provider if you need to. + * When serial chart parses dataProvider, it generates "chartData" array. + * Objects of this array are SerialDataItem objects. + */ +export default class SerialDataItem { + /** + * You can access each GraphDataItem using this object. + * The data structure is: graphDataItem = serialDataItem.axes[axisId].graphs[graphId]. + */ + axes: object; + /** + * category value. String if parseDates is false, Date if true. + */ + category: any; + /** + * Timestamp of a series date. Avalable only if parseDates property of CategoryAxis is set to true. + */ + time: number; + /** + * Coordinate (horizontal or vertical, depends on chart's rotate property) of the series. + */ + x: number; +} diff --git a/types/amcharts/Slice.d.ts b/types/amcharts/Slice.d.ts new file mode 100644 index 0000000000..a63cda4ebc --- /dev/null +++ b/types/amcharts/Slice.d.ts @@ -0,0 +1,52 @@ +/** + * Slice is an item of AmPieChart's chartData Array and holds all the information about the slice. + * When working with a pie chart, you do not create slices or change it's properties directly, + * instead you set array of data using dataProvider property. + * Consider properties of a Slice read-only - change values in chart's data provider if you need to. + */ +export default class Slice { + /** + * Opacity of a slice. + */ + alpha: number; + /** + * Color of a slice. + */ + color: string; + /** + * Original object from data provider. + */ + dataContext: object; + /** + * Slice description. + */ + description: string; + /** + * Specifies whether the slice is hidden + */ + hidden: boolean; + /** + * Percent value of a slice. + */ + percents: number; + /** + * Specifies whether the slice is pulled or not. + */ + pulled: boolean; + /** + * Slice title + */ + title: string; + /** + * Url of a slice + */ + url: string; + /** + * Value of a slice + */ + value: number; + /** + * specifies whether this slice has a legend entry + */ + visibleInLegend: boolean; +} diff --git a/types/amcharts/StockEvent.d.ts b/types/amcharts/StockEvent.d.ts new file mode 100644 index 0000000000..13b6b53fb5 --- /dev/null +++ b/types/amcharts/StockEvent.d.ts @@ -0,0 +1,69 @@ +import StockGraph from "./StockGraph"; + +/** + * StockEvent is object which holds information about event(bullet). + * Values from StockEventsSettings will be used if not set. + * Stock event bullet's size depends on it's graphs fontSize. + * When user rolls - over, clicks or rolls - out of the event bullet, AmStockChart dispatches events. + */ +export default class StockEvent { + /** + * Opacity of bullet background. + * @default 1 + */ + backgroundAlpha: number; + /** + * Color of bullet background. #DADADA + */ + backgroundColor: string; + /** + * Opacity of bullet border. + * @default 1 + */ + borderAlpha: number; + /** + * Bullet border color. #888888 + */ + borderColor: string; + /** + * The color of the event text. #000000 + */ + color: string; + /** + * Date of an event. Must be Date object, not a string. + */ + date: Date; + /** + * graph on which event will be displayed. + */ + graph: StockGraph; + /** + * Roll-over background color. #CC0000 + */ + rollOverColor: string; + /** + * Specifies if the event should be displayed on category axis + */ + showOnAxis: boolean; + /** + * Letter which will be displayed on the event. Not all types can display letters. + * "text" type can display longer texts. + */ + text: string; + /** + * Type of bullet. + * Possible values are: + * "flag", "sign", "pin", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "text", + * "arrowUp", "arrowDown" + * @default "sign" + */ + type: string; + /** + * A URL to go to when user clicks the event. + */ + url: string; + /** + * target of url, "_blank" for example. + */ + urlTarget: string; +} diff --git a/types/amcharts/StockGraph.d.ts b/types/amcharts/StockGraph.d.ts new file mode 100644 index 0000000000..e8bd53cc16 --- /dev/null +++ b/types/amcharts/StockGraph.d.ts @@ -0,0 +1,74 @@ +import AmGraph from "./AmGraph"; + +export default class StockGraph extends AmGraph { + /** + * Specifies whether this graph will be compared if some data set is selected for comparing. + */ + comparable: boolean; + /** + * Specifies a field to be used to generate comparing graph. + * Note, this field is not the one used in your dataProvider, but toField from FieldMapping object. + */ + compareField: string; + /** + * Balloon color of comparing graph. + */ + compareGraphBalloonColor: string; + /** + * Balloon text of comparing graph. + */ + compareGraphBalloonText: string; + /** + * Bullet of comparing graph. + * Possible values are: "square", "round", "line", "triangleUp", "triangleDown", "dashedLine", "bubble". + */ + compareGraphBullet: string; + /** + * Bullet size of comparing graph. + */ + compareGraphBulletSize: number; + /** + * Corner radius of comparing graph (if type is "column"). + */ + compareGraphCornerRadiusTop: number; + /** + * Dash length of compare graph. + */ + compareGraphDashLength: number; + /** + * Fill alpha of comparing graph. + */ + compareGraphFillAlphas: number; + /** + * Fill color of comparing graph. + */ + compareGraphFillColors: string; + /** + * Opacity of comparing graph line. + */ + compareGraphLineAlpha: number; + /** + * Thickness of compare graph. + */ + compareGraphLineThickness: number; + /** + * Type of comparing graph. Possible values are: "line", "column", "step", "smoothedLine." line + */ + compareGraphType: string; + /** + * Specifies if compare graph is visible in legend. + * @default true + */ + compareGraphVisibleInLegend: boolean; + /** + * When data is grouped to periods, the graph must know which period value should be used. + * Possible values are: "Open", "Low", "High", "Close", "Average" and "Sum". + * @default "Close" + */ + periodValue: string; + /** + * Specifies whether data set color should be used as this graph's lineColor. + * @default true + */ + useDataSetColors: boolean; +} diff --git a/types/amcharts/StockLegend.d.ts b/types/amcharts/StockLegend.d.ts new file mode 100644 index 0000000000..ae765b98e3 --- /dev/null +++ b/types/amcharts/StockLegend.d.ts @@ -0,0 +1,23 @@ +import AmLegend from "./AmLegend"; + +/** + * StockLegend is a legend of StockPanel. + */ +export default class StockLegend extends AmLegend { + /** + * The text which will be displayed in the value portion of the legend when graph is comparable and + * at least one dataSet is selected for comparing. + * You can use tags like + * [[value]], [[open]], [[high]], [[low]], [[close]], [[percents.value/open/close/low/high]], + * [[description]] + * @default [[percents.value]]% + */ + valueTextComparing: string; + /** + * The text which will be displayed in the value portion of the legend. + * You can use tags like + * [[value]], [[open]], [[high]], [[low]], [[close]],[[percents]], [[description]] + * @default [[value]] + */ + valueTextRegular: string; +} diff --git a/types/amcharts/StockPanel.d.ts b/types/amcharts/StockPanel.d.ts new file mode 100644 index 0000000000..817c7a1f7a --- /dev/null +++ b/types/amcharts/StockPanel.d.ts @@ -0,0 +1,85 @@ +import AmSerialChart from "./AmSerialChart"; +import StockGraph from "./StockGraph"; +import StockLegend from "./StockLegend"; +import ValueAxis from "./ValueAxis"; + +/** + * StockPanel class creates stock panels (charts). AmStockChart can have multiple Stock panels. + */ +export default class StockPanel extends AmSerialChart { + /** + * Specifies whether x button will be displayed near the panel. This button allows turning panel off. + */ + allowTurningOff: boolean; + /** + * If true, drawing icons will be displayed in top-right corner. + */ + drawingIconsEnabled: boolean; + /** + * Specifies on which value axis user can draw trend lines. + * Set drawingIconsEnabled to true if you want drawing icons to be visible. + * First value axis will be used if not set here. + */ + drawOnAxis: ValueAxis; + /** + * Specifies if all trend lines should be erased when erase button is clicked. + * If false, trend lines can be erased one by one. + */ + eraseAll: boolean; + /** + * Size of trend line drawing icons. + * If you change this size, you should update icon images if you want them to look properly. + * @default 18 + */ + iconSize: number; + /** + * Relative height of panel. Possible values 0 - 100. + */ + percentHeight: number; + /** + * Specifies when values should be recalculated to percents. + * Possible values are: "never", "always", "whenComparing". + * @default "whenComparing" + */ + recalculateToPercents: string; + /** + * Specifies whether this panel will show category axis. + * @default true + */ + showCategoryAxis: boolean; + stockGraphs: StockGraph[]; + /** + * Stock chart legend. + */ + stockLegend: StockLegend; + /** + * Title of a panel. Note, StockLegend should be added in order title to be displayed. + */ + title: string; + /** + * Trend line opacity. + * @default 1 + */ + trendLineAlpha: number; + /** + * Trend line color. #00CC00 + */ + trendLineColor: string; + /** + * Trend line dash length. + */ + trendLineDashLength: number; + /** + * Trend line thickness. + * @default 2 + */ + trendLineThickness: number; + /** + * Adds a graph to the panel. + */ + addStockGraph(graph: StockGraph): void; + /** + * Removes graph from the panel. + */ + removeStockGraph(graph: StockGraph): void; +} diff --git a/types/amcharts/Title.d.ts b/types/amcharts/Title.d.ts new file mode 100644 index 0000000000..2508ff303a --- /dev/null +++ b/types/amcharts/Title.d.ts @@ -0,0 +1,27 @@ +export default class Title { + /** + * @default 1 + */ + alpha: number; + /** + * Specifies if the tile is bold or not. + * @default false + */ + bold: boolean; + /** + * Text color of a title. + */ + color: string; + /** + * Unique id of a Title. You don't need to set it, unless you want to. + */ + id: string; + /** + * Text size + */ + size: number; + /** + * Text of a label + */ + text: string; +} diff --git a/types/amcharts/TrendLine.d.ts b/types/amcharts/TrendLine.d.ts new file mode 100644 index 0000000000..150f3b8071 --- /dev/null +++ b/types/amcharts/TrendLine.d.ts @@ -0,0 +1,15 @@ +/** + * Trend lines are straight lines indicating trends, might also be used for some different purposes. + * Can be used by Serial and XY charts. + * To add/remove trend line, use chart.addTrendLine(trendLine)/chart.removeTrendLine(trendLine) methods + * or simply pass array of trend lines: chart.trendLines = [trendLine1, trendLine2]. + * @example + * let trendLine = new AmCharts.TrendLine(); + * trendLine.initialDate = new Date(2012, 0, 2, 12); // 12 is hour - to start trend line in the middle of the day + * trendLine.finalDate = new Date(2012, 0, 11, 12); + * trendLine.initialValue = 10; + * trendLine.finalValue = 19; + * trendLine.lineColor = "#CC0000"; + * chart.addTrendLine(trendLine); + */ +export default class TrendLine { } diff --git a/types/amcharts/ValueAxesSettings.d.ts b/types/amcharts/ValueAxesSettings.d.ts new file mode 100644 index 0000000000..1b7676b7d7 --- /dev/null +++ b/types/amcharts/ValueAxesSettings.d.ts @@ -0,0 +1,126 @@ +/** + * ValueAxesSettings settings sets settings for all ValueAxes. + * If you change a property after the chart is initialized, + * you should call stockChart.validateNow() method in order for it to work. + * If there is no default value specified, default value of ValueAxis class will be used. + */ +export default class ValueAxesSettings { + /** + * Specifies whether number for gridCount is specified automatically, according to the axis size. + * @default true + */ + autoGridCount: boolean; + /** + * Axis opacity. + */ + axisAlpha: number; + /** + * Axis color. + */ + axisColor: string; + /** + * Thickness of the axis. + */ + axisThickness: number; + /** + * Label color. + */ + color: string; + /** + * Length of a dash. By default, the grid line is not dashed. + */ + dashLength: number; + /** + * Fill opacity. Every second space between grid lines can be filled with color. + */ + fillAlpha: number; + /** + * Fill color. Every second space between grid lines can be filled with color. + * Set fillAlpha to a value greater than 0 to see the fills. + */ + fillColor: string; + /** + * Opacity of grid lines. + */ + gridAlpha: number; + /** + * Color of grid lines. + */ + gridColor: string; + /** + * Approximate number of grid lines. autoGridCount should be set to false, + * otherwise this property will be ignored. + */ + gridCount: number; + /** + * Thickness of grid lines. + */ + gridThickness: number; + /** + * Specifies whether guide values should be included when calculating min and max of the axis. + */ + includeGuidesInMinMax: boolean; + /** + * If true, the axis will include hidden graphs when calculating min and max values. + */ + includeHidden: boolean; + /** + * Specifies whether values should be placed inside or outside plot area. + * In case you set this to false, you'll have to adjust marginLeft or marginRight in + * [[PanelsSettings]] in order labels to be visible. + * @default true + */ + inside: boolean; + /** + * Specifies whether values on axis can only be integers or both integers and doubles. + */ + integersOnly: boolean; + /** + * Frequency at which labels should be placed. + */ + labelFrequency: number; + /** + * Specifies whether value labels are displayed. + */ + labelsEnabled: boolean; + /** + * Set to true if value axis is logarithmic, false otherwise. + */ + logarithmic: boolean; + /** + * The distance of the axis to the plot area, in pixels. Useful if you have more then one axis on the same side. + */ + offset: number; + /** + * Position of the value axis. Possible values are "left" and "right". + */ + position: string; + /** + * Set to true if value axis is reversed (smaller values on top), false otherwise. + */ + reversed: boolean; + /** + * Specifies if first label of value axis should be displayed. + */ + showFirstLabel: boolean; + /** + * Specifies if last label of value axis should be displayed. + */ + showLastLabel: boolean; + /** + * Stacking mode of the axis. Possible values are: "none", "regular", "100%", "3d". + */ + stackType: string; + /** + * Tick length. + */ + tickLength: number; + /** + * Unit which will be added to the value label. + */ + unit: string; + /** + * Position of the unit. Possible values are "left" or "right". + */ + unitPosition: string; +} diff --git a/types/amcharts/ValueAxis.d.ts b/types/amcharts/ValueAxis.d.ts new file mode 100644 index 0000000000..dd9832d750 --- /dev/null +++ b/types/amcharts/ValueAxis.d.ts @@ -0,0 +1,250 @@ +import AmChart from "./AmChart"; +import AxisBase from "./AxisBase"; +import Guide from "./Guide"; + +/** + * ValueAxis is the class which displays value axis for the chart. The chart can have any number of value axes. + * For Serial chart one value axis is created automatically. + * For XY Chart two value axes (horizontal and vertical) are created automatically. + */ +export default class ValueAxis extends AxisBase { + /** + * Radar chart only. Specifies distance from axis to the axis title (category) 10 + */ + axisTitleOffset: number; + /** + * Read-only. Coordinate of the base value. + */ + baseCoord: number; + /** + * Specifies base value of the axis. + */ + baseValue: number; + /** + * If your values represents time units, and you want value axis labels to be formatted as duration, + * you have to set the duration unit. Possible values are: "ss", "mm", "hh" and "DD". + */ + duration: string; + /** + * If duration property is set, you can specify what string should be displayed next to day, + * hour, minute and second. + * {DD:"d. ", hh:":", mm:":",ss:""} + */ + durationUnits: { DD: string; hh: string; mm: string; ss: string }; + /** + * Radar chart only. Possible values are: "polygons" and "circles". Set "circles" for polar charts. + * @default "polygons" + */ + gridType: string; + /** + * Unique id of value axis. It is not required to set it, unless you need to tell the graph which exact + * value axis it should use. + */ + id: string; + /** + * Specifies whether guide values should be included when calculating min and max of the axis. + */ + includeGuidesInMinMax: boolean; + /** + * If true, the axis will include hidden graphs when calculating min and max values. + */ + includeHidden: boolean; + /** + * Specifies whether values on axis can only be integers or both integers and doubles. + */ + integersOnly: boolean; + /** + * You can use this function to format Value axis labels. + * This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis); + * Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object. + * If axis type is "date", labelFunction will pass different arguments: + * labelFunction(valueText, date, valueAxis) + * Your function should return string. + */ + labelFunction(value: number, valueText: string, valueAxis: ValueAxis): string; + labelFunction(valueText: string, data: Date, valueAxis: ValueAxis): string; + /** + * Specifies if this value axis' scale should be logarithmic. + */ + logarithmic: boolean; + /** + * Read-only. Maximum value of the axis. + */ + max: number; + /** + * If you don't want max value to be calculated by the chart, set it using this property. + * This value might still be adjusted so that it would be possible to draw grid at rounded intervals. + */ + maximum: number; + /** + * If your value axis is date-based, you can specify maximum date of the axis. + * Can be set as date object, timestamp number or string if dataDateFormat is set. + */ + maximumData: Date; + /** + * Read-only. Minimum value of the axis. + */ + min: number; + /** + * If you don't want min value to be calculated by the chart, set it using this property. + * This value might still be adjusted so that it would be possible to draw grid at rounded intervals. + */ + minimum: number; + /** + * If your value axis is date-based, you can specify minimum date of the axis. + * Can be set as date object, timestamp number or string if dataDateFormat is set. + */ + minimumDate: Date; + /** + * If set value axis scale (min and max numbers) will be multiplied by it. + * I.e. if set to 1.2 the scope of values will increase by 20%. + */ + minMaxMultiplier: number; + /** + * Works with radar charts only. + * If you set it to “middle”, labels and data points will be placed in the middle between axes. + */ + pointPosition: string; + /** + * Possible values are: "top", "bottom", "left", "right". + * If axis is vertical, default position is "left". If axis is horizontal, default position is "bottom". + */ + position: string; + /** + * Precision (number of decimals) of values. + */ + precision: number; + /** + * Radar chart only. Specifies if categories (axes' titles) should be displayed near axes) + * @default true + */ + radarCategoriesEnabled: boolean; + /** + * pecifies if graphs's values should be recalculated to percents. + */ + recalculateToPercents: boolean; + /** + * Specifies if value axis should be reversed (smaller values on top). + */ + reversed: boolean; + /** + * Stacking mode of the axis. + * Possible values are: "none", "regular", "100%", "3d". + * Note, only graphs of one type will be stacked. + * @default "none" + */ + stackType: string; + /** + * Read-only. Value difference between two grid lines. + */ + step: number; + /** + * If you set minimum and maximum for your axis, chart adjusts them so that grid would start and end on the + * beginning and end of plot area and grid would be at equal intervals. + * If you set strictMinMax to true, the chart will not adjust minimum and maximum of value axis. + */ + strictMinMax: boolean; + /** + * In case you synchronize one value axis with another, you need to set the synchronization multiplier. + * Use synchronizeWithAxis method to set with which axis it should be synced. + */ + synchronizationMultiplier: number; + /** + * One value axis can be synchronized with another value axis. + * You can use both reference to your axis or id of the axis here. + * You should set synchronizationMultiplyer in order for this to work. + */ + synchronizeWith: ValueAxis; + /** + * If this value axis is stacked and has columns, setting valueAxis.totalText = "[[total]]" will make it + * to display total value above the most-top column. + */ + totalText: string; + /** + * Color of total text. + */ + totalTextColor: string; + /** + * Distance from data point to total text. + */ + totalTextOffset: number; + /** + * This allows you to have logarithmic value axis and have zero values in the data. + * You must set it to >0 value in order to work. + */ + treatZeroAs: number; + /** + * Type of value axis. + * If your values in data provider are dates and you want this axis to show dates instead of numbers, + * set it to "date". + */ + type: string; + /** + * Unit which will be added to the value label. + */ + unit: string; + /** + * Position of the unit. Possible values are "left" and "right". right + */ + unitPosition: string; + /** + * If true, prefixes will be used for big and small numbers. + * You can set arrays of prefixes directly to the chart object + * via prefixesOfSmallNumbers and prefixesOfBigNumbers. + */ + usePrefixes: boolean; + /** + * If true, values will always be formatted using scientific notation (5e+8, 5e-8...) + * Otherwise only values bigger then 1e+21 and smaller then 1e-7 will be displayed in scientific notation. + */ + useScientificNotation: boolean; + + /** + * Adds guide to the axis. + */ + addGuide(guide: Guide): void; + /** + * Number, - value of coordinate. Returns value of the coordinate. coordinate - y or x coordinate, in pixels. + */ + coordinateToValue(coordinate: number): void; + /** + * Number - coordinate Returns coordinate of the value in pixels. value - Number + */ + getCoordinate(value: number): void; + /** + * Removes guide from the axis. + */ + removeGuide(guide: Guide): void; + + /** + * One value axis can be synchronized with another value axis. + * You should set synchronizationMultiplyer in order for this to work. + */ + synchronizeWithAxis(axis: ValueAxis): void; + /** + * XY Chart only. Zooms-in the axis to the provided values. + */ + zoomToValues(startValue: number, endValue: number): void; + + /** + * Adds event listener. + * @param type One of "axisChanged", "axisZoomed", "logarithmicAxisFailed". + * @param handler The event handler. + */ + addListener( + type: string, + handler: ( + e: { + type: string; + startValue?: Date; + endValue?: Date; + chart: AmChart; + }, + ) => void, + ): void; + + /** + * Removes event listener from chart object. + */ + removeListener(chart: AmChart, type: string, handler: any): void; +} diff --git a/types/amcharts/amcharts-tests.ts b/types/amcharts/amcharts-tests.ts new file mode 100644 index 0000000000..7dedc76ead --- /dev/null +++ b/types/amcharts/amcharts-tests.ts @@ -0,0 +1,76 @@ +import { AmCharts } from "amcharts"; + +const theme = AmCharts.themes.light; + +// Global namespace settings. +AmCharts.useUTC = false; +AmCharts.theme = theme; + +// "JSON"-style API. +const chart = AmCharts.makeChart("chartdiv", { + type: "gauge", + arrows: [ + { + value: 130 + } + ], + titles: [ + { + text: "Speedometer", + size: 15 + } + ], + axes: [ + { + bottomText: "0 km/h", + endValue: 220, + valueInterval: 10, + bands: [ + { + color: "#00CC00", + endValue: 90, + startValue: 0 + }, + { + color: "#ffac29", + endValue: 130, + startValue: 90 + }, + { + color: "#ea3838", + endValue: 220, + startValue: 130, + innerRadius: "95%" + } + ] + } + ] +}); + +// Object based API. +const amAngularGauge = new AmCharts.AmAngularGauge(theme); +const amBalloon = new AmCharts.AmBalloon(); +const amChart = new AmCharts.AmChart(theme); +const amCoordinateChart = new AmCharts.AmCoordinateChart(theme); +const amGraph = new AmCharts.AmGraph(); +const amLegend = new AmCharts.AmLegend(); +const amPieChart = new AmCharts.AmPieChart(theme); +const amRadarChart = new AmCharts.AmRadarChart(theme); +const amRectangularChart = new AmCharts.AmRectangularChart(theme); +const amSerialChart = new AmCharts.AmSerialChart(theme); +const amXYChart = new AmCharts.AmXYChart(theme); +const axisBase = new AmCharts.AxisBase(); +const categoryBase = new AmCharts.CategoryAxis(); +const chartCursor = new AmCharts.ChartCursor(); +const chartScrollbar = new AmCharts.ChartScrollbar(); +const gaugeArrow = new AmCharts.GaugeArrow(); +const gaugeAxis = new AmCharts.GaugeAxis(); +const gaugeBand = new AmCharts.GaugeBand(); +const graphDataItem = new AmCharts.GraphDataItem(); +const guid = new AmCharts.Guide(); +const label = new AmCharts.Label(); +const serialDateItem = new AmCharts.SerialDataItem(); +const slice = new AmCharts.Slice(); +const title = new AmCharts.Title(); +const trendLine = new AmCharts.TrendLine(); +const valueAxis = new AmCharts.ValueAxis(); diff --git a/types/amcharts/index.d.ts b/types/amcharts/index.d.ts index 98fae5adeb..759e22e942 100644 --- a/types/amcharts/index.d.ts +++ b/types/amcharts/index.d.ts @@ -1,2607 +1,141 @@ -// Type definitions for amCharts +// Type definitions for amCharts 3.21 // Project: http://www.amcharts.com/ -// Definitions by: aleksey-bykov +// Definitions by: ldrick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -/// AmCharts object (it's not a class) is create automatically when amcharts.js or amstock.js file is included in a web page. -declare namespace AmCharts { +import _AmAngularGauge from "./AmAngularGauge"; +import _AmBalloon from "./AmBalloon"; +import _AmChart from "./AmChart"; +import _AmCoordinateChart from "./AmCoordinateChart"; +// import _AmFunnelChart from "./AmFunnelChart"; +// import _AmGanttChart from "./AmGanttChart"; +import _AmGraph from "./AmGraph"; +import _AmLegend from "./AmLegend"; +import _AmPieChart from "./AmPieChart"; +import _AmRadarChart from "./AmRadarChart"; +import _AmRectangularChart from "./AmRectangularChart"; +import _AmSerialChart from "./AmSerialChart"; +// import _AmSlicedChart from "./AmSlicedChart"; +import _AmXYChart from "./AmXYChart"; +import _AxisBase from "./AxisBase"; +import _CategoryAxis from "./CategoryAxis"; +import _ChartCursor from "./ChartCursor"; +import _ChartScrollbar from "./ChartScrollbar"; +import _GaugeArrow from "./GaugeArrow"; +import _GaugeAxis from "./GaugeAxis"; +import _GaugeBand from "./GaugeBand"; +import _GraphDataItem from "./GraphDataItem"; +import _Guide from "./Guide"; +// import _Image from "./Image"; +import _Label from "./Label"; +import _SerialDataItem from "./SerialDataItem"; +import _Slice from "./Slice"; +import _Title from "./Title"; +import _TrendLine from "./TrendLine"; +import _ValueAxis from "./ValueAxis"; - /** Set it to true if you have base href set for your page. This will fix rendering problems in Firefox caused by base href. */ - var baseHref: boolean; +/** + * AmCharts namespace is create automatically when amcharts.js or amstock.js file is included. + */ +export namespace AmCharts { + /** + * Set it to true if you have base href set for your page. + * This will fix rendering problems in Firefox caused by base href. + */ + let baseHref: boolean; - /** Array of day names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] */ - var dayNames: string[]; + /** + * Array of day names, used when formatting dates (if categoryAxis.parseDates is set to true) + * ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] + */ + let dayNames: string[]; - /** Array of month names, used when formatting dates (if categoryAxis.parseDates is set to true) ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] */ - var monthNames: string[]; + /** + * Array of month names, used when formatting dates (if categoryAxis.parseDates is set to true) + * [ + * 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', + * 'September', 'October', 'November','December' + * ] + */ + let monthNames: string[]; - /** Array of short versions of day names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] */ - var shortDayNames: string[]; + /** + * Array of short versions of day names, used when formatting dates (if categoryAxis.parseDates is set to true) + * ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] + */ + let shortDayNames: string[]; - /** Array of short versions of month names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] */ - var shortMonthNames: string[]; + /** + * Array of short versions of month names, used when formatting dates (if categoryAxis.parseDates is set to true) + * ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + */ + let shortMonthNames: string[]; - /** Set it to true if you want UTC time to be used instead of local time. */ - var useUTC: boolean; + /** + * Set it to true if you want UTC time to be used instead of local time. + */ + let useUTC: boolean; - /** Object with themes */ - var themes: any; + /** + * Set global used AmCharts theme. + */ + let theme: any; - /** Clears all the charts on page, removes listeners and intervals. */ + /** + * Object with existing themes. + */ + let themes: any; + + /** + * Clears all the charts on page, removes listeners and intervals. + */ function clear(): void; - /** Handle ready event */ - function ready(f: Function): void; - - /** Create chart by params. */ + /** + * Create chart by params. + */ function makeChart(selector: string, params: any, delay?: number): AmChart; - /** Set a method to be called before initializing the chart. + /** + * Set a method to be called before initializing the chart. * When the method is called, the chart instance is passed as an attribute. * You can use this feature to preprocess chart data or do some other things you need * before initializing the chart. - * @param {Function} handler - The method to be called. - * @param {string[]} types - Which chart types should call this method. Defaults to all + * @param handler - The method to be called. + * @param types - Which chart types should call this method. Defaults to all * if none is passed. */ - function addInitHandler(handler: Function, types: string[]): any; - - /** AmPieChart class creates pie/donut chart. In order to display pie chart you need to set at least three properties - dataProvider, titleField and valueField. - @example - var chartData = [{title:"Pie I have eaten",value:70},{title:"Pie I haven\'t eaten",value:30}]; - var chart = new AmCharts.AmPieChart(); - chart.valueField = "value"; - chart.titleField = "title"; - chart.dataProvider = chartData; - chart.write("chartdiv"); - */ - class AmPieChart extends AmChart { - /** Name of the field in chart's dataProvider which holds slice's alpha. */ - alphaField: string; - /** Pie lean angle (for 3D effect). Valid range is 0 - 90. */ - angle: number; - /** Balloon text. The following tags can be used: [[value]], [[title]], [[percents]], [[description]]. [[title]]: [[percents]]% ([[value]])\n[[description]] */ - balloonText: string; - /** Read-only. Array of Slice objects. */ - chartData: any[]; - /** Name of the field in chart's dataProvider which holds slice's color. */ - colorField: string; - /** Specifies the colors of the slices, if the slice color is not set. If there are more slices than colors in this array, the chart picks random color. ["#FF0F00", "#FF6600", "#FF9E01", "#FCD202", "#F8FF01", "#B0DE09", "#04D215", "#0D8ECF", "#0D52D1", "#2A0CD0", "#8A0CCF", "#CD0D74", "#754DEB", "#DDDDDD", "#999999", "#333333", "#000000", "#57032A", "#CA9726", "#990000", "#4B0C25"] */ - colors: any[]; - /** Depth of the pie (for 3D effect). */ - depth3D: number; - /** Name of the field in chart's dataProvider which holds a string with description. */ - descriptionField: string; - /** Example: [-0.2,0.2]. Will make slices to be filled with color gradients. */ - gradientRatio: number[]; - /** Opacity of the group slice. Value range is 0 - 1. - @default 1 - */ - groupedAlpha: number; - /** Color of the group slice. The default value is not set - this means the next available color from "colors" array will be used. */ - groupedColor: string; - /** Description of the group slice. */ - groupedDescription: string; - /** If this is set to true, the group slice will be pulled out when the chart loads. */ - groupedPulled: boolean; - /** Title of the group slice. Other */ - groupedTitle: string; - /** If there is more than one slice whose percentage of the pie is less than this number, those slices will be grouped together into one slice. This is the "other" slice. It will always be the last slice in a pie. */ - groupPercent: number; - /** Slices with percent less then hideLabelsPercent won't display labels This is useful to avoid cluttering up the chart, if you have a lot of small slices. 0 means all labels will be shown. */ - hideLabelsPercent: number; - /** Opacity of a hovered slice. Value range is 0 - 1. - @default 1 - */ - hoverAlpha: number; - /** Inner radius of the pie, in pixels or percents. */ - innerRadius: any; - /** The distance between the label and the slice, in pixels. You can use negative values to put the label on the slice. - @default 30 - */ - labelRadius: number; - /** Name of the field in dataProvider which specifies the length of a tick. Note, the chart will not try to arrange labels automatically if this property is set. */ - labelRadiusField: string; - /** Specifies whether data labels are visible. - @default true - */ - labelsEnabled: boolean; - /** Label text. The following tags can be used: [[value]], [[title]], [[percents]], [[description]]. [[title]]: [[percents]]% */ - labelText: string; - /** Label tick opacity. Value range is 0 - 1. 0.2 */ - labelTickAlpha: number; - /** Label tick color. #000000 */ - labelTickColor: string; - /** Bottom margin of the chart. - @default 5 - */ - marginBottom: number; - /** Left margin of the chart. */ - marginLeft: number; - /** Right margin of the chart. */ - marginRight: number; - /** Top margin of the chart. - @default 5 - */ - marginTop: number; - /** Minimum radius of the pie, in pixels. - @default 10 - */ - minRadius: number; - /** Pie outline opacity. Value range is 0 - 1. */ - outlineAlpha: number; - /** Pie outline color. #FFFFFF */ - outlineColor: string; - /** Pie outline thickness. - @default 1 - */ - outlineThickness: number; - /** Opacity of the slices. You can set the opacity of individual slice too. - @default 1 - */ - pieAlpha: number; - /** Color of the first slice. All the other will be colored with darker or brighter colors. */ - pieBaseColor: string; - /** Lightness increase of each subsequent slice. This is only useful if pieBaseColor is set. Use negative values for darker colors. Value range is from -255 to 255. - @default 30*/ - pieBrightnessStep: number; - /** You can set fixed position of a pie center, in pixels or in percents. */ - pieX: any; - /** You can set fixed position of a pie center, in pixels or in percents. */ - pieY: any; - /** Name of the field in chart's dataProvider which holds a boolean value telling the chart whether this slice must be pulled or not. */ - pulledField: string; - /** Pull out duration, in seconds. - @default 1 - */ - pullOutDuration: number; - /** Pull out effect. Possible values are ">", "<", elastic" and "bounce". bounce */ - pullOutEffect: string; - /** If this is set to true, only one slice can be pulled out at a time. If the viewer clicks on a slice, any other pulled-out slice will be pulled in. */ - pullOutOnlyOne: boolean; - /** Pull out radius, in pixels or percents 0.2 */ - pullOutRadius: any; - /** Radius of a pie, in pixels or percents. By default, radius is calculated automatically. */ - radius: any; - /** Specifies whether the animation should be sequenced or all slices should appear at once. */ - sequencedAnimation: boolean; - /** Initial opacity of all slices. If you set startDuration higher than 0, slices will fade in from startAlpha. - @default 1 - */ - startAlpha: number; - /** Angle of the first slice, in degrees. This will work properly only if "depth3D" is set to 0. If "depth3D" is greater than 0, then there can be two angles only: 90 and 270. Value range is 0-360. - @default 90 - */ - startAngle: number; - /** Duration of the animation, in seconds. - @default 1 - */ - startDuration: number; - /** Animation effect. Possible values are ">", "<", "elastic" and "bounce". bounce */ - startEffect: string; - /** Radius of the positions from which the slices will fly in. - default 5 - */ - startRadius: any; - /** Name of the field in chart's dataProvider which holds slice's title. */ - titleField: string; - /** Name of the field in chart's dataProvider which holds url which would be accessed if the user clicks on a slice. */ - urlField: string; - /** If url is specified for a slice, it will be opened when user clicks on it. urlTarget specifies target of this url. Use _blank if you want url to be opened in a new window. _self */ - urlTarget: string; - /** Name of the field in chart's dataProvider which holds slice's value. */ - valueField: string; - /** Name of the field in chart's dataProvider which holds boolean variable defining whether this data item should have an entry in the legend. */ - visibleInLegendField: string; - - /** You can trigger the animation of the pie chart. */ - animateAgain(): void; - /** You can trigger the click on a slice from outside. index - the number of a slice or Slice object. */ - clickSlice(index: number): void; - /** Hides slice. index - the number of a slice or Slice object. */ - hideSlice(index: number): void; - /** You can simulate roll-out of a slice from outside. index - the number of a slice or Slice object. */ - rollOutSlice(index: number): void; - /** You can simulate roll-over a slice from outside. index - the number of a slice or Slice object. */ - rollOverSlice(index: number): void; - /** Shows slice. index - the number of a slice or Slice object. */ - showSlice(index: number): void; - - /** Adds event listener of the type "clickSlice" or "pullInSlice" or "pullOutSlice" to the object. - @param type Always "clickSlice" or "pullInSlice" or "pullOutSlice". - @param handler - If the type is "clickSlice", dispatched when user clicks on a slice. - If the type is "pullInSlice", dispatched when user clicks on a slice and the slice is pulled-in. - If the type is "pullOutSlice", dispatched when user clicks on a slice and the slice is pulled-out. - If the type is "rollOutSlice", dispatched when user rolls-out of the slice. - If the type is "rollOverSlice", dispatched when user rolls-over the slice. - */ - addListener(type: string, handler: (e: {/** Always "rollOverSlice". */ - type: string; dataItem: Slice; chart: AmChart; - }) => void): void; - } - - /** AmRadarChart is the class you have to use for radar and polar chart types. - @example - var chart; - var chartData = [ - {country:"Czech Republic",litres:156.90}, - {country:"Ireland",litres:131.10}, - {country:"Germany",litres:115.80}, - {country:"Australia",litres:109.90}, - {country:"Austria",litres:108.30}, - {country:"UK",litres:99.00} - ]; - - window.onload = function() { - chart = new AmCharts.AmRadarChart(); - chart.dataProvider = chartData; - chart.categoryField = "country"; - chart.startDuration = 2; - - var valueAxis = new AmCharts.ValueAxis(); - valueAxis.axisAlpha = 0.15; - valueAxis.minimum = 0; - valueAxis.dashLength = 3; - valueAxis.axisTitleOffset = 20; - valueAxis.gridCount = 5; - chart.addValueAxis(valueAxis); - - var graph = new AmCharts.AmGraph(); - graph.valueField = "litres"; - graph.bullet = "round"; - graph.balloonText = "[[value]] litres of beer per year" - chart.addGraph(graph); - - chart.write("chartdiv"); - } - */ - class AmRadarChart extends AmCoordinateChart { - /** Bottom margin of the chart. */ - marginBottom: number; - /** Left margin of the chart. */ - marginLeft: number; - /** Right margin of the chart. */ - marginRight: number; - /** Top margin of the chart. */ - marginTop: number; - /** Radius of a radar. 0.35 */ - radius: any; - } - - /** AmXYChart is the class you have to use for XY/Bubble/Scatter chart types. The chart supports simple and logarithmic scales, it can have multiple value axes. - @example - var chartData = [ - {x:10, y:14, value:59}, - {x:5, y:3, value:50}, - {x:-10, y:-3, value:19}, - {x:-6, y:5, value:65}, - {x:15, y:-4, value:92}, - {x:13, y:1, value:8}, - {x:1, y:6, value:35} - ]; - - var chart = new AmCharts.AmXYChart(); - chart.pathToImages = "../../amcharts/javascript/images/"; - chart.dataProvider = chartData; - chart.marginLeft = 35; - chart.startDuration = 1.5; - - var xAxis = new AmCharts.ValueAxis(); - xAxis.position = "left"; - xAxis.autoGridCount = true; - chart.addValueAxis(xAxis); - - var yAxis = new AmCharts.ValueAxis(); - yAxis.position = "bottom"; - yAxis.autoGridCount = true; - chart.addValueAxis(yAxis); - - var graph = new AmCharts.AmGraph(); - graph.valueField = "value"; - graph.xField = "x"; - graph.yField = "y"; - graph.lineAlpha = 0; - graph.bullet = "round"; - chart.addGraph(graph); - - var chartCursor = new AmCharts.ChartCursor(); - chart.addChartCursor(chartCursor); - - var chartScrollbar = new AmCharts.ChartScrollbar(); - chartScrollbar.hideResizeGrips = false; - chart.addChartScrollbar(chartScrollbar); - - chart.write("chartdiv); - */ - class AmXYChart extends AmRectangularChart { - /** Specifies if Scrollbar of X axis (horizontal) should be hidden. */ - hideXScrollbar: boolean; - /** Specifies if Scrollbar of Y axis (vertical) should be hidden. */ - hideYScrollbar: boolean; - /** Maximum zoom factor of the chart. - @default 20 - */ - maxZoomFactor: number; - /** Zooms out, charts shows all available data.*/ - zoomOut(): void; - } - /** Guides are straight vertical or horizontal lines or areas supported by AmSerialChart, AmXYChart and AmRadarChart. You can have guides both on value and category axes. To add/remove a guide to an axis, use axis.addGuide(guide)/axis.removeGuide(guide) methods. - -If you do not set properties such as dashLength, lineAlpha, lineColor, etc - values of the axis are used.*/ - class Guide { - /** If you set it to true, the guide will be displayed above the graphs. */ - above: boolean; - /** Radar chart only. Specifies angle at which guide should start. Affects only fills, not lines. */ - angle: number; - /** Baloon fill color. */ - balloonColor: string; - /** The text which will be displayed if the user rolls-over the guide. */ - balloonText: string; - /** Specifies if label should be bold or not. */ - boldLabel: boolean; - /** Category of the guide (in case the guide is for category axis). */ - category: string; - /** Dash length. */ - dashLength: number; - /** Date of the guide (in case the guide is for category axis and parseDates is set to true). */ - date: Date; - /** Works if a guide is added to CategoryAxis and this axis is non-date-based. If you set it to true, the guide will start (or be placed, if it's not a fill) on the beginning of the category cell and will end at the end of toCategory cell. */ - expand: boolean; - /** Fill opacity. Value range is 0 - 1. */ - fillAlpha: number; - /** Fill color. */ - fillColor: string; - /** Font size of guide label. */ - fontSize: string; - /** Unique id of a Guide. You don't need to set it, unless you want to. */ - id: string; - /** Specifies whether label should be placed inside or outside plot area. */ - inside: boolean; - /** The label which will be displayed near the guide. */ - label: string; - /** Rotation angle of a guide label. */ - labelRotation: number; - /** Line opacity. */ - lineAlpha: number; - /** Line color. */ - lineColor: string; - /** Line thickness. */ - lineThickness: number; - /** Position of guide label. Possible values are "left" or "right" for horizontal axis and "top" or "bottom" for vertical axis. */ - position: string; - /** Tick length. */ - tickLength: number; - /** Radar chart only. Specifies angle at which guide should end. Affects only fills, not lines. */ - toAngle: number; - /** To category of the guide (in case the guide is for category axis). */ - toCategory: string; - /** To date of the guide (in case the guide is for category axis and parseDates is set to true) If you have both date and toDate, the space between these two dates can be filled with color. */ - toDate: Date; - /** To value of the guide (in case the guide is for value axis). */ - toValue: number; - /** Value of the guide (in case the guide is for value axis). */ - value: number; - /** Value axis of a guide. As you can add guides directly to the chart, you might need to specify which which value axis should be used. */ - valueAxis: ValueAxis; - } - /** ImagesSettings is a class which holds common settings of all MapImage objects. */ - class ImagesSettings { - /** Opacity of the image. - @default 1 - */ - alpha: number; - /** Text which is displayed in a roll-over balloon. You can use the following tags: [[title]], [[description]], [[value]] and [[percent]]. [[title]] */ - balloonText: string; - /** Specifies if the image's center should be placed in the provided coordinates. If false, top-left corner will be at provided coordinates. - @default true - */ - centered: boolean; - /** Color of image. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. #000000 */ - color: string; - /** Height of a description window. */ - descriptionWindowHeight: number; - /** Width of a description window. - @default 250 - */ - descriptionWindowWidth: number; - /** X position of a description window. */ - descriptionWindowX: number; - /** Y position of a description window. */ - descriptionWindowY: number; - /** Label color. #000000 */ - labelColor: string; - /** Font size of a label. - @default 11 - */ - labelfontSize: string; - /** Position of the label. Allowed values are: left, right, top, bottom and middle. right */ - labelPosition: string; - /** Label roll-over color. #00CC00 */ - labelRollOverColor: string; - /** Opacity of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. */ - outlineAlpha: number; - /** Color of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. */ - outlineColor: string; - /** Thickness of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. - @default 1 - */ - outlineThickness: number; - /** Color of image when hovered. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. */ - rollOverColor: string; - /** Scale of the image when hovered. Use value like 1.5 - 2 to enlarge image when user rolls-over it. - @default 1 - */ - rollOverScale: number; - /** Scale of the image if it is selected. Use value like 1.5 - 2 to enlarge selected image. - @default 1 - */ - selectedScale: number; - } - - /** AreasSettings is a class which holds common settings of all MapArea objects. */ - class AreasSettings { - /** Opacity of areas. - @default 1 - */ - alpha: number; - /** Specifies if the areas should be zoomed-in when user clicks on them, event if zoom properties are not set. */ - autoZoom: boolean; - /** Text which is displayed in a roll-over balloon. You can use the following tags: [[title]], [[description]], [[value]] and [[percent]] [[title]] */ - balloonText: string; - /** Color of the areas. #FFCC00 */ - color: string; - /** Color of area with highest value. Colors for areas with values less then highest will be colored with intermediate colors between color and colorSolid. Use colorSteps property of AmMap to change the number of intermediate colors. #990000 */ - colorSolid: string; - /** Height of a description window. */ - descriptionWindowHeight: number; - /** Width of a description window. - @default 250 - */ - descriptionWindowWidth: number; - /** X position of a description window. */ - descriptionWindowX: number; - /** Y position of a description window. */ - descriptionWindowY: number; - /** Opacity of area's outline. - @default 1 - */ - outlineAlpha: number; - /** Color of area's outline. #FFFFFF */ - outlineColor: string; - /** Thickness of area's outline. 0.5 */ - outlineThickness: number; - /** Color of area when user rolls-over it. undefined */ - rollOverColor: string; - /** Color of area's outline when user rolls-over it. #CC0000 */ - rollOverOutlineColor: string; - /** Color of area which is currently selected. #CC0000 */ - selectedColor: string; - /** Opacity of all areas which are in the map svg file, but not listed as areas in DataSet. - @default 1 - */ - unlistedAreasAlpha: number; - /** Color of all areas which are in the map svg file, but not listed as areas in DataSet. #DDDDDD */ - unlistedAreasColor: string; - /** Opacity of all areas' outline which are in the map svg file, but not listed as areas in DataSet. - @default 1 - */ - unlistedAreasOutlineAlpha: number; - /** Color of all areas' outline which are in the map svg file, but not listed as areas in DataSet. #FFFFFF */ - unlistedAreasOutlineColor: string; - } - - /** Slice is an item of AmPieChart's chartData Array and holds all the information about the slice. When working with a pie chart, you do not create slices or change it's properties directly, instead you set array of data using dataProvider property. Consider properties of a Slice read-only - change values in chart's data provider if you need to. */ - class Slice { - /** Opacity of a slice. */ - alpha: number; - /** Color of a slice. */ - color: string; - /** Original object from data provider. */ - dataContext: Object; - /** Slice description. */ - description: string; - /** Specifies whether the slice is hidden */ - hidden: boolean; - /** Percent value of a slice. */ - percents: number; - /** Specifies whether the slice is pulled or not. */ - pulled: boolean; - /** Slice title */ - title: string; - /** Url of a slice */ - url: string; - /** Value of a slice */ - value: number; - /** specifies whether this slice has a legend entry */ - visibleInLegend: boolean; - } - - - /** AmStockChart is a main class Stock chart. */ - class AmStockChart { - /** Specifies if animation was already played. Animation is only played once, when chart is rendered for the first time. If you want the animation to be repeated, set this property to false. */ - animationPlayed: boolean; - /** Balloon object. */ - balloon: AmBalloon; - /** Settings for category axes. */ - categoryAxesSettings: CategoryAxesSettings; - /** Indicates if the chart is created. */ - chartCreated: boolean; - /** Chart cursor settings. */ - chartCursorSettings: ChartCursorSettings; - /** Chart scrollbar settings. */ - chartScrollbarSettings: ChartScrollbarSettings; - /** Array of colors used by data sets if no color was set explicitly on data set itself. #FF6600, "#FCD202", "#B0DE09", "#0D8ECF", "#2A0CD0", "#CD0D74", "#CC0000", "#00CC00", "#0000CC", "#DDDDDD", "#999999", "#333333", "#990000" */ - colors: any[]; - /** Array of data sets selected for comparing. */ - comparedDataSets: any[]; - /** Array of DataSets. */ - dataSets: any[]; - /** DataSetSelector object. You can add it if you have more than one data set and want users to be able to select/compare them. */ - dataSetSelector: DataSetSelector; - /** Current end date of the selected period, get only. To set start/end dates, use stockChart.zoom(startDate, endDate) method. */ - endDate: Date; - /** Defines on which day week starts. 0 - Sunday, 1 - Monday.. - @default 1 */ - firstDayOfWeek: number; - /** If set to true the scope of the data view will be set to the end after data update. */ - glueToTheEnd: boolean; - /** Legend settings. */ - legendSettings: LegendSettings; - /** Data set selected as main. */ - mainDataSet: DataSet; - /** Array of StockPanels (charts). */ - panels: any[]; - /** Settings for stock panels. */ - panelsSettings: PanelsSettings; - /** Period selector object. You can add it if you want user's to be able to enter date ranges or zoom chart with predefined period buttons. */ - periodSelector: PeriodSelector; - /** Scrollbar's chart object, get only. */ - scrollbarChart: AmSerialChart; - /** Current start date of the selected period, get only. To set start/end dates, use stockChart.zoom(startDate, endDate) method. */ - startDate: Date; - /** Settings for stock events. */ - stockEventsSettings: any; - /** Settings for value axes. */ - valueAxesSettings: ValueAxesSettings; - /** read-only. Indicates current version of a script. */ - version: string; - /** Specifies whether the chart should zoom-out when main data set is changed. */ - zoomOutOnDataSetChange: boolean; - - /** Adds panel to the stock chart. Requires stockChart.validateNow() method to be called after this action. */ - addPanel(panel: StockPanel): void; - /** Adds panel to the stock chart at a specified index. Requires stockChart.validateNow() method to be called after this action. */ - addPanelAt(panel: StockPanel, index: number): void; - /** Destroys chart, all timeouts and listeners. */ - clear(): void; - /** Hides event bullets. */ - hideStockEvents(): void; - /** Removes event listener from the object. */ - removeListener(obj: any, type: string, handler: any): void; - /** Removes panel from the stock chart. Requires stockChart.validateNow() method to be called after this action. */ - removePanel(panel: StockPanel): void; - /** Shows event bullets. */ - showStockEvents(): void; - /** Method which should be called after data was changed. */ - validateData(): void; - /** Method which forces the stock chart to rebuild. Should be called after properties are changed. */ - validateNow(): void; - /** Zooms chart to specified dates. startDate, endDate - Date objects. */ - zoom(startDate: Date, endDate: Date): void; - /** Zooms out the chart. */ - zoomOut(): void; - - /** Adds event listener of the type "dataUpdated" or "init" or "rendered" to the object. - @param type Always "dataUpdated" or "init" or "rendered". - @param handler - If the type is "dataUpdated", dispatched when the chart was updated with new data. - If the type is "init", dispatched when the chart is initialized for the first time. In case you want it to fire again after validateNow() method is called, set chart.chartCreated = false. - If the type is "rendered", dispatched each when chart is rendered. - */ - addListener(type: string, handler: (e: { - /** Either "dataUpdated" or "init". */ - type: string; - chart: AmStockChart; - }) => void): void; - - /** Adds event listener of the type "rollOutStockEvent" or "rollOverStockEvent" or "clickStockEvent" to the object. - @param type // Either "rollOutStockEvent" or "rollOverStockEvent" or "clickStockEvent". - @param handler - If the type is "rollOutStockEvent", dispatched when the user rolls-out of the Stock event (bullet). - If the type is "rollOverStockEvent", dispatched when the user rolls-over of the Stock event (bullet). - If the type is "clickStockEvent", dispatched when the user clicks on the Stock event (bullet). - */ - - addListener(type: string, handler: (e: { - /** Always "rollOverStockEvent". */ - type: string; - eventObject: any; - graph: AmGraph; - date: Date; - chart: AmStockChart; - }) => void): void; - - /** Adds event listener of the type "zoomed" to the object. - @param type Always "zoomed". - @param handler Dispatched when the chart is zoomed (even for the first time, when chart is initialized).*/ - addListener(type: string, handler: (e: { - /** Always "zoomed". */ - type: string; - startDate: Date; - endDate: Date; - period: string; - chart: AmStockChart; - }) => void): void; - - /** Adds event listener of the type "panelRemoved" to the object. - @param type Always "panelRemoved". - @param handler Dispatched when the StockPanel is removed.*/ - addListener(type: string, handler: (e: { - /** Always "panelRemoved". */ - - type: string; - panel: StockPanel; - chart: AmStockChart; - }) => void): void; - - /** Removes event listener from chart object. */ - removeListener(chart: AmChart, type: string, handler: any): void; - } - - /** ValueAxesSettings settings set 's settings for all ValueAxes. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of ValueAxis class will be used. */ - class ValueAxesSettings { - /** Specifies whether number for gridCount is specified automatically, according to the axis size. - @default true - */ - autoGridCount: boolean; - /** Axis opacity. */ - axisAlpha: number; - /** Axis color. */ - axisColor: string; - /** Thickness of the axis. */ - axisThickness: number; - /** Label color. */ - color: string; - /** Length of a dash. By default, the grid line is not dashed. */ - dashLength: number; - /** Fill opacity. Every second space between grid lines can be filled with color. */ - fillAlpha: number; - /** Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills. */ - fillColor: string; - /** Opacity of grid lines. */ - gridAlpha: number; - /** Color of grid lines. */ - gridColor: string; - /** Approximate number of grid lines. autoGridCount should be set to false, otherwise this property will be ignored. */ - gridCount: number; - /** Thickness of grid lines. */ - gridThickness: number; - /** Specifies whether guide values should be included when calculating min and max of the axis. */ - includeGuidesInMinMax: boolean; - /** If true, the axis will include hidden graphs when calculating min and max values. */ - includeHidden: boolean; - /** Specifies whether values should be placed inside or outside plot area. In case you set this to false, you'll have to adjust marginLeft or marginRight in [[PanelsSettings]] in order labels to be visible. - @default true - */ - inside: boolean; - /** Specifies whether values on axis can only be integers or both integers and doubles. */ - integersOnly: boolean; - /** Frequency at which labels should be placed. */ - labelFrequency: number; - /** Specifies whether value labels are displayed. */ - labelsEnabled: boolean; - /** Set to true if value axis is logarithmic, false otherwise. */ - logarithmic: boolean; - /** The distance of the axis to the plot area, in pixels. Useful if you have more then one axis on the same side. */ - offset: number; - /** Position of the value axis. Possible values are "left" and "right". */ - position: string; - /** Set to true if value axis is reversed (smaller values on top), false otherwise. */ - reversed: boolean; - /** Specifies if first label of value axis should be displayed. */ - showFirstLabel: boolean; - /** Specifies if last label of value axis should be displayed. */ - showLastLabel: boolean; - /** Stacking mode of the axis. Possible values are: "none", "regular", "100%", "3d". */ - stackType: string; - /** Tick length. */ - tickLength: number; - /** Unit which will be added to the value label. */ - unit: string; - /** Position of the unit. Possible values are "left" or "right". */ - unitPosition: string; - - } - - - /** AmLegend is the class that displays legend of the chart. Legend to the chart should be added using chart.addLegend(legend) method. - @example - var chart = new AmCharts.AmSerialChart(); - var legend = new AmCharts.AmLegend(); - chart.addLegend(legend); - */ - class AmLegend { - - /** Alignment of legend entries. Possible values are: "left", "center", "right". left */ - align: string; - /** Used if chart is Serial or XY. In case true, margins of the legend are adjusted and made equal to chart's margins. - @default true - */ - autoMargins: boolean; - /** Opacity of legend's background. Value range is 0 - 1 */ - backgroundAlpha: number; - /** Background color. You should set backgroundAlpha to >0 vallue in order background to be visible. #FFFFFF */ - backgroundColor: string; - /** Opacity of chart's border. Value range is 0 - 1. */ - borderAlpha: number; - /** Color of legend's border. You should set borderAlpha >0 in order border to be visible. #000000 */ - borderColor: string; - /** In case legend position is set to "absolute", you can set distance from bottom of the chart, in pixels. */ - bottom: number; - /** Text color. Will use chart's color if not set. */ - color: string; - /** This can be used by AmMap only. You can pass array of objects with title, color, markerType values, for example: [{title: "One", color: "#3366CC"},{title: "Two", color: "#FFCC33"}] */ - data: any[]; - /** Specifies if each of legend entry should be equal to the most wide entry. Won't look good if legend has more than one line. - @default true - */ - equalWidths: boolean; - /** Font size. Will use chart's font size if not set. */ - fontSize: string; - /** Horizontal space between legend item and left/right border. */ - horizontalGap: number; - /** The text which will be displayed in the legend. Tag [[title]] will be replaced with the title of the graph. [[title]] */ - labelText: string; - /** In case legend position is set to "absolute", you can set distance from left side of the chart, in pixels. */ - left: number; - /** Bottom margin. */ - marginBottom: number; - /** Left margin. This property will be ignored if chart is Serial or XY and autoMargins property of the legend is true (default). - @default 20 - */ - marginLeft: number; - /** Right margin. This property will be ignored if chart is Serial or XY and autoMargins property of the legend is true (default). - @default 20 - */ - marginRight: number; - /** Top margin. */ - marginTop: number; - /** Marker border opacity 1. */ - markerBorderAlpha: number; - /** Marker border color. If not set, will use the same color as marker. */ - markerBorderColor: string; - /** Thickness of the legend border. The default value (0) means the line will be a "hairline" (1 px). In case marker type is line, this style will be used for line thickness. - @default 1 - */ - markerBorderThickness: number; - /** The color of the disabled marker (when the graph is hidden). #AAB3B3 */ - markerDisabledColor: string; - /** Space between legend marker and legend text, in pixels. - @default 5 - */ - markerLabelGap: number; - /** Size of the legend marker (key). - @default 16 - */ - markerSize: number; - /** Shape of the legend marker (key). Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none". square */ - markerType: string; - /** Maximum number of columns in the legend. If Legend's position is set to "right" or "left", maxColumns is automatically set to 1. */ - maxColumns: number; - /** Position of a legend. Possible values are: "bottom", "top", "left", "right" and "absolute". In case "absolute", you should set left and top properties too. (this setting is ignored in Stock charts). In case legend is used with AmMap, position is set to "absolute" automatically. bottom */ - position: string; - /** Specifies whether legend entries should be placed in reversed order. */ - reversedOrder: boolean; - /** In case legend position is set to "absolute", you can set distance from right side of the chart, in pixels. */ - right: number; - /** Legend item text color on roll-over. #CC0000 */ - rollOverColor: string; - /** When you roll-over the legend entry, all other graphs can reduce their opacity, so that the graph you rolled-over would be distinguished. This style specifies the opacity of the graphs. - @default 1 - */ - rollOverGraphAlpha: number; - /** You can use this property to turn all the legend entries off. - @default true - */ - showEntries: boolean; - /** Horizontal space between legend items, in pixels. - @default 10 - */ - spacing: number; - /** Whether showing/hiding of graphs by clicking on the legend marker is enabled or not. In case legend is used with AmMap, this is set to false automatically. - @default true - */ - switchable: boolean; - /** Legend switch color. #FFFFFF */ - switchColor: string; - /** Legend switch type (in case the legend is switchable). Possible values are "x" and "v". x */ - switchType: string; - /** If true, clicking on the text will show/hide balloon of the graph. Otherwise it will show/hide graph/slice, if switchable is set to true. */ - textClickEnabled: boolean; - /** In case legend position is set to "absolute", you can set distance from top of the chart, in pixels. */ - top: number; - /** Legend markers can mirror graph’s settings, displaying a line and a real bullet as in the graph itself. - Set this property to true if you want to enable this feature. Note, if you set graph colors in dataProvider, they will not be reflected in the marker. - @default false*/ - useGraphSettings: boolean; - /** Specifies if legend labels should be use same color as corresponding markers. */ - useMarkerColorForLabels: boolean; - /** Alignment of the value text. Possible values are "left" and "right". right */ - valueAlign: string; - /** The text which will be displayed in the value portion of the legend. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. [[value]] */ - valueText: string; - /** Width of the value text. - @default 80 - */ - valueWidth: number; - /** Vertical space between legend items also between legend border and first and last legend row. 10 */ - verticalGap: number; - /** Adds event listener of the type "clickLabel" or "clickMarker" or "hideItem" to the object. - @param type Either "clickLabel" or "clickMarker" or "hideItem". - @param handler - If the type is "clickLabel", dispatched when legend label is clicked. - If the type is "clickMarker", dispatched when legend marker is clicked. - If the type is "hideItem", dispatched when user clicks on a legend item marker and hides corresponding object. - If the type is "rollOutItem", dispatched when user rolls-out of the legend item label (or whole item, if switchable is set to false). - If the type if "rollOverItem", dispatched when user rolls-over the legend item label (or whole item, if switchable is set to false). - If the type is "rollOutMarker", dispatched when user clicks out of a legend item marker and shows corresponding object. - If the type if "rollOverMarker", dispatched when user clicks on a legend item marker and shows corresponding object. - */ - - /** Adds event listener of the type "showItem" to the object. - @param type Always "showItem". - @param handler - */ - addListener(type: string, handler: (e: {/** Always "showItem". */ - type: string; dataItem: Object; chart: AmChart; - }) => void): void; - - /** Removes event listener from chart object. */ - removeListener(chart: AmChart, type: string, handler: any): void; - } - - /** StockLegend is a legend of StockPanel. */ - - class StockLegend extends AmLegend { - /** The text which will be displayed in the value portion of the legend when graph is comparable and at least one dataSet is selected for comparing. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents.value/open/close/low/high]], [[description]]. [[percents.value]]% */ - - valueTextComparing: string; - /** The text which will be displayed in the value portion of the legend. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. [[value]] */ - - valueTextRegular: string; - } - - /** StockPanel class creates stock panels (charts). AmStockChart can have multiple Stock panels. */ - - class StockPanel extends AmSerialChart { - /** Specifies whether x button will be displayed near the panel. This button allows turning panel off. */ - allowTurningOff: boolean; - /** If true, drawing icons will be displayed in top-right corner. */ - drawingIconsEnabled: boolean; - /** Specifies on which value axis user can draw trend lines. Set drawingIconsEnabled to true if you want drawing icons to be visible. First value axis will be used if not set here. */ - drawOnAxis: ValueAxis; - /** Specifies if all trend lines should be erased when erase button is clicked. If false, trend lines can be erased one by one. */ - eraseAll: boolean; - /** Size of trend line drawing icons. If you change this size, you should update icon images if you want them to look properly. - @default 18 - */ - iconSize: number; - /** Relative height of panel. Possible values 0 - 100. */ - percentHeight: number; - /** Specifies when values should be recalculated to percents. Possible values are: "never", "always", "whenComparing". whenComparing */ - recalculateToPercents: string; - /** Specifies whether this panel will show category axis. - @default true - */ - showCategoryAxis: boolean; - /** */ - stockGraphs: StockGraph[]; - /** Stock chart legend. */ - stockLegend: StockLegend; - /** Title of a panel. Note, StockLegend should be added in order title to be displayed. */ - title: string; - /** Trend line opacity. - @default 1 - */ - trendLineAlpha: number; - /** Trend line color. #00CC00 */ - trendLineColor: string; - /** Trend line dash length. */ - trendLineDashLength: number; - /** Trend line thickness. - @default 2 - */ - trendLineThickness: number; - /** Adds a graph to the panel. */ - addStockGraph(graph: StockGraph): void; - /** Removes graph from the panel. */ - removeStockGraph(graph: StockGraph): void; - } - - /** AmChart is a base class of all charts. It can not be instantiated explicitly. AmCoordinateChart, AmPieChart and AmMap extend AmChart class. */ - class AmChart { - /** used when constructing a chart with a theme */ - constructor(theme?: any); - /** Specifies, if class names should be added to chart elements. */ - addClassNames: boolean; - /** Array of Labels. Example of label object, with all possible properties: -{"x": 20, "y": 20, "text": "this is label", "align": "left", "size": 12, "color": "#CC0000", "alpha": 1, "rotation": 0, "bold": true, "url": "http://www.amcharts.com"} */ - allLabels: Label[]; - /** Set this to false if you don't want chart to resize itself whenever its parent container size changes. */ - autoResize: boolean; - /** Opacity of background. Set it to >0 value if you want backgroundColor to work. However we recommend changing div's background-color style for changing background color. */ - backgroundAlpha: number; - /** Background color. You should set backgroundAlpha to >0 value in order background to be visible. We recommend setting background color directly on a chart's DIV instead of using this property. #FFFFFF */ - backgroundColor: string; - /** The chart creates AmBalloon class itself. If you want to customize balloon, get balloon instance using this property, and then change balloon's properties. AmBalloon */ - balloon: AmBalloon; - /** Opacity of chart's border. Value range is 0 - 1. */ - borderAlpha: number; - /** Color of chart's border. You should set borderAlpha >0 in order border to be visible. We recommend setting border color directly on a chart's DIV instead of using this property. #000000 */ - borderColor: string; - /** This prefix is added to all class names which are added to all visual elements of a chart in case addClassNames is set to true. */ - classNamePrefix: string; - /** Text color. #000000 */ - color: string; - /** Non-commercial version only. Specifies position of link to amCharts site. Allowed values are: top-left, top-right, bottom-left and bottom-right. - @default 'top-left' - */ - creditsPosition: string; - /** Array of data objects, for example: [{country:"US", value:524},{country:"UK", value:624},{country:"Lithuania", value:824}]. You can have any number of fields and use any field names. In case of AmMap, data provider should be MapData object. */ - dataProvider: any[]; - /** Decimal separator. - @Default . */ - decimalSeparator: string; - /** Using this property you can add any additional information to SVG, like SVG filters or clip paths. The structure of this object should be identical to XML structure of a object you are adding, only in JSON format. */ - defs: any; - /** Export config. Specifies how export to image/data export/print/annotate menu will look and behave. You can find a lot of examples in amcharts/plugins/export folder. */ - export: ExportSettings; - /** Font family. Verdana */ - fontFamily: string; - /** Font size. - @default 11 - */ - fontSize: string; - /** If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result. - @Default false - */ - handDrawn: boolean; - /** Defines by how many pixels hand-drawn line (when handDrawn is set to true) will fluctuate. - @Default 2 - */ - handDrawScatter: number; - /** Defines by how many pixels line thickness will fluctuate (when handDrawn is set to true). - @Default 1 - */ - handDrawThickness: number; - /** Time, in milliseconds after which balloon is hidden if the user rolls-out of the object. Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas. Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class. - @Default 150 - */ - hideBalloonTime: number; - /** Legend of a chart. */ - legend: AmLegend; - /** Reference to the div of the legend. */ - legendDiv: HTMLElement; - /** You can add listeners of events using this property. Example: listeners = [{"event":"dataUpdated", "method":handleEvent}]; */ - listerns: Object[]; - /** This setting affects touch-screen devices only. If a chart is on a page, and panEventsEnabled are set to true, the page won't move if the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device, the user won’t be able to move the page at all. That's why the default value is "false". If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users, you should set panEventsEnabled to true. */ - panEventsEnabled: boolean; - /** Specifies absolute or relative path to amCharts files, i.e. "amcharts/". (where all .js files are located) - If relative URLs are used, they will be relative to the current web page, displaying the chart. - You can also set path globally, using global JavaScript variable AmCharts_path. If this variable is set, and "path" is not set in chart config, the chart will assume the path from the global variable. This allows setting amCharts path globally. I.e.: - var AmCharts_path = "/libs/amcharts/"; - "path" parameter will be used by the charts to locate it's files, like images, plugins or patterns.*/ - path: string; - /** Specifies path to the folder where images like resize grips, lens and similar are. - IMPORTANT: Since V3.14.12, you should use "path" to point to amCharts directory instead. The "pathToImages" will be automatically set and does not need to be in the chart config, unless you keep your images separately from other amCharts files. */ - pathToImages: string; - /** Precision of percent values. -1 means percent values won't be rounded at all and show as they are. - @default 2 - */ - percentPrecision: number; - /** Precision of values. -1 means values won't be rounded at all and show as they are. - @Default 1*/ - precision: number; - /** Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e+3,prefix:"k"},{number:1e+6,prefix:"M"},{number:1e+9,prefix:"G"},{number:1e+12,prefix:"T"},{number:1e+15,prefix:"P"},{number:1e+18,prefix:"E"},{number:1e+21,prefix:"Z"},{number:1e+24,prefix:"Y"}] */ - prefixesOfBigNumbers: any[]; - /** Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e-24, prefix:"y"},{number:1e-21, prefix:"z"},{number:1e-18, prefix:"a"},{number:1e-15, prefix:"f"},{number:1e-12, prefix:"p"},{number:1e-9, prefix:"n"},{number:1e-6, prefix:"μ"},{number:1e-3, prefix:"m"}] */ - prefixesOfSmallNumbers: any[]; - /** Theme of a chart. Config files of themes can be found in amcharts/themes/ folder. More info about using themes. */ - theme: string; - /** Thousands separator. - @default . - */ - thousandsSeparator: string; - /** Array of Title objects. */ - titles: Title[]; - /** Type of a chart. Required when creating chart using JSON. Possible types are: serial, pie, xy, radar, funnel, gauge, map, stock. */ - type: string; - /** If true, prefixes will be used for big and small numbers. You can set arrays of prefixes via prefixesOfSmallNumbers and prefixesOfBigNumbers properties. */ - usePrefixes: boolean; - /** Read-only. Indicates current version of a script. */ - version: string; - /** Adds a label on a chart. - You can use it for labeling axes, adding chart title, etc. x and y coordinates can be set in number, percent, or a number with ! in front of it - coordinate will be calculated from right or bottom instead of left or top. - x - horizontal coordinate - y - vertical coordinate - text - label's text - align - alignment (left/right/center) - size - text size - color - text color - rotation - angle of rotation - alpha - label alpha - bold - specifies if text is bold (true/false), - url - url - */ - addLabel(x: number|string, y: number|string, text: string, align: string, size?: number, color?: string, rotation?: number, alpha?: number, bold?: boolean, url?: string): any; - /** Adds a legend to the chart. - By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter. - (NOTE: This method will not work on StockPanel.) - @param legend - @param legendDivId - Id of the legend div (optional). - */ - addLegend(legend: AmLegend, legendDivId?: string): void; - /** Adds a legend to the chart. - By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter. - (NOTE: This method will not work on StockPanel.) - @param legend - @param legendDiv - Legend div (optional). - */ - addLegend(legend: AmLegend, legendDiv: HTMLElement): void; - - /** Adds title to the top of the chart. Pie, Radar positions are updated so that they won't overlap. Plot area of Serial/XY chart is also updated unless autoMargins property is set to false. You can add any number of titles - each of them will be placed in a new line. To remove titles, simply clear titles array: chart.titles = []; and call chart.validateNow() method. text - text of a title size - font size color - title color alpha - title opacity bold - boolean value indicating if title should be bold. */ - addTitle(text: string, size: number, color: string, alpha: number, bold: boolean): void; - /** Clears the chart area, intervals, etc. */ - clear(): void; - /** Removes all labels added to the chart. */ - clearLabels(): void; - /** Use this method to force the chart to resize to it's current container size. */ - invalidateSize(): void; - /** Removes chart's legend. */ - removeLegend(): void; - /** This method should be called after data in your data provider changed or a new array was set to dataProvider. After calling this method the chart will parse data and redraw. */ - validateData(): void; - /** This method should be called after you changed one or more properties of any class. The chart will redraw after this method is called. */ - validateNow(): void; - - /** Adds chart to the specified DIV. - @param container DIV object which will hold the chart. */ - write(container: HTMLElement): void; - /** Adds chart to the specified DIV. - @param container Id of a DIV which will hold the chart. */ - write(container: string): void; - - /** Adds event listener of the type "dataUpdated" or "init" to the object. - @param type "dataUpdated" or "init". - @param handler - If the type is "dataUpdated". - Dispatched when chart is build for the first time or after validateData() method was called. - If the type is "init". - Dispatched when chart is build for the first time. - */ - addListener(type: string, handler: (e: { - /** Either "dataUpdated" or "init". */ - type: string; - chart: AmChart; - }) => void): void; - /** Removes event listener from chart object. */ - removeListener(chart: AmChart, type: string, handler: any): void; - } - - /** AmCoordinateChart is a base class of AmRectangularChart. It can not be instantiated explicitly. */ - - class AmCoordinateChart extends AmChart { - /** Read-only. Array, holding processed chart's data. */ - chartData: Object[]; - /** Specifies the colors of the graphs if the lineColor of a graph is not set. - It there are more graphs then colors in this array, the chart picks random color. - @default ['#FF6600', '#FCD202', '#B0DE09', '#0D8ECF', '#2A0CD0', '#CD0D74', '#CC0000', '#00CC00', '#0000CC', '#DDDDDD', '#999999', '#333333', '#990000'] */ - colors: string[]; - /** The array of graphs belonging to this chart. - To add/remove graph use addGraph/removeGraph methods instead of adding/removing graphs directly to array. - */ - graphs: AmGraph[]; - /** Specifies if grid should be drawn above the graphs or below. Will not work properly with 3D charts. - @default false - */ - gridAboveGraphs: boolean; - /** Instead of adding guides to the axes, you can push all of them to this array. In case guide has category or date defined, it will automatically will be assigned to the category axis. Otherwise to first value axis, unless you specify a different valueAxis for the guide. */ - guides: Guide[]; - /** Specifies whether the animation should be sequenced or all objects should appear at once. - @default true - */ - sequencedAnimation: boolean; - /** The initial opacity of the column/line. - If you set startDuration to a value higher than 0, the columns/lines will fade in from startAlpha. - Value range is 0 - 1. - @default 1 - */ - startAlpha: number; - /** Duration of the animation, in seconds. */ - startDuration: number; - /** Animation effect. - Possible values are ">", "<", elastic" and "bounce". - @default "elastic" - */ - startEffect: string; - /** Target of url. - @default this - */ - urlTarget: any; - /** The array of value axes. - To add/remove value axis use addValueAxis/removeValueAxis methods instead of adding/removing axes directly to array. - Chart creates one value axis automatically, so if you need only one value axis, you don't need to create it. - */ - valueAxes: any[]; - /** Adds a graph to the chart. - */ - addGraph(graph: AmGraph): void; - /** Adds a legend to the chart. By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter. (NOTE: This method will not work on StockPanel.) */ - /** Adds value axis to the chart. - One value axis is created automatically, so if you don't want to change anything or add more value axes, you don't need to add it. - */ - addValueAxis(axis: ValueAxis): void; - /** You can trigger the animation of the chart. */ - animateAgain(): void; - - /** AmGraph Returns graph by id. */ - getGraphById(graphId: string): AmGraph; - - /** Returns value axis by id.*/ - getValueAxisById(axisId: string): ValueAxis; - - /** Hide the graph (if it is visible). Usually this method is called from the Legend, when you click on the legend marker. - */ - hideGraph(graph: AmGraph): void; - - /** Hide value balloon of a graph. Usually this method is called from the Legend, when you click on the legend text.*/ - hideGraphsBalloon(graph: AmGraph): void; - - /** Highlight the graph. Usually this method is called from the Legend, when you roll-over the legend entry.*/ - highlightGraph(graph: AmGraph): void; - - /** Removes graph from the chart.*/ - removeGraph(graph: AmGraph): void; - - /** Removes value axis from the chart. When you remove value axis, all graphs assigned to this axis are also removed. */ - removeValueAxis(axis: ValueAxis): void; - - /** Show the graph (if it is hidden). Usually this method is called from the Legend, when you click on the legend marker.*/ - showGraph(graph: AmGraph): void; - - /** Show value balloon of a graph. Usually this method is called from the Legend, when you click on the legend text.*/ - showGraphsBalloon(graph: AmGraph): void; - - /** UnhighlightGraph the graph. Usually this method is called from the Legend, when you roll-out the legend entry.*/ - unhighlightGraph(graph: AmGraph): void; - /** Adds event listener of the type "clickGraphItem" or "doubleClickGraphItem" or "rightClickGraphItem" or "rollOutGraphItem" or "rollOverGraphItem" to the object. - @param type Either "clickGraphItem" or "doubleClickGraphItem" or "rightClickGraphItem" or "rollOutGraphItem" or "rollOverGraphItem". - @param handler Dispatched when user clicks on the data item (column/bullet) - */ - addListener(type: string, handler: (e: { - /** Either "clickGraphItem" or "doubleClickGraphItem" or "rightClickGraphItem" or "rollOutGraphItem" or "rollOverGraphItem". */ - type: string; - graph: AmGraph; - item: GraphDataItem; - index: number; - chart: AmChart; - }) => void): void; - } - - /** GraphDataItem holds all the information about the graph's data item. When working with a chart, you do not create GraphDataItem objects or change it's properties directly. GraphDataItem is passed to you by events when user interacts with data item on the chart. The list of properties below will help you to extract data item's value/coordinate/etc. */ - class GraphDataItem { - /** Opacity of the data item. */ - alpha: number; - /** Bullet type. */ - bullet: string; - /** Bullet size. */ - bulletSize: number; - /** Category value. */ - category: string; - /** Color of the data item. */ - color: string; - /** Custom bullet (path to file name). */ - customBullet: string; - /** Original object from data provider. */ - dataContext: Object; - /** Description. */ - description: string; - /** Array of colors of the data item, used by column and candlestick chart only. */ - fillColors: any[]; - /** Object which holds percents when recalculateToPercents is set to true. */ - percents: Object; - /** SerialDataItem of this graphDataItem */ - serialDataItem: SerialDataItem; - /** url */ - url: string; - /** Object which holds values of the data item (value, open, close, low, high). */ - values: Object; - /** x coordinate of the data item. */ - x: number; - /** y coordinate of the data item. */ - y: number; - } - - /** SerialDataItem holds all the information about each series. When working with a chart, you do not create SerialDataItem objects or change it's properties directly. Consider properties of a SerialDataItem read-only - change values in chart's data provider if you need to. When serial chart parses dataProvider, it generates "chartData" array. Objects of this array are SerialDataItem objects. */ - class SerialDataItem { - - /** You can access each GraphDataItem using this object. The data structure is: graphDataItem = serialDataItem.axes[axisId].graphs[graphId]. */ - axes: Object; - - /** category value. String if parseDates is false, Date if true. */ - category: any; - - /** Timestamp of a series date. Avalable only if parseDates property of CategoryAxis is set to true. */ - time: number; - - /** Coordinate (horizontal or vertical, depends on chart's rotate property) of the series. */ - x: number; - } - - class CategoryAxis extends AxisBase { - - /** When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, like month, in bold. Set this to false to disable the functionality. - @default true - */ - boldPeriodBeginning: boolean; - - /** Date formats of different periods. Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, WW - weeks, YYYY - years. Check this page for date formatting strings. [{period:'fff',format:'JJ:NN:SS'},{period:'ss',format:'JJ:NN:SS'},{period:'mm',format:'JJ:NN'},{period:'hh',format:'JJ:NN'},{period:'DD',format:'MMM DD'},{period:'WW',format:'MMM DD'},{period:'MM',format:'MMM'},{period:'YYYY',format:'YYYY'}] */ - dateFormats: any[]; - - /** In case your category axis values are Date objects and parseDates is set to true, the chart will parse dates and will place your data points at irregular intervals. However if you want dates to be parsed (displayed on the axis, baloons, etc), but data points to be placed at equal intervals (omiting dates with no data), set equalSpacing to true. */ - equalSpacing: boolean; - - /** Field in data provider which specifies if the category value should always be shown. For example: categoryAxis.forceShowField = "forceShow"; Field in data provider which specifies if the category value should always be shown. For example: categoryAxis.forceShowField = "forceShow"; - And in data: - {category:"one", forceShow:true, value:100} - Note, this works only when parseDates is set to false.*/ - forceShowField: string; - - /** Specifies if a grid line is placed on the center of a cell or on the beginning of a cell. Possible values are: "start" and "middle" This setting doesn't work if parseDates is set to true. middle */ - gridPosition: string; - - /** Specifies if minor grid should be displayed. - NOTE: If equalSpacing is set to true, this setting will be ignored. - @default false*/ - minorGridEnabled: boolean; - - /** Specifies the shortest period of your data. This should be set only if parseDates is set to "true". Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, YYYY - years. DD */ - minPeriod: string; - - /** In case your category axis values are Date objects, set this to true. In this case the chart will parse dates and will place your data points at irregular intervals. If you want dates to be parsed, but data points to be placed at equal intervals, set both parseDates and equalSpacing to true. */ - parseDates: boolean; - - /** Specifies whether the graph should start on axis or not. In case you display columns, it is recommended to set this to false. If parseDates is set to true, startOnAxis will allways be false, unless equalSpacing is set to true. */ - startOnAxis: boolean; - - /** Works only when parseDates is set to true and equalSpacing is false. If you set it to true, at the position where bigger period changes, - category axis will display date strings of bot small and big period, in two rows. - @default false*/ - twoLineMode: boolean; - - /** Use line color for bullet - @default false*/ - useLineColorForBulletBorder: boolean; - /** Number returns coordinate of a category. Works only if parseDates is false. If parseDates is true, use dateToCoordinate method. category - String */ - categoryToCoordinate(category: string): void; - - /** date - Date object Returns Date of the coordinate, in case parseDates is set to true and equalSpacing is set to false. coordinate - Number */ - coordinateToDate(coordinate: number): void; - - /** Number Returns coordinate of the date, in case parseDates is set to true. if parseDates is false, use categoryToCoordinate method. date - Date object */ - dateToCoordinate(date: Date): void; - - /** Number Returns index of the category which is most close to specified coordinate. x - coordinate */ - xToIndex(x: number): void; - } - - /** ChartScrollbar class displays chart scrollbar. Supported by AmSerialChart and AmXYChart. - @example - var chart = new AmCharts.AmSerialChart(); - var chartScrollbar = new AmCharts.ChartScrollbar(); - chart.addChartScrollbar(chartScrollbar); - */ - class ChartScrollbar { - /** Specifies whether number of gridCount is specified automatically, acoarding to the axis size. */ - autoGridCount: boolean; - /** Background opacity. - @default 1 - */ - backgroundAlpha: number; - /** Background color of the scrollbar. - @default #D4D4D4 - */ - backgroundColor: string; - /** Read-only. Category axis of the scrollbar. */ - categoryAxis: CategoryAxis; - /** Text color. Will use chart's color if not set. */ - color: string; - /** Specifies which graph will be displayed in the scrollbar. Only Serial chart's scrollbar can display a graph. */ - graph: AmGraph; - /** Graph fill opacity. Value range is 0 - 1. 0.1 */ - graphFillAlpha: number; - /** Graph fill color. #000000 */ - graphFillColor: string; - /** Graph line opacity. Value range is 0 - 1. */ - graphLineAlpha: number; - /** Graph line color. #000000 */ - graphLineColor: string; - /** by default the graph type is the same as the original graph's type, however in case of candlestick or ohlc you might want to show line graph in the scrollbar. Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". */ - graphType: string; - /** Grid opacity. Value range is 0 - 1. 0.7 */ - gridAlpha: number; - /** Grid color. #FFFFFF */ - gridColor: string; - /** The number of grid lines. */ - gridCount: number; - /** Specifies whether resize grips are hidden when mouse is away from the scrollbar. */ - hideResizeGrips: boolean; - /** Specifies whether scrollbar has a resize feature. - @default true - */ - resizeEnabled: boolean; - /** Height (width, if chart is rotated) of a scrollbar. 20 */ - scrollbarHeight: number; - /** Duration of scrolling, when the user clicks on scrollbar's background, in seconds. - @default 2 - 3*/ - scrollDuration: number; - /** Selected backround opacity. - @default 1 - */ - selectedBackgroundAlpha: number; - /** Selected background color. #EFEFEF */ - selectedBackgroundColor: string; - /** Selected graph's fill opacity. Value range is 0 - 1. 0.5 */ - selectedGraphFillAlpha: number; - /** Selected graph's fill color. #000000 */ - selectedGraphFillColor: string; - /** Selected graph's line opacity. Value range is 0 - 1. */ - selectedGraphLineAlpha: number; - /** Selected graph's line color. #000000 */ - selectedGraphLineColor: string; - /** Specifies if the chart should be updated while dragging/resizing the scrollbar or only at the moment when user releases mouse button. */ - updateOnReleaseOnly: boolean; - } - - /** AmRectangularChart is a base class of AmSerialChart and AmXYChart. It can not be instantiated explicitly.*/ - class AmRectangularChart extends AmCoordinateChart { - /** The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0). - @default 0 - */ - angle: number; - /** Space left from axis labels/title to the chart's outside border, if autoMargins set to true. - @default 10 - */ - autoMarginOffset: number; - /** Specifies if margins of a chart should be calculated automatically so that labels of axes would fit. The chart will adjust only margins with axes. Other margins will use values set with marginRight, marginTop, marginLeft and marginBottom properties. - @default true - */ - autoMargins: boolean; - /** Cursor of a chart. */ - chartCursor: ChartCursor; - /** Chart scrollbar. */ - chartScrollbar: ChartScrollbar; - /** The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0). - @default 0*/ - depth3D: number; - /** Number of pixels between the container's bottom border and plot area. This space can be used for bottom axis' values. If autoMargin is true and bottom side has axis, this property is ignored. - @default 20 - */ - marginBottom: number; - /** Number of pixels between the container's left border and plot area. This space can be used for left axis' values. If autoMargin is true and left side has axis, this property is ignored. - @default 20 - */ - marginLeft: number; - /** Number of pixels between the container's right border and plot area. This space can be used for Right axis' values. If autoMargin is true and right side has axis, this property is ignored. - @default 20 - */ - marginRight: number; - /** Flag which should be set to false if you need margins to be recalculated on next chart.validateNow() call. - @default false - */ - marginsUpdated: boolean; - /** Number of pixels between the container's top border and plot area. This space can be used for top axis' values. If autoMargin is true and top side has axis, this property is ignored. - @default 20 - */ - marginTop: number; - /** The opacity of plot area's border. Value range is 0 - 1. - @default 0 - */ - plotAreaBorderAlpha: number; - /** The color of the plot area's border. Note, the it is invisible by default, as plotAreaBorderAlpha default value is 0. Set it to a value higher than 0 to make it visible. - @default '#000000'*/ - plotAreaBorderColor: string; - /** Opacity of plot area. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used. - @default 0 - */ - plotAreaFillAlphas: number; - /** You can set both one color if you need a solid color or array of colors to generate gradients, for example: ["#000000", "#0000CC"] - @default '#FFFFFF' - */ - plotAreaFillColors: any; - /** If you are using gradients to fill the plot area, you can use this property to set gradient angle. The only allowed values are horizontal and vertical: 0, 90, 180, 270. - @default 0 - */ - plotAreaGradientAngle: number; - /** Array of trend lines added to a chart. You can add trend lines to a chart using this array or access already existing trend lines */ - trendLines: TrendLine[]; - /** Opacity of zoom-out button background. - @default 0 - */ - zoomOutButtonAlpha: number; - /** Zoom-out button background color. - @default '#e5e5e5' - */ - zoomOutButtonColor: string; - /** Name of zoom-out button image. In the images folder there is another lens image, called lensWhite.png. You might want to have white lens when background is dark. Or you can simply use your own image. - @default lens.png - */ - zoomOutButtonImage: string; - /** Size of zoom-out button image - @default: 17 - */ - zoomOutButtonImageSize: number; - /** Padding around the text and image. - @default: 8 - */ - zoomOutButtonPadding: number; - /** Opacity of zoom-out button background when mouse is over it. - @default: 1 - */ - zoomOutButtonRollOverAlpha: number; - /** Text in the zoom-out button. Show all */ - zoomOutText: string; - - /** Adds a ChartCursor object to a chart */ - addChartCursor(cursor: ChartCursor): void; - /** Adds a ChartScrollbar to a chart */ - addChartScrollbar(scrollbar: ChartScrollbar): void; - /** Adds a TrendLine to a chart. - You should call chart.validateNow() after this method is called in order the trend line to be visible. */ - addTrendLine(trendLine: TrendLine): void; - /** Removes cursor from the chart */ - removeChartCursor(): void; - /** Removes scrollbar from the chart */ - removeChartScrollbar(): void; - /** Removes a trend line from a chart. - You should call chart.validateNow() in order the changes to be visible. */ - removeTrendLine(trendLine: TrendLine): void; - } - - /* Trend lines are straight lines indicating trends, might also be used for some different purposes. Can be used by Serial and XY charts. To add/remove trend line, use chart.addTrendLine(trendLine)/chart.removeTrendLine(trendLine) methods or simply pass array of trend lines: chart.trendLines = [trendLine1, trendLine2]. - @example - var trendLine = new AmCharts.TrendLine(); - trendLine.initialDate = new Date(2012, 0, 2, 12); // 12 is hour - to start trend line in the middle of the day - trendLine.finalDate = new Date(2012, 0, 11, 12); - trendLine.initialValue = 10; - trendLine.finalValue = 19; - trendLine.lineColor = "#CC0000"; - chart.addTrendLine(trendLine); - */ - class TrendLine { - - } - - /** ChartCursor is a class which displays a cursor which follows the mouse. In case of Serial chart it also shows value and category balloons. - @example - var chart = new AmCharts.AmSerialChart(); - var chartCursor = new AmCharts.ChartCursor(); - chart.addChartCursor(chartCursor); - */ - class ChartCursor { - /** Specifies if bullet for each graph will follow the cursor. */ - bulletsEnabled: boolean; - /** Size of bullets, following the cursor. - @default 8 - */ - bulletSize: number; - /** Opacity of the category balloon. - @default 1 - */ - categoryBalloonAlpha: number; - /** Color of the category balloon. cursorColor is used if not set. */ - categoryBalloonColor: string; - /** Category balloon date format (used only if category axis parses dates). Check this page for instructions on how to format dates. MMM DD, YYYY */ - categoryBalloonDateFormat: string; - /** Specifies whether category balloon is enabled. - @default true - */ - categoryBalloonEnabled: boolean; - /** Text color. #FFFFFF */ - color: string; - /** Opacity of the cursor line. 1 */ - cursorAlpha: number; - /** Color of the cursor line. #CC0000 */ - cursorColor: string; - /** Specifies where the cursor line should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). If you want the cursor to follow mouse and not to glue to the nearest data point, set "mouse" here. Possible values are: "start", "middle", "mouse". */ - cursorPosition: string; - /** Specifies whether cursor is enabled. - @default true - */ - enabled: boolean; - /** If set to true, instead of a cursor line user will see a fill which width will always be equal to the width of one data item. - Recommend setting cursorAlpha to 0.1 or some other small number if using this feature. - @default false*/ - fullWidth: boolean; - /** If this is set to true, only one balloon at a time will be displayed. Note, this is quite CPU consuming. */ - oneBalloonOnly: boolean; - /** If this is set to true, the user will be able to pan the chart (Serial only) instead of zooming. */ - pan: boolean; - /** Opacity of the selection. */ - selectionAlpha: number; - /** Specifies if cursor should only mark selected area but not zoom-in after user releases mouse button. */ - selectWithoutZooming: boolean; - /** Specifies whether value balloons are enabled. In case they are not, the balloons might be displayed anyway, when the user rolls-over the column or bullet. - @default true - */ - valueBalloonsEnabled: boolean; - /** Specifies if the user can zoom-in the chart. If pan is set to true, zoomable is switched to false automatically. - @default true - */ - zoomable: boolean; - /** Indicates if currently user is selecting some chart area to zoom-in. */ - zooming: boolean; - - - /** Hides cursor. */ - hideCursor(): void; - /** You can force cursor to appear at specified cateogry or date. */ - showCursorAt(category: string): void; - /** Adds event listener of the type "changed" to the object. - @param type Always "changed". - @param handler Dispatched when cursor position is changed. "index" is a series index over which chart cursors currently is. "zooming" specifies if user is currently zooming (is selecting) the chart. mostCloseGraph property is set only when oneBalloonOnly is set to true.*/ - addListener(type: string, handler: (e: {/** Always "changed". */ - type: string; index: number; zooming: boolean; mostCloseGraph: AmGraph; chart: AmChart; - }) => void): void; - /** Adds event listener of the type "onHideCursor" to the object. - @param type Always "onHideCursor". - @param handler Dispatched when cursor is hidden.*/ - addListener(type: string, handler: (e: {/** Always "onHideCursor". */ - type: string; chart: AmChart; - }) => void): void; - /** Adds event listener of the type "selected" or "zoomed" to the object. - @param type "selected" or "zoomed". - @param handler - If the type is "selected". Dispatched if selectWithoutZooming is set to true and when user selects some period. start and end are indices or timestamp (when categoryAxis.parseDates is true) of selection start/end. - If the type is "zoomed". Dispatched when user zooms to some period. start and end are indices or timestamp (when categoryAxis.parseDates is true) of selection start/end. - */ - addListener(type: string, handler: (e: {/** Always "zoomed". */ - type: string; index: number; zooming: boolean; chart: AmChart; - }) => void): void; - - /** Removes event listener from chart object. */ - removeListener(chart: AmChart, type: string, handler: any): void; - } - - /** AmSerialChart is the class you have to use for majority of chart types. The supported chart types are: line, area, column, bar, step line, smoothed line, candlestick and OHLC. The chart can be rotated by 90 degrees so the column chart becomes bar chart. The chart supports simple and logarithmic scales, it can have multiple value axes. The chart can place data points at equal intervals or can parse dates and place data points at irregular intervals. - @example - var chartData = [{title:"sample 1",value:130},{title:"sample 2",value:26}]; - - var chart = new AmCharts.AmSerialChart(); - chart.categoryField = "title"; - chart.dataProvider = chartData; - - var graph = new AmCharts.AmGraph(); - graph.valueField = "value"; - graph.type = "column"; - graph.fillAlphas = 1; - chart.addGraph(graph); - - chart.write("chartdiv"); - */ - class AmSerialChart extends AmRectangularChart { - /** Date format of the graph balloon (if chart parses dates and you don't use chartCursor). - @default 'MMM DD, YYYY' - */ - balloonDateFormat: string; - /** Read-only. Chart creates category axis itself. If you want to change some properties, you should get this axis from the chart and set properties to this object. */ - categoryAxis: CategoryAxis; - /** Category field name tells the chart the name of the field in your dataProvider object which will be used for category axis values. */ - categoryField: string; - /** The gap in pixels between two columns of the same category. - @default 5 - */ - columnSpacing: number; - /** Space between 3D stacked columns. - @default 0 - */ - columnSpacing3D: number; - /** Relative width of columns. Value range is 0 - 1. - @default 0.8 - */ - columnWidth: number; - /** Read-only. If category axis parses dates endDate indicates date to which the chart is currently displayed. */ - endDate: Date; - /** Read-only. Category index to which the chart is currently displayed. */ - endIndex: number; - /** Maximum number of series allowed to select. */ - maxSelectedSeries: number; - /** The longest time span allowed to select (in milliseconds) for example, 259200000 will limit selection to 3 days. */ - maxSelectedTime: number; - /** The shortest time span allowed to select (in milliseconds) for example, 1000 will limit selection to 1 second. - @default 0 - */ - minSelectedTime: number; - /** Specifies if scrolling of a chart with mouse wheel is enabled. If you press shift while rotating mouse wheel, the chart will zoom-in/out. */ - mouseWheelScrollEnabled: boolean; - /** Specifies if zooming of a chart with mouse wheel is enabled. If you press shift while rotating mouse wheel, the chart will scroll. */ - mouseWheelZoomEnabled: boolean; - /** If you set this to true, the chart will be rotated by 90 degrees (the columns will become bars). */ - rotate: boolean; - /** Read-only. If category axis parses dates startDate indicates date from which the chart is currently displayed. */ - startDate: Date; - /** Read-only. Category index from which the chart is currently displayed. */ - startIndex: number; - /** Specifies if chart should zoom-out when data is updated. - @default true - */ - zoomOutOnDataUpdate: boolean; - - /** Number Returns index of the specified category value. value - series (category value) which index you want to find. */ - getCategoryIndexByValue(value: number): void; - /** Zooms out, charts shows all available data. */ - zoomOut(): void; - /** Zooms the chart by the value of the category axis. start - category value, String \\ end - category value, String */ - zoomToCategoryValues(start: Date, end: Date): void; - /** Zooms the chart from one date to another. start - start date, Date object \\ end - end date, Date object */ - zoomToDates(start: Date, end: Date): void; - /** Zooms the chart by the index of the category. start - start index, Number \\ end - end index, Number */ - zoomToIndexes(start: Date, end: Date): void; - } - - class PeriodSelector { - /** Date format of date input fields. Check [[http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateFormatter.html DD-MM-YYYY */ - dateFormat: string; - /** Text displayed next to "from" date input field. From: */ - fromText: string; - /** Specifies if period buttons with date range bigger than available data should be hidden. - @default true - */ - hideOutOfScopePeriods: boolean; - /** Specifies whether period selector displays "from" and "to" date input fields. - @default true - */ - inputFieldsEnabled: boolean; - /** Width of date input fields, in pixels. Works only if period selector is horizontal. - @default 100 - */ - inputFieldWidth: number; - /** Array of predefined period objects. Period object has 4 properties - period, count, label and selected. Possible period values are: "ss" - seconds, "mm" - minutes, "hh" - hours, "DD" - days, "MM" - months and "YYYY" - years. property "count" specifies how many periods this button will select. "label" will be displayed on a button and "selected" is a boolean which specifies if this button is selected when chart is initialized or not. Example: {period:"DD", count:10, label:"10 days", selected:false}. */ - periods: any[]; - /** Text displayed next to predefined period buttons. Zoom: */ - periodsText: string; - /** Possible values: "right", "left", "top", "bottom". bottom */ - position: string; - /** Specifies whether predefined period buttons should select a period from the beginning or the end of the data. */ - selectFromStart: boolean; - /** Text displayed next to "to" date input field. To: */ - toText: string; - /** Width of a period selector, when position is "left" or "right". - @default 180 - */ - width: number; - - /** Adds event listener to the object. - . -@param handler - Dispatched when dates in period selector input fields are changed or user clicks on one of the predefined period buttons. */ - - addListener(type: string, handler: (e: { - /** Always: "changed" */ - - type: string; - startDate: Date; - endDate: Date; - predefinedPeriod: string; - count: number; - }) => void): void; - - /** Removes event listener from chart object. */ - removeListener(chart: AmChart, type: string, handler: any): void; - } - - /** PanelsSettings settings set's settings for all StockPanels. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of StockPanel class will be used. */ - - class PanelsSettings { - /** The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0). */ - angle: number; - /** Opacity of panel background. Possible values are 1 and 0. Values like 0.5 will not make it half-transparent. */ - backgroundAlpha: number; - /** Background color of panels. Set backgroundAlpha to > 0 value in order to make background visible. #FFFFFF */ - backgroundColor: string; - /** The gap in pixels between two columns of the same category. */ - columnSpacing: number; - /** Relative width of columns. Valid values 0 - 1. */ - columnWidth: number; - /** The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0). */ - depth3D: number; - /** Font family. */ - fontFamily: string; - /** Font size. */ - fontSize: string; - /** Number of pixels between the container's bottom border and plot area. - @default 1 - */ - marginBottom: number; - /** Number of pixels between the container's left border and plot area. If your left valueAxis values ar not placed inside the plot area, you should set marginLeft to 80 or some close value. */ - marginLeft: number; - /** Number of pixels between the container's left border and plot area. If your right valueAxis values ar not placed inside the plot area, you should set marginRight to 80 or some close value. */ - marginRight: number; - /** Number of pixels between the container's top border and plot area. */ - marginTop: number; - /** Gap between panels. - @default 8 - */ - panelSpacing: number; - /** This setting affects touch-screen devices only. If a chart is on a page, and panEventsEnabled are set to true, the page won't move if the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device, the user won’t be able to move the page at all. That's why the default value is "false". If you think that selecting or or panning the chart is a primary purpose of your chart users, you should set panEventsEnabled to true. */ - panEventsEnabled: boolean; - /** The opacity of plot area's border. */ - plotAreaBorderAlpha: number; - /** The color of the plot area's border. */ - plotAreaBorderColor: string; - /** Opacity of plot area fill. */ - plotAreaFillAlphas: number; - /** Specifies the colors used to tint the background gradient fill of the plot area. String or Array of Strings */ - plotAreaFillColors: any; - /** Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e+3,prefix:"k"},{number:1e+6,prefix:"M"},{number:1e+9,prefix:"G"},{number:1e+12,prefix:"T"},{number:1e+15,prefix:"P"},{number:1e+18,prefix:"E"},{number:1e+21,prefix:"Z"},{number:1e+24,prefix:"Y"}] */ - prefixesOfBigNumbers: any[]; - /** Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e-24, prefix:"y"},{number:1e-21, prefix:"z"},{number:1e-18, prefix:"a"},{number:1e-15, prefix:"f"},{number:1e-12, prefix:"p"},{number:1e-9, prefix:"n"},{number:1e-6, prefix:"μ"},{number:1e-3, prefix:"m"}] */ - prefixesOfSmallNumbers: any[]; - /** Specifies whether the animation should be sequenced or all objects should appear at once. */ - sequencedAnimation: boolean; - /** The initial opacity of the column/line. If you set startDuration to a value higher than 0, the columns/lines will fade in from startAlpha. */ - startAlpha: number; - /** Duration of the animation, in seconds. */ - startDuration: number; - /** Possible values are: "linear", "<", ">" "<>", "elastic", "bounce". */ - startEffect: string; - /** If true, prefixes will be used for big and small numbers. */ - usePrefixes: boolean; - } - - /** DataSet is objects which holds all information about data. */ - - class DataSet { - /** Category field name in your dataProvider. */ - categoryField: string; - /** Color of the data set. One of colors from AmStockChart.colors array will be used if not set. */ - color: string; - /** Whether this data set is selected for comparing. If you change this property, you should call stockChart.validateData() method in order the changes to be applied. */ - compared: boolean; - /** Data provider of the data set. */ - dataProvider: any[]; - /** Array of field mappings. Field mapping is an object with fromField and toField properties. fromField is a name of your value field in dataProvider. toField might be chosen freely, it will be used to set value/open/close/high/low fields for the StockGraph. Example: {fromField:"val1", toField:"value"}. */ - fieldMappings: any[]; - /** Specifies whether this data set should be visible in "compare to" list. - @default true - */ - showInCompare: boolean; - /** Specifies whether this data set should be visible in "select" dropdown. - @default true - */ - showInSelect: boolean; - /** Array of StockEvent objects. */ - stockEvents: StockEvent[]; - /** DataSet title. */ - title: string; - } - - class StockGraph extends AmGraph { - /** Specifies whether this graph will be compared if some data set is selected for comparing. */ - comparable: boolean; - /** Specifies a field to be used to generate comparing graph. Note, this field is not the one used in your dataProvider, but toField from FieldMapping object. */ - compareField: string; - /** Balloon color of comparing graph. */ - compareGraphBalloonColor: string; - /** Balloon text of comparing graph. */ - compareGraphBalloonText: string; - /** Bullet of comparing graph. Possible values are: "square", "round", "line", "triangleUp", "triangleDown", "dashedLine", "bubble". */ - compareGraphBullet: string; - /** Bullet size of comparing graph. */ - compareGraphBulletSize: number; - /** Corner radius of comparing graph (if type is "column"). */ - compareGraphCornerRadiusTop: number; - /** Dash length of compare graph. */ - compareGraphDashLength: number; - /** Fill alpha of comparing graph. */ - compareGraphFillAlphas: number; - /** Fill color of comparing graph. */ - compareGraphFillColors: string; - /** Opacity of comparing graph line. */ - compareGraphLineAlpha: number; - /** Thickness of compare graph. */ - compareGraphLineThickness: number; - /** Type of comparing graph. Possible values are: "line", "column", "step", "smoothedLine." line */ - compareGraphType: string; - /** Specifies if compare graph is visible in legend. - @default true - */ - compareGraphVisibleInLegend: boolean; - /** When data is grouped to periods, the graph must know which period value should be used. Possible values are: "Open", "Low", "High", "Close", "Average" and "Sum". Close */ - periodValue: string; - /** Specifies whether data set color should be used as this graph's lineColor. - @default true - */ - useDataSetColors: boolean; - } - - /** StockEvent is object which holds information about event(bullet).Values from StockEventsSettings will be used if not set.Stock event bullet's size depends on it's graphs fontSize.When user rolls - over, clicks or rolls - out of the event bullet, AmStockChart dispatches events.*/ - class StockEvent { - /** Opacity of bullet background. - @default 1 - */ - backgroundAlpha: number; - /** Color of bullet background. #DADADA */ - backgroundColor: string; - /** Opacity of bullet border. - @default 1 - */ - borderAlpha: number; - /** Bullet border color. #888888 */ - borderColor: string; - /** The color of the event text. #000000 */ - color: string; - /** Date of an event. Must be Date object, not a string. */ - date: Date; - /** graph on which event will be displayed. */ - graph: StockGraph; - /** Roll-over background color. #CC0000 */ - rollOverColor: string; - /** Specifies if the event should be displayed on category axis */ - showOnAxis: boolean; - /** Letter which will be displayed on the event. Not all types can display letters. "text" type can display longer texts. */ - text: string; - /** Type of bullet. Possible values are: "flag", "sign", "pin", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "text", "arrowUp", "arrowDown". sign */ - type: string; - /** A URL to go to when user clicks the event. */ - url: string; - /** target of url, "_blank" for example. */ - urlTarget: string; - } - - /** Creates a label on the chart which can be placed anywhere, multiple can be assigned. */ - class Label { - /** @Default 'left' */ - align: string; - /** @Default 1 */ - alpha: number; - /** Specifies if label is bold or not. */ - bold: boolean; - /** Color of a label */ - color: string; - /** Unique id of a Label. You don't need to set it, unless you want to. */ - id: string; - /** Rotation angle. */ - rotation: number; - /** Text size */ - size: number; - /** Text of a label */ - text: string; - /** URL which will be access if user clicks on a label. */ - url: string; - /** X position of a label. */ - x: number | string; - /** y position of a label. */ - y: number | string; - } - /** Common settings of legends. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of StockLegend class will be used. */ - class LegendSettings { - /** Alignment of legend entries. Possible values are: "left", "right" and "center". */ - align: string; - /** Specifies if each legend entry should take the same space as the longest legend entry. */ - equalWidths: boolean; - /** Horizontal space between legend item and left/right border. */ - horizontalGap: number; - /** The text which will be displayed in the legend. Tag [[title]] will be replaced with the title of the graph. */ - labelText: string; - /** Space below the last row of the legend, in pixels. */ - marginBottom: number; - /** Space above the first row of the legend, in pixels. */ - marginTop: number; - /** Opacity of marker border. */ - markerBorderAlpha: number; - /** Marker border color. */ - markerBorderColor: string; - /** Thickness of the legend border. */ - markerBorderThickness: number; - /** The color of the disabled marker (when the graph is hidden). */ - markerDisabledColor: string; - /** Space between legend marker and legend text, in pixels. */ - markerLabelGap: number; - /** Size of the legend marker (key). */ - markerSize: number; - /** Shape of the legend marker (key). Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none". */ - markerType: string; - /** Specifies whether legend entries should be placed in reversed order. */ - reversedOrder: boolean; - /** Legend item text color on roll-over. */ - rollOverColor: string; - /** When you roll-over the legend entry, all other graphs can reduce their opacity, so that the graph you rolled-over would be distinguished. This property specifies the opacity of the graphs. */ - rollOverGraphAlpha: number; - /** Whether showing/hiding of graphs by clicking on the legend marker is enabled or not. */ - switchable: boolean; - /** Legend switch color. */ - switchColor: string; - /** Legend switch type (in case the legend is switchable). Possible values are: "x" and "v". */ - switchType: string; - /** Specifies whether the legend text is clickable or not. Clicking on legend text can show/hide value balloons if they are enabled. */ - textClickEnabled: boolean; - /** Specifies if legend labels should be use same color as corresponding markers. */ - useMarkerColorForLabels: boolean; - /** The text which will be displayed in the value portion of the legend when graph is comparable and at least one dataSet is selected for comparing. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. */ - valueTextComparing: string; - /** The text which will be displayed in the value portion of the legend. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. */ - valueTextRegular: string; - /** Width of the value text. Increase this value if your values do not fit in the allocated space. */ - valueWidth: number; - /** Vertical space between legend items, in pixels. */ - verticalGap: number; - - } - - /** DataSetSelector is a tool for selecting data set's as main and for comparing with main data set. */ - class DataSetSelector { - /** Text displayed in the "compare to" combobox (when position is "top" or "bottom"). Select... */ - comboBoxSelectText: string; - /** Text displayed near "compare to" list. Compare to: */ - compareText: string; - /** The maximum height of the Compare to field in pixels. - @default 150 - */ - listHeight: number; - /** Possible values: "right", "left", "top", "bottom". "top" and "bottom" positions has a limitation - only one data set can be selected for comparing. left */ - position: string; - /** Text displayed near "Select" dropDown. Select: */ - selectText: string; - /** Width of a Data set selector, when position is "left" or "right". - @default 180 - */ - width: number; - } - - /** AmBalloon is the class which generates balloons (datatips). Balloon follows the mouse when you roll-over the pie slice/line bullet/column/etc, chart indicator of serial charts displays value balloons and category balloon. Balloon instance is created by the chart automatically and can be accessed via "balloon" property of AmChart. Chart shows/hides and sets position for every balloon automatically, so all you need to do is to change balloon appearance, if you want to. - @example - var chart = new AmCharts.AmSerialChart(); - // get balloon intance - var balloon = chart.balloon; - // set properties - balloon.adjustBorderColor = true; - balloon.color = "#000000"; - balloon.cornerRadius = 5; - balloon.fillColor = "#FFFFFF"; - */ - class AmBalloon { - /** If this is set to true, border color instead of background color will be changed when user rolls-over the slice, graph, etc. */ - adjustBorderColor: boolean; - /** Balloon border opacity. Value range is 0 - 1. - @default 1 - */ - borderAlpha: number; - /** Balloon border color. #FFFFFF */ - borderColor: string; - /** Balloon border thickness. - @default 2 - */ - borderThickness: number; - /** Color of text in the balloon. #FFFFFF */ - color: string; - /** Balloon corner radius. - @default 6 - */ - cornerRadius: number; - /** Balloon background opacity. - @default 1 - */ - fillAlpha: number; - /** Balloon background color. Usually balloon background color is set by the chart. Only if "adjustBorderColor" is "true" this color will be used. #CC0000 */ - fillColor: string; - /** Size of text in the balloon. Chart's fontSize is used by default. */ - fontSize: string; - /** Horizontal padding of the balloon. - @default 8 - 3*/ - horizontalPadding: number; - /** The width of the pointer (arrow) "root". Only used if cornerRadius is 0. - @default 10 - */ - pointerWidth: number; - /** If cornerRadius of a balloon is >0, showBullet is set to true for value balloons when ChartCursor is used. If you don't want the bullet near the balloon, set it to false: chart.balloon.showBullet = false */ - showBullet: boolean; - /** Text alignment, possible values "left", "middle" and "right" middle */ - textAlign: string; - /** Color of the text shadow. #000000 */ - textShadowColor: string; - /** Vertical padding of the balloon. - @default 5 - */ - verticalPadding: number; - /** Hides balloon. */ - hide(): void; - /** Defines a square within which the balloon should appear. Bounds are set by chart class, you don't need to call this method yourself. */ - setBounds(left: number, top: number, right: number, bottom: number): void; - /** Sets coordinates the balloon should point to. */ - setPosition(x: number, y: number): void; - /** Specifies the text which should be displayed. */ - show(value: string): void; - } - - /** CategoryAxesSettings settings set's settings common for all CategoryAxes of StockPanels. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of CategoryAxis class will be used. */ - class CategoryAxesSettings { - /** Specifies whether number of gridCount is specified automatically, according to the axis size. - @default true - */ - autoGridCount: boolean; - /** Axis opacity. */ - axisAlpha: number; - /** Axis color. */ - axisColor: string; - /** Height of category axes. Set it to 0 if you set inside property to true. - @default 28 - */ - axisHeight: number; - /** Thickness of the axis. */ - axisThickness: number; - /** Text color. */ - color: string; - /** Length of a dash. */ - dashLength: number; - /** Date formats of different periods. Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, WW - weeks, YYYY - years. Check this page for date formatting strings. */ - dateFormats: any[]; - /** If you want data points to be placed at equal intervals (omiting dates with no data), set equalSpacing to true. */ - equalSpacing: boolean; - /** Fill opacity. Every second space between grid lines can be filled with fillColor. */ - fillAlpha: number; - /** Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills. */ - fillColor: string; - /** Text size. */ - fontSize: string; - /** Opacity of grid lines. */ - gridAlpha: number; - /** Color of grid lines. */ - gridColor: string; - /** Approximate number of grid lines. You should set autoGridCount to false in order this property not to be ignored. - @default 10 - */ - gridCount: number; - /** Thickness of grid lines. */ - gridThickness: number; - /** Periods to which data will be gruoped in case there are more data items in the selected period than specified in maxSeries property. ["ss", "10ss", "30ss", "mm", "10mm", "30mm", "hh", "DD", "WW", "MM", "YYYY"] */ - groupToPeriods: any[]; - /** Specifies whether values should be placed inside or outside of plot area. */ - inside: boolean; - /** Rotation angle of a label. */ - labelRotation: number; - /** Maximum series shown at a time. In case there are more data points in the selection than maxSeries, the chart will group data to longer periods, for example - you have 250 days in the selection, and maxSeries is 150 - the chart will group data to weeks. - @default 150 - */ - maxSeries: number; - /** Specifies the shortest period of your data. fff - millisecond, ss - second, mm - minute, hh - hour, DD - day, MM - month, YYYY - year. DD */ - minPeriod: string; - /** top or "bottom". */ - position: string; - /** Specifies whether the graph should start on axis or not. In case you display columns, it is recommended to set this to false. startOnAxis can be set to true only if equalSpacing is set to true. */ - startOnAxis: boolean; - /** Tick length. */ - tickLength: number; - } - - /** ChartCursorSettings settings set's settings for chart cursor. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of ChartCursor class will be used. */ - class ChartCursorSettings { - /** Specifies if bullet for each graph will follow the cursor. */ - bulletsEnabled: boolean; - /** Size of bullets, following the cursor. */ - bulletSize: number; - /** Opacity of the category balloon. */ - categoryBalloonAlpha: number; - /** Color of the category balloon. */ - categoryBalloonColor: string; - /** Array of date format objects. Date format object must have "period" and "format" items. Available periods are: fff - millisecond, ss - second, mm - minute, hh - hour, DD - date, WW - week, MM - month, YYYY - year. [{period:"YYYY", format:"YYYY"}, {period:"MM", format:"MMM, YYYY"}, {period:"WW", format:"MMM DD, YYYY"}, {period:"DD", format:"MMM DD, YYYY"}, {period:"hh", format:"JJ:NN"}, {period:"mm", format:"JJ:NN"}, {period:"ss", format:"JJ:NN:SS"}, {period:"fff", format:"JJ:NN:SS"}] */ - categoryBalloonDateFormats: any[]; - /** Specifies whether category balloon is enabled. */ - categoryBalloonEnabled: boolean; - /** Opacity of the cursor line. */ - cursorAlpha: number; - /** Color of the cursor line. */ - cursorColor: string; - /** Possible values: "start", "middle" and "mouse". */ - cursorPosition: string; - /** Set this to "false" if you don't want chart cursor to appear in your charts. - @default true - */ - enabled: boolean; - /** If this is set to true, the user will be able to pan the chart instead of zooming. */ - pan: boolean; - /** Specifies whether value balloons are enabled. In case they are not, the balloons might be displayed anyway, when the user rolls-over the column or bullet. */ - valueBalloonsEnabled: boolean; - /** Specifies if the user can zoom-in the chart. If pan is set to true, zoomable is switched to false automatically. */ - zoomable: boolean; - } - - /* ChartScrollbarSettings settings set's settings for chart scrollbar. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of ChartScrollbar class will be used.*/ - class ChartScrollbarSettings { - /** Specifies whether number of gridCount is specified automatically, according to the axis size. - @default true - */ - autoGridCount: boolean; - /** Background opacity. */ - backgroundAlpha: number; - /** Background color of the scrollbar. */ - backgroundColor: string; - /** Text color. */ - color: string; - /** Set false if you don't need scrollbar. - @default true - */ - enabled: boolean; - /** Font size. */ - fontSize: string; - /** Specifies which graph will be displayed in the scrollbar. */ - graph: AmGraph; - /** Graph fill opacity. */ - graphFillAlpha: number; - /** Graph fill color. */ - graphFillColor: string; - /** Graph line opacity. */ - graphLineAlpha: number; - /** Graph line color. */ - graphLineColor: string; - /** Type of chart scrollbar's graph. By default the graph type is the same as the original graph's type, however in case of candlestick or ohlc you might want to show line graph in the scrollbar. Possible values are: line, column, step, smoothedLine, candlestick, ohlc. */ - graphType: string; - /** Grid opacity. */ - gridAlpha: number; - /** Grid color. */ - gridColor: string; - /** Grid count. You should set autoGridCount to false in order this property to work. */ - gridCount: number; - /** Height of scrollbar, in pixels. - @default 40 - */ - height: number; - /** Specifies whether resize grips are hidden when mouse is away from the scrollbar. */ - hideResizeGrips: boolean; - /** Duration of scrolling, when the user clicks on scrollbar's background, in seconds. */ - scrollDuration: number; - /** Selected background opacity. */ - selectedBackgroundAlpha: number; - /** Selected background color. */ - selectedBackgroundColor: string; - /** Selected graph'sfill opacity. */ - selectedGraphFillAlpha: number; - /** Selected graph'sfill color. */ - selectedGraphFillColor: string; - /** Selected graph'sline opacity. */ - selectedGraphLineAlpha: number; - /** Selected graph's line color. */ - selectedGraphLineColor: string; - /** Specifies if the chart should be updated while dragging/resizing the scrollbar or only at the moment when user releases mouse button. Usefull when working with large data sets. - @default true - */ - updateOnReleaseOnly: boolean; - } - - /** AmGraph class displays all types of graphs - line, column, step line, smoothed line, ohlc and candlestick. - @example - var chart = new AmCharts.AmSerialChart(); - var graph = new AmCharts.AmGraph(); - graph.valueField = 'value'; - graph.type = 'column'; - graph.fillAlphas = 1; - chart.addGraph(graph); - */ - class AmGraph { - /** Name of the alpha field in your dataProvider. */ - alphaField: string; - /** Value balloon color. Will use graph or data item color if not set. */ - balloonColor: string; - /** If you set some function, the graph will call it and pass GraphDataItem and AmGraph object to it. This function should return a string which will be displayed in a balloon. */ - balloonFunction(graphDataItem: GraphDataItem, amGraph: AmGraph): string; - /** Balloon text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] [[value]] */ - balloonText: string; - /** Specifies if the line graph should be placed behind column graphs */ - behindColumns: boolean; - /** Type of the bullets. Possible values are: "none", "round", "square", "triangleUp", "triangleDown", "bubble", "custom". none */ - bullet: string; - /** Opacity of bullets. Value range is 0 - 1. - @default 1 - */ - bulletAlpha: number; - /** Bullet border opacity. - @default 1 - */ - bulletBorderAlpha: number; - /** Bullet border color. Will use lineColor if not set. */ - bulletBorderColor: string; - /** Bullet border thickness. - @default 2 - */ - bulletBorderThickness: number; - /** Bullet color. Will use lineColor if not set. */ - bulletColor: string; - /** Name of the bullet field in your dataProvider. */ - bulletField: string; - /** Bullet offset. Distance from the actual data point to the bullet. Can be used to place custom bullets above the columns. */ - bulletOffset: number; - /** Bullet size. - @default 8 - */ - bulletSize: number; - /** Name of the bullet size field in your dataProvider. */ - bulletSizeField: string; - /** Name of the close field (used by candlesticks and ohlc) in your dataProvider. */ - closeField: string; - /** Color of value labels. Will use chart's color if not set. */ - color: string; - /** Name of the color field in your dataProvider. */ - colorField: string; - /** Specifies whether to connect data points if data is missing. The default value is true. - @default true - */ - connect: boolean; - /** Corner radius of column. It can be set both in pixels or in percents. The chart's depth and angle styles must be set to 0. The default value is 0. Note, cornerRadiusTop will be applied for all corners of the column, JavaScript charts do not have a possibility to set separate corner radius for top and bottom. As we want all the property names to be the same both on JS and Flex, we didn't change this too. */ - cornerRadiusTop: number; - /** If bulletsEnabled of ChartCurosor is true, a bullet on each graph follows the cursor. You can set opacity of each graphs bullet. In case you want to disable these bullets for a certain graph, set opacity to 0. - @default 1 - */ - cursorBulletAlpha: number; - /** Path to the image of custom bullet. */ - customBullet: string; - /** Name of the custom bullet field in your dataProvider. */ - customBulletField: string; - /** Dash length. If you set it to a value greater than 0, the graph line will be dashed. */ - dashLength: number; - /** Name of the description field in your dataProvider. */ - descriptionField: string; - /** Opacity of fill. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used. */ - fillAlphas: number; - /** Fill color. Will use lineColor if not set. */ - fillColors: any; - /** Name of the fill colors field in your dataProvider. */ - fillColorsField: string; - /** You can set another graph here and if fillAlpha is >0, the area from this graph to fillToGraph will be filled (instead of filling the area to the X axis). */ - fillToGraph: AmGraph; - /** Size of value labels text. Will use chart's fontSize if not set. */ - fontSize: string; - /** Orientation of the gradient fills (only for "column" graph type). Possible values are "vertical" and "horizontal". vertical */ - gradientOrientation: string; - /** Specifies whether the graph is hidden. Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead. */ - hidden: boolean; - /** If there are more data points than hideBulletsCount, the bullets will not be shown. 0 means the bullets will always be visible. */ - hideBulletsCount: number; - /** Name of the high field (used by candlesticks and ohlc) in your dataProvider. */ - highField: string; - - /** Unique id of a graph. It is not required to set one, unless you want to use this graph for as your scrollbar's graph and need to indicate which graph should be used.*/ - id?: string; - - /** Whether to include this graph when calculating min and max value of the axis. - @default true - */ - includeInMinMax: boolean; - /** Name of label color field in data provider. */ - labelColorField: string; - /** Position of value label. Possible values are: "bottom", "top", "right", "left", "inside", "middle". Sometimes position is changed by the chart, depending on a graph type, rotation, etc. top */ - labelPosition: string; - /** Value label text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]]. */ - labelText: string; - /** Legend marker opacity. Will use lineAlpha if not set. Value range is 0 - 1. */ - legendAlpha: number; - /** Legend marker color. Will use lineColor if not set. */ - legendColor: string; - /** Legend value text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] You can also use custom fields from your dataProvider. If not set, uses Legend's valueText. */ - legendValueText: string; - /** Opacity of the line (or column border). Value range is 0 - 1. - @default 1 - */ - lineAlpha: number; - /** Color of the line (or column border). If you do not set any, the color from [[AmCoordinateChart */ - lineColor: string; - /** Name of the line color field (used by columns and candlesticks only) in your dataProvider. */ - lineColorField: string; - /** Specifies thickness of the graph line (or column border). - @default 1 - */ - lineThickness: number; - /** Name of the low field (used by candlesticks and ohlc) in your dataProvider. */ - lowField: string; - /** Legend marker type. You can set legend marker (key) type for individual graphs. Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble". */ - markerType: string; - /** Specifies size of the bullet which value is the biggest (XY chart). - @default 50 - */ - maxBulletSize: number; - /** Specifies minimum size of the bullet (XY chart). */ - minBulletSize: number; - /** If you use different colors for your negative values, a graph below zero line is filled with negativeColor. With this property you can define a different base value at which colors should be changed to negative colors. */ - negativeBase: number; - /** Fill opacity of negative part of the graph. Will use fillAlphas if not set. */ - negativeFillAlphas: number; - /** Fill color of negative part of the graph. Will use fillColors if not set. */ - negativeFillColors: any; //String /Array; - /** Color of the line (or column) when the values are negative. In case the graph type is candlestick or ohlc, negativeLineColor is used when close value is less then open value. */ - negativeLineColor: string; - /** Example: {precision:-1, decimalSeparator:'.', thousandsSeparator:','}. The graph uses this object's values to format the numbers. Uses chart's numberFormatter if not defined. */ - numberFormatter: Object; - /** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. */ - openField: string; - /**Precision of values. Will use chart's precision if not set any.*/ - precision: number; - /** Specifies where data points should be placed - on the beginning of the period (day, hour, etc) or in the middle (only when parseDates property of categoryAxis is set to true). This setting affects Serial chart only. Possible values are "start" and "middle". middle */ - pointPosition: string; - /** If graph's type is column and labelText is set, graph hides labels which do not fit into the column's space. If you don't want these labels to be hidden, set this to true. */ - showAllValueLabels: boolean; - /** Specifies whether the value balloon of this graph is shown when mouse is over data item or chart's indicator is over some series. - @default true - */ - showBalloon: boolean; - /** Specifies graphs value at which cursor is showed. This is only important for candlestick and ohlc charts, also if column chart has "open" value. Possible values are: "open", "close", "high", "low". close */ - showBalloonAt: string; - /** If the value axis of this graph has stack types like "regular" or "100%" You can exclude this graph from stacking. - @default true - */ - stackable: boolean; - /** Graph title. */ - title: string; - /** Type of the graph. Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc". XY and Radar charts can only display "line" type graphs. line */ - type: string; - /** Name of the url field in your dataProvider. */ - urlField: string; - /** Target to open URLs in, i.e. _blank, _top, etc. */ - urlTarget: string; - /** Specifies which value axis the graph will use. Will use the first value axis if not set. */ - valueAxis: ValueAxis; - /** Name of the value field in your dataProvider. */ - valueField: string; - /** Specifies whether this graph should be shown in the Legend. - @default true - */ - visibleInLegend: boolean; - /** XY chart only. A horizontal value axis object to attach graph to. */ - xAxis: ValueAxis; - /** XY chart only. Name of the x field in your dataProvider. */ - xField: string; - /** XY chart only. A vertical value axis object to attach graph to. */ - yAxis: ValueAxis; - /** XY chart only. Name of the y field in your dataProvider. */ - yField: string; - } - - /** AxisBase is the base class for ValueAxis and CategoryAxis. It can not be instantiated explicitly. */ - class AxisBase { - /** Specifies whether number of gridCount is specified automatically, acoarding to the axis size. - @default true - */ - autoGridCount: boolean; - /** Axis opacity. Value range is 0 - 1. - @default 1 - */ - axisAlpha: number; - /** Axis color. #000000 */ - axisColor: string; - /** Thickness of the axis. - @default 1 - */ - axisThickness: number; - /** Color of axis value labels. Will use chart's color if not set. */ - color: string; - /** Length of a dash. 0 means line is not dashed. */ - dashLength: number; - /** Fill opacity. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills. */ - fillAlpha: number; - /** Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills. #FFFFFF */ - fillColor: string; - /** Size of value labels text. Will use chart's fontSize if not set. */ - fontSize: string; - /** Opacity of grid lines. 0.2 */ - gridAlpha: number; - /** Color of grid lines. #000000 */ - gridColor: string; - /** Number of grid lines. In case this is value axis, or your categoryAxis parses dates, the number is approximate. The default value is 5. If you set autoGridCount to true, this property is ignored. - @default 5 - */ - gridCount: number; - /** Thickness of grid lines. - @default 1 - */ - gridThickness: number; - /** The array of guides belonging to this axis. */ - guides: any[]; - /** If autoMargins of a chart is set to true, but you want this axis not to be measured when calculating margin, set ignoreAxisWidth to true. */ - ignoreAxisWidth: boolean; - /** Specifies whether values should be placed inside or outside plot area. */ - inside: boolean; - /** Frequency at which labels should be placed. Doesn't work for CategoryAxis if parseDates is set to true. - @default 1 - */ - labelFrequency: number; - /** Rotation angle of a label. Only horizontal axis' values can be rotated. If you set this for vertical axis, the setting will be ignored. */ - labelRotation: number; - /** Specifies whether axis displays category axis' labels and value axis' values. - @default true - */ - labelsEnabled: boolean; - /** The distance of the axis to the plot area, in pixels. Negative values can also be used. */ - offset: number; - /** Possible values are: "top", "bottom", "left", "right". If axis is vertical, default position is "left". If axis is horizontal, default position is "bottom". */ - position: string; - /** Whether to show first axis label or not. - @default true - */ - showFirstLabel: boolean; - /** Whether to show last axis label or not. - @default true - */ - showLastLabel: boolean; - /** Length of the tick marks. - @default 5 - */ - tickLength: number; - /** Title of the axis. */ - title: string; - /** Specifies if title should be bold or not. - @default true - */ - titleBold: boolean; - /** Color of axis title. Will use text color of chart if not set any. */ - titleColor: string; - /** Font size of axis title. Will use font size of chart plus two pixels if not set any. */ - titlefontSize: string; - - /** Adds guide to the axis. */ - addGuide(guide: Guide): void; - /** Removes guide from the axis. */ - removeGuide(guide: Guide): void; - } - - /** ValueAxis is the class which displays value axis for the chart. The chart can have any number of value axes. For Serial chart one value axis is created automatically. For XY Chart two value axes (horizontal and vertical) are created automatically. */ - class ValueAxis extends AxisBase { - /** Radar chart only. Specifies distance from axis to the axis title (category) 10 */ - axisTitleOffset: number; - /** Read-only. Coordinate of the base value. */ - baseCoord: number; - /** Specifies base value of the axis. */ - baseValue: number; - /** If your values represents time units, and you want value axis labels to be formatted as duration, you have to set the duration unit. Possible values are: "ss", "mm", "hh" and "DD". */ - duration: string; - /** If duration property is set, you can specify what string should be displayed next to day, hour, minute and second. {DD:"d. ", hh:":", mm:":",ss:""} */ - durationUnits: Object; - /** Radar chart only. Possible values are: "polygons" and "circles". Set "circles" for polar charts. polygons */ - gridType: string; - /** Unique id of value axis. It is not required to set it, unless you need to tell the graph which exact value axis it should use. */ - id: string; - /** Specifies whether guide values should be included when calculating min and max of the axis. */ - includeGuidesInMinMax: boolean; - /** If true, the axis will include hidden graphs when calculating min and max values. */ - includeHidden: boolean; - /** Specifies whether values on axis can only be integers or both integers and doubles. */ - integersOnly: boolean; - /** You can use this function to format Value axis labels. This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis); -Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object. - -If axis type is "date", labelFunction will pass different arguments: -labelFunction(valueText, date, valueAxis) - -Your function should return string.*/ - labelFunction(value: number, valueText: string, valueAxis: ValueAxis): string; - labelFunction(valueText: string, data: Date, valueAxis: ValueAxis): string; - /** Specifies if this value axis' scale should be logarithmic. */ - logarithmic: boolean; - /** Read-only. Maximum value of the axis. */ - max: number; - /** If you don't want max value to be calculated by the chart, set it using this property. This value might still be adjusted so that it would be possible to draw grid at rounded intervals. */ - maximum: number; - /** If your value axis is date-based, you can specify maximum date of the axis. Can be set as date object, timestamp number or string if dataDateFormat is set. */ - maximumData: Date; - /** Read-only. Minimum value of the axis. */ - min: number; - /** If you don't want min value to be calculated by the chart, set it using this property. This value might still be adjusted so that it would be possible to draw grid at rounded intervals. */ - minimum: number; - /** If your value axis is date-based, you can specify minimum date of the axis. Can be set as date object, timestamp number or string if dataDateFormat is set. */ - minimumDate: Date; - /** If set value axis scale (min and max numbers) will be multiplied by it. I.e. if set to 1.2 the scope of values will increase by 20%. */ - minMaxMultiplier: number; - /** Works with radar charts only. If you set it to “middle”, labels and data points will be placed in the middle between axes. */ - pointPosition: string; - /** Possible values are: "top", "bottom", "left", "right". If axis is vertical, default position is "left". If axis is horizontal, default position is "bottom". */ - position: string; - /** Precision (number of decimals) of values. */ - precision: number; - /** Radar chart only. Specifies if categories (axes' titles) should be displayed near axes) - @default true - */ - radarCategoriesEnabled: boolean; - /** pecifies if graphs's values should be recalculated to percents. */ - recalculateToPercents: boolean; - /** Specifies if value axis should be reversed (smaller values on top). */ - reversed: boolean; - /** Stacking mode of the axis. Possible values are: "none", "regular", "100%", "3d". none Note, only graphs of one type will be stacked. */ - stackType: string; - /** Read-only. Value difference between two grid lines. */ - step: number; - /** If you set minimum and maximum for your axis, chart adjusts them so that grid would start and end on the beginning and end of plot area and grid would be at equal intervals. If you set strictMinMax to true, the chart will not adjust minimum and maximum of value axis. */ - strictMinMax: boolean; - /** In case you synchronize one value axis with another, you need to set the synchronization multiplier. Use synchronizeWithAxis method to set with which axis it should be synced. */ - synchronizationMultiplier: number; - /** One value axis can be synchronized with another value axis. You can use both reference to your axis or id of the axis here. You should set synchronizationMultiplyer in order for this to work. */ - synchronizeWith: ValueAxis; - /** If this value axis is stacked and has columns, setting valueAxis.totalText = "[[total]]" will make it to display total value above the most-top column. */ - totalText: string; - /** Color of total text. */ - totalTextColor: string; - /** Distance from data point to total text. */ - totalTextOffset: number; - /** This allows you to have logarithmic value axis and have zero values in the data. You must set it to >0 value in order to work. */ - treatZeroAs: number; - /** Type of value axis. If your values in data provider are dates and you want this axis to show dates instead of numbers, set it to "date". */ - type: string; - /** Unit which will be added to the value label. */ - unit: string; - /** Position of the unit. Possible values are "left" and "right". right */ - unitPosition: string; - /** If true, prefixes will be used for big and small numbers. You can set arrays of prefixes directly to the chart object via prefixesOfSmallNumbers and prefixesOfBigNumbers. */ - usePrefixes: boolean; - /** If true, values will always be formatted using scientific notation (5e+8, 5e-8...) Otherwise only values bigger then 1e+21 and smaller then 1e-7 will be displayed in scientific notation. */ - useScientificNotation: boolean; - - /** Adds guide to the axis. */ - addGuide(guide: Guide): void; - /** Adds event listener to the object. type - string like 'axisChanged' (should be listed in 'events' section of this class or classes which extend this class). handler - function which is called when event happens */ - addListener(type: string, handler: any): void; - /** Number, - value of coordinate. Returns value of the coordinate. coordinate - y or x coordinate, in pixels. */ - coordinateToValue(coordinate: number): void; - /** Number - coordinate Returns coordinate of the value in pixels. value - Number */ - getCoordinate(value: number): void; - /** Removes guide from the axis.*/ - removeGuide(guide: Guide): void; - /** Removes event listener from the object. */ - removeListener(obj: any, type: string, handler: any): void; - - /** One value axis can be synchronized with another value axis. You should set synchronizationMultiplyer in order for this to work. */ - synchronizeWithAxis(axis: ValueAxis): void; - /** XY Chart only. Zooms-in the axis to the provided values. */ - zoomToValues(startValue: number, endValue: number): void; - - /** Adds event listener of the type "axisZoomed" to the object. - @param type Always "axisZoomed". - @param handler XY chart only. Dispatched when axis is zoomed.*/ - addListener(type: string, handler: (e: { - /** Always "axisZoomed". */ - type: string; startValue: Date; endValue: Date; chart: AmChart; - }) => void): void; - /** Adds event listener of the type "logarithmicAxisFailed" to the object. - @param type Always "logarithmicAxisFailed". - @param handler Dispatched when valueAxis is logarithmic and values equal or less then zero were found in data.*/ - addListener(type: string, handler: (e: { - /** Always "logarithmicAxisFailed". */ - type: string; chart: AmChart; - }) => void): void; - - /** Removes event listener from chart object. */ - removeListener(chart: AmChart, type: string, handler: any): void; - } - - class Title { - /** @default 1 */ - alpha: number; - /** Specifies if the tile is bold or not. - @default false*/ - bold: boolean; - /** Text color of a title. */ - color: string; - /** Unique id of a Title. You don't need to set it, unless you want to. */ - id: string; - /** Text size */ - size: number; - /** Text of a label */ - text: string; - } - class ExportSettings { - enabled: boolean; - libs: Object; - menu: Object; - config: any; - capture(config: any, callback: () => void): any; - toJPG(config: any, callback: (config:any) => void): any; - } + function addInitHandler(handler: () => {}, types?: string[]): any; + + class AmAngularGauge extends _AmAngularGauge { } + class AmBalloon extends _AmBalloon { } + class AmChart extends _AmChart { } + class AmCoordinateChart extends _AmCoordinateChart { } + // class AmFunnelChart extends _AmFunnelChart { } + // class AmGanttChart extends _AmGanttChart { } + class AmGraph extends _AmGraph { } + class AmLegend extends _AmLegend { } + class AmPieChart extends _AmPieChart { } + class AmRadarChart extends _AmRadarChart { } + class AmRectangularChart extends _AmRectangularChart { } + class AmSerialChart extends _AmSerialChart { } + // class AmSlicedChart extends _AmSlicedChart { } + class AmXYChart extends _AmXYChart { } + class AxisBase extends _AxisBase { } + class CategoryAxis extends _CategoryAxis { } + class ChartCursor extends _ChartCursor { } + class ChartScrollbar extends _ChartScrollbar { } + class GaugeArrow extends _GaugeArrow { } + class GaugeAxis extends _GaugeAxis { } + class GaugeBand extends _GaugeBand { } + class GraphDataItem extends _GraphDataItem { } + class Guide extends _Guide { } + // class Image extends _Image { } + class Label extends _Label { } + class SerialDataItem extends _SerialDataItem { } + class Slice extends _Slice { } + class Title extends _Title { } + class TrendLine extends _TrendLine { } + class ValueAxis extends _ValueAxis { } } diff --git a/types/amcharts/tsconfig.json b/types/amcharts/tsconfig.json index fa1c069762..1d07459b73 100644 --- a/types/amcharts/tsconfig.json +++ b/types/amcharts/tsconfig.json @@ -5,9 +5,9 @@ "es6", "dom" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -18,6 +18,50 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "AmAngularGauge.d.ts", + "AmBalloon.d.ts", + "AmChart.d.ts", + "AmCoordinateChart.d.ts", + "AmGraph.d.ts", + "AmLegend.d.ts", + "AmPieChart.d.ts", + "AmRadarChart.d.ts", + "AmRectangularChart.d.ts", + "AmSerialChart.d.ts", + "AmStockChart.d.ts", + "AmXYChart.d.ts", + "AreasSettings.d.ts", + "AxisBase.d.ts", + "CategoryAxesSettings.d.ts", + "CategoryAxis.d.ts", + "ChartCursor.d.ts", + "ChartCursorSettings.d.ts", + "ChartScrollbar.d.ts", + "ChartScrollbarSettings.d.ts", + "DataSet.d.ts", + "DataSetSelector.d.ts", + "ExportSettings.d.ts", + "GaugeArrow.d.ts", + "GaugeAxis.d.ts", + "GaugeBand.d.ts", + "GraphDataItem.d.ts", + "Guide.d.ts", + "ImagesSettings.d.ts", + "Label.d.ts", + "LegendSettings.d.ts", + "PanelSettings.d.ts", + "PeriodSelector.d.ts", + "SerialDataItem.d.ts", + "Slice.d.ts", + "StockEvent.d.ts", + "StockGraph.d.ts", + "StockLegend.d.ts", + "StockPanel.d.ts", + "Title.d.ts", + "TrendLine.d.ts", + "ValueAxesSettings.d.ts", + "ValueAxis.d.ts", + "amcharts-tests.ts" ] } \ No newline at end of file diff --git a/types/amcharts/tslint.json b/types/amcharts/tslint.json new file mode 100644 index 0000000000..96b5837fb6 --- /dev/null +++ b/types/amcharts/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": [true, 120] + } +} \ No newline at end of file diff --git a/types/amplitude-js/tslint.json b/types/amplitude-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/amplitude-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/amqp-rpc/tslint.json b/types/amqp-rpc/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/amqp-rpc/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/amqplib/callback_api.d.ts b/types/amqplib/callback_api.d.ts index 60ff8cf622..9fca3972e4 100644 --- a/types/amqplib/callback_api.d.ts +++ b/types/amqplib/callback_api.d.ts @@ -54,6 +54,19 @@ export interface ConfirmChannel extends Channel { waitForConfirms(callback?: (err: any) => void): void; } +export const credentials: { + external(): { + mechanism: string; + response(): Buffer; + }; + plain(username: string, password: string): { + mechanism: string; + response(): Buffer; + username: string; + password: string; + }; +}; + export function connect(callback: (err: any, connection: Connection) => void): void; export function connect(url: string, callback: (err: any, connection: Connection) => void): void; export function connect(url: string, socketOptions: any, callback: (err: any, connection: Connection) => void): void; diff --git a/types/amqplib/index.d.ts b/types/amqplib/index.d.ts index 91060d23b0..25b0ef04e9 100644 --- a/types/amqplib/index.d.ts +++ b/types/amqplib/index.d.ts @@ -63,4 +63,17 @@ export interface ConfirmChannel extends Channel { waitForConfirms(): Promise; } -export function connect(url: string, socketOptions?: any): Promise; +export const credentials: { + external(): { + mechanism: string; + response(): Buffer; + }; + plain(username: string, password: string): { + mechanism: string; + response(): Buffer; + username: string; + password: string; + }; +}; + +export function connect(url: string | Options.Connect, socketOptions?: any): Promise; diff --git a/types/amqplib/properties.d.ts b/types/amqplib/properties.d.ts index 12514d7810..af90909d8c 100644 --- a/types/amqplib/properties.d.ts +++ b/types/amqplib/properties.d.ts @@ -21,6 +21,64 @@ export namespace Replies { } export namespace Options { + interface Connect { + /** + * The to be used protocol + * + * Default value: 'amqp' + */ + protocol?: string; + /** + * Hostname used for connecting to the server. + * + * Default value: 'localhost' + */ + hostname?: string; + /** + * Port used for connecting to the server. + * + * Default value: 5672 + */ + port?: number; + /** + * Username used for authenticating against the server. + * + * Default value: 'guest' + */ + username?: string; + /** + * Password used for authenticating against the server. + * + * Default value: 'guest' + */ + password?: string; + /** + * The desired locale for error messages. RabbitMQ only ever uses en_US + * + * Default value: 'en_US' + */ + locale?: string; + /** + * The size in bytes of the maximum frame allowed over the connection. 0 means + * no limit (but since frames have a size field which is an unsigned 32 bit integer, it’s perforce 2^32 - 1). + * + * Default value: 0x1000 (4kb) - That's the allowed minimum, it will fit many purposes + */ + frameMax?: number; + /** + * The period of the connection heartbeat in seconds. + * + * Default value: 0 + */ + heartbeat?: number; + /** + * What VHost shall be used. + * + * Default value: '/' + */ + vhost?: string; + } + interface AssertQueue { exclusive?: boolean; durable?: boolean; @@ -85,4 +143,4 @@ export interface Message { content: Buffer; fields: any; properties: any; -} \ No newline at end of file +} diff --git a/types/analytics-node/tslint.json b/types/analytics-node/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/analytics-node/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-agility/tslint.json b/types/angular-agility/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-agility/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-animate/index.d.ts b/types/angular-animate/index.d.ts index 0ce96a2f2f..6a51b368c8 100644 --- a/types/angular-animate/index.d.ts +++ b/types/angular-animate/index.d.ts @@ -2,7 +2,7 @@ // Project: http://angularjs.org // Definitions by: Michel Salib , Adi Dahiya , Raphael Schweizer , Cody Schaaf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 declare var _: string; export = _; diff --git a/types/angular-animate/tslint.json b/types/angular-animate/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-animate/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-block-ui/index.d.ts b/types/angular-block-ui/index.d.ts index 47ba9902b9..f415d386e9 100644 --- a/types/angular-block-ui/index.d.ts +++ b/types/angular-block-ui/index.d.ts @@ -67,7 +67,7 @@ declare module 'angular' { * If the filter function returns a string it will be passed as the message * argument to the start method of the service. * - * @param {angular.IRequestConfig} config - the Angular request config object. + * @param config the Angular request config object. * */ requestFilter?(config: IRequestConfig): (string | boolean); @@ -123,7 +123,7 @@ declare module 'angular' { * * This behaviour can be modified in the configuration. * - * @param {string|IBlockUIConfig} messageOrOptions - + * @param messageOrOptions * Either supply the message (string) to be show in the * overlay or specify an IBlockUIConfig object that will be * merged/extended into the block ui instance state. @@ -156,7 +156,7 @@ declare module 'angular' { * Allows the message shown in the overlay to be updated * while to block is active. * - * @param {string} message - The message to show in the overlay. + * @param message The message to show in the overlay. */ message(message: string): void; diff --git a/types/angular-bootstrap-calendar/package.json b/types/angular-bootstrap-calendar/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/angular-bootstrap-calendar/package.json +++ b/types/angular-bootstrap-calendar/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/angular-bootstrap-calendar/tslint.json b/types/angular-bootstrap-calendar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-bootstrap-calendar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-bootstrap-lightbox/tslint.json b/types/angular-bootstrap-lightbox/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-bootstrap-lightbox/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-breadcrumb/tslint.json b/types/angular-breadcrumb/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-breadcrumb/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-clipboard/tslint.json b/types/angular-clipboard/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-clipboard/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-cookie/tslint.json b/types/angular-cookie/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-cookie/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-cookies/tslint.json b/types/angular-cookies/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-cookies/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-deferred-bootstrap/tslint.json b/types/angular-deferred-bootstrap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-deferred-bootstrap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-dialog-service/tslint.json b/types/angular-dialog-service/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-dialog-service/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-dynamic-locale/angular-dynamic-locale-tests.ts b/types/angular-dynamic-locale/angular-dynamic-locale-tests.ts index 1e30aafd94..962219d465 100644 --- a/types/angular-dynamic-locale/angular-dynamic-locale-tests.ts +++ b/types/angular-dynamic-locale/angular-dynamic-locale-tests.ts @@ -5,6 +5,7 @@ app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleP localStorageServiceProvider .localeLocationPattern("app/config/locales/") .useCookieStorage(); + localStorageServiceProvider.defaultLocale('en'); }); class LocaleTestController { diff --git a/types/angular-dynamic-locale/index.d.ts b/types/angular-dynamic-locale/index.d.ts index 1aa14d4c3b..e68c037fa3 100644 --- a/types/angular-dynamic-locale/index.d.ts +++ b/types/angular-dynamic-locale/index.d.ts @@ -17,6 +17,7 @@ declare module 'angular' { } interface tmhDynamicLocaleProvider extends angular.IServiceProvider { + defaultLocale(locale: string): void; localeLocationPattern(location: string): tmhDynamicLocaleProvider; localeLocationPattern(): string; storageKey(storageKey: string): void; diff --git a/types/angular-dynamic-locale/tslint.json b/types/angular-dynamic-locale/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-dynamic-locale/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-environment/tslint.json b/types/angular-environment/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-environment/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-es/tslint.json b/types/angular-es/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-es/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-feature-flags/tslint.json b/types/angular-feature-flags/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-feature-flags/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-file-saver/tslint.json b/types/angular-file-saver/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-file-saver/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-file-upload/index.d.ts b/types/angular-file-upload/index.d.ts index ee1982123a..edac0ce2ad 100644 --- a/types/angular-file-upload/index.d.ts +++ b/types/angular-file-upload/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/nervgh/angular-file-upload // Definitions by: Cyril Gandon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import * as angular from 'angular'; diff --git a/types/angular-formly/tslint.json b/types/angular-formly/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-formly/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-fullscreen/tslint.json b/types/angular-fullscreen/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-fullscreen/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-gettext/tslint.json b/types/angular-gettext/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-gettext/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-google-analytics/tslint.json b/types/angular-google-analytics/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-google-analytics/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-growl-v2/tslint.json b/types/angular-growl-v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-growl-v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-hotkeys/README.md b/types/angular-hotkeys/README.md deleted file mode 100644 index a31ed8a936..0000000000 --- a/types/angular-hotkeys/README.md +++ /dev/null @@ -1,55 +0,0 @@ -## What is it? - -This is a typescript interface to be used with [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys/). - -## What are declaration files? - -See the [TypeScript handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). - - -## How do I get them? - -### npm - -This is the preferred method. This is only available for TypeScript 2.0+ users. For these typings: - -```sh -npm install --save-dev @types/angular-hotkeys -``` - -The types should then be automatically included by the compiler. -See more in the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). - - -### Other methods - -These can be used by TypeScript 1.0. - -* [Typings](https://github.com/typings/typings) -* ~~[NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped)~~ (use preferred alternatives, nuget DT type publishing has been turned off) -* Manually download from the `master` branch of this repository - -You may need to add manual [references](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). - -## How to use - -After installing a package you can import the definition file and begin using it as so: - -```ts - -import * as hotkeys from '../../node_modules/@types/angular-hotkeys' - -class FooController { - static $inject = [ - 'hotkeys' - ]; - - constructor( - private hotkeys: ng.hotkeys.HotkeysProvider - ) { } -} - -``` - -for a detailed explanation of the behavior of angular-hotkeys please refer to [its documentation](https://github.com/chieffancypants/angular-hotkeys/) - diff --git a/types/angular-hotkeys/angular-hotkeys-tests.ts b/types/angular-hotkeys/angular-hotkeys-tests.ts index c0bd9b974d..503080e9d8 100644 --- a/types/angular-hotkeys/angular-hotkeys-tests.ts +++ b/types/angular-hotkeys/angular-hotkeys-tests.ts @@ -1,30 +1,67 @@ -var scope: ng.IScope; -var hotkeyProvider: ng.hotkeys.HotkeysProvider; -var hotkeyObj: ng.hotkeys.Hotkey; +import { HotkeysProvider, Hotkey } from 'angular-hotkeys'; +import { module } from 'angular'; -hotkeyProvider.add("mod+s", "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => {} ); -hotkeyProvider.add(["mod+s"], "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => {} ); -hotkeyProvider.add(hotkeyObj); -hotkeyProvider.bindTo(scope); -hotkeyProvider.del("mod+s"); -hotkeyProvider.del(["mod+s"]); -hotkeyProvider.get("mod+s"); -hotkeyProvider.get(["mod+s"]); -hotkeyProvider.toggleCheatSheet(); - -hotkeyProvider.add(hotkeyObj.combo, hotkeyObj.description ,hotkeyObj.callback); - -hotkeyProvider.bindTo(scope) - .add(hotkeyObj) - .add(hotkeyObj) - .add({ - combo: 'w', - description: 'blah blah', - callback: function() {} - }) - .add({ - combo: ['w', 'mod+w'], - description: 'blah blah', - callback: function() {} +module('myApp', ['cfp.hotkeys']) + .config((hotkeysProvider: HotkeysProvider) => { + hotkeysProvider.includeCheatSheet = false; + const somehotKeyObj: Hotkey = { + combo: '', + callback: () => { } + }; }); +function someInjectionService( + scope: ng.IScope, + hotkeyProvider: ng.hotkeys.HotkeysProvider, + hotkeyObj: ng.hotkeys.Hotkey +) { + hotkeyProvider.add("mod+s", "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => { }); + hotkeyProvider.add(["mod+s"], "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => { }); + hotkeyProvider.add(hotkeyObj); + hotkeyProvider.bindTo(scope); + hotkeyProvider.del("mod+s"); + hotkeyProvider.del(["mod+s"]); + hotkeyProvider.get("mod+s"); + hotkeyProvider.get(["mod+s"]); + hotkeyProvider.toggleCheatSheet(); + + hotkeyProvider.add(hotkeyObj.combo, hotkeyObj.description, hotkeyObj.callback); + + hotkeyProvider.bindTo(scope) + .add(hotkeyObj) + .add(hotkeyObj) + .add({ + combo: 'w', + description: 'blah blah', + callback: () => { } + }) + .add({ + combo: ['w', 'mod+w'], + description: 'blah blah', + callback: () => { } + }); + + hotkeyProvider.add({ + combo: 'ctrl+w', + description: 'Description goes here', + callback: (event, hotkey) => { + event.preventDefault(); + } + }); + + hotkeyProvider.add({ + combo: 'ctrl+x', + callback: (event, hotkey) => { + // + } + }); + + hotkeyProvider.add({ + combo: 'ctrl+w', + description: 'Description goes here', + allowIn: ['INPUT', 'SELECT', 'TEXTAREA'], + callback(event, hotkey) { + event.preventDefault(); + } + }); +} diff --git a/types/angular-hotkeys/index.d.ts b/types/angular-hotkeys/index.d.ts index 0f0be68d8e..360e2cefbe 100644 --- a/types/angular-hotkeys/index.d.ts +++ b/types/angular-hotkeys/index.d.ts @@ -1,12 +1,10 @@ -// Type definitions for angular-hotkeys +// Type definitions for angular-hotkeys 1.7 // Project: https://github.com/chieffancypants/angular-hotkeys -// Definitions by: Jason Zhao , Stefan Steinhart +// Definitions by: Jason Zhao +// Stefan Steinhart +// Cyril Gandon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -//readme written by David Valentine - - -/// import * as ng from 'angular'; @@ -15,46 +13,123 @@ export type HotkeysProviderChained = ng.hotkeys.HotkeysProviderChained; export type Hotkey = ng.hotkeys.Hotkey; declare module 'angular' { - export namespace hotkeys { - + namespace hotkeys { interface HotkeysProvider { - template: string; - templateTitle: string; + /** + * Configurable setting to disable the cheatsheet entirely. + * @default true + */ includeCheatSheet: boolean; + /** + * Configurable setting to disable ngRoute hooks. + */ + useNgRoute: boolean; + /** + * Configurable setting for the cheat sheet title + * @default 'Keyboard Shortcuts' + */ + templateTitle: string; + /** + * Configurable settings for the cheat sheet header in HTML. + * This overrides the normal title if specified. + * @default null + */ + templateHeader: string | null; + /** + * Configurable settings for the cheat sheet footer in HTML. + * @default null + */ + templateFooter: string | null; + /** + * Cheat sheet template in the event you want to totally customize it. + */ + template: string; + /** + * Configurable setting for the cheat sheet hotkey. + * @default '?' + */ cheatSheetHotkey: string; + /** + * Configurable setting for the cheat sheet description. + * @default 'Show / hide this help menu' + */ cheatSheetDescription: string; - add(combo: string | string[], callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array, persistent?: boolean): ng.hotkeys.Hotkey; + /** + * Creates a new Hotkey and creates the Mousetrap binding. + */ + add(combo: string | string[], description?: string, callback?: (event: Event, hotkey: Hotkey) => void, action?: string, allowIn?: string[], persistent?: boolean): Hotkey; - add(combo: string | string[], description: string, callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array, persistent?: boolean): ng.hotkeys.Hotkey; + /** + * Creates a new Hotkey and creates the Mousetrap binding. + */ + add(hotkeyObj: Hotkey): Hotkey; - add(hotkeyObj: ng.hotkeys.Hotkey): ng.hotkeys.Hotkey; + /** + * Binds the hotkey to a particular scope. + * Useful if the scope is destroyed, we can automatically destroy the hotkey binding. + * @param scope The scope to bind to + */ + bindTo(scope: IScope): HotkeysProviderChained; - bindTo(scope: ng.IScope): ng.hotkeys.HotkeysProviderChained; + /** + * Removes and unbinds a hotkey + * @param combo The keyboard combo (shortcut) or the HotKey object + */ + del(combo: string | string[] | Hotkey): void; - del(combo: string | string[]): void; - - del(hotkeyObj: ng.hotkeys.Hotkey): void; - - get(combo: string | string[]): ng.hotkeys.Hotkey; + /** + * Returns the Hotkey object + * @param combo The keyboard combo (shortcut) + */ + get(combo: string | string[]): Hotkey; + /** + * Toggles the help menu element's visiblity + */ toggleCheatSheet(): void; - + /** + * Purges all non-persistent hotkeys (such as those defined in routes) + * + * Without this, the same hotkey would get recreated everytime + * the route is accessed. + */ purgeHotkeys(): void; } interface HotkeysProviderChained { - add(combo: string | string[], description: string, callback: (event: Event, hotkeys: ng.hotkeys.Hotkey) => void): HotkeysProviderChained; + add(combo: string | string[], description: string, callback: (event: Event, hotkeys: Hotkey) => void): HotkeysProviderChained; - add(hotkeyObj: ng.hotkeys.Hotkey): HotkeysProviderChained; + add(hotkeyObj: Hotkey): HotkeysProviderChained; } interface Hotkey { + /** + * They keyboard combo (shortcut) you want to bind to. + */ combo: string | string[]; + /** + * The description for what the combo does and is only used for the Cheat Sheet. + * If it is not supplied, it will not show up, and in effect, allows you to have unlisted hotkeys. + */ description?: string; - callback: (event: Event, hotkey: ng.hotkeys.Hotkey) => void; + /** + * The function to execute when the key(s) are pressed. Passes along two arguments, event and hotkey + */ + callback(event: Event, hotkey: Hotkey): void; + /** + * The type of event to listen for, such as keypress, keydown or keyup. + * Usage of this parameter is discouraged as the underlying library will pick the most suitable option automatically. + * This should only be necessary in advanced situations. + */ action?: string; - allowIn?: Array; + /** + * An array of tag names to allow this combo in ('INPUT', 'SELECT', and/or 'TEXTAREA') + */ + allowIn?: Array<'INPUT' | 'SELECT' | 'TEXTAREA'>; + /** + * Whether the hotkey persists navigation events + */ persistent?: boolean; } } diff --git a/types/angular-hotkeys/tsconfig.json b/types/angular-hotkeys/tsconfig.json index f277241888..acb11ff247 100644 --- a/types/angular-hotkeys/tsconfig.json +++ b/types/angular-hotkeys/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -21,4 +21,4 @@ "index.d.ts", "angular-hotkeys-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/bignumber.js/tslint.json b/types/angular-hotkeys/tslint.json similarity index 100% rename from types/bignumber.js/tslint.json rename to types/angular-hotkeys/tslint.json diff --git a/types/angular-http-auth/tslint.json b/types/angular-http-auth/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-http-auth/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-httpi/tslint.json b/types/angular-httpi/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-httpi/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-idle/tslint.json b/types/angular-idle/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-idle/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-jwt/tslint.json b/types/angular-jwt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-jwt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-load/tslint.json b/types/angular-load/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-load/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-loading-bar/tslint.json b/types/angular-loading-bar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-loading-bar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-local-storage/tslint.json b/types/angular-local-storage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-local-storage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-localforage/package.json b/types/angular-localforage/package.json index 22ff6e6118..9ef28aa765 100644 --- a/types/angular-localforage/package.json +++ b/types/angular-localforage/package.json @@ -3,4 +3,4 @@ "dependencies": { "localforage": "^1.5.0" } -} \ No newline at end of file +} diff --git a/types/angular-localforage/tslint.json b/types/angular-localforage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-localforage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-locker/angular-locker-tests.ts b/types/angular-locker/angular-locker-tests.ts index 368dd1d308..7bb27d68e1 100644 --- a/types/angular-locker/angular-locker-tests.ts +++ b/types/angular-locker/angular-locker-tests.ts @@ -131,7 +131,7 @@ angular $scope['foo']; // = undefined locker.get('foo'); // = undefined - if (! locker.supported()) { + if (! locker.supported('session')) { // load a polyfill? } }]); diff --git a/types/angular-locker/index.d.ts b/types/angular-locker/index.d.ts index 0fd1d0a472..37bc041ec1 100644 --- a/types/angular-locker/index.d.ts +++ b/types/angular-locker/index.d.ts @@ -140,7 +140,7 @@ declare module 'angular' { * * @param {String} driver The driver to check support with */ - supported(): boolean; + supported(driver: string): boolean; /** * Unbind a storage key from a $scope property * diff --git a/types/angular-locker/tslint.json b/types/angular-locker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-locker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index 79f72f0b5d..8d6955c697 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -5,6 +5,7 @@ interface TestScope extends ng.IScope { } myApp.config(( + $mdAriaProvider: ng.material.IAriaProvider, $mdThemingProvider: ng.material.IThemingProvider, $mdIconProvider: ng.material.IIconProvider, $mdProgressCircularProvider: ng.material.IProgressCircularProvider) => { @@ -52,6 +53,9 @@ myApp.config(( return c * Math.pow(2, (t / d - 1) * 10) + b; } }); + + // Globally disables all ARIA warnings. + $mdAriaProvider.disableWarnings(); }); myApp.controller('BottomSheetController', ($scope: TestScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => { @@ -136,6 +140,9 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material. $scope['promptDialog'] = () => { $mdDialog.show($mdDialog.prompt().initialValue('Buddy')); }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().required(true)); + }; $scope['prerenderedDialog'] = () => { $mdDialog.show({ template: 'Hello!', @@ -189,7 +196,7 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material. }); class IconDirective implements ng.IDirective { - private $mdIcon: ng.material.IIcon; + private readonly $mdIcon: ng.material.IIcon; constructor($mdIcon: ng.material.IIcon) { this.$mdIcon = $mdIcon; } @@ -264,6 +271,48 @@ myApp.controller('ToastController', ($scope: TestScope, $mdToast: ng.material.IT }; }); +myApp.controller('ThemeController', ($element: JQuery, $scope: TestScope, $mdTheming: ng.material.IThemingService) => { + $mdTheming($element); + + const PALETTES: ng.material.IConfiguredColorPalette = $mdTheming.PALETTES; + const redPalette: ng.material.IPalette = PALETTES.red; + const myPalette: ng.material.IPalette = PALETTES.myPalette; + const THEMES: ng.material.IConfiguredThemes = $mdTheming.THEMES; + const defaultTheme: ng.material.ITheme = THEMES.default; + const myTheme: ng.material.ITheme = THEMES.myTheme; + + $scope['registered'] = () => { + let registered: boolean = $mdTheming.registered('default'); + registered = $mdTheming.registered('myTheme'); + }; + + $scope['defaultTheme'] = () => { + const themeName: string = $mdTheming.defaultTheme(); + }; + + $scope['generateTheme'] = () => { + $mdTheming.generateTheme('myTheme'); + }; + + $scope['setBrowserColors'] = () => { + const browserColors: ng.material.IBrowserColors = { + theme: 'default', + palette: 'neonRed', + hue: '500' + }; + const remove: () => void = $mdTheming.setBrowserColor(browserColors); + }; + + $scope['defineTheme'] = () => { + const newTheme: ng.material.IDefineThemeOptions = { + primary: 'blue', + accent: 'orange', + dark: true + }; + $mdTheming.defineTheme('newTheme', newTheme); + }; +}); + myApp.controller('PanelController', ($scope: TestScope, $mdPanel: ng.material.IPanelService, $q: ng.IQService) => { $scope['createPanel'] = () => { const config: ng.material.IPanelConfig = { diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index a8808f92ff..92f6d46751 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for angular-material 1.1 // Project: https://github.com/angular/material -// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello , Geert Jansen +// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello , Geert Jansen , Edward Knowles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -11,6 +11,10 @@ export = _; declare module 'angular' { namespace material { + interface IAriaProvider { + disableWarnings(): void; + } + interface ResolveObject { [name: string]: Injectable<(...args: any[]) => PromiseLike>; } @@ -76,6 +80,7 @@ declare module 'angular' { interface IPromptDialog extends IPresetDialog { cancel(cancel: string): IPromptDialog; + required(required: boolean): IPromptDialog; // default: false placeholder(placeholder: string): IPromptDialog; initialValue(initialValue: string): IPromptDialog; } @@ -290,6 +295,25 @@ declare module 'angular' { configuration(): IThemeConfig; } + interface IDefineThemeOptions { + primary?: string; + accent?: string; + warn?: string; + background?: string; + dark?: boolean; + } + + interface IThemingService { + PALETTES: IConfiguredColorPalette; // get only + THEMES: IConfiguredThemes; // get only + (element: JQuery): void; + registered(themeName: string): boolean; + defaultTheme(): string; + generateTheme(name: string): void; + setBrowserColor(options: IBrowserColors): () => void; + defineTheme(name: string, options: IDefineThemeOptions): IPromise; + } + interface IDateLocaleProvider { months: string[]; shortMonths: string[]; @@ -330,6 +354,18 @@ declare module 'angular' { 'blue-grey': IPalette; } + interface IConfiguredColorPalette extends IColorPalette { + [name: string]: IPalette; + } + + interface IThemes { + default: ITheme; + } + + interface IConfiguredThemes extends IThemes { + [name: string]: ITheme; + } + interface IPanelConfig { id?: string; template?: string; diff --git a/types/angular-media-queries/tslint.json b/types/angular-media-queries/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-media-queries/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-meteor/tslint.json b/types/angular-meteor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-meteor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-mocks/tslint.json b/types/angular-mocks/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-mocks/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-modal/angular-modal-tests.ts b/types/angular-modal/angular-modal-tests.ts index edb4d7e6ef..1f55403490 100644 --- a/types/angular-modal/angular-modal-tests.ts +++ b/types/angular-modal/angular-modal-tests.ts @@ -45,9 +45,9 @@ function withContainerAsString() { }); } -// With container as jQuery element +// With container as jQuery/JQLite element function withContainerAsJquery() { - var container: JQuery = $('body'); + var container: JQuery = angular.element('body'); btfModal({ template: '
', container: container @@ -94,6 +94,10 @@ function callingValues() { template: '
' }); modal.activate().then(() => {}, () => {}); + // activating with random locals + modal.activate({name: 'TestName'}).then(() => {}, () => {}); + // activating with genericly typed locals + modal.activate<{name: string}>({name: 'TestName'}).then(() => {}, () => {}); modal.deactivate().then(() => {}, () => {}); var isActive: boolean = modal.active(); } diff --git a/types/angular-modal/index.d.ts b/types/angular-modal/index.d.ts index 40106e955e..e817157adb 100644 --- a/types/angular-modal/index.d.ts +++ b/types/angular-modal/index.d.ts @@ -5,7 +5,6 @@ // TypeScript Version: 2.3 /// -/// declare namespace angularModal { @@ -28,7 +27,8 @@ declare namespace angularModal { } export interface AngularModal { - activate(): angular.IPromise; + activate(locals?: {}): angular.IPromise; + activate(locals: T): angular.IPromise; deactivate(): angular.IPromise; active(): boolean; } diff --git a/types/angular-modal/tslint.json b/types/angular-modal/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-modal/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-notifications/tslint.json b/types/angular-notifications/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-notifications/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-notify/tslint.json b/types/angular-notify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-notify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-odata-resources/tslint.json b/types/angular-odata-resources/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-odata-resources/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-permission/tslint.json b/types/angular-permission/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-permission/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-promise-tracker/tslint.json b/types/angular-promise-tracker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-promise-tracker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-q-spread/tslint.json b/types/angular-q-spread/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-q-spread/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-route/tslint.json b/types/angular-route/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-route/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-sanitize/angular-sanitize-tests.ts b/types/angular-sanitize/angular-sanitize-tests.ts index b093f2bbb0..51d48db90d 100644 --- a/types/angular-sanitize/angular-sanitize-tests.ts +++ b/types/angular-sanitize/angular-sanitize-tests.ts @@ -4,5 +4,6 @@ declare var $sanitizeService: ng.sanitize.ISanitizeService; shouldBeString = $sanitizeService(shouldBeString); declare var $linky: ng.sanitize.filter.ILinky; +shouldBeString = $linky(shouldBeString); shouldBeString = $linky(shouldBeString, "target"); shouldBeString = $linky(shouldBeString, shouldBeString); diff --git a/types/angular-sanitize/index.d.ts b/types/angular-sanitize/index.d.ts index ad42ec362e..b9d16aaeb2 100644 --- a/types/angular-sanitize/index.d.ts +++ b/types/angular-sanitize/index.d.ts @@ -36,7 +36,7 @@ declare module 'angular' { * see https://docs.angularjs.org/api/ngSanitize/filter/linky */ interface ILinky { - (text: string, target: string, attributes?: { [attribute: string]: string } | ((url: string) => { [attribute: string]: string })): string; + (text: string, target?: string, attributes?: { [attribute: string]: string } | ((url: string) => { [attribute: string]: string })): string; } } diff --git a/types/angular-sanitize/tslint.json b/types/angular-sanitize/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-sanitize/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-scenario/tslint.json b/types/angular-scenario/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-scenario/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-scroll/angular-scroll-tests.ts b/types/angular-scroll/angular-scroll-tests.ts index fbc1c01642..84491706bc 100644 --- a/types/angular-scroll/angular-scroll-tests.ts +++ b/types/angular-scroll/angular-scroll-tests.ts @@ -50,11 +50,11 @@ namespace TestApp { var horixontalPosition: number = $document.duScrollLeft(); } - private invertedEasingFn = (x: number): number => { + private readonly invertedEasingFn = (x: number): number => { return 1 - x; } - private onScrollCompleted = (): void => { + private readonly onScrollCompleted = (): void => { console.log('Done scrolling'); } } diff --git a/types/angular-scroll/tslint.json b/types/angular-scroll/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-scroll/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-signalr-hub/angular-signalr-hub-tests.ts b/types/angular-signalr-hub/angular-signalr-hub-tests.ts index 14d202e171..62ea189787 100644 --- a/types/angular-signalr-hub/angular-signalr-hub-tests.ts +++ b/types/angular-signalr-hub/angular-signalr-hub-tests.ts @@ -1,6 +1,6 @@ class EmployeesFactory { static $inject = ['$rootScope', 'Hub', '$timeout']; - private hub: ngSignalr.Hub; + private readonly hub: ngSignalr.Hub; public all: Array; constructor($rootScope: ng.IRootScopeService, Hub: ngSignalr.HubFactory, $timeout: ng.ITimeoutService) { diff --git a/types/angular-signalr-hub/tslint.json b/types/angular-signalr-hub/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-signalr-hub/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-spinner/tslint.json b/types/angular-spinner/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-spinner/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-storage/index.d.ts b/types/angular-storage/index.d.ts index 8021ba2f5e..a5f65955f5 100644 --- a/types/angular-storage/index.d.ts +++ b/types/angular-storage/index.d.ts @@ -6,10 +6,13 @@ /// +declare var _: string; +export = _; + import * as angular from 'angular'; declare module 'angular' { - export namespace a0.storage { + namespace a0.storage { interface IStoreService extends INamespacedStoreService { /** * Returns a namespaced store diff --git a/types/angular-storage/tslint.json b/types/angular-storage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-storage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-toastr/tslint.json b/types/angular-toastr/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-toastr/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-toasty/tslint.json b/types/angular-toasty/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-toasty/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-tooltips/index.d.ts b/types/angular-tooltips/index.d.ts index d3cf83c1ec..682737756f 100644 --- a/types/angular-tooltips/index.d.ts +++ b/types/angular-tooltips/index.d.ts @@ -2,6 +2,7 @@ // Project: http://720kb.github.io/angular-tooltips // Definitions by: Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 declare const AngularTooltips: '720kb.tooltips'; export = AngularTooltips; diff --git a/types/angular-touchspin/tslint.json b/types/angular-touchspin/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-touchspin/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-translate/tslint.json b/types/angular-translate/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-translate/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-bootstrap/tslint.json b/types/angular-ui-bootstrap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-bootstrap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-notification/tslint.json b/types/angular-ui-notification/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-notification/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-router/angular-ui-router-tests.ts b/types/angular-ui-router/angular-ui-router-tests.ts index 406e94a1eb..889e92bfc9 100644 --- a/types/angular-ui-router/angular-ui-router-tests.ts +++ b/types/angular-ui-router/angular-ui-router-tests.ts @@ -137,10 +137,10 @@ class UrlLocatorTestService implements IUrlLocatorTestService { static $inject = ["$http", "$rootScope", "$urlRouter", "$state"]; constructor( - private $http: ng.IHttpService, - private $rootScope: ng.IRootScopeService, - private $urlRouter: ng.ui.IUrlRouterService, - private $state: ng.ui.IStateService + private readonly $http: ng.IHttpService, + private readonly $rootScope: ng.IRootScopeService, + private readonly $urlRouter: ng.ui.IUrlRouterService, + private readonly $state: ng.ui.IStateService ) { $rootScope.$on("$locationChangeSuccess", (event: ng.IAngularEvent) => this.onLocationChangeSuccess(event)); $rootScope.$on('$stateNotFound', (event: ng.IAngularEvent, unfoundState: ng.ui.IUnfoundState, fromState: ng.ui.IState, fromParams: {}) => diff --git a/types/angular-ui-router/tslint.json b/types/angular-ui-router/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-router/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-scroll/tslint.json b/types/angular-ui-scroll/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-scroll/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-sortable/tslint.json b/types/angular-ui-sortable/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-sortable/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-tree/tslint.json b/types/angular-ui-tree/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-tree/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-websocket/angular-websocket-tests.ts b/types/angular-websocket/angular-websocket-tests.ts index 1df77b7a2a..51246c529a 100644 --- a/types/angular-websocket/angular-websocket-tests.ts +++ b/types/angular-websocket/angular-websocket-tests.ts @@ -1,69 +1,62 @@ -let dummySocket: ng.websocket.IWebSocket; -let dummyPromise: ng.IPromise; -let dummyScope: ng.IScope; +import * as ng from 'angular'; -let provider: ng.websocket.IWebSocketProvider = (url: string, protocols?:string[] | ng.websocket.IWebSocketConfigOptions, options?: ng.websocket.IWebSocketConfigOptions) => { - return dummySocket; -} +(promise: angular.IPromise, scope: ng.IScope, provider: ng.websocket.IWebSocketProvider) => { + const socket = provider("wss://localhost"); + const socketWithProtocols = provider("wss://localhost", ["protocol-a", "protocol-b"]); -let socketWithProtocol = provider("wss://localhost", "protocol"); -let socketWithProtocols = provider("wss://localhost", ["protocol-a", "protocol-b"]); + const socketWithOptions = provider("wss://localhost", { + scope, + rootScopeFailOver: true, + useApplyAsync: true, + initialTimeout: 100, + maxTimeout: 300000, + reconnectIfNotNormalClose: true, + binaryType: "blob" + }); -let socketWithOptions = provider("wss://localhost", { - scope: dummyScope, - rootScopeFailOver: true, - useApplyAsync: true, - initialTimeout: 100, - maxTimeout: 300000, - reconnectIfNotNormalClose: true, - binaryType: "blob" -}); + const socketWithProtocolAndOptions = provider("wss://localhost", "protocol", { + scope, + rootScopeFailOver: true, + useApplyAsync: true, + initialTimeout: 100, + maxTimeout: 300000, + reconnectIfNotNormalClose: true, + binaryType: "blob" + }); -let socketWithProtocolAndOptions = provider("wss://localhost", "protocol", { - scope: dummyScope, - rootScopeFailOver: true, - useApplyAsync: true, - initialTimeout: 100, - maxTimeout: 300000, - reconnectIfNotNormalClose: true, - binaryType: "blob" -}); + socket.onOpen((event: Event) => {}) + .onClose((event: Event) => {}) + .onError((event: Event) => {}) + .onMessage((event: Event) => {}); -let socket = provider("wss://localhost"); + socket.onMessage((event: Event) => {}, { filter: /Some Filter/ }) + .onMessage((event: Event) => {}, { filter: 'Some Filter' }) + .onMessage((event: Event) => {}, { filter: 'Some Filter', autoApply: true }) + .onMessage((event: Event) => {}, { autoApply: false }); -socket.onOpen((event) => {}) - .onClose((event) => {}) - .onError((event) => {}) - .onMessage((event) => {}); + socket.close(true); + socket.close(); -socket.onMessage((event) => {}, { filter: /Some Filter/ }) - .onMessage((event) => {}, { filter: 'Some Filter' }) - .onMessage((event) => {}, { filter: 'Some Filter', autoApply: true }) - .onMessage((event) => {}, { autoApply: false }); + socket.send("Some great data here!").finally(() => {}); + socket.send({ list: [1, 2, 3, 4] }); -socket.close(true); -socket.close(); + socket.socket.send("data"); + socket.socket.close(); + socket.socket.close(1); + socket.socket.close(1, "reason"); -socket.send("Some great data here!").finally(() => {}); -socket.send({ list: [1, 2, 3, 4] }); + socket.sendQueue.push({ message: "msg", defered: promise }); -socket.socket.send("data"); -socket.socket.close(); -socket.socket.close(1); -socket.socket.close(1, "reason"); + socket.onOpenCallbacks.push((event: Event) => {}); + socket.onCloseCallbacks.push((event: CloseEvent) => {}); + socket.onErrorCallbacks.push((event: Event) => {}); + socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, pattern: 'Some Filter', autoApply: true }); + socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, pattern: /Some Filter/, autoApply: true }); + socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, autoApply: true }); -socket.sendQueue.push({ message: "msg", defered: dummyPromise }); + socket.readyState = 0; -socket.onOpenCallbacks.push((event: Event) => {}); -socket.onCloseCallbacks.push((event: CloseEvent) => {}); -socket.onErrorCallbacks.push((event: Event) => {}); -socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, pattern: 'Some Filter', autoApply: true }); -socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, pattern: /Some Filter/, autoApply: true }); -socket.onMessageCallbacks.push({ fn: (event: MessageEvent) => {}, pattern: undefined, autoApply: true }); - -socket.readyState = 0; - -socket.initialTimeout = 10; - -socket.maxTimeout = 5000; + socket.initialTimeout = 10; + socket.maxTimeout = 5000; +}; diff --git a/types/angular-websocket/index.d.ts b/types/angular-websocket/index.d.ts index b7b3f55093..0b26bd2cfd 100644 --- a/types/angular-websocket/index.d.ts +++ b/types/angular-websocket/index.d.ts @@ -1,39 +1,45 @@ -// Type definitions for angular-websocket v2.0 +// Type definitions for angular-websocket 2.0 // Project: https://github.com/AngularClass/angular-websocket // Definitions by: Nick Veys // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -import * as ng from "angular"; +import * as angular from "angular"; + +export type IWebSocketConfigOptions = angular.websocket.IWebSocketConfigOptions; +export type IWebSocketProvider = angular.websocket.IWebSocketProvider; +export type IWebSocketMessageOptions = angular.websocket.IWebSocketMessageOptions; +export type IWebSocketMessageHandler = angular.websocket.IWebSocketMessageHandler; +export type IWebSocketQueueItem = angular.websocket.IWebSocketQueueItem; +export type IWebSocket = angular.websocket.IWebSocket; declare module "angular" { namespace websocket { - /** * Options available to be specified for IWebSocketProvider. */ - type IWebSocketConfigOptions = { - scope?: ng.IScope; - rootScopeFailOver?: boolean; - useApplyAsync?: boolean; - initialTimeout?: number; - maxTimeout?: number; - binaryType?: "blob" | "arraybuffer"; - reconnectIfNotNormalClose?: boolean; - } - interface IWebSocketProvider { - /** - * Creates and opens an IWebSocket instance. - * - * @param url url to connect to - * @return websocket instance - */ - (url: string, protocols?: string | string[] | IWebSocketConfigOptions, options?: IWebSocketConfigOptions): IWebSocket; + interface IWebSocketConfigOptions { + scope?: IScope; + rootScopeFailOver?: boolean; + useApplyAsync?: boolean; + initialTimeout?: number; + maxTimeout?: number; + binaryType?: "blob" | "arraybuffer"; + reconnectIfNotNormalClose?: boolean; } + /** + * Creates and opens an IWebSocket instance. + * + * @param url url to connect to + * @return websocket instance + */ + type IWebSocketProvider = + (url: string, protocols?: string | string[] | IWebSocketConfigOptions, + options?: IWebSocketConfigOptions) => IWebSocket; + /** Options available to be specified for IWebSocket.onMessage */ - type IWebSocketMessageOptions = { - + interface IWebSocketMessageOptions { /** * If specified, only messages that match the filter will cause the message event * to be fired. @@ -44,21 +50,20 @@ declare module "angular" { autoApply?: boolean; } - /** Type corresponding to onMessage callbaks stored in $Websocket#onMessageCallbacks instance. */ - type IWebSocketMessageHandler = { - fn: (evt: MessageEvent) => void; - pattern: string | RegExp; - autoApply: boolean; + /** Type corresponding to onMessage callbacks stored in $Websocket#onMessageCallbacks instance. */ + interface IWebSocketMessageHandler { + fn: (evt: MessageEvent) => void; + pattern?: string | RegExp; + autoApply: boolean; } /** Type corresponding to items stored in $WebSocket#sendQueue instance. */ - type IWebSocketQueueItem = { - message: any; - defered: ng.IPromise; + interface IWebSocketQueueItem { + message: any; + defered: IPromise; } interface IWebSocket { - /** * Adds a callback to be executed each time a socket connection is opened for * this instance. @@ -108,7 +113,7 @@ declare module "angular" { * * @param data data to send, if this is an object, it will be stringified before sending */ - send(data: string | {}): ng.IPromise; + send(data: string | {}): IPromise; /** * WebSocket instance. @@ -123,7 +128,7 @@ declare module "angular" { /** * List of callbacks to be executed when the socket is opened. */ - onOpenCallbacks: ((evt: Event) => void)[]; + onOpenCallbacks: Array<((evt: Event) => void)>; /** * List of callbacks to be executed when a message is received from the socket. @@ -133,12 +138,12 @@ declare module "angular" { /** * List of callbacks to be executed when an error is received from the socket. */ - onErrorCallbacks: ((evt: Event) => void)[]; + onErrorCallbacks: Array<((evt: Event) => void)>; /** * List of callbacks to be executed when the socket is closed. */ - onCloseCallbacks: ((evt: CloseEvent) => void)[]; + onCloseCallbacks: Array<((evt: CloseEvent) => void)>; /** * Returns either the readyState value from the underlying WebSocket instance diff --git a/types/angular-websocket/tsconfig.json b/types/angular-websocket/tsconfig.json index 96aab30ef0..89d5cb9dc3 100644 --- a/types/angular-websocket/tsconfig.json +++ b/types/angular-websocket/tsconfig.json @@ -1,8 +1,4 @@ { - "files": [ - "index.d.ts", - "angular-websocket-tests.ts" - ], "compilerOptions": { "module": "commonjs", "lib": [ @@ -11,8 +7,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, + "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,5 +16,9 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true - } -} \ No newline at end of file + }, + "files": [ + "index.d.ts", + "angular-websocket-tests.ts" + ] +} diff --git a/types/angular-websocket/tslint.json b/types/angular-websocket/tslint.json new file mode 100644 index 0000000000..2c7c1bed53 --- /dev/null +++ b/types/angular-websocket/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": false + } +} diff --git a/types/angular-wizard/tslint.json b/types/angular-wizard/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-wizard/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-xeditable/tslint.json b/types/angular-xeditable/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-xeditable/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular.throttle/tslint.json b/types/angular.throttle/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular.throttle/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index c60da29504..795e74a058 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -6,8 +6,6 @@ * License: MIT */ -/* tslint:disable:no-empty no-shadowed-variable */ - class AuthService { /** * Holds all the requests which failed due to 401 response, @@ -163,7 +161,7 @@ namespace My.Namespace { } class TestProvider implements ng.IServiceProvider { - constructor(private $scope: ng.IScope) {} + constructor(private readonly $scope: ng.IScope) {} $get() {} } @@ -178,7 +176,7 @@ mod.controller('name', class { // $onChanges(x: number) { } }); mod.controller({ - MyCtrl: class{}, + MyCtrl: class {}, MyCtrl2() {}, MyCtrl3: ['$fooService', ($fooService: any) => { }] }); @@ -229,7 +227,7 @@ mod.provider(My.Namespace); mod.service('name', ($scope: ng.IScope) => {}); mod.service('name', ['$scope', ($scope: ng.IScope) => {}]); mod.service({ - MyCtrl: class{}, + MyCtrl: class {}, MyCtrl2: () => {}, // tslint:disable-line:object-literal-shorthand MyCtrl3: ['$fooService', ($fooService: any) => {}] }); @@ -491,9 +489,7 @@ namespace TestInjector { // $injector.instantiate { - class Foobar { - constructor($q) {} - } + class Foobar {} const result: Foobar = $injector.instantiate(Foobar); } @@ -509,7 +505,13 @@ namespace TestInjector { } const anyFunction: Function = foobar; - const anyResult: string = $injector.invoke(anyFunction); + let anyResult: string = $injector.invoke(anyFunction); + + const inlineAnnotatedFunction: any[] = [false, foobar]; + anyResult = $injector.invoke(inlineAnnotatedFunction); + anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext', 'anyLocals'); + anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext'); + anyResult = $injector.invoke(inlineAnnotatedFunction, undefined, 'anyLocals'); } } @@ -640,6 +642,9 @@ isolateScope = element.find('div').isolateScope(); isolateScope = element.children().isolateScope(); let element2 = angular.element(element); let elementArray = angular.element(document.querySelectorAll('div')); +let elementReadyFn = angular.element(() => { + console.log('ready'); +}); // $timeout signature tests namespace TestTimeout { @@ -700,7 +705,7 @@ class SampleDirective implements ng.IDirective { restrict = 'A'; name = 'doh'; - compile(templateElement: ng.IAugmentedJQuery) { + compile(templateElement: JQLite) { return { post: this.link }; @@ -716,7 +721,7 @@ class SampleDirective implements ng.IDirective { class SampleDirective2 implements ng.IDirective { restrict = 'EAC'; - compile(templateElement: ng.IAugmentedJQuery) { + compile(templateElement: JQLite) { return { pre: this.link }; @@ -734,7 +739,7 @@ angular.module('SameplDirective', []).directive('sampleDirective', SampleDirecti angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpolate', '$q', ($interpolate: ng.IInterpolateService, $q: ng.IQService) => { return { restrict: 'A', - link: (scope: ng.IScope, el: ng.IAugmentedJQuery, attr: ng.IAttributes) => { + link: (scope: ng.IScope, el: JQLite, attr: ng.IAttributes) => { $interpolate(attr['test'])(scope); $interpolate('', true)(scope); $interpolate('', true, 'html')(scope); @@ -862,7 +867,7 @@ angular.module('docsTimeDirective', []) }]) .directive('myCurrentTime', ['$interval', 'dateFilter', ($interval: any, dateFilter: any) => { return { - link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes) { + link(scope: ng.IScope, element: JQLite, attrs: ng.IAttributes) { let format: any; let timeoutId: any; @@ -909,7 +914,7 @@ angular.module('docsTransclusionExample', []) transclude: true, scope: {}, templateUrl: 'my-dialog.html', - link(scope: ng.IScope, element: ng.IAugmentedJQuery) { + link(scope: ng.IScope, element: JQLite) { scope['name'] = 'Jeff'; } }; @@ -1010,7 +1015,7 @@ angular.module('docsTabsExample', []) scope: { title: '@' }, - link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) { + link(scope: ng.IScope, element: JQLite, attrs: ng.IAttributes, tabsCtrl: any) { tabsCtrl.addPane(scope); }, templateUrl: 'my-pane.html' @@ -1091,6 +1096,18 @@ angular.module('copyExample', []) $scope.reset(); }]); +// Extending IScope for a directive, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/21160 +interface IMyScope extends angular.IScope { + myScopeProperty: boolean; +} + +angular.module('aaa').directive('directive', () => ({ + link(scope: IMyScope) { + console.log(scope.myScopeProperty); + return; + } +})); + namespace locationTests { const $location: ng.ILocationService = null; @@ -1305,3 +1322,35 @@ function toPromise(val: T): ng.IPromise { const p: ng.IPromise = null; return p; } + +const directiveCompileFn: ng.IDirectiveCompileFn = ( + templateElement: JQLite, + templateAttributes: ng.IAttributes, + transclude: ng.ITranscludeFunction + ): ng.IDirectiveLinkFn => { + return ( + scope: ng.IScope, + instanceElement: JQLite, + instanceAttributes: ng.IAttributes + ) => { + return null; + }; +}; + +interface MyScope extends ng.IScope { + foo: string; +} + +const directiveCompileFnWithGeneric: ng.IDirectiveCompileFn = ( + templateElement: JQLite, + templateAttributes: ng.IAttributes, + transclude: ng.ITranscludeFunction + ): ng.IDirectiveLinkFn => { + return ( + scope: MyScope, + instanceElement: JQLite, + instanceAttributes: ng.IAttributes + ) => { + return null; + }; +}; diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 8415c6e6b7..5d8b6315b0 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -9,9 +9,6 @@ /// -// NOTE: @types/angular technically doesn't require TypeScript 2.3, only TypeScript 2.1. -// It has a TypeScript 2.3 header so that merging tests with @types/jquery v3 will work. - declare var angular: angular.IAngularStatic; // Support for painless dependency injection @@ -162,7 +159,7 @@ declare namespace angular { module( name: string, requires?: string[], - configFn?: Function): IModule; + configFn?: Injectable): IModule; noop(...args: any[]): void; reloadWithDebugInfo(): void; @@ -232,8 +229,8 @@ declare namespace angular { * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) * @param directiveFactory An injectable directive factory function. */ - directive(name: string, directiveFactory: Injectable): IModule; - directive(object: {[directiveName: string]: Injectable}): IModule; + directive(name: string, directiveFactory: Injectable>): IModule; + directive(object: {[directiveName: string]: Injectable>}): IModule; /** * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. * @@ -392,6 +389,7 @@ declare namespace angular { $rollbackViewValue(): void; $commitViewValue(): void; $isEmpty(value: any): boolean; + $overrideModelOptions(options: INgModelOptions): void; $viewValue: any; @@ -1088,7 +1086,7 @@ declare namespace angular { * Retrieves or overrides whether to generate an error when a rejected promise is not handled. * This feature is enabled by default. * - * @returns {boolean} Current value + * @returns Current value */ errorOnUnhandledRejections(): boolean; @@ -1096,8 +1094,8 @@ declare namespace angular { * Retrieves or overrides whether to generate an error when a rejected promise is not handled. * This feature is enabled by default. * - * @param {boolean} value Whether to generate an error when a rejected promise is not handled. - * @returns {ng.IQProvider} Self for chaining otherwise. + * @param value Whether to generate an error when a rejected promise is not handled. + * @returns Self for chaining otherwise. */ errorOnUnhandledRejections(value: boolean): IQProvider; } @@ -1108,8 +1106,8 @@ declare namespace angular { * The successCallBack may return IPromise for when a $q.reject() needs to be returned * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. */ - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: null | undefined, notifyCallback?: (state: any) => any): IPromise; - then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback?: null | undefined, notifyCallback?: (state: any) => any): IPromise; + then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise; + then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise; then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => IPromise|TCatch, notifyCallback?: (state: any) => any): IPromise; then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback: (reason: any) => IPromise|TCatch2, notifyCallback?: (state: any) => any): IPromise; @@ -1251,8 +1249,8 @@ declare namespace angular { } interface ICompileProvider extends IServiceProvider { - directive(name: string, directiveFactory: Injectable): ICompileProvider; - directive(object: {[directiveName: string]: Injectable}): ICompileProvider; + directive(name: string, directiveFactory: Injectable>): ICompileProvider; + directive(object: {[directiveName: string]: Injectable>}): ICompileProvider; component(name: string, options: IComponentOptions): ICompileProvider; @@ -1301,6 +1299,17 @@ declare namespace angular { */ cssClassDirectivesEnabled(): boolean; cssClassDirectivesEnabled(enabled: boolean): ICompileProvider; + + /** + * Call this method to enable/disable strict component bindings check. + * If enabled, the compiler will enforce that for all bindings of a + * component that are not set as optional with ?, an attribute needs + * to be provided on the component's HTML tag. + * Defaults to false. + * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#strictComponentBindingsEnabled + */ + strictComponentBindingsEnabled(): boolean; + strictComponentBindingsEnabled(enabled: boolean): ICompileProvider; } interface ICloneAttachFunction { @@ -1638,9 +1647,8 @@ declare namespace angular { useApplyAsync(value: boolean): IHttpProvider; /** - * - * @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods. - * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. + * @param value If true, `$http` will return a normal promise without the `success` and `error` methods. + * @returns If a value is specified, returns the $httpProvider for chaining. * otherwise, returns the current configured value. */ useLegacyPromiseExtensions(value: boolean): boolean | IHttpProvider; @@ -1761,7 +1769,6 @@ declare namespace angular { (tpl: string, ignoreRequestError?: boolean): IPromise; /** * total amount of pending template requests being downloaded. - * @type {number} */ totalPendingRequests: number; } @@ -1962,13 +1969,13 @@ declare namespace angular { // and http://docs.angularjs.org/guide/directive /////////////////////////////////////////////////////////////////////////// - interface IDirectiveFactory { - (...args: any[]): IDirective | IDirectiveLinkFn; + interface IDirectiveFactory { + (...args: any[]): IDirective | IDirectiveLinkFn; } - interface IDirectiveLinkFn { + interface IDirectiveLinkFn { ( - scope: IScope, + scope: TScope, instanceElement: JQLite, instanceAttributes: IAttributes, controller?: IController | IController[] | {[key: string]: IController}, @@ -1976,12 +1983,12 @@ declare namespace angular { ): void; } - interface IDirectivePrePost { - pre?: IDirectiveLinkFn; - post?: IDirectiveLinkFn; + interface IDirectivePrePost { + pre?: IDirectiveLinkFn; + post?: IDirectiveLinkFn; } - interface IDirectiveCompileFn { + interface IDirectiveCompileFn { ( templateElement: JQLite, templateAttributes: IAttributes, @@ -1992,11 +1999,11 @@ declare namespace angular { * that is passed to the link function instead. */ transclude: ITranscludeFunction - ): void | IDirectiveLinkFn | IDirectivePrePost; + ): void | IDirectiveLinkFn | IDirectivePrePost; } - interface IDirective { - compile?: IDirectiveCompileFn; + interface IDirective { + compile?: IDirectiveCompileFn; controller?: string | Injectable; controllerAs?: string; /** @@ -2005,7 +2012,7 @@ declare namespace angular { * relies upon bindings inside a $onInit method on the controller, instead. */ bindToController?: boolean | {[boundProperty: string]: string}; - link?: IDirectiveLinkFn | IDirectivePrePost; + link?: IDirectiveLinkFn | IDirectivePrePost; multiElement?: boolean; priority?: number; /** @@ -2078,9 +2085,7 @@ declare namespace angular { get(name: '$xhrFactory'): IXhrFactory; has(name: string): boolean; instantiate(typeConstructor: {new(...args: any[]): T}, locals?: any): T; - invoke(inlineAnnotatedFunction: any[]): any; - invoke(func: (...args: any[]) => T, context?: any, locals?: any): T; - invoke(func: Function, context?: any, locals?: any): any; + invoke(func: Injectable T)>, context?: any, locals?: any): T; strictDi: boolean; } diff --git a/types/angular/jqlite.d.ts b/types/angular/jqlite.d.ts index 858201fb18..a9da89cf65 100644 --- a/types/angular/jqlite.d.ts +++ b/types/angular/jqlite.d.ts @@ -684,7 +684,7 @@ interface JQuery { } interface JQueryStatic { - (element: string | Element | Document | JQuery | ArrayLike): JQLite; + (element: string | Element | Document | JQuery | ArrayLike | (() => void)): JQLite; } /** diff --git a/types/angular/tsconfig.json b/types/angular/tsconfig.json index 92d1e026c3..5ce810f938 100644 --- a/types/angular/tsconfig.json +++ b/types/angular/tsconfig.json @@ -16,7 +16,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -25,4 +25,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/angularfire/index.d.ts b/types/angularfire/index.d.ts index de1482b0e3..a339e89bc5 100644 --- a/types/angularfire/index.d.ts +++ b/types/angularfire/index.d.ts @@ -112,7 +112,7 @@ interface AngularFireObject extends AngularFireSimpleObject { * @param {object} scope * @param {string} varName * @returns a promise which resolves to an unbind method after data is set in scope - */ + */ $bindTo(scope: ng.IScope, varName: string): ng.IPromise; /** @@ -125,7 +125,7 @@ interface AngularFireObject extends AngularFireSimpleObject { * @param {Function} cb * @param {Object} [context] * @returns {Function} invoke to stop observing events - */ + */ $watch(callback: Function, context?: any): Function; /** diff --git a/types/angularfire/package.json b/types/angularfire/package.json new file mode 100644 index 0000000000..3cf0b2f8bd --- /dev/null +++ b/types/angularfire/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@types/firebase": "^2.4.1" + } +} diff --git a/types/angularfire/tslint.json b/types/angularfire/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angularfire/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angularlocalstorage/angularlocalstorage-tests.ts b/types/angularlocalstorage/angularlocalstorage-tests.ts index 22d71f8b5d..df50c6694a 100644 --- a/types/angularlocalstorage/angularlocalstorage-tests.ts +++ b/types/angularlocalstorage/angularlocalstorage-tests.ts @@ -3,7 +3,7 @@ interface TestScope extends ng.IScope { } class TestController { - constructor(private $scope: TestScope, private storage: ng.localStorage.ILocalStorageService) { + constructor(private readonly $scope: TestScope, private readonly storage: ng.localStorage.ILocalStorageService) { storage.bind($scope, 'varName'); storage.bind($scope,'varName', { defaultValue: 'randomValue123', storeName: 'customStoreKey' }); $scope.viewType = 'ANYTHING'; diff --git a/types/angularlocalstorage/tslint.json b/types/angularlocalstorage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angularlocalstorage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angulartics/angulartics-tests.ts b/types/angulartics/angulartics-tests.ts index 5a5660a3f8..a130ec64b2 100644 --- a/types/angulartics/angulartics-tests.ts +++ b/types/angulartics/angulartics-tests.ts @@ -1,5 +1,5 @@ import * as angular from 'angular'; -import { angulartics } from 'angulartics'; +import * as angulartics from 'angulartics'; namespace Analytics { angular.module("angulartics.app", ["angulartics"]) diff --git a/types/angulartics/index.d.ts b/types/angulartics/index.d.ts index 0d9ba1f17f..40ff202329 100644 --- a/types/angulartics/index.d.ts +++ b/types/angulartics/index.d.ts @@ -1,11 +1,13 @@ -// Type definitions for Angulartics 1.3 +// Type definitions for Angulartics 1.4 // Project: http://luisfarzati.github.io/angulartics/ -// Definitions by: Steven Fan +// Definitions by: Bateast2 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as angular from 'angular'; +export = angulartics;//AMD/Require module support +export as namespace angulartics;//UMD module support declare namespace angulartics { interface IAngularticsStatic { @@ -13,41 +15,67 @@ declare namespace angulartics { } interface IAnalyticsService { - eventTrack(eventName: string, properties?: any): any; - getOptOut(): boolean; pageTrack(path: string, location?: angular.ILocationService): any; + eventTrack(eventName: string, properties?: any): any; + exceptionTrack(error: any, cause: string): any; + transactionTrack: any; setAlias(alias: string): any; - setOptOut(value: boolean): void; setUsername(username: string): any; - setUserProperties(properties: any): any; - setSuperProperties(properties: any): any; + setUserProperties(userProperties: any): any; + setUserPropertiesOnce(userProperties: any): any; + setSuperProperties(superProperties: any): any; + setSuperPropertiesOnce(superProperties: any): any; + incrementProperty(property: string, value?: any): any; + userTimings(properties: any): any; + clearCookies: any; + + getOptOut(): boolean; + setOptOut(value: boolean): void; } interface IAnalyticsServiceProvider extends angular.IServiceProvider { virtualPageviews(value: boolean): void; + trackStates(value: boolean): void; + trackRoutes(value: boolean): void; excludeRoutes(value: string[]): void; + queryKeysWhitelist(keys: string[]): void + queryKeysBlacklist(keys: string[]): void firstPageview(value: boolean): void; withBase(value: boolean): void; withAutoBase(value: boolean): void; - developerMode(value: boolean): void; trackExceptions(value: boolean): void; - trackRoutes(value: boolean): void; - trackStates(value: boolean): void; + developerMode(value: boolean): void; registerPageTrack(callback: (path: string, location?: angular.ILocationService) => any): void; registerEventTrack(callback: (eventName: string, properties?: any) => any): void; + registerTransactionTrack(callback: any): void; registerSetAlias(callback: (alias: string) => any): void; registerSetUsername(callback: (username: string) => any): void; registerSetUserProperties(callback: (userProperties: any) => any): void; + registerSetUserPropertiesOnce(callback: (userProperties: any) => any): void; registerSetSuperProperties(callback: (superProperties: any) => any): void; + registerSetSuperPropertiesOnce(callback: (superProperties: any) => any): void; + registerIncrementProperty(callback: (property: string, value?: any) => any): void; + registerUserTimings(callback: (properties: any) => any): void; + registerClearCookies(callback: any): void; settings: { pageTracking: { autoTrackingVirtualPages: boolean, autoTrackingFirstPage: boolean, + trackRelativePath: boolean, + trackRoutes: boolean, + trackStates: boolean, + autoBasePath: boolean, basePath: string, - autoBasePath: boolean + excludedRoutes: string[], + queryKeysWhitelisted: string[], + queryKeysBlacklisted: string[] }, + eventTracking: {}, + bufferFlushDelay: number, + trackExceptions: boolean, + optOut: boolean, developerMode: boolean }; } diff --git a/types/angulartics/tslint.json b/types/angulartics/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angulartics/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/animation-frame/tslint.json b/types/animation-frame/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/animation-frame/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/annyang/index.d.ts b/types/annyang/index.d.ts index fee0cb9acb..76f2bdb455 100644 --- a/types/annyang/index.d.ts +++ b/types/annyang/index.d.ts @@ -6,39 +6,23 @@ /** * Options for function `start` - * - * @export - * @interface StartOptions */ export interface StartOptions { /** * Should annyang restart itself if it is closed indirectly, because of silence or window conflicts? - * - * @type {boolean} */ autoRestart?: boolean; /** * Allow forcing continuous mode on or off. Annyang is pretty smart about this, so only set this if you know what you're doing. - * - * @type {boolean} */ continuous?: boolean; } /** * A command option that supports custom regular expressions - * - * @export - * @interface CommandOptionRegex */ export interface CommandOptionRegex { - /** - * @type {RegExp} - */ regexp: RegExp; - /** - * @type {() => any} - */ callback(): void; } @@ -50,8 +34,6 @@ export interface CommandOptionRegex { * {'hello :name': helloFunction, 'howdy': helloFunction}; * {'hi': helloFunction}; * ```` - * @export - * @interface CommandOption */ export interface CommandOption { [command: string]: CommandOptionRegex | (() => void); @@ -92,8 +74,6 @@ export interface Annyang { /** * Start listening. * It's a good idea to call this after adding some commands first, but not mandatory. - * - * @param {StartOptions} options */ start(options?: StartOptions): void; @@ -119,15 +99,13 @@ export interface Annyang { /** * Turn on output of debug messages to the console. Ugly, but super-handy! * - * @export - * @param {boolean} [newState=true] Turn on/off debug messages + * @param [newState=true] Turn on/off debug messages */ debug(newState?: boolean): void; /** * Set the language the user will speak in. If this method is not called, defaults to 'en-US'. * - * @param {string} lang * @see [Languages](https://github.com/TalAter/annyang/blob/master/docs/FAQ.md#what-languages-are-supported) */ setLanguage(lang: string): void; @@ -144,8 +122,6 @@ export interface Annyang { * annyang.addCommands(commands2); * // annyang will now listen to all three commands * ```` - * - * @param {CommandOption} commands */ addCommands(commands: CommandOption): void; @@ -161,7 +137,6 @@ export interface Annyang { * // Remove all existing commands * annyang.removeCommands(); * ```` - * @param {string} command */ removeCommands(command?: string): void; @@ -175,37 +150,22 @@ export interface Annyang { * // Don't respond to howdy or hi * annyang.removeCommands(['howdy', 'hi']); * ```` - * - * @param {string[]} command */ removeCommands(command: string[]): void; - /** - * @param {Events} event - * @param {(userSaid : string, commandText : string, results : string[]) => void} callback - * @param {*} [context] - */ addCallback(event: Events, callback: (userSaid?: string, commandText?: string, results?: string[]) => void, context?: any): void; - /** - * @param {Events} [event] - * @param {Function} [callback] - */ removeCallback(event?: Events, callback?: (userSaid: string, commandText: string, results: string[]) => void): void; /** * Returns true if speech recognition is currently on. * Returns false if speech recognition is off or annyang is paused. - * - * @returns {boolean} */ isListening(): boolean; /** * Returns the instance of the browser's SpeechRecognition object used by annyang. * Useful in case you want direct access to the browser's Speech Recognition engine. - * - * @returns {*} */ getSpeechRecognizer(): any; @@ -223,8 +183,6 @@ export interface Annyang { * ['Time for some thrilling heroics', 'Time for some thrilling aerobics'] * ); * ```` - * - * @param {string} command */ trigger(command: string | string[]): void; } diff --git a/types/ansi-colors/ansi-colors-tests.ts b/types/ansi-colors/ansi-colors-tests.ts new file mode 100644 index 0000000000..9a9afc43f4 --- /dev/null +++ b/types/ansi-colors/ansi-colors-tests.ts @@ -0,0 +1,30 @@ +import * as colors from 'ansi-colors'; + +let s: string; + +s = colors.bgblack("hello"); +s = colors.bgblue("hello"); +s = colors.bgcyan("hello"); +s = colors.bggreen("hello"); +s = colors.bgmagenta("hello"); +s = colors.bgred("hello"); +s = colors.bgwhite("hello"); +s = colors.bgyellow("hello"); +s = colors.black("hello"); +s = colors.blue("hello"); +s = colors.bold("hello"); +s = colors.cyan("hello"); +s = colors.dim("hello"); +s = colors.gray("hello"); +s = colors.green("hello"); +s = colors.grey("hello"); +s = colors.hidden("hello"); +s = colors.inverse("hello"); +s = colors.italic("hello"); +s = colors.magenta("hello"); +s = colors.red("hello"); +s = colors.reset("hello"); +s = colors.strikethrough("hello"); +s = colors.underline("hello"); +s = colors.white("hello"); +s = colors.yellow("hello"); diff --git a/types/ansi-colors/index.d.ts b/types/ansi-colors/index.d.ts new file mode 100644 index 0000000000..092c4c1f2b --- /dev/null +++ b/types/ansi-colors/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for ansi-colors 1.0 +// Project: https://github.com/doowb/ansi-colors +// Definitions by: Rogier Schouten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function bgblack(s: string): string; +export function bgblue(s: string): string; +export function bgcyan(s: string): string; +export function bggreen(s: string): string; +export function bgmagenta(s: string): string; +export function bgred(s: string): string; +export function bgwhite(s: string): string; +export function bgyellow(s: string): string; +export function black(s: string): string; +export function blue(s: string): string; +export function bold(s: string): string; +export function cyan(s: string): string; +export function dim(s: string): string; +export function gray(s: string): string; +export function green(s: string): string; +export function grey(s: string): string; +export function hidden(s: string): string; +export function inverse(s: string): string; +export function italic(s: string): string; +export function magenta(s: string): string; +export function red(s: string): string; +export function reset(s: string): string; +export function strikethrough(s: string): string; +export function underline(s: string): string; +export function white(s: string): string; +export function yellow(s: string): string; diff --git a/types/ansi-colors/tsconfig.json b/types/ansi-colors/tsconfig.json new file mode 100644 index 0000000000..8a0f980cbc --- /dev/null +++ b/types/ansi-colors/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", + "ansi-colors-tests.ts" + ] +} diff --git a/types/chunked-dc/tslint.json b/types/ansi-colors/tslint.json similarity index 100% rename from types/chunked-dc/tslint.json rename to types/ansi-colors/tslint.json diff --git a/types/ansi-regex/ansi-regex-tests.ts b/types/ansi-regex/ansi-regex-tests.ts new file mode 100644 index 0000000000..a5787902f0 --- /dev/null +++ b/types/ansi-regex/ansi-regex-tests.ts @@ -0,0 +1,13 @@ +import ansiRegex = require("ansi-regex"); + +ansiRegex(); // $ExpectType RegExp + +// From the ansi-regex README.md +ansiRegex().test('\u001B[4mcake\u001B[0m'); // $ExpectType boolean +// => true + +ansiRegex().test('cake'); // $ExpectType boolean +// => false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); // $ExpectType RegExpMatchArray | null +// => ['\u001B[4m', '\u001B[0m'] diff --git a/types/ansi-regex/index.d.ts b/types/ansi-regex/index.d.ts new file mode 100644 index 0000000000..34890912dc --- /dev/null +++ b/types/ansi-regex/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for ansi-regex 3.0 +// Project: https://github.com/chalk/ansi-regex#readme +// Definitions by: Manish Vachharajani +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function r(): RegExp; +export = r; diff --git a/types/ansi-regex/tsconfig.json b/types/ansi-regex/tsconfig.json new file mode 100644 index 0000000000..cf1ac84a5c --- /dev/null +++ b/types/ansi-regex/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", + "ansi-regex-tests.ts" + ] +} diff --git a/types/cypress/tslint.json b/types/ansi-regex/tslint.json similarity index 100% rename from types/cypress/tslint.json rename to types/ansi-regex/tslint.json diff --git a/types/ansi-styles/tslint.json b/types/ansi-styles/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ansi-styles/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ansicolors/tslint.json b/types/ansicolors/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ansicolors/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/any-db-transaction/tslint.json b/types/any-db-transaction/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/any-db-transaction/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/any-db/tslint.json b/types/any-db/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/any-db/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/anybar/tslint.json b/types/anybar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/anybar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/anydb-sql-migrations/anydb-sql-migrations-tests.ts b/types/anydb-sql-migrations/anydb-sql-migrations-tests.ts deleted file mode 100644 index ed79ace368..0000000000 --- a/types/anydb-sql-migrations/anydb-sql-migrations-tests.ts +++ /dev/null @@ -1,15 +0,0 @@ -import anydbsql = require('anydb-sql'); -import { Table, Column } from 'anydb-sql' -import migrator = require('anydb-sql-migrations'); - -function do_not_run() { - - var db = anydbsql({ - url: 'postgres://user:pass@host:port/database', - connections: { min: 2, max: 20 } - }); - - migrator - .create(db, '/path/to/migrations/dir') - .run(); -} diff --git a/types/anydb-sql-migrations/index.d.ts b/types/anydb-sql-migrations/index.d.ts deleted file mode 100644 index f6e12ed752..0000000000 --- a/types/anydb-sql-migrations/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Type definitions for anydb-sql-migrations -// Project: https://github.com/spion/anydb-sql-migrations -// Definitions by: Gorgi Kosev -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import Promise = require('bluebird'); -import { Column, Table, Transaction, AnydbSql } from 'anydb-sql'; -export interface Migration { - version: string; -} -export interface MigrationsTable extends Table { - version: Column; -} -export interface MigFn { - (tx: Transaction): Promise; -} -export interface MigrationTask { - up: MigFn; - down: MigFn; - name: string; -} -export declare function create(db: AnydbSql, tasks: string | MigrationTask[]): { - run: () => Promise; - migrateTo: (target?: string) => Promise; - check: (f: (m: { - type: string; - items: MigrationTask[]; - }) => any) => Promise; -}; diff --git a/types/anydb-sql-migrations/package.json b/types/anydb-sql-migrations/package.json deleted file mode 100644 index 7ce063c332..0000000000 --- a/types/anydb-sql-migrations/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "anydb-sql": "^0.6.53" - } -} \ No newline at end of file diff --git a/types/anydb-sql-migrations/tsconfig.json b/types/anydb-sql-migrations/tsconfig.json deleted file mode 100644 index 33bb5ae800..0000000000 --- a/types/anydb-sql-migrations/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "anydb-sql-migrations-tests.ts" - ] -} \ No newline at end of file diff --git a/types/apex.js/index.d.ts b/types/apex.js/index.d.ts index 20178369dc..0998ce794c 100644 --- a/types/apex.js/index.d.ts +++ b/types/apex.js/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/apex/node-apex // Definitions by: Yoriki Yamaguchi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/aphrodite/tslint.json b/types/aphrodite/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aphrodite/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/api-error-handler/api-error-handler-tests.ts b/types/api-error-handler/api-error-handler-tests.ts index 3bc39c4a7b..67afbb0fce 100644 --- a/types/api-error-handler/api-error-handler-tests.ts +++ b/types/api-error-handler/api-error-handler-tests.ts @@ -1,4 +1,3 @@ - import * as errorHandler from 'api-error-handler'; import * as express from 'express'; diff --git a/types/api-error-handler/index.d.ts b/types/api-error-handler/index.d.ts index e9337cc448..41e91a35ea 100644 --- a/types/api-error-handler/index.d.ts +++ b/types/api-error-handler/index.d.ts @@ -2,9 +2,7 @@ // Project: https://github.com/expressjs/api-error-handler // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - - +// TypeScript Version: 2.2 import * as express from 'express'; diff --git a/types/api-error-handler/tslint.json b/types/api-error-handler/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/api-error-handler/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/apigee-access/tslint.json b/types/apigee-access/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/apigee-access/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/app-root-path/tslint.json b/types/app-root-path/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/app-root-path/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/appdmg/appdmg-tests.ts b/types/appdmg/appdmg-tests.ts new file mode 100644 index 0000000000..47800d622f --- /dev/null +++ b/types/appdmg/appdmg-tests.ts @@ -0,0 +1,47 @@ +import appdmg = require("appdmg"); +import { Options, Specification, SpecificationOptions } from "appdmg"; + +const proc = appdmg({ + target: "/foo/bar.dmg", + basepath: "/baz", + specification: { + title: "Happy", + icon: "happy.icns", + background: "happy.tiff", + format: "UDBZ", + "icon-size": 98, + contents: [ + { + x: 405, + y: 150, + type: "link", + path: "/Applications" + }, + { + x: 127, + y: 150, + type: "file", + path: "/foo/bar.app" + } + ] + } +}); + +proc.on("progress", info => { + if (info.type === "step-begin") { + process.stdout.write(`${info.title}... `); + } + + if (info.type === "step-end") { + process.stdout.write(`${info.status}\n`); + } +}); + +proc.on("finish", () => { + console.log('Installer was created successfully!'); +}); + +proc.on("error", (err) => { + console.error('Installer could not be created', err); + process.exit(1); +}); diff --git a/types/appdmg/index.d.ts b/types/appdmg/index.d.ts new file mode 100644 index 0000000000..2e23009f44 --- /dev/null +++ b/types/appdmg/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for appdmg 0.5 +// Project: https://github.com/LinusU/node-appdmg#readme +// Definitions by: Daniel Perez Alvarez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace appdmg { + interface Progress { + current: number; + total: number; + type: "step-begin" | "step-end"; + title: string; + status: "ok" | "skip" | "fail"; + } + + interface EventEmitter extends NodeJS.EventEmitter { + on(event: "progress", listener: (info: Progress) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "error", listener: (err: any) => void): this; + } + + interface SpecificationOptions { + app: string; + background: string; + icon: string; + iconSize: number; + title: string; + } + + interface SpecificationWindow { + position?: { x: number; y: number }; + size?: { width: number; height: number }; + } + + interface SpecificationContents { + x: number; + y: number; + type: "link" | "file" | "position"; + path: string; + name?: string; + } + + interface SpecificationCodeSign { + "signing-identity": string; + identifier?: string; + } + + interface Specification { + title: string; + icon?: string; + background?: string; + "background-color"?: string; + "icon-size"?: number; + window?: SpecificationWindow; + format: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO"; + contents: SpecificationContents[]; + "code-sign"?: SpecificationCodeSign; + } + + interface Options { + target: string; + basepath: string; + specification: Specification; + } +} + +declare function appdmg(options?: appdmg.Options): appdmg.EventEmitter; + +export = appdmg; diff --git a/types/appdmg/tsconfig.json b/types/appdmg/tsconfig.json new file mode 100644 index 0000000000..f4ca0f95c5 --- /dev/null +++ b/types/appdmg/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", + "appdmg-tests.ts" + ] +} diff --git a/types/egg/tslint.json b/types/appdmg/tslint.json similarity index 100% rename from types/egg/tslint.json rename to types/appdmg/tslint.json diff --git a/types/appframework/tslint.json b/types/appframework/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/appframework/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/applepayjs/applepayjs-tests.ts b/types/applepayjs/applepayjs-tests.ts index 505dbd2daf..99b323453b 100644 --- a/types/applepayjs/applepayjs-tests.ts +++ b/types/applepayjs/applepayjs-tests.ts @@ -22,7 +22,7 @@ describe("ApplePaySession", () => { }); it("can create a new instance", () => { const version = 1; - const paymentRequest = { + const paymentRequest: ApplePayJS.ApplePayPaymentRequest = { countryCode: "US", currencyCode: "USD", supportedNetworks: [ @@ -57,8 +57,8 @@ describe("ApplePaySession", () => { }); }); it("can call instance methods", () => { - const version = 1; - const paymentRequest = { + const version = 3; + const paymentRequest: ApplePayJS.ApplePayPaymentRequest = { countryCode: "US", currencyCode: "USD", supportedNetworks: [ @@ -66,7 +66,9 @@ describe("ApplePaySession", () => { "visa" ], merchantCapabilities: [ - "supports3DS" + "supports3DS", + "supportsCredit", + "supportsDebit" ], total: { label: "My Store", @@ -80,15 +82,29 @@ describe("ApplePaySession", () => { session.completeMerchantValidation({ foo: "bar" }); + session.completePayment(ApplePaySession.STATUS_SUCCESS); - const total = { + const authorizationResult: ApplePayJS.ApplePayPaymentAuthorizationResult = { + status: ApplePaySession.STATUS_FAILURE, + errors: [ + { + code: "addressUnserviceable", + contactField: "postalCode", + message: "The specified postal code cannot be delivered to." + } + ] + }; + + session.completePayment(authorizationResult); + + const total: ApplePayJS.ApplePayLineItem = { label: "Subtotal", type: "final", amount: "35.00" }; - const lineItems = [ + const lineItems: ApplePayJS.ApplePayLineItem[] = [ { label: "Subtotal", type: "final", @@ -97,11 +113,12 @@ describe("ApplePaySession", () => { { label: "Free Shipping", amount: "0.00", - type: "pending" + type: "final" }, { label: "Estimated Tax", - amount: "3.06" + amount: "3.06", + type: "pending" } ]; @@ -120,17 +137,35 @@ describe("ApplePaySession", () => { session.completePaymentMethodSelection(total, lineItems); + const paymentUpdate = { + newTotal: total + }; + + session.completePaymentMethodSelection(paymentUpdate); + session.completeShippingContactSelection( ApplePaySession.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS, shippingMethods, total, lineItems); + const contactUpdate = { + newTotal: total + }; + + session.completeShippingContactSelection(contactUpdate); + session.completeShippingMethodSelection( ApplePaySession.STATUS_SUCCESS, total, lineItems); + const shippingUpdate = { + newTotal: total + }; + + session.completeShippingMethodSelection(shippingUpdate); + session.oncancel = (event: ApplePayJS.Event): void => { event.cancelBubble = true; }; @@ -201,7 +236,9 @@ describe("ApplePayPaymentRequest", () => { "1 Infinite Loop" ], locality: "Cupertino", + subLocality: "", administrativeArea: "CA", + subAdministrativeArea: "", postalCode: "95014", country: "United States", countryCode: "US" @@ -233,7 +270,7 @@ describe("ApplePayPaymentRequest", () => { "postalAddress", "name", "phone", - "email" + "name" ]; paymentRequest.shippingContact = { @@ -241,11 +278,15 @@ describe("ApplePayPaymentRequest", () => { familyName: "Patel", givenName: "Ravi", phoneNumber: "(408) 555-5555", + phoneticFamilyName: "Patel", + phoneticGivenName: "Ravi", addressLines: [ "1 Infinite Loop" ], locality: "Cupertino", + subLocality: "", administrativeArea: "CA", + subAdministrativeArea: "", postalCode: "95014", country: "United States", countryCode: "US" @@ -265,5 +306,6 @@ describe("ApplePayPaymentRequest", () => { ]; paymentRequest.shippingType = "storePickup"; + paymentRequest.shippingType = "delivery"; }); }); diff --git a/types/applepayjs/index.d.ts b/types/applepayjs/index.d.ts index f705a4fad2..a37f60b6fd 100644 --- a/types/applepayjs/index.d.ts +++ b/types/applepayjs/index.d.ts @@ -1,26 +1,26 @@ -// Type definitions for Apple Pay JS 1.0 +// Type definitions for Apple Pay JS 3.0 // Project: https://developer.apple.com/reference/applepayjs -// Definitions by: Martin Costello +// Definitions by: Martin Costello // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** - * A session object for managing the payment process on the web. + * ApplePaySession is the entry point for Apple Pay on the web. */ declare class ApplePaySession extends EventTarget { /** - * Creates a new instance of the ApplePaySession class. - * @param version - The version of the ApplePay JS API you are using. - * @param paymentRequest - An ApplePayPaymentRequest object that contains the information that is displayed on the Apple Pay payment sheet. + * The entry point for Apple Pay on the web. + * @param version - The version number of the ApplePay JS API you are using. The current API version number is 3. + * @param paymentRequest - An ApplePayPaymentRequest object that contains the information to be displayed on the Apple Pay payment sheet. */ constructor(version: number, paymentRequest: ApplePayJS.ApplePayPaymentRequest); /** - * A callback function that is automatically called when the payment UI is dismissed with an error. + * A callback function that is automatically called when the payment UI is dismissed. */ oncancel: (event: ApplePayJS.Event) => void; /** - * A callback function that is automatically called when the user has authorized the Apple Pay payment, typically via TouchID. + * A callback function that is automatically called when the user has authorized the Apple Pay payment with Touch ID, Face ID, or passcode. */ onpaymentauthorized: (event: ApplePayJS.ApplePayPaymentAuthorizedEvent) => void; @@ -45,28 +45,28 @@ declare class ApplePaySession extends EventTarget { onvalidatemerchant: (event: ApplePayJS.ApplePayValidateMerchantEvent) => void; /** - * Indicates whether or not the device supports Apple Pay. + * Indicates whether the device supports Apple Pay. * @returns true if the device supports making payments with Apple Pay; otherwise, false. */ static canMakePayments(): boolean; /** - * Indicates whether or not the device supports Apple Pay and if the user has an active card in Wallet. - * @param merchantIdentifier - The merchant ID received when the merchant enrolled in Apple Pay. - * @returns true if the device supports Apple Pay and there is at least one active card in Wallet; otherwise, false. + * Indicates whether the device supports Apple Pay and whether the user has an active card in Wallet. + * @param merchantIdentifier - The merchant ID created when the merchant enrolled in Apple Pay. + * @returns true if the device supports Apple Pay and there is at least one active card in Wallet that is qualified for payments on the web; otherwise, false. */ static canMakePaymentsWithActiveCard(merchantIdentifier: string): Promise; /** * Displays the Set up Apple Pay button. - * @param merchantIdentifier - The merchant ID received when the merchant enrolled in Apple Pay. + * @param merchantIdentifier - The merchant ID created when the merchant enrolled in Apple Pay. * @returns A boolean value indicating whether setup was successful. */ static openPaymentSetup(merchantIdentifier: string): Promise; /** - * Verifies if a web browser supports a given Apple Pay JS API version. - * @param version - A number representing the Apple Pay JS API version being checked. The initial version is 1. + * Verifies whether a web browser supports a given Apple Pay JS API version. + * @param version - A number representing the Apple Pay JS API version being checked. The initial version is 1. The latest version is 3. * @returns A boolean value indicating whether the web browser supports the given API version. Returns false if the web browser does not support the specified version. */ static supportsVersion(version: number): boolean; @@ -82,26 +82,33 @@ declare class ApplePaySession extends EventTarget { begin(): void; /** - * Call after the merchant has been validated. + * Completes the validation for a merchant session. * @param merchantSession - An opaque message session object. */ completeMerchantValidation(merchantSession: any): void; /** - * Call when a payment has been authorized. - * @param status - The status of the payment. + * Completes the payment authorization with a result. + * @param result - The status of the payment, whether it succeeded or failed for Apple Pay JS versions 1 and 2, + * or the result of the payment authorization, including its status and list of errors for Apple Pay JS version 3. */ - completePayment(status: number): void; + completePayment(result: number | ApplePayJS.ApplePayPaymentAuthorizationResult): void; /** - * Call after a payment method has been selected. + * Call after a payment method has been selected for Apple Pay JS versions 1 and 2. * @param newTotal - An ApplePayLineItem dictionary representing the total price for the purchase. * @param newLineItems - A sequence of ApplePayLineItem dictionaries. */ completePaymentMethodSelection(newTotal: ApplePayJS.ApplePayLineItem, newLineItems: ApplePayJS.ApplePayLineItem[]): void; /** - * Call after a shipping contact has been selected. + * Completes the selection of a payment method with an update for Apple Pay JS version 3. + * @param update - The updated payment method. + */ + completePaymentMethodSelection(update: ApplePayJS.ApplePayPaymentMethodUpdate): void; + + /** + * Completes the selection of a shipping contact with an update for Apple Pay JS versions 1 and 2. * @param status - The status of the shipping contact update. * @param newShippingMethods - A sequence of ApplePayShippingMethod dictionaries. * @param newTotal - An ApplePayLineItem dictionary representing the total price for the purchase. @@ -114,13 +121,25 @@ declare class ApplePaySession extends EventTarget { newLineItems: ApplePayJS.ApplePayLineItem[]): void; /** - * Call after the shipping method has been selected. + * Completes the selection of a shipping contact with an update for Apple Pay JS version 3. + * @param update - The updated shipping contact. + */ + completeShippingContactSelection(update: ApplePayJS.ApplePayShippingContactUpdate): void; + + /** + * Call after the shipping method has been selected for Apple Pay JS versions 1 and 2. * @param status - The status of the shipping method update. * @param newTotal - An ApplePayLineItem dictionary representing the total price for the purchase. * @param newLineItems - A sequence of ApplePayLineItem dictionaries. */ completeShippingMethodSelection(status: number, newTotal: ApplePayJS.ApplePayLineItem, newLineItems: ApplePayJS.ApplePayLineItem[]): void; + /** + * Completes the selection of a shipping method with an update for Apple Pay JS version 3. + * @param update - The updated shipping method. + */ + completeShippingMethodSelection(update: ApplePayJS.ApplePayShippingMethodUpdate): void; + /** * The requested action succeeded. */ @@ -163,6 +182,78 @@ declare class ApplePaySession extends EventTarget { } declare namespace ApplePayJS { + /** + * Field names used for requesting contact information in a payment request. + */ + type ApplePayContactField = + 'email' | + 'name' | + 'phone' | + 'postalAddress' | + 'phoneticName'; + + /** + * A customizable error type that you create to indicate problems with the address or contact information on an Apple Pay sheet. + */ + interface ApplePayError { + /** + * The error code for this instance. + */ + code: ApplePayErrorCode; + + /** + * The name of the field that contains the error. + */ + contactField?: ApplePayErrorContactField; + + /** + * A localized, user-facing string that describes the error. + */ + message: string; + } + + /** + * The error code that indicates whether an error on the payment sheet is for shipping or billing information, or for another kind of error. + */ + type ApplePayErrorCode = + /** + * Shipping address or contact information is invalid or missing. + */ + 'shippingContactInvalid' | + + /** + * Billing address information is invalid or missing. + */ + 'billingContactInvalid' | + + /** + * The merchant cannot provide service to the shipping address (for example, can't deliver to a P.O. Box). + */ + 'addressUnserviceable' | + + /** + * An unknown but nonfatal error occurred during payment processing. The user can attempt authorization again. + */ + 'unknown'; + + /** + * Names of the fields in the shipping or billing contact information, used to locate errors in the payment sheet. + */ + type ApplePayErrorContactField = + 'phoneNumber' | + 'emailAddress' | + 'name' | + 'phoneticName' | + 'postalAddress' | + 'addressLines' | + 'locality' | + 'subLocality' | + 'postalCode' | + 'administrativeArea' | + 'subAdministrativeArea' | + 'country' | + 'countryCode'; + /** * Defines a line item in a payment request - for example, total, tax, discount, or grand total. */ @@ -180,15 +271,53 @@ declare namespace ApplePayJS { /** * A value that indicates if the line item is final or pending. */ - type?: string; + type?: ApplePayLineItemType; } + /** + * A type that indicates whether a line item is final or pending. + */ + type ApplePayLineItemType = + /** + * A line item representing the known, final cost. + */ + 'final' | + + /** + * A line item representing an estimated or unknown cost. + */ + 'pending'; + + /** + * The payment capabilities supported by the merchant. + */ + type ApplePayMerchantCapability = + /** + * Required. This value must be supplied. + */ + 'supports3DS' | + + /** + * Include this value only if you support China Union Pay transactions. + */ + 'supportsEMV' | + + /** + * Optional. If present, only transactions that are categorized as credit cards are allowed. + */ + 'supportsCredit' | + + /** + * Optional. If present, only transactions that are categorized as debit cards are allowed. + */ + 'supportsDebit'; + /** * Represents the result of authorizing a payment request and contains encrypted payment information. */ interface ApplePayPayment { /** - * The encrypted token for an authorized payment. + * The encrypted information for an authorized payment. */ token: ApplePayPaymentToken; @@ -208,11 +337,26 @@ declare namespace ApplePayJS { */ abstract class ApplePayPaymentAuthorizedEvent extends Event { /** - * The payment token used to authorize a payment. + * The authorized payment information for this transaction. */ readonly payment: ApplePayPayment; } + /** + * The result of payment authorization, including status and errors. + */ + interface ApplePayPaymentAuthorizationResult { + /** + * The status code for the authorization result. + */ + status: number; + + /** + * A list of custom errors to display on the payment sheet. + */ + errors?: ApplePayError[]; + } + /** * Encapsulates contact information needed for billing and shipping. */ @@ -220,56 +364,76 @@ declare namespace ApplePayJS { /** * An email address for the contact. */ - emailAddress: string; + emailAddress?: string; /** * The contact's family name. */ - familyName: string; + familyName?: string; /** * The contact's given name. */ - givenName: string; + givenName?: string; /** * A phone number for the contact. */ - phoneNumber: string; + phoneNumber?: string; /** - * The address for the contact. + * The phonetic spelling of the contact's family name. */ - addressLines: string[]; + phoneticFamilyName?: string; + + /** + * The phonetic spelling of the contact's given name. + */ + phoneticGivenName?: string; + + /** + * The street portion of the address for the contact. + */ + addressLines?: string[]; /** * The city for the contact. */ - locality: string; + locality?: string; + + /** + * Additional information associated with the location, typically defined at the city or town level (such as district or neighborhood), in a postal address. + */ + subLocality?: string; /** * The state for the contact. */ - administrativeArea: string; + administrativeArea?: string; /** - * The zip code, where applicable, for the contact. + * The subadministrative area (such as a county or other region) in a postal address. */ - postalCode: string; + subAdministrativeArea?: string; /** - * The colloquial country name for the contact. + * The zip code or postal code, where applicable, for the contact. */ - country: string; + postalCode?: string; /** - * The contact's ISO country code. + * The name of the country for the contact. */ - countryCode: string; + country?: string; + + /** + * The contact’s two-letter ISO 3166 country code. + */ + countryCode?: string; } /** - * Contains information about an Apple Pay payment card. + * A dictionary that describes an Apple Pay payment card. */ interface ApplePayPaymentMethod { /** @@ -279,21 +443,29 @@ declare namespace ApplePayJS { /** * A string, suitable for display, that is the name of the payment network backing the card. - * The value is one of the supported networks specified in the supportedNetworks property of the ApplePayPaymentRequest. */ network: string; /** * A value representing the card's type of payment. */ - type: string; + type: ApplePayPaymentMethodType; /** - * The payment pass object associated with the payment. + * The payment pass object currently selected to complete the payment. */ paymentPass: ApplePayPaymentPass; } + /** + * A payment card's type of payment. + */ + type ApplePayPaymentMethodType = + 'debit' | + 'credit' | + 'prepaid' | + 'store'; + /** * The ApplePayPaymentMethodSelectedEvent class defines the attributes contained by the ApplePaySession.onpaymentmethodselected callback function. */ @@ -304,6 +476,21 @@ declare namespace ApplePayJS { readonly paymentMethod: ApplePayPaymentMethod; } + /** + * Updated transaction details resulting from a change in payment method. + */ + interface ApplePayPaymentMethodUpdate { + /** + * An optional list of line items. + */ + newLineItems?: ApplePayLineItem[]; + + /** + * The new total resulting from a change in the payment method. + */ + newTotal: ApplePayLineItem; + } + /** * Represents a provisioned payment card for Apple Pay payments. */ @@ -331,9 +518,38 @@ declare namespace ApplePayJS { /** * The activation state of the pass. */ - activationState: string; + activationState: ApplePayPaymentPassActivationState; } + /** + * Payment pass activation states. + */ + type ApplePayPaymentPassActivationState = + /** + * Active and ready to be used for payment. + */ + 'activated' | + + /** + * Not active but may be activated by the issuer. + */ + 'requiresActivation' | + + /** + * Not ready for use but activation is in progress. + */ + 'activating' | + + /** + * Not active and can't be activated. + */ + 'suspended' | + + /** + * Not active because the issuer has disabled the account associated with the device. + */ + 'deactivated'; + /** * Encapsulates a request for payment, including information about payment processing capabilities, the payment amount, and shipping information. */ @@ -357,7 +573,7 @@ declare namespace ApplePayJS { * The payment capabilities supported by the merchant. * The value must at least contain ApplePayMerchantCapability.supports3DS. */ - merchantCapabilities: string[]; + merchantCapabilities: ApplePayMerchantCapability[]; /** * The payment networks supported by the merchant. @@ -377,12 +593,12 @@ declare namespace ApplePayJS { /** * The billing information that you require from the user in order to process the transaction. */ - requiredBillingContactFields?: string[]; + requiredBillingContactFields?: ApplePayContactField[]; /** * The shipping information that you require from the user in order to fulfill the order. */ - requiredShippingContactFields?: string[]; + requiredShippingContactFields?: ApplePayContactField[]; /** * Shipping contact information for the user. @@ -397,7 +613,12 @@ declare namespace ApplePayJS { /** * How the items are to be shipped. */ - shippingType?: string; + shippingType?: ApplePayShippingType; + + /** + * A list of ISO 3166 country codes for limiting payments to cards from specific countries. + */ + supportedCountries?: string[]; /** * Optional user-defined data. @@ -406,7 +627,7 @@ declare namespace ApplePayJS { } /** - * Contains the user's payment credentials. + * An object that contains the user's payment credentials. */ interface ApplePayPaymentToken { /** @@ -426,7 +647,7 @@ declare namespace ApplePayJS { } /** - * The ApplePayShippingContactSelectedEvent class defines the attributes contained by the ApplePaySession.onshippingcontactselected callback function. + * Encapsulates the attributes contained by the onshippingcontactselected callback function. */ abstract class ApplePayShippingContactSelectedEvent extends Event { /** @@ -435,6 +656,31 @@ declare namespace ApplePayJS { readonly shippingContact: ApplePayPaymentContact; } + /** + * Updated transaction details resulting from a change in shipping contact, including any errors. + */ + class ApplePayShippingContactUpdate { + /** + * List of custom errors to display on the payment sheet. + */ + errors?: ApplePayError[]; + + /** + * An optional list of updated line items. + */ + newLineItems?: ApplePayLineItem[]; + + /** + * A list of shipping methods that are available to the updated shipping contact. + */ + newShippingMethods?: ApplePayShippingMethod[]; + + /** + * The new total resulting from a change in the shipping contact. + */ + newTotal: ApplePayLineItem; + } + /** * Defines a shipping method for delivering physical goods. */ @@ -471,11 +717,35 @@ declare namespace ApplePayJS { } /** - * The ApplePayValidateMerchantEvent class defines the attributes contained by the ApplePaySession.onvalidatemerchant callback function. + * Updated transaction details resulting from a change in shipping method. + */ + interface ApplePayShippingMethodUpdate { + /** + * An optional list of updated line items. + */ + newLineItems?: ApplePayLineItem[]; + + /** + * The new total resulting from a change in the shipping method. + */ + newTotal: ApplePayLineItem; + } + + /** + * A type that indicates how purchased items are to be shipped. + */ + type ApplePayShippingType = + 'shipping' | + 'delivery' | + 'storePickup' | + 'servicePickup'; + + /** + * The attributes contained by the onvalidatemerchant callback function. */ abstract class ApplePayValidateMerchantEvent extends Event { /** - * The URL used to validate the merchant server. + * The URL your server must use to validate itself and obtain a merchant session object. */ readonly validationURL: string; } diff --git a/types/appletvjs/tslint.json b/types/appletvjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/appletvjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/applicationinsights-js/index.d.ts b/types/applicationinsights-js/index.d.ts index 17137d67dd..4214837ddf 100644 --- a/types/applicationinsights-js/index.d.ts +++ b/types/applicationinsights-js/index.d.ts @@ -777,7 +777,7 @@ declare module Microsoft.ApplicationInsights { * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. * @param accountId {string} - An optional string to represent the account associated with the authenticated user. */ - setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string): any; + setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie?: boolean): any; /** * Clears the authenticated user id and the account id from the user context. */ diff --git a/types/applicationinsights-js/tslint.json b/types/applicationinsights-js/tslint.json index e4be61c456..29f4a79556 100644 --- a/types/applicationinsights-js/tslint.json +++ b/types/applicationinsights-js/tslint.json @@ -6,7 +6,10 @@ "no-declare-current-package": false, "no-internal-module": false, "no-mergeable-namespace": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, "no-single-declare-module": false, + "no-unnecessary-class": false, "no-unnecessary-qualifier": false } } diff --git a/types/applicationinsights/applicationinsights-tests.ts b/types/applicationinsights/applicationinsights-tests.ts deleted file mode 100644 index 00c303eff4..0000000000 --- a/types/applicationinsights/applicationinsights-tests.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as appInsights from "applicationinsights"; - -// basic use -appInsights.setup("").start(); - -// basic use with auto-collection configuration -appInsights.setup("") - .setAutoCollectRequests(false) - .setAutoCollectPerformance(false) - .setAutoCollectExceptions(false) - // no telemetry will be sent until .start() is called - // this prevents any of the auto-collectors from initializing - .enableVerboseLogging() - .start(); - -appInsights.client.trackEvent("custom event", {customProperty: "custom property value"}); -appInsights.client.trackException(new Error("handled exceptions can be logged with this method")); -appInsights.client.trackMetric("custom metric", 3); -appInsights.client.trackTrace("trace message"); -appInsights.client.trackDependency("dependency name", "commandName", 500, true); - -// assign common properties to all telemetry -appInsights.client.commonProperties = { - environment: "dev" -}; - -// send any pending data and log the response -appInsights.client.sendPendingData(function (response) { - console.log(response); -}); diff --git a/types/applicationinsights/index.d.ts b/types/applicationinsights/index.d.ts deleted file mode 100644 index 471089a96f..0000000000 --- a/types/applicationinsights/index.d.ts +++ /dev/null @@ -1,490 +0,0 @@ -// Type definitions for Application Insights v0.15.12 -// Project: https://github.com/Microsoft/ApplicationInsights-node.js -// Definitions by: Scott Southwood -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface AutoCollectConsole { - constructor(client: Client): AutoCollectConsole; - enable(isEnabled: boolean): void; - isInitialized(): boolean; -} - -interface AutoCollectExceptions { - constructor(client:Client): AutoCollectExceptions; - isInitialized(): boolean; - enable(isEnabled:boolean): void; -} - -interface AutoCollectPerformance { - constructor(client: Client): AutoCollectPerformance; - enable(isEnabled: boolean): void; - isInitialized(): boolean; -} - -interface AutoCollectRequests { - constructor(client: Client): AutoCollectRequests; - enable(isEnabled: boolean): void; - isInitialized(): boolean; -} - - -declare namespace ContractsModule { - enum DataPointType { - Measurement = 0, - Aggregation = 1, - } - enum DependencyKind { - SQL = 0, - Http = 1, - Other = 2, - } - enum DependencySourceType { - Undefined = 0, - Aic = 1, - Apmc = 2, - } - enum SessionState { - Start = 0, - End = 1, - } - enum SeverityLevel { - Verbose = 0, - Information = 1, - Warning = 2, - Error = 3, - Critical = 4, - } - interface ContextTagKeys { - applicationVersion: string; - applicationBuild: string; - deviceId: string; - deviceIp: string; - deviceLanguage: string; - deviceLocale: string; - deviceModel: string; - deviceNetwork: string; - deviceOEMName: string; - deviceOS: string; - deviceOSVersion: string; - deviceRoleInstance: string; - deviceRoleName: string; - deviceScreenResolution: string; - deviceType: string; - deviceMachineName: string; - locationIp: string; - operationId: string; - operationName: string; - operationParentId: string; - operationRootId: string; - operationSyntheticSource: string; - operationIsSynthetic: string; - sessionId: string; - sessionIsFirst: string; - sessionIsNew: string; - userAccountAcquisitionDate: string; - userAccountId: string; - userAgent: string; - userId: string; - userStoreRegion: string; - sampleRate: string; - internalSdkVersion: string; - internalAgentVersion: string; - constructor(): ContextTagKeys; - } - interface Domain { - ver: number; - properties: any; - constructor(): Domain; - } - interface Data { - baseType: string; - baseData: TDomain; - constructor(): Data; - } - interface Envelope { - ver: number; - name: string; - time: string; - sampleRate: number; - seq: string; - iKey: string; - flags: number; - deviceId: string; - os: string; - osVer: string; - appId: string; - appVer: string; - userId: string; - tags: { - [key: string]: string; - }; - data: Data; - constructor(): Envelope; - } - interface EventData extends ContractsModule.Domain { - ver: number; - name: string; - properties: any; - measurements: any; - constructor(): EventData; - } - interface MessageData extends ContractsModule.Domain { - ver: number; - message: string; - severityLevel: ContractsModule.SeverityLevel; - properties: any; - constructor(): MessageData; - } - interface ExceptionData extends ContractsModule.Domain { - ver: number; - handledAt: string; - exceptions: ExceptionDetails[]; - severityLevel: ContractsModule.SeverityLevel; - problemId: string; - crashThreadId: number; - properties: any; - measurements: any; - constructor(): ExceptionData; - } - interface StackFrame { - level: number; - method: string; - assembly: string; - fileName: string; - line: number; - constructor(): StackFrame; - } - interface ExceptionDetails { - id: number; - outerId: number; - typeName: string; - message: string; - hasFullStack: boolean; - stack: string; - parsedStack: StackFrame[]; - constructor(): ExceptionDetails; - } - interface DataPoint { - name: string; - kind: ContractsModule.DataPointType; - value: number; - count: number; - min: number; - max: number; - stdDev: number; - constructor(): DataPoint; - } - interface MetricData extends ContractsModule.Domain { - ver: number; - metrics: DataPoint[]; - properties: any; - constructor(): MetricData; - } - interface PageViewData extends ContractsModule.EventData { - ver: number; - url: string; - name: string; - duration: string; - properties: any; - measurements: any; - constructor(): PageViewData; - } - interface PageViewPerfData extends ContractsModule.PageViewData { - ver: number; - url: string; - perfTotal: string; - name: string; - duration: string; - networkConnect: string; - sentRequest: string; - receivedResponse: string; - domProcessing: string; - properties: any; - measurements: any; - constructor(): PageViewPerfData; - } - interface RemoteDependencyData extends ContractsModule.Domain { - ver: number; - name: string; - kind: ContractsModule.DataPointType; - value: number; - count: number; - min: number; - max: number; - stdDev: number; - dependencyKind: ContractsModule.DependencyKind; - success: boolean; - async: boolean; - dependencySource: ContractsModule.DependencySourceType; - commandName: string; - dependencyTypeName: string; - properties: any; - constructor(): RemoteDependencyData; - } - interface AjaxCallData extends ContractsModule.PageViewData { - ver: number; - url: string; - ajaxUrl: string; - name: string; - duration: string; - requestSize: number; - responseSize: number; - timeToFirstByte: string; - timeToLastByte: string; - callbackDuration: string; - responseCode: string; - success: boolean; - properties: any; - measurements: any; - constructor(): AjaxCallData; - } - interface RequestData extends ContractsModule.Domain { - ver: number; - id: string; - name: string; - startTime: string; - duration: string; - responseCode: string; - success: boolean; - httpMethod: string; - url: string; - properties: any; - measurements: any; - constructor(): RequestData; - } - interface SessionStateData extends ContractsModule.Domain { - ver: number; - state: ContractsModule.SessionState; - constructor(): SessionStateData; - } - interface PerformanceCounterData extends ContractsModule.Domain { - ver: number; - categoryName: string; - counterName: string; - instanceName: string; - kind: DataPointType; - count: number; - min: number; - max: number; - stdDev: number; - value: number; - properties: any; - constructor(): PerformanceCounterData; - } -} - - -interface Channel { - constructor(isDisabled: () => boolean, getBatchSize: () => number, getBatchIntervalMs: () => number, sender: Sender): Channel; - /** - * Add a telemetry item to the send buffer - */ - send(envelope: ContractsModule.Envelope): void; - handleCrash(envelope: ContractsModule.Envelope): void; - /** - * Immediately send buffered data - */ - triggerSend(isNodeCrashing?: boolean): void; -} - -interface Client { - config: Config; - context: Context; - commonProperties: { - [key: string]: string; - }; - channel: Channel; - /** - * Constructs a new client of the client - * @param iKey the instrumentation key to use (read from environment variable if not specified) - */ - constructor(iKey?: string): Client; - /** - * Log a user action or other occurrence. - * @param name A string to identify this event in the portal. - * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. - * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. - */ - trackEvent(name: string, properties?: { - [key: string]: string; - }, measurements?: { - [key: string]: number; - }): void; - /** - * Log a trace message - * @param message A string to identify this event in the portal. - * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. - */ - trackTrace(message: string, severityLevel?: ContractsModule.SeverityLevel, properties?: { - [key: string]: string; - }): void; - /** - * Log an exception you have caught. - * @param exception An Error from a catch clause, or the string error message. - * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. - * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. - */ - trackException(exception: Error, properties?: { - [key: string]: string; - }): void; - /** - * Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators. - * To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the - * telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals. - * @param name A string that identifies the metric. - * @param value The value of the metric - * @param count the number of samples used to get this value - * @param min the min sample for this set - * @param max the max sample for this set - * @param stdDev the standard deviation of the set - */ - trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number, properties?: { - [key: string]: string; - }): void; - - /** - * Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error" - * event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish" - * or request "error" events were fired. - * @param request The http.IncomingMessage object to track - * @param response The http.ServerResponse object for this request - * @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty. - */ - trackRequest(request: any /* http.IncomingMessage */, response: any /* http.ServerResponse */, properties?: { - [key: string]: string; - }): void; - - /** - * Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events. - * Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags). - * @param request The http.IncomingMessage object to track - * @param response The http.ServerResponse object for this request - * @param ellapsedMilliseconds The duration for this request. Defaults to 0. - * @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty. - * @param error An error that was returned for this request if it was unsuccessful. Defaults to null. - */ - trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: { - [key: string]: string;}, error?: any) : void; - - /** - * Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server. - * @param name The name of the dependency (i.e. "myDatabse") - * @param commandname The name of the command executed on the dependency - * @param elapsedTimeMs The amount of time in ms that the dependency took to return the result - * @param success True if the dependency succeeded, false otherwise - * @param dependencyTypeName The type of the dependency (i.e. "SQL" "HTTP"). Defaults to empty. - * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. - * @param dependencyKind ContractsModule.DependencyKind of this dependency. Defaults to Other. - * @param async True if the dependency was executed asynchronously, false otherwise. Defaults to false - * @param dependencySource ContractsModule.DependencySourceType of this dependency. Defaults to Undefined. - */ - trackDependency(name: string, commandName: string, elapsedTimeMs: number, success: boolean, dependencyTypeName?: string, properties?: {}, dependencyKind?: any, async?: boolean, dependencySource?: number): void; - /** - * Immediately send all queued telemetry. - */ - sendPendingData(callback?: (response: string) => void): void; - getEnvelope(data: ContractsModule.Data, tagOverrides?: { - [key: string]: string; - }): ContractsModule.Envelope; - /** - * Generic track method for all telemetry types - * @param data the telemetry to send - * @param tagOverrides the context tags to use for this telemetry which overwrite default context values - */ - track(data: ContractsModule.Data, tagOverrides?: { - [key: string]: string; - }): void; -} - -interface Config { - instrumentationKey: string; - sessionRenewalMs: number; - sessionExpirationMs: number; - endpointUrl: string; - maxBatchSize: number; - maxBatchIntervalMs: number; - disableAppInsights: boolean; - constructor(instrumentationKey?: string): Config; -} - -interface Context { - keys: ContractsModule.ContextTagKeys; - tags: { - [key: string]: string; - }; - constructor(packageJsonPath?: string): Context; -} - -interface Sender { - constructor(getUrl: () => string, onSuccess?: (response: string) => void, onError?: (error: Error) => void): Sender; - send(payload: any/* Buffer */): void; - saveOnCrash(payload: string): void; - /** - * enable caching events locally on error - */ - enableCacheOnError(): void; - /** - * disable caching events locally on error - */ - disableCacheOnError(): void; -} - -/** - * The singleton meta interface for the default client of the client. This interface is used to setup/start and configure - * the auto-collection behavior of the application insights module. - */ -interface ApplicationInsights { - client: Client; - /** - * Initializes a client with the given instrumentation key, if this is not specified, the value will be - * read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY - * @returns {ApplicationInsights/Client} a new client - */ - getClient(instrumentationKey?: string): Client; - /** - * Initializes the default client of the client and sets the default configuration - * @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be - * read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY - * @returns {ApplicationInsights} this interface - */ - setup(instrumentationKey?: string): ApplicationInsights; - /** - * Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected - * @returns {ApplicationInsights} this interface - */ - start(): ApplicationInsights; - /** - * Sets the state of console tracking (enabled by default) - * @param value if true console activity will be sent to Application Insights - * @returns {ApplicationInsights} this interface - */ - setAutoCollectConsole(value: boolean): ApplicationInsights; - /** - * Sets the state of exception tracking (enabled by default) - * @param value if true uncaught exceptions will be sent to Application Insights - * @returns {ApplicationInsights} this interface - */ - setAutoCollectExceptions(value: boolean): ApplicationInsights; - /** - * Sets the state of performance tracking (enabled by default) - * @param value if true performance counters will be collected every second and sent to Application Insights - * @returns {ApplicationInsights} this interface - */ - setAutoCollectPerformance(value: boolean): ApplicationInsights; - /** - * Sets the state of request tracking (enabled by default) - * @param value if true requests will be sent to Application Insights - * @returns {ApplicationInsights} this interface - */ - setAutoCollectRequests(value: boolean): ApplicationInsights; - /** - * Enables verbose debug logging - * @returns {ApplicationInsights} this interface - */ - enableVerboseLogging(): ApplicationInsights; -} - -declare module "applicationinsights" { - const applicationinsights: ApplicationInsights; - export = applicationinsights; -} diff --git a/types/applicationinsights/tsconfig.json b/types/applicationinsights/tsconfig.json deleted file mode 100644 index abc81fb75c..0000000000 --- a/types/applicationinsights/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "applicationinsights-tests.ts" - ] -} \ No newline at end of file diff --git a/types/arbiter/tslint.json b/types/arbiter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/arbiter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index 9202525e55..dadb02d265 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,37 +1,47 @@ -// Type definitions for ArcGIS API for JavaScript 4.5 +// Type definitions for ArcGIS API for JavaScript 4.6 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 + interface HashMap { [index: string]: T; } +interface IPromiseLike { + then(onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null): IPromiseLike; +} + interface IPromise { - always(callback?: (valueOrError: T) => IPromise | U | void): IPromise; + always(callback?: ((valueOrError: T | any) => TResult1 | IPromiseLike) | undefined | null): IPromise; cancel?(reason?: U, strict?: boolean): U; + catch(onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null): IPromise; isCanceled?(): boolean; isFulfilled(): boolean; isRejected(): boolean; isResolved(): boolean; - otherwise(errback?: (reason: any) => IPromise | U | void): IPromise; - then(callback?: (value: T) => IPromise | U | void, errback?: (reason: any) => IPromise | U | void, progback?: (update: any) => IPromise | U | void): IPromise; + otherwise(onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null): IPromise; + then(onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null): IPromise; } interface IHandle { remove(): void; } + + declare namespace JSX { interface IntrinsicElements { [elementName: string]: any; } - interface Element {} + interface Element { + } } declare namespace __esri { + export class Accessor { constructor(obj?: any); @@ -52,6 +62,15 @@ declare namespace __esri { protected _set(propertyName: string, value: T): this; } + export interface AnonymousAccessor extends Object { + get?(propertyName: string): T; + get?(propertyName: string): any; + set?(propertyName: string, value: T): this; + set?(props: HashMap): this; + watch?(path: string | string[], callback: WatchCallback, sync?: boolean): WatchHandle; + } + + export type ItemCallback = (item: T, index: number) => void; @@ -108,7 +127,7 @@ declare namespace __esri { slice(begin?: number, end?: number): Collection; some(callback: ItemCallback): boolean; sort(compareFunction?: ItemCompareCallback): void; - splice(start: number, deleteCount: number, items: T[] | Collection): T[]; + splice(start: number, deleteCount: number, ...items: T[]): T[]; toArray(): T[]; unshift(...items: T[]): number; @@ -204,6 +223,10 @@ declare namespace __esri { export type MapViewPointerDownEventHandler = (event: MapViewPointerDownEvent) => void; + export type MapViewPointerEnterEventHandler = (event: MapViewPointerEnterEvent) => void; + + export type MapViewPointerLeaveEventHandler = (event: MapViewPointerLeaveEvent) => void; + export type MapViewPointerMoveEventHandler = (event: MapViewPointerMoveEvent) => void; export type MapViewPointerUpEventHandler = (event: MapViewPointerUpEvent) => void; @@ -211,21 +234,79 @@ declare namespace __esri { export type MapViewResizeEventHandler = (event: MapViewResizeEvent) => void; interface Basemap extends Accessor, Loadable, JSONSupport { + /** + * A collection of tile layers that make up the basemap's features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) + */ baseLayers: Collection; + /** + * An identifier used to refer to the basemap when referencing it elsewhere. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#id) + */ id: string; - loaded: boolean; + /** + * Indicates whether the basemap instance has loaded. When `true`, all the properties of the object can be accessed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#loaded) + * + * @default false + */ + readonly loaded: boolean; + /** + * The portal item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#portalItem) + */ portalItem: PortalItem; + /** + * A collection of tiled reference layers for displaying labels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) + */ referenceLayers: Collection; + /** + * The URL pointing to an image that represents the basemap. When using a custom basemap in the [BasemapToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) widget, the image specified here will display in the widget. When the user clicks the image, the map's basemap will update to the basemap associated with the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#thumbnailUrl) + */ thumbnailUrl: string; + /** + * The title of the basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#title) + */ title: string; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#clone) + * + * + */ clone(): Basemap; } interface BasemapConstructor { + /** + * Basemap is used for creating custom basemaps. These basemaps may be created from tiled services you publish to your own server or from tiled services published by third parties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) + */ + new(properties?: BasemapProperties): Basemap; + /** + * Creates a new basemap instance from a [well known basemap ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). See [Map.basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) for a list of possible values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#fromId) + * + * @param id The basemap ID. + * + */ fromId(id: string): Basemap; fromJSON(json: any): Basemap; @@ -234,25 +315,94 @@ declare namespace __esri { export const Basemap: BasemapConstructor; interface BasemapProperties extends LoadableProperties { + /** + * A collection of tile layers that make up the basemap's features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) + */ baseLayers?: CollectionProperties; + /** + * An identifier used to refer to the basemap when referencing it elsewhere. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#id) + */ id?: string; - loaded?: boolean; + /** + * The portal item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#portalItem) + */ portalItem?: PortalItemProperties; + /** + * A collection of tiled reference layers for displaying labels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) + */ referenceLayers?: CollectionProperties; + /** + * The URL pointing to an image that represents the basemap. When using a custom basemap in the [BasemapToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) widget, the image specified here will display in the widget. When the user clicks the image, the map's basemap will update to the basemap associated with the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#thumbnailUrl) + */ thumbnailUrl?: string; + /** + * The title of the basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#title) + */ title?: string; } interface Camera extends Accessor, JSONSupport { + /** + * The field of view of the camera in degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#fov) + * + * @default 55 + */ fov: number; + /** + * The compass heading of the camera in degrees. Heading is zero when north is the top of the screen. It increases as the view rotates clockwise. The angles are always normalized between 0 and 360 degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) + * + * @default 0 + */ heading: number; + /** + * The position of the camera defined by a map point. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) + */ position: Point; + /** + * The tilt of the camera in degrees with respect to the surface as projected down from the camera position. Tilt is zero when looking straight down at the surface and 90 degrees when the camera is looking parallel to the surface. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt) + * + * @default 0 + */ tilt: number; + /** + * Creates a deep clone of the camera object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone) + * + * + */ clone(): Camera; } interface CameraConstructor { + /** + * The camera defines the [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position), [tilt](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt), and [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) of the point from which the [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) visible extent is observed. It is not associated with device hardware. This class only applies to 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html) + */ + new(properties?: CameraProperties): Camera; fromJSON(json: any): Camera; @@ -261,83 +411,455 @@ declare namespace __esri { export const Camera: CameraConstructor; interface CameraProperties { + /** + * The field of view of the camera in degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#fov) + * + * @default 55 + */ fov?: number; + /** + * The compass heading of the camera in degrees. Heading is zero when north is the top of the screen. It increases as the view rotates clockwise. The angles are always normalized between 0 and 360 degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) + * + * @default 0 + */ heading?: number; + /** + * The position of the camera defined by a map point. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) + */ position?: PointProperties; + /** + * The tilt of the camera in degrees with respect to the surface as projected down from the camera position. Tilt is zero when looking straight down at the surface and 90 degrees when the camera is looking parallel to the surface. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt) + * + * @default 0 + */ tilt?: number; } interface Color { + /** + * The alpha value. This value can be any number between `0` and `1` and represents the opacity of the Color. `0` indicates the color is fully transparent and `1` indicates it is fully opaque. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#a) + */ a: number; + /** + * The blue value. This value can range between `0` and `255`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#b) + */ b: number; + /** + * The green value. This value can range between `0` and `255`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#g) + */ g: number; + /** + * The red value. This value can range between `0` and `255`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#r) + */ r: number; + /** + * Creates a deep clone of the Color instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#clone) + * + * + */ clone(): Color; + /** + * Takes a named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object and sets this color instance to the input value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#setColor) + * + * @param color The new color value. This parameter can be a string representing a named color or a hex value; an array of three or four numbers representing r, g, b, a values; or an object with r, g, b, a properties. + * + */ setColor(color: string | number[] | any): Color; + /** + * Returns a CSS color string in rgba form representing the Color instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toCss) + * + * @param includeAlpha If `true`, the alpha value will be included in the result. + * + */ toCss(includeAlpha?: boolean): string; + /** + * Returns a CSS color string in hexadecimal form that represents the Color instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toHex) + * + * + */ toHex(): string; + /** + * Returns a JSON object with all the values from a Color instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toJSON) + * + * + */ toJSON(): any; + /** + * Returns a 3-component array of rgb values that represent the Color instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toRgb) + * + * + */ toRgb(): number[]; + /** + * Returns a 4-component array of rgba values that represent the Color instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toRgba) + * + * + */ toRgba(): number[]; } interface ColorConstructor { + /** + * Creates a new color object by passing either a hex, rgba, or named color value. This class inherits all attributes from **dojo/_base/Color** to provide functions for setting colors. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) + */ + + /** + * Creates a Color instance by blending two colors using a weight factor. Optionally accepts a Color object to update and return instead of creating a new object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#blendColors) + * + * @param start The start color. + * @param end The end color. + * @param weight The weight value is a number from 0 to 1, with 0.5 being a 50/50 blend. + * @param obj A previously allocated Color object to reuse for the result. + * + */ blendColors(start: Color, end: Color, weight: number, obj?: Color): Color; + new(color: string | number[] | any): Color; + /** + * Creates a Color instance using a 3 or 4 element array, mapping each element in sequence to the rgb(a) values of the color. Optionally accepts a Color object to update with the color value and return instead of creating a new object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromArray) + * + * @param a The input array. + * @param obj A previously allocated Color object to reuse for the result. + * + */ fromArray(a: number[], obj?: Color): Color; + /** + * Creates a Color instance from a hex string with a '#' prefix. Supports 12-bit #rgb shorthand. Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromHex) + * + * @param color The input color in a hex string. + * @param obj A previously allocated Color object to reuse for the result. + * + */ fromHex(color: string, obj?: Color): Color; + /** + * Creates a new Color instance, and initializes it with values from a JSON object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromJSON) + * + * @param json A JSON representation of the instance. + * + */ fromJSON(json: any): Color; + /** + * Creates a Color instance from a string of the form "rgb()" or "rgba()". Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromRgb) + * + * @param color The input color in a string of the form "rgb()" or "rgba()". + * @param obj A previously allocated Color object to reuse for the result. + * + */ fromRgb(color: string, obj?: Color): Color; + /** + * Creates a Color instance by parsing a generic string. Accepts hex, rgb, and rgba style color values. Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromString) + * + * @param str The input value. + * @param obj A previously allocated Color object to reuse for the result. + * + */ fromString(str: string, obj?: Color): Color; } export const Color: ColorConstructor; + /** + * Configure global properties of the library. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html) + */ interface config { + /** + * The default [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html) used by widgets and other operations, such as on-the-fly projections. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geometryServiceUrl) + * + * @default "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer" + */ geometryServiceUrl: string; + /** + * The URL for the utility service used by [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html) to convert GeoRSS documents. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geoRSSServiceUrl) + * + * @default "https://utility.arcgis.com/sharing/rss" + */ geoRSSServiceUrl: string; + /** + * The URL for the utility service used by [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to convert KML documents. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#kmlServiceUrl) + * + * @default "https://utility.arcgis.com/sharing/kml" + */ kmlServiceUrl: string; + /** + * The URL of the portal instance. If using an on-premise portal, this value should be set to the portal instance, for example: `https://www.example.com/arcgis` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) + * + * @default "https://www.arcgis.com" + */ portalUrl: string; + /** + * An object with properties that control various aspects of communication between the library and web servers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ request: configRequest; + /** + * The AMD loader's configuration object, which is loaded with each worker. Modify the configuration to specify locations of packages to be loaded with [the workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html) or to define a feature detection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) + */ workers: configWorkers; } export const config: config; - export interface configRequest { + + export interface configRequest extends Object { + /** + * Indicates whether the library automatically detects if [CORS](http://enable-cors.org/) (Cross-Origin Resource Sharing) specification is supported by ArcGIS Servers used in your application. Upon successful detection, the server will be added to `corsEnabledServers` list. CORS detection will not be performed for a server if it is already listed in `corsEnabledServers`. The default is `true` if your application is running in a web browser, or `false` if your application is running on [Apache Cordova](https://cordova.apache.org/) platform. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ corsDetection?: boolean; + /** + * Number of seconds to wait for response from the ArcGIS Server during CORS detection. If the detection is not complete before this time expires, then it is assumed that the server does not support CORS. Applicable when `corsDetection` is true. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + * + * @default 15 + */ corsDetectionTimeout?: number; + /** + * A list of servers known to support CORS specification. Out of the box, this list includes many Esri hosted servers that are known to support CORS and is updated at every release as the list grows. The library is capable of automatically detecting CORS support for servers used in an application (see `corsDetection`), but if you are already aware that a server supports CORS, then it should be added to this list. Since the API includes some servers by default it's important to add items onto this array rather than overwriting it. The following servers are enabled by default: + * * `basemaps.arcgis.com` (added in 4.3) + * * `demographics1.arcgis.com` (added in 4.4) + * * `demographics2.arcgis.com` (added in 4.4) + * * `demographics3.arcgis.com` (added in 4.4) + * * `demographics4.arcgis.com` (added in 4.4) + * * `demographics5.arcgis.com` (added in 4.4) + * * `demographics6.arcgis.com` (added in 4.4) + * * `elevation3d.arcgis.com` + * * `geocode.arcgis.com` + * * `geoenrich.arcgis.com` + * * `js.arcgis.com` + * * `server.arcgisonline.com` + * * `services.arcgis.com` + * * `services.arcgisonline.com` + * * `services1.arcgis.com` + * * `services2.arcgis.com` + * * `services3.arcgis.com` + * * `services4.arcgis.com` + * * `services5.arcgis.com` + * * `services6.arcgis.com` + * * `services7.arcgis.com` + * * `services8.arcgis.com` + * * `services9.arcgis.com` + * * `static.arcgis.com` + * * `tiles.arcgis.com` + * * `tiles1.arcgis.com` + * * `tiles2.arcgis.com` + * * `tiles3.arcgis.com` + * * `tiles4.arcgis.com` + * * `utility.arcgis.com` (added in 4.4) + * * `utility.arcgisonline.com` + * * `www.arcgis.com` + * + * + * Example: + * ```js + * // Add a known server to the list. + * require(["esri/config"], function(esriConfig) { + * esriConfig.request.corsEnabledServers.push(".:"); + * }); + * ``` + * + * You can also pass objects to this property with the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ corsEnabledServers?: (string | configRequestCorsEnabledServers)[]; + /** + * Indicates whether the proxy specified in `proxyUrl` is used for all AJAX requests made using [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html) and images added using `` element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + * + * @default false + */ forceProxy?: boolean; + /** + * List of domain suffixes known to support https. This will automatically upgrade requests made to such domains to use https instead of http when the application is not running on http. Note that port numbers should not be included in the domain suffix to be matched. If no `httpsDomains` list exists , the API redirects all calls using https. If the list exists and a domain of a required http resource is not listed, the API sends the URL as it is specified within the code. Likewise, if the list exists and the domain of a required http resource is listed in it, the API sends an https request to that resource. The list includes the following domain suffixes by default: + * * `arcgis.com` + * * `arcgisonline.com` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ httpsDomains?: string[]; + /** + * Maximum number of characters allowed in the URL for HTTP GET requests made by [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html). If this limit is exceeded, HTTP POST method will be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + * + * @default 2000 + */ maxUrlLength?: number; + /** + * Resource proxy for your application. It is used by the library when communicating with a web server hosted on a domain that is different from the domain where your application is hosted. The library may or may not use the proxy depending on the type of request made, whether the server support CORS, whether the application is being run on older versions of browsers etc. To keep it simple, it is recommended that you always configure a resource proxy for your application. You can download the resource proxy from this [GitHub repo](https://github.com/Esri/resource-proxy). + * ```js + * require(["esri/config"], function(esriConfig) { + * esriConfig.request.proxyUrl = "/resource-proxy/Java/proxy.jsp"; + * }); + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ proxyUrl?: string; + /** + * Number of milliseconds [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html) will wait for response from a server. If a server fails to respond before this time expires, then the request is considered to have encountered an error. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + * + * @default 60000 + */ timeout?: number; + /** + * Indicates whether the library will use [CORS](http://enable-cors.org/)-enabled requests when communicating with a web server hosted on a domain that is different from the domain where the application is hosted. If `true`, AJAX requests are directly made to servers that support CORS. If `with-credentials` is specified, then AJAX requests will use credentials stored in a client's cookies. If `false`, direct requests are not made. A proxy will be used if available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + * + * @default with-credentials + */ useCors?: string | boolean; + /** + * **Since:** 4.5 Indicates whether `esri/request` will request a credential from `IdentityManager`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + * + * @default true + */ useIdentity?: boolean; + /** + * A proxy rule defines a proxy for a set of resources with an identical URL prefix. When using [esriRequest](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html), if a target URL matches a rule, then the request will be sent to the specified proxy. Rather than populating this array directly, use the urlUtils.addProxyRule() method. Rule objects have the following properties: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ proxyRules?: configRequestProxyRules[]; } - export interface configRequestCorsEnabledServers { + + export interface configRequestCorsEnabledServers extends Object { + /** + * The host name of the server to add to the list of CORS-enabled servers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ host?: string; + /** + * Indicates whether requests made to the associated server should include credentials such as cookies and authorization headers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + * + * @default false + */ withCredentials?: boolean; } - export interface configRequestProxyRules { + + export interface configRequestProxyRules extends Object { + /** + * The URL of the proxy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ proxyUrl?: string; + /** + * URL prefix for resources that need to be accessed through a specific proxy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) + */ urlPrefix?: string; } - export interface configWorkers { + + export interface configWorkers extends Object { + /** + * The configuration parameters for [the workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) + */ loaderConfig?: configWorkersLoaderConfig; } - export interface configWorkersLoaderConfig { + + export interface configWorkersLoaderConfig extends Object { + /** + * Determines if the specified feature capabilities are supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) + */ has?: any; + /** + * Map of module id fragments to file paths. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) + */ paths?: any; + /** + * Map paths in module identifiers to different paths. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) + */ map?: any; + /** + * An array of objects which provide the package name and its location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) + */ packages?: any[]; } @@ -345,28 +867,137 @@ declare namespace __esri { export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; - export interface WatchHandle { + /** + * Represents a watch created when an object invokes [watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#WatchHandle) + */ + export interface WatchHandle extends Object { + /** + * Removes the watch handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#WatchHandle) + * + * + */ remove(): void; } + interface decorators { + /** + * A property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#aliasOf) + * + * @param propertyName The aliased property name. + * + */ aliasOf(propertyName: string): Function; + /** + * This method decorator is used to define the method that will cast a property from a class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#cast) + * + * @param propertyName The property name the function will cast. + * + */ cast(propertyName: string): Function; + /** + * This parameter decorator is used to define the function or class for a parameter of a method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#cast) + * + * @param classFunction The function or class to cast the parameter + * + */ cast(classFunction: Function): Function; + /** + * A function that can be used as a class. It extends [expression](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-6.html#extending-expressions) and is used in conjunction with the `@subclass` decorator to create a class compatible to [dojo.declare](https://dojotoolkit.org/reference-guide/1.10/dojo/declare.html). Please refer to the `subclass` documentation for further information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#declared) + * + * @param baseClass The class to extend. + * @param mixinClasses The mixin classes used to extend the base class. + * + */ declared(baseClass: T, ...mixinClasses: any[]): T; + /** + * This convenience decorator is used to define an [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html) property. Any property defined with this decorator can now be `get` and `set`. In addition, you can [watch for any property changes](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html). Many times this decorator is used in conjunction with the [@renderable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html) decorator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) + * + * @param propertyMetadata An object describing the property. + * @param propertyMetadata.dependsOn Property names of dependencies. + * @param propertyMetadata.type The constructor used to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. + * @param propertyMetadata.cast The function to use to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. Alternative to define the `type`. The function is called with the value set by the user and should return the cast value. + * @param propertyMetadata.readOnly Indicates whether the property is read-only. + * @param propertyMetadata.constructOnly Indicates whether the property can be set during construction but is otherwise read-only. + * @param propertyMetadata.aliasOf The property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. + * @param propertyMetadata.value The default value for the property. + * + */ property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; + /** + * A class decorator that must be used together with the `declared` function to create a class compatible to [dojo.declare](https://dojotoolkit.org/reference-guide/1.10/dojo/declare.html). It supports both single and multiple inheritance and can be considered the underlying functionality needed when creating 4.x classes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#subclass) + * + * @param declaredClass The subclass name. + * + */ subclass(declaredClass?: string): Function; } export const decorators: decorators; - export interface decoratorsPropertyPropertyMetadata { + + export interface decoratorsPropertyPropertyMetadata extends Object { + /** + * Property names of dependencies. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) + */ dependsOn?: string[]; + /** + * The constructor used to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) + */ type?: Function; + /** + * The function to use to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. Alternative to define the `type`. The function is called with the value set by the user and should return the cast value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) + */ cast?: Function; + /** + * Indicates whether the property is read-only. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) + * + * @default false + */ readOnly?: boolean; + /** + * Indicates whether the property can be set during construction but is otherwise read-only. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) + * + * @default false + */ constructOnly?: boolean; + /** + * The property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) + */ aliasOf?: string; + /** + * The default value for the property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) + */ value?: any; } @@ -382,182 +1013,812 @@ declare namespace __esri { + interface Error { + /** + * The details object provides additional details specific to the error, giving more information about why the error was raised. For example, the details object for esriRequest includes additional information to help the developer diagnose issues with a problematic request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#details) + */ details: any; + /** + * A message describing the details of the error. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#message) + */ message: string; + /** + * A unique error name. This can be used to map to a localized error message to present to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#name) + */ name: string; } export const Error: Error; export class Evented { + /** + * Emits an event on the instance. This method should only be used when creating subclasses of this class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#emit) + * + * @param type The name of the event. + * @param event The event payload. + * + */ protected emit(type: string, event: any): void; + /** + * Indicates whether there is an event listener on the instance that matches the provided event name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#hasEventListener) + * + * @param type The name of the event. + * + */ hasEventListener(type: string): boolean; + /** + * Registers an event handler on the instance. Call this method to hook an event with a listener. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#on) + * + * @param type The name of event to listen for. + * @param listener The function to call when the event is fired. + * + */ on(type: string, listener: EventHandler): IHandle; } export type EventHandler = (event: any) => void; interface JSONSupport { + /** + * 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-core-JSONSupport.html#toJSON) + * + * + */ toJSON(): any; } interface JSONSupportConstructor { + + new(): JSONSupport; + /** + * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-JSONSupport.html#fromJSON) + * + * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Classification_objects/02r30000019z000000/) for examples of the structure of various input JSON objects. + * + */ fromJSON(json: any): any; } export const JSONSupport: JSONSupportConstructor; + interface lang { + /** + * Use this method to deeply clone objects with properties that are computed or have their own `clone()` method. For example, if you are creating an object that stores an initial extent and a spatial reference for your application, you can use `esriLang.clone(initialProps)` to clone this object so that the `extent` and `spatialReference` are properly cloned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-lang.html#clone) + * + * @param elem The object to be cloned. + * + */ clone(elem: any): any; } export const lang: lang; interface Loadable { - loadError: Error; - loadStatus: string; - loadWarnings: any[]; + /** + * The Error object returned if an error occurred while loading. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadError) + * + * @default null + */ + readonly loadError: Error; + /** + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation. + * + * Value | Description + * ------|------------ + * not-loaded | The object's resources have not loaded. + * loading | The object's resources are currently loading. + * loaded | The object's resources have loaded without errors. + * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadError) for more details. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadStatus) + * + * @default not-loaded + */ + readonly loadStatus: string; + /** + * A list of warnings which occurred while loading. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadWarnings) + */ + readonly loadWarnings: any[]; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `always()` may be used to execute a function if the promise is rejected or resolved. The input function will always execute no matter the response. For more information about promises, see the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#always) + * + * @param callbackOrErrback The function to execute when the promise is rejected or resolved. + * + */ always(callbackOrErrback?: Function): IPromise; + /** + * Cancels a [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation if it is already in progress. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#cancelLoad) + * + * + */ cancelLoad(): void; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `isFulfilled()` may be used to verify if the promise is fulfilled (either resolved or rejected). If it is fulfilled, `true` will be returned. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for more information about promises. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isFulfilled) + * + * + */ isFulfilled(): boolean; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `isRejected()` may be used to verify if the promise is rejected. If it is rejected, `true` will be returned. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for more information about promises. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isRejected) + * + * + */ isRejected(): boolean; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `isResolved()` may be used to verify if the promise is resolved. If it is resolved, `true` will be returned. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for more information about promises. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isResolved) + * + * + */ isResolved(): boolean; + /** + * Loads the resources referenced by this class. This method automatically executes for a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) and all of the resources it references in [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) if the view is constructed with a map instance. This method must be called by the developer when accessing a resource that will not be loaded in a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) + * + * + */ load(): IPromise; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Use `otherwise()` to call a function once the promise is rejected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#otherwise) + * + * @param errback The function to execute when the promise fails. + * + */ otherwise(errback?: Function): IPromise; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `then()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the promise resolves (when the instance of the class loads). The `errback` executes if the promise fails. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for additional details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#then) + * + * @param callback The function to call when the promise resolves. + * @param errback The function to execute when the promise fails. + * @param progback The function to invoke when the promise emits a progress update. + * + */ then(callback?: Function, errback?: Function, progback?: Function): IPromise; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `when()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the promise resolves (when the instance of the class loads). The `errback` executes if the promise fails. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for additional details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#when) + * + * @param callback The function to call when the promise resolves. + * @param errback The function to execute when the promise fails. + * @param progback The function to invoke when the promise emits a progress update. + * + */ + when(callback?: Function, errback?: Function, progback?: Function): IPromise; } interface LoadableConstructor { + + new(): Loadable; } export const Loadable: LoadableConstructor; interface LoadableProperties { - loadError?: Error; - loadStatus?: string; - loadWarnings?: any[]; + } interface corePromise { + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `always()` may be used to execute a function if the promise is rejected or resolved. The input function will always execute no matter the response. For more information about promises, see the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#always) + * + * @param callbackOrErrback The function to execute when the promise is rejected or resolved. + * + */ always(callbackOrErrback?: Function): IPromise; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `isFulfilled()` may be used to verify if the promise is fulfilled (either resolved or rejected). If it is fulfilled, `true` will be returned. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for more information about promises. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isFulfilled) + * + * + */ isFulfilled(): boolean; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `isRejected()` may be used to verify if the promise is rejected. If it is rejected, `true` will be returned. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for more information about promises. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isRejected) + * + * + */ isRejected(): boolean; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `isResolved()` may be used to verify if the promise is resolved. If it is resolved, `true` will be returned. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for more information about promises. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isResolved) + * + * + */ isResolved(): boolean; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Use `otherwise()` to call a function once the promise is rejected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#otherwise) + * + * @param errback The function to execute when the promise fails. + * + */ otherwise(errback?: Function): IPromise; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `then()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the promise resolves (when the instance of the class loads). The `errback` executes if the promise fails. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for additional details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#then) + * + * @param callback The function to call when the promise resolves. + * @param errback The function to execute when the promise fails. + * @param progback The function to invoke when the promise emits a progress update. + * + */ then(callback?: Function, errback?: Function, progback?: Function): IPromise; + /** + * An instance of this class is a [Promise](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html). Therefore `when()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the promise resolves (when the instance of the class loads). The `errback` executes if the promise fails. See the [Working with Promises](https://developers.arcgis.com/javascript/latest/guide/working-with-promises/index.html) guide page for additional details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#when) + * + * @param callback The function to call when the promise resolves. + * @param errback The function to execute when the promise fails. + * @param progback The function to invoke when the promise emits a progress update. + * + */ + when(callback?: Function, errback?: Function, progback?: Function): IPromise; } interface corePromiseConstructor { + + new(): corePromise; } export const corePromise: corePromiseConstructor; + interface promiseUtils { + /** + * Convenience utility method to wait for a number of promises to either resolve or reject. The resulting promise resolves to an array of result objects containing the promise and either a value if the promise resolved, or an error if the promise rejected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#eachAlways) + * + * @param promises Array of promises, or object where each property is a promise. + * + */ eachAlways(promises: IPromise[] | any): IPromise | any; + /** + * A convenience utility method for filtering an array of values using an asynchronous predicate function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#filter) + * + * @param input The array of input values to filter. + * @param predicate A predicate function returning a promise. Only array entries for which the returned promise contains `true` are kept. + * + */ filter(input: T[], predicate: FilterPredicateCallback): IPromise; + /** + * Convenience utility method to create a promise that has been rejected with a provided error value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#reject) + * + * @param error The error to reject the resulting promise with. + * + */ reject(error?: any): IPromise; + /** + * Convenience utility method to create a promise that will be resolved with a provided value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#resolve) + * + * @param value The value to resolve the resulting promise with. + * + */ resolve(value?: T): IPromise; } export const promiseUtils: promiseUtils; - export interface EachAlwaysResult { + /** + * The result object for a promise passed to [promiseUtils.eachAlways](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#eachAlways). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) + */ + export interface EachAlwaysResult extends Object { + /** + * The promise that has been fulfilled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) + */ promise: IPromise; - value: any; - error: any; + /** + * The value with which the promise resolved. Defined only if the promise resolved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) + */ + value?: any; + /** + * The error with which the promise rejected. Defined only if the promise rejected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) + */ + error?: any; } export type FilterPredicateCallback = (value: any, index: number) => IPromise; + interface requireUtils { + /** + * Dynamically requires one or more modules and returns a promise that resolves when all the specified modules have loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-requireUtils.html#when) + * + * @param moduleRequire The `require` function used to load the modules. This is the AMD alias (e.g. the `moduleRequire` reference in the snippets below) used to reference the `require` module. + * @param moduleNames The names of the modules to load. + * + */ when(moduleRequire: any, moduleNames: string[] | string): IPromise; } export const requireUtils: requireUtils; + interface urlUtils { + /** + * Adds the given proxy rule to the proxy rules list: `esriConfig.request.proxyRules`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) + * + * @param rule An object specifying a URL that should use the proxy. See the object specification table below for the required properties of this object. + * @param rule.proxyUrl The URL of the proxy. + * @param rule.urlPrefix The URL prefix of the resources that should be accessed through the given proxy. + * + */ addProxyRule(rule: urlUtilsAddProxyRuleRule): number; + /** + * Returns the proxy rule that matches the given URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#getProxyRule) + * + * @param url The URL of the resources accessed via proxy. + * + */ getProxyRule(url: string): any; + /** + * Converts the URL arguments to an object representation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#urlToObject) + * + * @param url The input URL. + * + */ urlToObject(url: string): any; } export const urlUtils: urlUtils; - export interface urlUtilsAddProxyRuleRule { + + export interface urlUtilsAddProxyRuleRule extends Object { + /** + * The URL of the proxy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) + */ proxyUrl: string; + /** + * The URL prefix of the resources that should be accessed through the given proxy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) + */ urlPrefix: string; } + interface watchUtils { + /** + * Watches a property for changes and calls the callback with the initial value of the property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#init) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call with the initial value of the property when the property changes. + * + */ init(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; - on(obj: Accessor, propertyName: string, eventName: string, eventHandler: Function, attachedHandler?: EventAttachedCallback, detachedHandler?: EventAttachedCallback): WatchHandle; - once(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - pausable(obj: Accessor, propertyName: string, callback?: WatchCallback): PausableWatchHandle; + /** + * Watches a property for changes and automatically attaches and detaches an event handler for a given event to the property value as needed. The attachedHandler and detachedHandler are optional and if provided will be called whenever the event handler is attached and detached respectively. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#on) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param eventName The name of the event to attach the event handler for. + * @param eventHandler The event handler callback function. + * @param attachedHandler Callback called each time the event handler is attached. + * @param detachedHandler Callback called each time the event handler is detached. + * + */ + on(obj: Accessor, propertyName: string | string[], eventName: string, eventHandler: Function, attachedHandler?: EventAttachedCallback, detachedHandler?: EventAttachedCallback): WatchHandle; + /** + * Watches a property for changes once. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming truthy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#once) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + once(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; + /** + * Watches a property for changes. The returned handle can be paused (and resumed) to temporarily prevent the callback from being called on property changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#pausable) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + pausable(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PausableWatchHandle; + /** + * Watches a property for changes. This is an alias for [Accessor.watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch), provided for completeness. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#watch) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ watch(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; - when(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenDefined(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenDefinedOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenFalse(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenFalseOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenNot(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenNotOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenTrue(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenTrueOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; - whenUndefined(obj: Accessor, propertyName: string, callback: WatchCallback): WatchHandle; - whenUndefinedOnce(obj: Accessor, propertyName: string, callback?: WatchCallback): PromisedWatchHandle; + /** + * Watches a property for becoming truthy. As with module:esri/core/watchUtils#init, the callback is called initially if the property is initially truthy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#when) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + when(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; + /** + * Watches a property for becoming `defined`. As with init(), the callback is called if the property is initially defined. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenDefined) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenDefined(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; + /** + * Watches a property for becoming `defined` once. As with init(), the callback is called if the property is initially `defined`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming defined. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenDefinedOnce) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenDefinedOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; + /** + * Watches a property for becoming `false`. As with init(), the callback is called if the property is initially `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenFalse) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenFalse(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; + /** + * Watches a property for becoming `false` once. As with init(), the callback is called if the property is initially `false`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming false. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenFalseOnce) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenFalseOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; + /** + * Watches a property for becoming falsy. As with module:esri/core/watchUtils#init, the callback is called initially if the property is initially falsy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenNot) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenNot(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; + /** + * Watches a property for becoming falsy once. As with init(), the callback is called if the property is initially falsy. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming falsy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenNotOnce) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenNotOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; + /** + * Watches a property for becoming truthy once. As with init(), the callback is called if the property is initially truthy. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming truthy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenOnce) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; + /** + * Watches a property for becoming `true`. As with init(), the callback is called if the property is initially `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenTrue) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenTrue(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; + /** + * Watches a property for becoming `true` once. As with init(), the callback is called if the property is initially `true`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming true. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenTrueOnce) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenTrueOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; + /** + * Watches a property for becoming `undefined`. As with init(), the callback is called if the property is initially `undefined`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenUndefined) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenUndefined(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; + /** + * Watches a property for becoming `undefined` once. As with init(), the callback is called if the property is initially `undefined`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming undefined. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenUndefinedOnce) + * + * @param obj The object containing the property to watch. + * @param propertyName The name of the property to watch. + * @param callback The function to call when the property changes. + * + */ + whenUndefinedOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; } export const watchUtils: watchUtils; export type EventAttachedCallback = (target: any, propName: string, obj: Accessor, eventName: string) => void; - export interface PausableWatchHandle { + /** + * Represents a watch created when an object invokes [watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) + */ + export interface PausableWatchHandle extends Object { + /** + * Removes the watch handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) + * + * + */ remove(): void; + /** + * Pauses the handle preventing changes to invoke the associated callback. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) + * + * + */ pause(): void; + /** + * Resumes a paused the handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) + * + * + */ resume(): void; } export interface PromisedWatchHandle extends IPromise { + remove(): void; } + /** + * This module is a utility framework that simplifies the use of [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) in the ArcGIS API for JavaScript. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html) + */ interface workers { + /** + * Opens a connection to workers and loads a script with the workers framework. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html#open) + * + * @param client The instance of the client which will be using the [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html). + * @param modulePath A fully qualified URL to a script to execute with the workers framework. + * + */ open(client: any, modulePath: string): IPromise; } export const workers: workers; interface Connection { + /** + * A convenient method that broadcasts a message to all workers. Use this method if it is mandatory that all workers need to have a piece of information which is critical for them to process additional requests. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#broadcast) + * + * @param methodName The name of the method to invoke on all workers. + * @param data The object which contains all required parameters to be passed to the method. The data passed between the main thread and the workers framework are copied, not shared. Objects are serialized and de-serialized on both ends. + * @param buffers An array of [transferable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) buffers. Each buffer in the array should have a corresponding entry in the data object. Transferable objects are transferred from one context to another with a zero-copy operation, which results in a big performance improvement when sending large data sets. + * + */ broadcast(methodName: string, data?: any, buffers?: ArrayBuffer[]): IPromise; + /** + * Closes the existing connection instance to workers. Notify all workers to destroy the connection instance and unload the connection module. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#close) + * + * + */ close(): void; + /** + * Invokes a method on the script loaded with the workers framework. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) + * + * @param methodName The name of the method to be invoked in the script. + * @param data The object which contains all required parameters to be passed to the method. The data passed between the main thread and the workers framework are copied, not shared. Objects are serialized and de-serialized on both ends. + * @param buffers An array of [transferable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) buffers. Each buffer in the array should have a corresponding entry in the data object. Transferable objects are transferred from one context to another with a zero-copy operation, which results in a big performance improvement when sending large data sets. + * + */ invoke(methodName: string, data?: any, buffers?: ArrayBuffer[]): IPromise; } interface ConnectionConstructor { + /** + * The Connection class is used to access code loaded into a separate thread via the [workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html) + */ + + new(client: any, id: number): Connection; } export const Connection: ConnectionConstructor; + /** + * A convenience module for importing [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing geometries one at a time like this: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html) + */ + interface geometry { + } + + export const geometry: geometry; + interface Circle extends Polygon { - center: Point | number[]; + /** + * The center point of the circle. The center must be specified either as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of longitude/latitude coordinates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#center) + */ + center: Point; + /** + * Applicable when the spatial reference of the center point is either set to Web Mercator (wkid: 3857) or geographic/geodesic (wkid: 4326). When either of those spatial references is used, set geodesic to `true` to minimize distortion. Other coordinate systems will not create geodesic circles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#geodesic) + * + * @default false + */ geodesic: boolean; + /** + * This value defines the number of points along the curve of the circle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#numberOfPoints) + * + * @default 60 + */ numberOfPoints: number; + /** + * The radius of the circle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radius) + * + * @default 1000 + */ radius: number; + /** + * Unit of the radius. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radiusUnit) + * + * @default meters + */ radiusUnit: string; + /** + * Creates a deep clone of Circle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#clone) + * + * + */ clone(): Circle; } interface CircleConstructor { + + new(properties?: CircleProperties): Circle; fromJSON(json: any): Circle; @@ -566,39 +1827,233 @@ declare namespace __esri { export const Circle: CircleConstructor; interface CircleProperties extends PolygonProperties { - center?: PointProperties | number[]; + /** + * The center point of the circle. The center must be specified either as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of longitude/latitude coordinates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#center) + */ + center?: PointProperties; + /** + * Applicable when the spatial reference of the center point is either set to Web Mercator (wkid: 3857) or geographic/geodesic (wkid: 4326). When either of those spatial references is used, set geodesic to `true` to minimize distortion. Other coordinate systems will not create geodesic circles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#geodesic) + * + * @default false + */ geodesic?: boolean; + /** + * This value defines the number of points along the curve of the circle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#numberOfPoints) + * + * @default 60 + */ numberOfPoints?: number; + /** + * The radius of the circle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radius) + * + * @default 1000 + */ radius?: number; + /** + * Unit of the radius. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radiusUnit) + * + * @default meters + */ radiusUnit?: string; } interface Extent extends Geometry { - center: Point; - height: number; + /** + * The center point of the extent in map units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#center) + */ + readonly center: Point; + /** + * The height of the extent in map units (the distance between [ymin](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) and [ymax](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#height) + */ + readonly height: number; + /** + * The maximum possible `m` value in an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmax) + * + * @default undefined + */ mmax: number; + /** + * The minimum possible `m` value of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmin) + * + * @default undefined + */ mmin: number; - width: number; + /** + * For Extent, the type is always `extent`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#type) + */ + readonly type: "extent"; + /** + * The width of the extent in map units (the distance between [xmin](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) and [xmax](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#width) + */ + readonly width: number; + /** + * The bottom-right X-coordinate of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax) + * + * @default 0 + */ xmax: number; + /** + * The top-left X-coordinate of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) + * + * @default 0 + */ xmin: number; + /** + * The top-right Y-coordinate of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax) + * + * @default 0 + */ ymax: number; + /** + * The bottom-left Y-coordinate of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) + * + * @default 0 + */ ymin: number; + /** + * The maximum possible `z`, or elevation, value in an extent envelope. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmax) + * + * @default undefined + */ zmax: number; + /** + * The minimum possible `z`, or elevation, value of an extent envelope. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmin) + * + * @default undefined + */ zmin: number; + /** + * Centers the extent to the specified [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#centerAt) + * + * @param point The point to center the extent. + * + */ centerAt(point: Point): Extent; + /** + * Creates a deep clone of Extent object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) + * + * + */ clone(): Extent; + /** + * Checks if the input geometry is contained within the extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#contains) + * + * @param geometry Input geometry to test if it is contained within the extent. + * + */ contains(geometry: Point | Extent): boolean; + /** + * Indicates if the input extent is equal to the testing extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#equals) + * + * @param extent Input extent. + * + */ equals(extent: Extent): boolean; + /** + * Expands the extent by the given factor. For example, a value of 1.5 will expand the extent to be 50 percent larger than the original extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#expand) + * + * @param factor The multiplier value. + * + */ expand(factor: number): Extent; + /** + * Shrinks the original extent to the intersection with the input extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. If the original extent and the input extent have no intersection, the extent is not modified and null is returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#intersection) + * + * @param extent The input extent to intersect. + * + */ intersection(extent: Extent): Extent; + /** + * Tests to validate if the input geometry intersects the extent and returns a Boolean value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#intersects) + * + * @param geometry The geometry used to test the intersection. It can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) or [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). + * + */ intersects(geometry: Geometry): boolean; + /** + * Returns an array with either one Extent that's been shifted to within +/- 180 or two Extents if the original extent intersects the International Dateline. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#normalize) + * + * + */ normalize(): Extent[]; + /** + * Modifies the extent geometry in-place with X and Y offsets in map units. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#offset) + * + * @param dx The offset distance in map units for the X-coordinate. + * @param dy The offset distance in map units for the Y-coordinate. + * @param dz The offset distance in map units for the Z-coordinate. + * + */ offset(dx: number, dy: number, dz: number): Extent; + /** + * Expands the original extent to include the extent of the input Extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#union) + * + * @param extent The input extent to union. + * + */ union(extent: Extent): Extent; } interface ExtentConstructor { + + new(properties?: ExtentProperties): Extent; fromJSON(json: any): Extent; @@ -607,31 +2062,128 @@ declare namespace __esri { export const Extent: ExtentConstructor; interface ExtentProperties extends GeometryProperties { - center?: PointProperties; - height?: number; + /** + * The maximum possible `m` value in an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmax) + * + * @default undefined + */ mmax?: number; + /** + * The minimum possible `m` value of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmin) + * + * @default undefined + */ mmin?: number; - width?: number; + /** + * The bottom-right X-coordinate of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax) + * + * @default 0 + */ xmax?: number; + /** + * The top-left X-coordinate of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) + * + * @default 0 + */ xmin?: number; + /** + * The top-right Y-coordinate of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax) + * + * @default 0 + */ ymax?: number; + /** + * The bottom-left Y-coordinate of an extent envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) + * + * @default 0 + */ ymin?: number; + /** + * The maximum possible `z`, or elevation, value in an extent envelope. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmax) + * + * @default undefined + */ zmax?: number; + /** + * The minimum possible `z`, or elevation, value of an extent envelope. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmin) + * + * @default undefined + */ zmin?: number; } interface Geometry extends Accessor, JSONSupport { - cache: any; - extent: Extent; + /** + * The cache is used to store values computed from geometries that need to cleared or recomputed upon mutation. An example is the extent of a polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#cache) + */ + readonly cache: any; + /** + * The extent of the geometry. For points, the extent is null. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#extent) + */ + readonly extent: Extent; + /** + * Indicates if the geometry has M values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasM) + */ hasM: boolean; + /** + * Indicates if the geometry has Z (elevation) values. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasZ) + */ hasZ: boolean; + /** + * The spatial reference of the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#spatialReference) + * + * @default WGS84 (wkid: 4326) + */ spatialReference: SpatialReference; - type: string; + /** + * The geometry type. **Possible Values:** point | multipoint | polyline | polygon | extent + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) + */ + readonly type: string; + /** + * Creates a deep clone of the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#clone) + * + * + */ clone(): Geometry; } interface GeometryConstructor { + + new(properties?: GeometryProperties): Geometry; fromJSON(json: any): Geometry; @@ -640,111 +2192,861 @@ declare namespace __esri { export const Geometry: GeometryConstructor; interface GeometryProperties { - cache?: any; - extent?: ExtentProperties; + /** + * Indicates if the geometry has M values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasM) + */ hasM?: boolean; + /** + * Indicates if the geometry has Z (elevation) values. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasZ) + */ hasZ?: boolean; + /** + * The spatial reference of the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#spatialReference) + * + * @default WGS84 (wkid: 4326) + */ spatialReference?: SpatialReferenceProperties; - type?: string; } + interface geometryEngine { + /** + * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. The GeometryEngine has two methods for buffering geometries client-side: buffer and [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer). Use caution when deciding which method to use. As a general rule, use [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer) if the input geometries have a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator). Only use buffer (this method) when attempting to buffer geometries with a [projected coordinate system](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) other than Web Mercator. If you need to buffer geometries with a [geographic coordinate system](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buffer) + * + * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. + * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. + * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * @param unionResults Determines whether the output geometries should be unioned into a single polygon. + * + */ buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + /** + * Calculates the clipped geometry from a target geometry by an envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#clip) + * + * @param geometry The geometry to be clipped. + * @param envelope The envelope used to clip. + * + */ clip(geometry: Geometry, envelope: Extent): Geometry; + /** + * Indicates if one geometry contains another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#contains) + * + * @param containerGeometry The geometry that is tested for the "contains" relationship to the other geometry. Think of this geometry as the potential "container" of the `insideGeometry`. + * @param insideGeometry The geometry that is tested for the "within" relationship to the `containerGeometry`. + * + */ contains(containerGeometry: Geometry, insideGeometry: Geometry): boolean; + /** + * Calculates the convex hull of the input geometry. A convex hull is the smallest convex polygon that encloses a group of Objects, such as points. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#convexHull) + * + * @param geometry The input geometry. + * @param merge Dictates whether to merge output geometries. + * + */ convexHull(geometry: Geometry, merge?: boolean): Geometry | Geometry[]; + /** + * Indicates if one geometry crosses another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#crosses) + * + * @param geometry1 The geometry to cross. + * @param geometry2 The geometry being crossed. + * + */ crosses(geometry1: Geometry, geometry2: Geometry): boolean; + /** + * Split the input Polyline or Polygon where it crosses a cutting Polyline. For Polylines, all left cuts are grouped together in the first Geometry. Right cuts and coincident cuts are grouped in the second Geometry and each undefined cut, along with any uncut parts, are output as separate Polylines. For Polygons, all left cuts are grouped in the first Polygon, all right cuts are grouped in the second Polygon, and each undefined cut, along with any left-over parts after cutting, are output as a separate Polygon. If no cuts are returned then the array will be empty. An undefined cut will only be produced if a left cut or right cut was produced and there was a part left over after cutting, or a cut is bounded to the left and right of the cutter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#cut) + * + * @param geometry The geometry to be cut. + * @param cutter The polyline to cut the geometry. + * + */ cut(geometry: Geometry, cutter: Polyline): Geometry[]; + /** + * Densify geometries by plotting points between existing vertices. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#densify) + * + * @param geometry The geometry to be densified. + * @param maxSegmentLength The maximum segment length allowed. Must be a positive value. + * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; + /** + * Creates the difference of two geometries. The resultant geometry is the portion of `inputGeometry` not in the `subtractor`. The dimension of the `subtractor` has to be equal to or greater than that of the `inputGeometry`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#difference) + * + * @param inputGeometry The input geometry to subtract from. + * @param subtractor The geometry being subtracted from inputGeometry. + * + */ difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): Geometry | Geometry[]; + /** + * Indicates if one geometry is disjoint (doesn't intersect in any way) with another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#disjoint) + * + * @param geometry1 The base geometry that is tested for the "disjoint" relationship to the other geometry. + * @param geometry2 The comparison geometry that is tested for the "disjoint" relationship to the other geometry. + * + */ disjoint(geometry1: Geometry, geometry2: Geometry): boolean; + /** + * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. + * > To calculate the geodesic distance between two points, first construct a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) using the two points of interest as the beginning and ending points of a single path. Then use the polyline as input for the [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#distance) + * + * @param geometry1 First input geometry. + * @param geometry2 Second input geometry. + * @param distanceUnit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number; + /** + * Indicates if two geometries are equal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#equals) + * + * @param geometry1 First input geometry. + * @param geometry2 Second input geometry. + * + */ equals(geometry1: Geometry, geometry2: Geometry): boolean; + /** + * Returns an Object containing additional information about the input spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#extendedSpatialReferenceInfo) + * + * @param spatialReference The input spatial reference. + * + */ extendedSpatialReferenceInfo(spatialReference: SpatialReference): any; + /** + * Flips a geometry on the horizontal axis. Can optionally be flipped around a point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#flipHorizontal) + * + * @param geometry The input geometry to be flipped. + * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. + * + */ flipHorizontal(geometry: Geometry, flipOrigin?: Point): Geometry; + /** + * Flips a geometry on the vertical axis. Can optionally be flipped around a point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#flipVertical) + * + * @param geometry The input geometry to be flipped. + * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. + * + */ flipVertical(geometry: Geometry, flipOrigin?: Point): Geometry; + /** + * Performs the generalize operation on the geometries in the cursor. Point and Multipoint geometries are left unchanged. Envelope is converted to a Polygon and then generalized. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#generalize) + * + * @param geometry The input geometry to be generalized. + * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. + * @param removeDegenerateParts When `true` the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). + * @param maxDeviationUnit Measurement unit for maxDeviation. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry; + /** + * Calculates the area of the input geometry. As opposed to [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea), geodesicArea takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea) + * + * @param geometry The input polygon. + * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles + * + */ geodesicArea(geometry: Polygon, unit: string | number): number; + /** + * Creates geodesic buffer polygons at a specified distance around the input geometries. When calculating distances, this method takes the curvature of the earth into account, which provides highly accurate results when dealing with very large geometries and/or geometries that spatially vary on a global scale where one projected coordinate system could not accurately plot coordinates and measure distances for all the geometries. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. In general, if your input geometries are assigned one of those two spatial references, you should always use geodesicBuffer() to obtain the most accurate results for those geometries. If needing to buffer points assigned a [projected coordinate system other than Web Mercator](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/), use [buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buffer) instead. If the input geometries have a [geographic coordinate system](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer) + * + * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. + * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. + * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * @param unionResults Determines whether the output geometries should be unioned into a single polygon. + * + */ geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + /** + * Returns a geodesically densified version of the input geometry. Use this function to draw the line(s) of the geometry along great circles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicDensify) + * + * @param geometry A polyline or polygon to densify. + * @param maxSegmentLength The maximum segment length allowed. This must be a positive value. + * @param maxSegmentLengthUnit Measurement unit for `maxSegmentLength`. If a unit is not specified, the units are considered to be the same as the units of the `geometry`. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; + /** + * Calculates the length of the input geometry. As opposed to [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength), geodesicLength() takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using geodesicLength(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength) + * + * @param geometry The input geometry. + * @param unit Measurement unit of the return value. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ geodesicLength(geometry: Geometry, unit: string | number): number; + /** + * Creates a new geometry through intersection between two geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#intersect) + * + * @param geometry The input geometry(ies). + * @param intersector The geometry being intersected. + * + */ intersect(geometry: Geometry | Geometry[], intersector: Geometry): Geometry | Geometry[]; + /** + * Indicates if one geometry intersects another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#intersects) + * + * @param geometry1 The geometry that is tested for the intersects relationship to the other geometry. + * @param geometry2 The geometry being intersected. + * + */ intersects(geometry1: Geometry, geometry2: Geometry): boolean; + /** + * Indicates if the given geometry is topologically simple. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#isSimple) + * + * @param geometry The input geometry. + * + */ isSimple(geometry: Geometry): boolean; + /** + * Finds the coordinate of the geometry that is closest to the specified point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestCoordinate) + * + * @param geometry The geometry to consider. + * @param inputPoint The point used to search the nearest coordinate in the geometry. + * + */ nearestCoordinate(geometry: Geometry, inputPoint: Point): NearestPointResult; + /** + * Finds the vertex on the geometry nearest to the specified point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertex) + * + * @param geometry The geometry to consider. + * @param inputPoint The point used to search the nearest vertex in the geometry. + * + */ nearestVertex(geometry: Geometry, inputPoint: Point): NearestPointResult; + /** + * Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of Objects. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertices) + * + * @param geometry The geometry to consider. + * @param inputPoint The point from which to measure. + * @param searchRadius The distance to search from the inputPoint in the units of the view's spatial reference. + * @param maxVertexCountToReturn The maximum number of vertices to return. + * + */ nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): NearestPointResult[]; + /** + * The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon. It is similar to buffering, but produces a one-sided result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#offset) + * + * @param geometry The geometries to offset. + * @param offsetDistance The planar distance to offset from the input geometry. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, if offsetDistance = 0, then there is no change in the geometries, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the "right side" of a simple polygon is always its inside. + * @param offsetUnit Measurement unit of the offset distance. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * @param joinType The join type. **Possible values:** round | bevel | miter | square + * @param bevelRatio Applicable when `joinType = 'miter'`; bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. + * @param flattenError Applicable when `joinType = 'round'`; flattenError determines the maximum distance of the resulting segments compared to the true circular arc. The algorithm never produces more than around 180 vertices for each round join. + * + */ offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): Geometry | Geometry[]; + /** + * Indicates if one geometry overlaps another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#overlaps) + * + * @param geometry1 The base geometry that is tested for the "overlaps" relationship with the other geometry. + * @param geometry2 The comparison geometry that is tested for the "overlaps" relationship with the other geometry. + * + */ overlaps(geometry1: Geometry, geometry2: Geometry): boolean; + /** + * Calculates the area of the input geometry. As opposed to [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea), planarArea() performs this calculation using projected coordinates and does not take into account the earth's curvature. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea) + * + * @param geometry The input polygon. + * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles + * + */ planarArea(geometry: Polygon, unit: string | number): number; + /** + * Calculates the length of the input geometry. As opposed to [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength), planarLength() uses projected coordinates and does not take into account the curvature of the earth when performing this calculation. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength). If the input geometries have a projected coordinate system other than Web Mercator, use planarLength() instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength) + * + * @param geometry The input geometry. + * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ planarLength(geometry: Geometry, unit: string | number): number; + /** + * Indicates if the given DE-9IM relation holds for the two geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) + * + * @param geometry1 The first geometry for the relation. + * @param geometry2 The second geometry for the relation. + * @param relation The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: `0`,`1`,`2`), a Boolean value (`T` or `F`), or a mask character (for ignoring results: '\*'). Example: Each of the following DE-9IM string codes are valid for testing whether a polygon geometry completely contains a line geometry: `TTTFFTFFT` (Boolean), 'T*\*\*\*\*\*FF\*' (ignore irrelevant intersections), or '102FF\*FF\*' (dimension form). Each returns the same result. See [this article](https://en.wikipedia.org/wiki/DE-9IM) and [this ArcGIS help page](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) for more information about the DE-9IM model and how string codes are constructed. + * + */ relate(geometry1: Geometry, geometry2: Geometry, relation: string): boolean; + /** + * Rotates a geometry counterclockwise by the specified number of degrees. Rotation is around the centroid, or a given rotation point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#rotate) + * + * @param geometry The geometry to rotate. + * @param angle The rotation angle in degrees. + * @param rotationOrigin Point to rotate the geometry around. Defaults to the centroid of the geometry. + * + */ rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): Geometry; + /** + * Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#simplify) + * + * @param geometry The geometry to be simplified. + * + */ simplify(geometry: Geometry): Geometry; + /** + * Creates the symmetric difference of two geometries. The symmetric difference includes the parts that are in either of the sets, but not in both. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#symmetricDifference) + * + * @param leftGeometry One of the Geometry instances in the XOR operation. + * @param rightGeometry One of the Geometry instances in the XOR operation. + * + */ symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): Geometry | Geometry[]; + /** + * Indicates if one geometry touches another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#touches) + * + * @param geometry1 The geometry to test the "touches" relationship with the other geometry. + * @param geometry2 The geometry to be touched. + * + */ touches(geometry1: Geometry, geometry2: Geometry): boolean; + /** + * All inputs must be of the same type of geometries and share one spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#union) + * + * @param geometries An array of Geometries to union. + * + */ union(geometries: Geometry[]): Geometry; + /** + * Indicates if one geometry is within another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#within) + * + * @param innerGeometry The base geometry that is tested for the "within" relationship to the other geometry. + * @param outerGeometry The comparison geometry that is tested for the "contains" relationship to the other geometry. + * + */ within(innerGeometry: Geometry, outerGeometry: Geometry): boolean; } export const geometryEngine: geometryEngine; - export interface NearestPointResult { + /** + * Object returned from the [nearestCoordinate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestCoordinate), [nearestVertex()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertex), and [nearestVertices()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertices) methods. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) + */ + export interface NearestPointResult extends Object { + /** + * A vertex within the specified distance of the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) + */ coordinate: Point; + /** + * The distance from the `inputPoint` in the units of the view's spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) + */ distance: number; + /** + * Indicates if the vertex is on the right side of the `geometry`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) + */ isRightSide: boolean; + /** + * The index of the vertex within the geometry's rings or paths. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) + */ vertexIndex: number; + /** + * Indicates if it is an empty geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) + */ isEmpty: boolean; } + interface geometryEngineAsync { + /** + * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. The GeometryEngine has two methods for buffering geometries client-side: buffer and [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer). Use caution when deciding which method to use. As a general rule, use [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer) if the input geometries have a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator). Only use buffer (this method) when attempting to buffer geometries with a [projected coordinate system](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) other than Web Mercator. If you need to buffer geometries with a [geographic coordinate system](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#buffer) + * + * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. + * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. + * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * @param unionResults Determines whether the output geometries should be unioned into a single polygon. + * + */ buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; + /** + * Calculates the clipped geometry from a target geometry by an envelope. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#clip) + * + * @param geometry The geometry to be clipped. + * @param envelope The envelope used to clip. + * + */ clip(geometry: Geometry, envelope: Extent): IPromise; + /** + * Indicates if one geometry contains another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#contains) + * + * @param containerGeometry The geometry that is tested for the "contains" relationship to the other geometry. Think of this geometry as the potential "container" of the `insideGeometry`. + * @param insideGeometry The geometry that is tested for the "within" relationship to the `containerGeometry`. + * + */ contains(containerGeometry: Geometry, insideGeometry: Geometry): IPromise; + /** + * Calculates the convex hull of the input geometry. A convex hull is the smallest convex polygon that encloses a group of Objects, such as points. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#convexHull) + * + * @param geometry The input geometry. + * @param merge Dictates whether to merge output geometries. + * + */ convexHull(geometry: Geometry, merge?: boolean): IPromise; + /** + * Indicates if one geometry crosses another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#crosses) + * + * @param geometry1 The geometry to cross. + * @param geometry2 The geometry being crossed. + * + */ crosses(geometry1: Geometry, geometry2: Geometry): IPromise; + /** + * Split the input Polyline or Polygon where it crosses a cutting Polyline. For Polylines, all left cuts are grouped together in the first Geometry. Right cuts and coincident cuts are grouped in the second Geometry and each undefined cut, along with any uncut parts, are output as separate Polylines. For Polygons, all left cuts are grouped in the first Polygon, all right cuts are grouped in the second Polygon, and each undefined cut, along with any left-over parts after cutting, are output as a separate Polygon. If no cuts are returned then the array will be empty. An undefined cut will only be produced if a left cut or right cut was produced and there was a part left over after cutting, or a cut is bounded to the left and right of the cutter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#cut) + * + * @param geometry The geometry to be cut. + * @param cutter The polyline to cut the geometry. + * + */ cut(geometry: Geometry, cutter: Polyline): IPromise; + /** + * Densify geometries by plotting points between existing vertices. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#densify) + * + * @param geometry The geometry to be densified. + * @param maxSegmentLength The maximum segment length allowed. Must be a positive value. + * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; + /** + * Creates the difference of two geometries. The resultant geometry is the portion of inputGeometry not in the subtractor. The dimension of the subtractor has to be equal to or greater than that of the inputGeometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#difference) + * + * @param inputGeometry The input geometry to subtract from. + * @param subtractor The geometry being subtracted from inputGeometry. + * + */ difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): IPromise; + /** + * Indicates if one geometry is disjoint (doesn't intersect in any way) with another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#disjoint) + * + * @param geometry1 The base geometry that is tested for the "disjoint" relationship to the other geometry. + * @param geometry2 The comparison geometry that is tested for the "disjoint" relationship to the other geometry. + * + */ disjoint(geometry1: Geometry, geometry2: Geometry): IPromise; + /** + * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. + * > To calculate the geodesic distance between two points, first construct a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) using the two points of interest as the beginning and ending points of a single path. Then use the polyline as input for the [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#distance) + * + * @param geometry1 First input geometry. + * @param geometry2 Second input geometry. + * @param distanceUnit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): IPromise; + /** + * Indicates if two geometries are equal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#equals) + * + * @param geometry1 First input geometry. + * @param geometry2 Second input geometry. + * + */ equals(geometry1: Geometry, geometry2: Geometry): IPromise; + /** + * Returns an Object containing additional information about the input spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#extendedSpatialReferenceInfo) + * + * @param spatialReference The input spatial reference. + * + */ extendedSpatialReferenceInfo(spatialReference: SpatialReference): IPromise; + /** + * Flips a geometry on the horizontal axis. Can optionally be flipped around a point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#flipHorizontal) + * + * @param geometry The input geometry to be flipped. + * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. + * + */ flipHorizontal(geometry: Geometry, flipOrigin?: Point): IPromise; + /** + * Flips a geometry on the vertical axis. Can optionally be flipped around a point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#flipVertical) + * + * @param geometry The input geometry to be flipped. + * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. + * + */ flipVertical(geometry: Geometry, flipOrigin?: Point): IPromise; + /** + * Performs the generalize operation on the geometries in the cursor. Point and Multipoint geometries are left unchanged. Envelope is converted to a Polygon and then generalized. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#generalize) + * + * @param geometry The input geometry to be generalized. + * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. + * @param removeDegenerateParts When `true` the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). + * @param maxDeviationUnit Measurement unit for maxDeviation. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): IPromise; + /** + * Calculates the area of the input geometry. As opposed to [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea), geodesicArea takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea) + * + * @param geometry The input polygon. + * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles + * + */ geodesicArea(geometry: Polygon, unit: string | number): IPromise; + /** + * Creates geodesic buffer polygons at a specified distance around the input geometries. When calculating distances, this method takes the curvature of the earth into account, which provides highly accurate results when dealing with very large geometries and/or geometries that spatially vary on a global scale where one projected coordinate system could not accurately plot coordinates and measure distances for all the geometries. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. In general, if your input geometries are assigned one of those two spatial references, you should always use geodesicBuffer() to obtain the most accurate results for those geometries. If needing to buffer points assigned a [projected coordinate system other than Web Mercator](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/), use [buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#buffer) instead. If the input geometries have a [geographic coordinate system](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer) + * + * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. + * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. + * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * @param unionResults Determines whether the output geometries should be unioned into a single polygon. + * + */ geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; + /** + * Returns a geodesically densified version of the input geometry. Use this function to draw the line(s) of the geometry along great circles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicDensify) + * + * @param geometry A polyline or polygon to densify. + * @param maxSegmentLength The maximum segment length allowed. This must be a positive value. + * @param maxSegmentLengthUnit Measurement unit for `maxSegmentLength`. If a unit is not specified, the units are considered to be the same as the units of the `geometry`. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; + /** + * Calculates the length of the input geometry. As opposed to [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength), geodesicLength() takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using geodesicLength(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength) + * + * @param geometry The input geometry. + * @param unit Measurement unit of the return value. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ geodesicLength(geometry: Geometry, unit: string | number): IPromise; + /** + * Creates a new geometry through intersection between two geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#intersect) + * + * @param geometry The input geometry(ies). + * @param intersector The geometry being intersected. + * + */ intersect(geometry: Geometry | Geometry[], intersector: Geometry): IPromise; + /** + * Indicates if one geometry intersects another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#intersects) + * + * @param geometry1 The geometry that is tested for the intersects relationship to the other geometry. + * @param geometry2 The geometry being intersected. + * + */ intersects(geometry1: Geometry, geometry2: Geometry): IPromise; + /** + * Indicates if the given geometry is topologically simple. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#isSimple) + * + * @param geometry The input geometry. + * + */ isSimple(geometry: Geometry): IPromise; + /** + * Finds the coordinate of the geometry that is closest to the specified point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestCoordinate) + * + * @param geometry The geometry to consider. + * @param inputPoint The point used to search the nearest coordinate in the geometry. + * + */ nearestCoordinate(geometry: Geometry, inputPoint: Point): IPromise; + /** + * Finds vertex on the geometry nearest to the specified point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestVertex) + * + * @param geometry The geometry to consider. + * @param inputPoint The point used to search the nearest vertex in the geometry. + * + */ nearestVertex(geometry: Geometry, inputPoint: Point): IPromise; + /** + * Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of Objects. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestVertices) + * + * @param geometry The geometry to consider. + * @param inputPoint The point from which to measure. + * @param searchRadius The distance to search from the inputPoint in the units of the view's spatial reference. + * @param maxVertexCountToReturn The maximum number of vertices to return. + * + */ nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): IPromise; + /** + * The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon. It is similar to buffering, but produces a one-sided result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#offset) + * + * @param geometry The geometries to offset. + * @param offsetDistance The planar distance to offset from the input geometry. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, if offsetDistance = 0, then there is no change in the geometries, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the "right side" of a simple polygon is always its inside. + * @param offsetUnit Measurement unit of the offset distance. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * @param joinType The join type. **Possible values:** round | bevel | miter | square + * @param bevelRatio Applicable when `joinType = 'miter'`; bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. + * @param flattenError Applicable when `joinType = 'round'`; flattenError determines the maximum distance of the resulting segments compared to the true circular arc. The algorithm never produces more than around 180 vertices for each round join. + * + */ offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): IPromise; + /** + * Indicates if one geometry overlaps another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#overlaps) + * + * @param geometry1 The base geometry that is tested for the "overlaps" relationship with the other geometry. + * @param geometry2 The comparison geometry that is tested for the "overlaps" relationship with the other geometry. + * + */ overlaps(geometry1: Geometry, geometry2: Geometry): IPromise; + /** + * Calculates the area of the input geometry. As opposed to [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea), planarArea() performs this calculation using projected coordinates and does not take into account the earth's curvature. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea) + * + * @param geometry The input polygon. + * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles + * + */ planarArea(geometry: Polygon, unit: string | number): IPromise; + /** + * Calculates the length of the input geometry. As opposed to [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength), planarLength() uses projected coordinates and does not take into account the curvature of the earth when performing this calculation. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength). If the input geometries have a projected coordinate system other than Web Mercator, use planarLength() instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength) + * + * @param geometry The input geometry. + * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards + * + */ planarLength(geometry: Geometry, unit: string | number): IPromise; + /** + * Indicates if the given DE-9IM relation holds for the two geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#relate) + * + * @param geometry1 The first geometry for the relation. + * @param geometry2 The second geometry for the relation. + * @param relation The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: `0`,`1`,`2`), a Boolean value (`T` or `F`), or a mask character (for ignoring results: '\*'). Example: Each of the following DE-9IM string codes are valid for testing whether a polygon geometry completely contains a line geometry: `TTTFFTFFT` (Boolean), 'T\*\*\*\*\*FF\*' (ignore irrelevant intersections), or '102FF\*FF\*' (dimension form). Each returns the same result. See [this article](https://en.wikipedia.org/wiki/DE-9IM) and [this ArcGIS help page](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) for more information about the DE-9IM model and how string codes are constructed. + * + */ relate(geometry1: Geometry, geometry2: Geometry, relation: string): IPromise; + /** + * Rotates a geometry counterclockwise by the specified number of degrees. Rotation is around the centroid, or a given rotation point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#rotate) + * + * @param geometry The geometry to rotate. + * @param angle The rotation angle in degrees. + * @param rotationOrigin Point to rotate the geometry around. Defaults to the centroid of the geometry. + * + */ rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): IPromise; + /** + * Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#simplify) + * + * @param geometry The geometry to be simplified. + * + */ simplify(geometry: Geometry): IPromise; + /** + * Creates the symmetric difference of two geometries. The symmetric difference includes the parts that are in either of the sets, but not in both. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#symmetricDifference) + * + * @param leftGeometry One of the Geometry instances in the XOR operation. + * @param rightGeometry One of the Geometry instances in the XOR operation. + * + */ symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): IPromise; + /** + * Indicates if one geometry touches another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#touches) + * + * @param geometry1 The geometry to test the "touches" relationship with the other geometry. + * @param geometry2 The geometry to be touched. + * + */ touches(geometry1: Geometry, geometry2: Geometry): IPromise; + /** + * All inputs must be of the same type of geometries and share one spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#union) + * + * @param geometries An array of Geometries to union. + * + */ union(geometries: Geometry[]): IPromise; + /** + * Indicates if one geometry is within another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#within) + * + * @param innerGeometry The base geometry that is tested for the "within" relationship to the other geometry. + * @param outerGeometry The comparison geometry that is tested for the "contains" relationship to the other geometry. + * + */ within(innerGeometry: Geometry, outerGeometry: Geometry): IPromise; } export const geometryEngineAsync: geometryEngineAsync; interface HeightModelInfo extends Accessor, JSONSupport { - heightModel: string; - heightUnit: string; - vertCRS: string; + /** + * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. + * + * Value | Description + * ------|------------ + * gravity-related-height | A gravity-related VCS may set its zero point through a local mean sea level or a benchmark, and is compatible with other gravity-related VCS for the purposes of rendering. + * ellipsoidal | An ellipsoidal VCS defines heights that are referenced to an ellipsoid of a geographic coordinate system. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightModel) + * + * @default "gravity-related-height" + */ + readonly heightModel: string; + /** + * The unit of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will use this property to check that the vertical data of layers that define a HeightModelInfo is compatible with the view. **Possible Values:** meters | feet | us-feet | clarke-feet | clarke-yards | clarke-links | sears-yards | sears-feet | sears-chains | benoit-1895-b-chains | indian-yards | indian-1937-yards | gold-coast-feet | sears-1922-truncated-chains | 50-kilometers | 150-kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightUnit) + * + * @default "meters" + */ + readonly heightUnit: string; + /** + * The datum realization of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers that define a HeightModelInfo with an identical `vertCRS` to that of the scene, when using an `ellipsoidal` height model. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#vertCRS) + */ + readonly vertCRS: string; } interface HeightModelInfoConstructor { + + new(properties?: HeightModelInfoProperties): HeightModelInfo; fromJSON(json: any): HeightModelInfo; @@ -753,22 +3055,100 @@ declare namespace __esri { export const HeightModelInfo: HeightModelInfoConstructor; interface HeightModelInfoProperties { + /** + * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. + * + * Value | Description + * ------|------------ + * gravity-related-height | A gravity-related VCS may set its zero point through a local mean sea level or a benchmark, and is compatible with other gravity-related VCS for the purposes of rendering. + * ellipsoidal | An ellipsoidal VCS defines heights that are referenced to an ellipsoid of a geographic coordinate system. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightModel) + * + * @default "gravity-related-height" + */ heightModel?: string; + /** + * The unit of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will use this property to check that the vertical data of layers that define a HeightModelInfo is compatible with the view. **Possible Values:** meters | feet | us-feet | clarke-feet | clarke-yards | clarke-links | sears-yards | sears-feet | sears-chains | benoit-1895-b-chains | indian-yards | indian-1937-yards | gold-coast-feet | sears-1922-truncated-chains | 50-kilometers | 150-kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightUnit) + * + * @default "meters" + */ heightUnit?: string; + /** + * The datum realization of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers that define a HeightModelInfo with an identical `vertCRS` to that of the scene, when using an `ellipsoidal` height model. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#vertCRS) + */ vertCRS?: string; } interface Multipoint extends Geometry { + /** + * An array of points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) + */ points: number[][]; + /** + * For Multipoint, the type is always `multipoint`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#type) + */ + readonly type: "multipoint"; + /** + * Adds a point to the Multipoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#addPoint) + * + * @param point The point to add to the multipoint. The point can either be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of numbers representing XY coordinates. + * + */ addPoint(point: Point | number[]): Multipoint; + /** + * Creates a deep clone of Multipoint object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#clone) + * + * + */ clone(): Multipoint; + /** + * Returns the point at the specified index. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#getPoint) + * + * @param index The index of the point in the [points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) property. + * + */ getPoint(index: number): Point; + /** + * Removes a point from the Multipoint. The index specifies which point to remove. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#removePoint) + * + * @param index The index of the point to remove. + * + */ removePoint(index: number): Point; + /** + * Updates the point at the specified index. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#setPoint) + * + * @param index The index of the point in the [points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) property. + * @param point Point geometry that specifies the new location. + * + */ setPoint(index: number, point: Point): Multipoint; } interface MultipointConstructor { + + new(properties?: MultipointProperties): Multipoint; fromJSON(json: any): Multipoint; @@ -777,25 +3157,119 @@ declare namespace __esri { export const Multipoint: MultipointConstructor; interface MultipointProperties extends GeometryProperties { + /** + * An array of points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) + */ points?: number[][]; } interface Point extends Geometry { + /** + * The latitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#latitude) + */ latitude: number; + /** + * The longitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#longitude) + */ longitude: number; + /** + * The m-coordinate of the point in map units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#m) + * + * @default undefined + */ m: number; + /** + * For Point, the type is always `point`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#type) + */ + readonly type: "point"; + /** + * The x-coordinate (easting) of the point in map units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#x) + * + * @default 0 + */ x: number; + /** + * The y-coordinate (northing) of the point in map units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#y) + * + * @default 0 + */ y: number; + /** + * The z-coordinate (or elevation) of the point in map units. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#z) + * + * @default undefined + */ z: number; + /** + * Creates a deep clone of Point object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone) + * + * + */ clone(): Point; + /** + * Copies all values from another Point instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#copy) + * + * @param other The point to copy from. + * + */ copy(other: Point): void; + /** + * Computes the Euclidean distance between this Point and a given Point. Points must have the same spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#distance) + * + * @param other The point to compute the distance to. + * + */ distance(other: Point): number; + /** + * Determines if the input point is equal to the point calling the function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#equals) + * + * @param point The input point to test. + * + */ equals(point: Point): boolean; + /** + * Modifies the point geometry in-place by shifting the X-coordinate to within +/- 180 span in map units. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone) the point object before calling this method where appropriate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#normalize) + * + * + */ normalize(): Point; } interface PointConstructor { + /** + * A location defined by X, Y, and Z coordinates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) + */ + new(properties?: PointProperties): Point; fromJSON(json: any): Point; @@ -804,34 +3278,193 @@ declare namespace __esri { export const Point: PointConstructor; interface PointProperties extends GeometryProperties { + /** + * The latitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#latitude) + */ latitude?: number; + /** + * The longitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#longitude) + */ longitude?: number; + /** + * The m-coordinate of the point in map units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#m) + * + * @default undefined + */ m?: number; + /** + * The x-coordinate (easting) of the point in map units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#x) + * + * @default 0 + */ x?: number; + /** + * The y-coordinate (northing) of the point in map units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#y) + * + * @default 0 + */ y?: number; + /** + * The z-coordinate (or elevation) of the point in map units. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#z) + * + * @default undefined + */ z?: number; } interface Polygon extends Geometry { + /** + * The centroid of the polygon. For a polygon with multiple rings, it represents the centroid of the largest ring. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#centroid) + */ centroid: Point; + /** + * Checks to see if polygon rings cross each other and indicates if the polygon is self-intersecting, which means the ring of the polygon crosses itself. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting) + */ isSelfIntersecting: boolean; + /** + * An array of rings. Each ring is a two-dimensional array of numbers representing the coordinates of each vertex in the ring in the spatial reference of the view. The first vertex of each ring should always be the same as the last vertex. Each vertex is an array of two, three, or four numbers. The table below shows the various structures of a vertex array. + * + * Case | Vertex array + * --- | --- + * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM)| [x, y] + * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, m] + * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z] + * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z, m] + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) + */ rings: number[][][]; + /** + * For Polygon, the type is always `polygon`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#type) + */ + readonly type: "polygon"; - addRing(ring: Point[] | number[][]): Polygon; + /** + * Adds a ring to the Polygon. The ring can be one of the following: an array of numbers or an array of points. When added the index of the ring is incremented by one. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#addRing) + * + * @param points A polygon ring. The first and last coordinates/points in the ring must be the same. This can either be defined as an array of Point geometries or an array of XY coordinates. + * + */ + addRing(points: Point[] | number[][]): Polygon; + /** + * Creates a deep clone of Polygon object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#clone) + * + * + */ clone(): Polygon; + /** + * Checks on the client if the input point is inside the polygon. A point on the polygon line is considered inside. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#contains) + * + * @param point The point to test whether it is contained within the testing polygon. + * + */ contains(point: Point): boolean; + /** + * Returns a point specified by a ring and point in the path. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#getPoint) + * + * @param ringIndex The index of the ring containing the desired point. + * @param pointIndex The index of the desired point within the ring. + * + */ getPoint(ringIndex: number, pointIndex: number): Point; - insertPoint(ringIndex: number, pointIndex: number, point: Point): Polygon; + /** + * Inserts a new point into the polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#insertPoint) + * + * @param ringIndex The index of the ring in which to insert the point. + * @param pointIndex The index of the point to insert within the ring. + * @param point The point to insert. + * + */ + insertPoint(ringIndex: number, pointIndex: number, point: Point | number[]): Polygon; + /** + * Checks if a Polygon ring is clockwise. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isClockwise) + * + * @param ring A polygon ring. The first and last coordinates/points in the ring must be the same. This can either be defined as an array of Point geometries or an array of XY coordinates. + * + */ isClockwise(ring: Point[] | number[][]): boolean; + /** + * Removes a point from the polygon at the given `pointIndex` within the ring identified by `ringIndex`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#removePoint) + * + * @param ringIndex The index of the ring containing the point to remove. + * @param pointIndex The index of the point to remove within the ring. + * + */ removePoint(ringIndex: number, pointIndex: number): Point[]; + /** + * Removes a ring from the Polygon. The index specifies which ring to remove. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#removeRing) + * + * @param index The index of the ring to remove. + * + */ removeRing(index: number): Point[]; - setPoint(ringIndex: number, pointIndex: number, point: Point): Polygon; + /** + * Updates a point in the polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#setPoint) + * + * @param ringIndex The index of the ring containing the point to update. + * @param pointIndex The index of the point to update within the ring. + * @param point The new point geometry. + * + */ + setPoint(ringIndex: number, pointIndex: number, point: Point | number[]): Polygon; } interface PolygonConstructor { + /** + * A polygon contains an array of [rings](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) and a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#spatialReference). Each ring is represented as an array points. The first and last points of a ring must be the same. A polygon also has boolean-valued [hasM](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) and [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) + */ + new(properties?: PolygonProperties): Polygon; + /** + * Converts the given Extent to a Polygon instance. This is useful for scenarios in which you would like to display an area of interest, which is typically defined by an Extent or bounding box, as a polygon with a fill symbol in the view. Some geoprocessing tools require input geometries to be of a Polygon type and not an Extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#fromExtent) + * + * @param extent An extent object to convert to a polygon. + * + */ fromExtent(extent: Extent): Polygon; fromJSON(json: any): Polygon; @@ -840,24 +3473,129 @@ declare namespace __esri { export const Polygon: PolygonConstructor; interface PolygonProperties extends GeometryProperties { + /** + * The centroid of the polygon. For a polygon with multiple rings, it represents the centroid of the largest ring. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#centroid) + */ centroid?: PointProperties; + /** + * Checks to see if polygon rings cross each other and indicates if the polygon is self-intersecting, which means the ring of the polygon crosses itself. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting) + */ isSelfIntersecting?: boolean; + /** + * An array of rings. Each ring is a two-dimensional array of numbers representing the coordinates of each vertex in the ring in the spatial reference of the view. The first vertex of each ring should always be the same as the last vertex. Each vertex is an array of two, three, or four numbers. The table below shows the various structures of a vertex array. + * + * Case | Vertex array + * --- | --- + * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM)| [x, y] + * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, m] + * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z] + * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z, m] + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) + */ rings?: number[][][]; } interface Polyline extends Geometry { + /** + * An array of paths, or line segments, that make up the polyline. Each path is a two-dimensional array of numbers representing the coordinates of each vertex in the path in the spatial reference of the view. Each vertex is represented as an array of two, three, or four numbers. The table below shows the various structures of a vertex array. + * + * Case | Vertex array + * --- | --- + * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y] + * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, m] + * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z] + * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z, m] + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#paths) + */ paths: number[][][]; + /** + * For Polyline, the type is always `polyline`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#type) + */ + readonly type: "polyline"; - addPath(points: number[][]): Polyline; + /** + * Adds a path, or line segment, to the polyline. When added, the index of the path is incremented by one. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#addPath) + * + * @param points A polyline path. This can either be defined as an array of Point geometries or an array of XY coordinates. + * + */ + addPath(points: Point[] | number[][]): Polyline; + /** + * Creates a deep clone of Polyline object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#clone) + * + * + */ clone(): Polyline; + /** + * Returns a point specified by a path and point in the path. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#getPoint) + * + * @param pathIndex The index of a path in the polyline. + * @param pointIndex The index of a point in a path. + * + */ getPoint(pathIndex: number, pointIndex: number): Point; - insertPoint(pathIndex: number, pointIndex: number, point: Point): Polyline; + /** + * Inserts a new point into a polyline. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#insertPoint) + * + * @param pathIndex The index of the path in which to insert a point. + * @param pointIndex The index of the inserted point in the path. + * @param point The point to insert. + * + */ + insertPoint(pathIndex: number, pointIndex: number, point: Point | number[]): Polyline; + /** + * Removes a path from the Polyline. The index specifies which path to remove. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#removePath) + * + * @param index The index of the path to remove from the polyline. + * + */ removePath(index: number): Point[]; + /** + * Removes a point from the polyline at the given `pointIndex` within the path identified by the given `pathIndex`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#removePoint) + * + * @param pathIndex The index of the path containing the point to be removed. + * @param pointIndex The index of the point to be removed within the path. + * + */ removePoint(pathIndex: number, pointIndex: number): Point; - setPoint(pathIndex: number, pointIndex: number, point: Point): Polyline; + /** + * Updates a point in a polyline. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#setPoint) + * + * @param pathIndex The index of the path that contains the point to be updated. + * @param pointIndex The index of the point to be updated in the path. + * @param point Point geometry to update in the path. + * + */ + setPoint(pathIndex: number, pointIndex: number, point: Point | number[]): Polyline; } interface PolylineConstructor { + + new(properties?: PolylineProperties): Polyline; fromJSON(json: any): Polyline; @@ -866,96 +3604,354 @@ declare namespace __esri { export const Polyline: PolylineConstructor; interface PolylineProperties extends GeometryProperties { + /** + * An array of paths, or line segments, that make up the polyline. Each path is a two-dimensional array of numbers representing the coordinates of each vertex in the path in the spatial reference of the view. Each vertex is represented as an array of two, three, or four numbers. The table below shows the various structures of a vertex array. + * + * Case | Vertex array + * --- | --- + * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y] + * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, m] + * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z] + * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z, m] + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#paths) + */ paths?: number[][][]; } 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 { - isGeographic: boolean; - isWebMercator: boolean; - isWGS84: boolean; - isWrappable: boolean; - WebMercator: SpatialReference; - WGS84: SpatialReference; + /** + * Indicates if the spatial reference refers to a geographic coordinate system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isGeographic) + */ + readonly isGeographic: boolean; + /** + * Indicates if the [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) of the spatial reference object is one of the following values: `102113`, `102100`, `3857`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) + */ + readonly isWebMercator: boolean; + /** + * Indicates if the [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) of the spatial reference object is `4326`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWGS84) + */ + readonly isWGS84: boolean; + /** + * Indicates if the spatial reference of the map supports wrapping around the International Date Line. Value is `true` if the spatial reference is Web Mercator or WGS84. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWrappable) + */ + readonly isWrappable: boolean; + /** + * The well-known ID of a spatial reference. See [Projected Coordinate Systems](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) and [Geographic Coordinate Systems](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) for the list of supported spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) + */ wkid: number; + /** + * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to setup and use a proxy page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) + */ wkt: string; + /** + * Returns a deep clone of the spatial reference object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#clone) + * + * + */ clone(): SpatialReference; + /** + * Checks if the specified spatial reference object has the same [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) or [wkt](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) as this spatial reference object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#equals) + * + * @param spatialReference The spatial reference to compare to. + * + */ equals(spatialReference: SpatialReference): boolean; } interface SpatialReferenceConstructor { + + new(properties?: SpatialReferenceProperties): SpatialReference; + + /** + * A convenience spatial reference instance for Web Mercator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#WebMercator) + */ + WebMercator: SpatialReference; + /** + * A convenience spatial reference instance for WGS84. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#WGS84) + */ + WGS84: SpatialReference; + fromJSON(json: any): SpatialReference; } export const SpatialReference: SpatialReferenceConstructor; interface SpatialReferenceProperties { - isGeographic?: boolean; - isWebMercator?: boolean; - isWGS84?: boolean; - isWrappable?: boolean; - WebMercator?: SpatialReferenceProperties; - WGS84?: SpatialReferenceProperties; + /** + * The well-known ID of a spatial reference. See [Projected Coordinate Systems](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) and [Geographic Coordinate Systems](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) for the list of supported spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) + */ wkid?: number; + /** + * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to setup and use a proxy page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) + */ wkt?: string; } + interface jsonUtils { + /** + * Creates a new instance of an appropriate [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-jsonUtils.html#fromJSON) + * + * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geometry_objects/02r3000000n1000000/) for examples of the structure of various input JSON objects. + * + */ fromJSON(json: any): Geometry; + /** + * Returns the type for a given geometry in the JSON format used by the ArcGIS platform. This only applies to geometries that can be processed by the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-jsonUtils.html#getJsonType) + * + * @param geometry The input geometry object. + * + */ getJsonType(geometry: Geometry): string; } export const jsonUtils: jsonUtils; + interface normalizeUtils { + /** + * Normalizes geometries that intersect the central meridian or fall outside the world extent so they stay within the coordinate system of the view. Only supported for Web Mercator and WGS84 spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-normalizeUtils.html#normalizeCentralMeridian) + * + * @param geometries An array of geometries to normalize. + * @param geometryService A geometry service used to perform the normalization. If this value is `null` then the default geometry service in [esriConfig.geometryServiceUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geometryServiceUrl) is used. + * + */ normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService): IPromise; } export const normalizeUtils: normalizeUtils; + interface webMercatorUtils { + /** + * Returns `true` if the `source` spatial reference can be projected to the `target` spatial reference with the [project()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#project) function, or if the `source` and `target` are the same [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) + * + * @param source The input [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). + * @param target The target [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). + * + */ canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; + /** + * Converts a geometry from geographic units (wkid: 4326) to Web Mercator units (wkid: 3857). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#geographicToWebMercator) + * + * @param geometry The input geometry to convert. + * + */ geographicToWebMercator(geometry: Geometry): Geometry; + /** + * Translates the given latitude and longitude (decimal degree) values to Web Mercator XY values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#lngLatToXY) + * + * @param long The longitude value to convert. + * @param lat The latitude value to convert. + * + */ lngLatToXY(long: number, lat: number): number[]; + /** + * Projects the geometry clientside (if possible). You should test the input geometry in [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) prior to using this function. If the result of [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) is `true`, then proceed to project. If [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) returns `false`, then `project()` won't return useful results. Use [GeometryService.project()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#project) instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#project) + * + * @param geometry The input geometry. + * @param spatialReference The target [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). + * + */ project(geometry: Geometry, spatialReference: SpatialReference | any): Geometry; + /** + * Converts a geometry from Web Mercator units (wkid: 3857) to geographic units (wkid: 4326). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#webMercatorToGeographic) + * + * @param geometry The input geometry to convert. + * + */ webMercatorToGeographic(geometry: Geometry): Geometry; + /** + * Translates the given Web Mercator coordinates to Longitude and Latitude values (decimal degrees). By default the returned longitude is normalized so that it is within -180 and +180. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#xyToLngLat) + * + * @param x The X coordinate value to convert. + * @param y The Y coordinate value to convert. + * + */ xyToLngLat(x: number, y: number): number[]; } export const webMercatorUtils: webMercatorUtils; interface Graphic extends Accessor, JSONSupport { + /** + * Name-value pairs of fields and field values associated with the graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) + */ attributes: any; + /** + * The geometry that defines the graphic's location. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry) + */ geometry: Geometry; - layer: FeatureLayer | GraphicsLayer; + /** + * If applicable, references the layer in which the graphic is stored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) + */ + layer: Layer; + /** + * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of version 4.5, if the `popupTemplate` is not defined on the `Graphic`, it will use the graphic [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) popupTemplate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) + */ popupTemplate: PopupTemplate; + /** + * The [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the graphic. Choosing a symbol for a graphic depends on the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) type (SceneView or MapView), and the [geometry type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) of the graphic. If the symbol is not specified for a graphic in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), it displays using the symbol defined in the layer's [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). Each graphic may have its own symbol specified when the parent layer is a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) + */ symbol: Symbol; + /** + * Indicates the visibility of the graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#visible) + * + * @default true + */ visible: boolean; + /** + * Creates a deep clone of the graphic object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#clone) + * + * + */ clone(): Graphic; + /** + * Returns the value of the specified attribute. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getAttribute) + * + * @param name The name of the attribute. + * + */ getAttribute(name: string): any; + /** + * Sets a new value to the specified attribute. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#setAttribute) + * + * @param name The name of the attribute to set. + * @param newValue The new value to set on the named attribute. + * + */ setAttribute(name: string, newValue: any): void; } interface GraphicConstructor { + /** + * A Graphic is a vector representation of real world geographic phenomena. It can contain [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry), a [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol), and [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes). A Graphic is displayed in the [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) + */ + new(properties?: GraphicProperties): Graphic; fromJSON(json: any): Graphic; @@ -964,23 +3960,92 @@ declare namespace __esri { export const Graphic: GraphicConstructor; interface GraphicProperties { + /** + * Name-value pairs of fields and field values associated with the graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) + */ attributes?: any; + /** + * The geometry that defines the graphic's location. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry) + */ geometry?: GeometryProperties; - layer?: FeatureLayerProperties | GraphicsLayerProperties; + /** + * If applicable, references the layer in which the graphic is stored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) + */ + layer?: LayerProperties; + /** + * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of version 4.5, if the `popupTemplate` is not defined on the `Graphic`, it will use the graphic [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) popupTemplate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) + */ popupTemplate?: PopupTemplateProperties; + /** + * The [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the graphic. Choosing a symbol for a graphic depends on the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) type (SceneView or MapView), and the [geometry type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) of the graphic. If the symbol is not specified for a graphic in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), it displays using the symbol defined in the layer's [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). Each graphic may have its own symbol specified when the parent layer is a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) + */ symbol?: SymbolProperties; + /** + * Indicates the visibility of the graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#visible) + * + * @default true + */ visible?: boolean; } interface Ground extends Accessor, Loadable, JSONSupport { - layers: Collection; - loaded: boolean; + /** + * A collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that define the elevation or terrain that makes up the ground surface. When elevation layers are added to the ground, the topographical variations of the surface are rendered in 3D as they would appear in the real world. ![elev-default](https://developers.arcgis.com/javascript/latest/assets/img/apiref/ground/elev-default.png) When the layers collection is empty, the ground surface is flat. ![no-elev](https://developers.arcgis.com/javascript/latest/assets/img/apiref/ground/no-elev.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) + */ + layers: Collection; + /** + * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A Ground is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) are fully created, but not yet loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#loaded) + * + * @default false + */ + readonly loaded: boolean; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#clone) + * + * + */ clone(): Ground; + /** + * Queries the ground layer services for elevation values for the given geometry. The returned result contains a copy of the geometry with z-values sampled from elevation data from the first layer that has data available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) + * + * @param geometry The geometry to sample. + * @param options Additional query options. + * @param options.returnSampleInfo Indicates whether to return additional sample information for each sampled coordinate. + * @param options.noDataValue The value that appears in the resulting geometry when there is no data available. + * + */ queryElevation(geometry: Point | Multipoint | Polyline, options?: GroundQueryElevationOptions): IPromise; } interface GroundConstructor { + /** + * The Ground class contains properties that specify how the ground surface is displayed in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It contains a [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) property, which is a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that defines the elevation or terrain of the map's surface. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) + */ + new(properties?: GroundProperties): Ground; fromJSON(json: any): Ground; @@ -989,74 +4054,242 @@ declare namespace __esri { export const Ground: GroundConstructor; interface GroundProperties extends LoadableProperties { - layers?: CollectionProperties; - loaded?: boolean; + /** + * A collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that define the elevation or terrain that makes up the ground surface. When elevation layers are added to the ground, the topographical variations of the surface are rendered in 3D as they would appear in the real world. ![elev-default](https://developers.arcgis.com/javascript/latest/assets/img/apiref/ground/elev-default.png) When the layers collection is empty, the ground surface is flat. ![no-elev](https://developers.arcgis.com/javascript/latest/assets/img/apiref/ground/no-elev.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) + */ + layers?: CollectionProperties; } - export interface ElevationQueryResult { + /** + * Object returned when [queryElevation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) promise resolves: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) + */ + export interface ElevationQueryResult extends Object { + /** + * The geometry with sampled z-values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) + */ geometry: Point | Multipoint | Polyline; - sampleInfo: ElevationQueryResultSampleInfo[]; + /** + * Contains additional information about how the geometry was sampled. This property is present depending on whether the user set `options.returnSampleInfo = true`, for each coordinate in the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) + */ + sampleInfo?: ElevationQueryResultSampleInfo[]; + /** + * The value used when there is no data available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) + */ noDataValue: number; } - export interface GroundQueryElevationOptions { + + export interface GroundQueryElevationOptions extends Object { + /** + * Indicates whether to return additional sample information for each sampled coordinate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) + * + * @default false + */ returnSampleInfo?: boolean; + /** + * The value that appears in the resulting geometry when there is no data available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) + * + * @default 0 + */ noDataValue?: number; } - export interface ElevationQueryResultSampleInfo { + + export interface ElevationQueryResultSampleInfo extends Object { + /** + * The resolution at which the z-value was sampled. If no data was available for sampling for a given coordinate, the dem resolution value will be -1 for that coordinate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) + */ demResolution: number; + /** + * The elevation source from which the data for the corresponding coordinate was sampled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) + */ source: ElevationLayer; } interface Credential extends Accessor { + /** + * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#expires) + */ expires: number; + /** + * Indicates whether this credential belongs to a user with admin privileges. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#isAdmin) + */ isAdmin: boolean; + /** + * The Identity Manager's [setOAuthRedirectionHandler](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) returns an object that contains a `state` property. This information is returned for this property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#oAuthState) + */ oAuthState: any; + /** + * The server url. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#server) + */ server: string; + /** + * Indicates whether the resources accessed using this credential should be fetched over HTTPS protocol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#ssl) + */ ssl: boolean; + /** + * Token generated by the token service using the specified userId and password. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) + */ token: string; + /** + * User associated with the Credential object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#userId) + */ userId: string; + /** + * Destroys the credential. When the credential is destroyed, you should remove any map layers that are using this credential. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#destroy) + * + * + */ destroy(): void; + /** + * Generates a new token and updates the Credential's [token](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) property with the newly acquired token. Tokens are typically kept valid using a timer that automatically triggers a refresh before the token expires. Use this method in cases where the timer has been delayed or stopped. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#refreshToken) + * + * + */ refreshToken(): void; } interface CredentialConstructor { + + new(properties?: CredentialProperties): Credential; } export const Credential: CredentialConstructor; interface CredentialProperties { + /** + * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#expires) + */ expires?: number; + /** + * Indicates whether this credential belongs to a user with admin privileges. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#isAdmin) + */ isAdmin?: boolean; + /** + * The Identity Manager's [setOAuthRedirectionHandler](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) returns an object that contains a `state` property. This information is returned for this property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#oAuthState) + */ oAuthState?: any; + /** + * The server url. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#server) + */ server?: string; + /** + * Indicates whether the resources accessed using this credential should be fetched over HTTPS protocol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#ssl) + */ ssl?: boolean; + /** + * Token generated by the token service using the specified userId and password. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) + */ token?: string; + /** + * User associated with the Credential object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#userId) + */ userId?: string; } interface IdentityManager extends IdentityManagerBase { + /** + * Dialog box widget used to challenge the user for their credentials when the application attempts to access a secure resource. This property is available after the dialog-create event has fired. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#dialog) + */ dialog: any; + /** + * When accessing secure resources via Oauth 2.0 from ArcGIS.com or one of its sub-domains the IdentityManager redirects the user to the ArcGIS.com or Portal for ArcGIS sign-in page. Once the user successfully logs in they are redirected back to the application. Use this method if the application needs to execute custom logic before the page is redirected. The IdentityManager calls the custom handler function with an object containing redirection properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) + * + * @param handlerFunction When called, the callback passed to `setOAuthRedirectionHandler` receives an object containing the redirection properties. + * + */ setOAuthRedirectionHandler(handlerFunction: HandlerCallback): void; + /** + * Use this method in the popup callback page to pass the token and other values back to the IdentityManager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthResponseHash) + * + * @param hash The token information in addition to any other values needed to be passed back to the IdentityManager. + * + */ setOAuthResponseHash(hash: string): void; + on(name: "credential-create", eventHandler: IdentityManagerCredentialCreateEventHandler): IHandle; + on(name: "credential-create", modifiers: string[], eventHandler: IdentityManagerCredentialCreateEventHandler): IHandle; + on(name: "credentials-destroy", eventHandler: IdentityManagerCredentialsDestroyEventHandler): IHandle; + on(name: "credentials-destroy", modifiers: string[], eventHandler: IdentityManagerCredentialsDestroyEventHandler): IHandle; } interface IdentityManagerConstructor { + /** + * This object provides the framework and helper methods used in managing user credentials for the following resources: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html) + */ + new(): IdentityManager; } export const IdentityManager: IdentityManagerConstructor; export interface IdentityManagerCredentialCreateEvent { + credential: Credential; } @@ -1066,91 +4299,463 @@ declare namespace __esri { export type HandlerCallback = (authorizeParams: any, authorizeUrl: string, oAuthInfo: OAuthInfo, resourceUrl: string, serverInfo: ServerInfo) => void; interface IdentityManagerBase extends Evented { + /** + * The suggested lifetime of the token in minutes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#tokenValidity) + * + * @default 60 + */ tokenValidity: number; + /** + * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) if the user has already signed in to access the given resource. If the user has not signed in, then the promise will be rejected and its error callback will be called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#checkSignInStatus) + * + * @param resUrl The resource URL. + * + */ checkSignInStatus(resUrl: string): IPromise; + /** + * Destroys all credentials. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#destroyCredentials) + * + * + */ destroyCredentials(): void; + /** + * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) for the resource identified by the specified url. Optionally, you can provide a userId to find credentials for a specific user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findCredential) + * + * @param url The URL to a server. + * @param userId The userId for which you want to obtain credentials. + * + */ findCredential(url: string, userId?: string): Credential; + /** + * Returns the [OAuthInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html) configuration for the passed in Portal server URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findOAuthInfo) + * + * @param url The URL to a Portal. + * + */ findOAuthInfo(url: string): OAuthInfo; + /** + * Returns information about the server that is hosting the specified URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findServerInfo) + * + * @param url The URL to the server + * + */ findServerInfo(url: string): ServerInfo; + /** + * Returns an object containing a token and its expiration time. It is necessary to provide the [ServerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html) object that contains a token service URL and a user info object containing username and password. This is a helper method typically called by sub-classes to generate tokens. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + * + * @param serverInfo A ServerInfo object that contains a token service URL. + * @param userInfo A user info object containing a user name and password. + * @param options See the table below for the structure of this object. + * @param options.serverUrl The server URL. + * @param options.token The server token. + * @param options.ssl Indicates if the server requires SSL. + * + */ generateToken(serverInfo: ServerInfo, userInfo: any, options?: IdentityManagerBaseGenerateTokenOptions): IPromise; + /** + * Returns a [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) object that can be used to access the secured resource identified by the input URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + * + * @param url The URL for the secure resource + * @param options See the table below for the structure of the **options** object. + * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. + * @param options.oAuthPopupConfirmation If set to *false*, the user will not be shown a dialog before the OAuth popup window is opened. + * @param options.retry Determines if the method should make additional attempts to get the credentials after a failure. + * @param options.token Token used for a previous unsuccessful attempt to fetch the given URL. + * + */ getCredential(url: string, options?: IdentityManagerBaseGetCredentialOptions): IPromise; + /** + * Call this method during application initialization with the JSON previously obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) method used to re-hydrate the state of IdentityManager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#initialize) + * + * @param json The JSON obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) method. + * + */ initialize(json: any): void; + /** + * Indicates if the IdentityManager is busy accepting user input. For example, it returns `true` if the user has invoked [signIn](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) and is waiting for a response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#isBusy) + * + * + */ isBusy(): boolean; + /** + * Subclasses must implement this method if OAuth support is required. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) + * + * @param resUrl The resource URL. + * @param serverInfo A ServerInfo object that contains the token service URL. + * @param oAuthInfo An OAuthInfo object that contains the authorization configuration. + * @param options See the table below for the structure of the **options** object. + * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. + * @param options.oAuthPopupConfirmation Indicates whether the user will be shown a dialog before the OAuth popup window is opened. + * @param options.token Token used for previous unsuccessful attempts to fetch the given URL. + * + */ oAuthSignIn(resUrl: string, serverInfo: ServerInfo, oAuthInfo: OAuthInfo, options?: IdentityManagerBaseOAuthSignInOptions): IPromise; + /** + * Registers OAuth 2.0 configurations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerOAuthInfos) + * + * @param oAuthInfos An array of OAuthInfo objects that defines the OAuth configurations. + * + */ registerOAuthInfos(oAuthInfos: OAuthInfo[]): void; + /** + * Register secure servers and the token endpoints. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerServers) + * + * @param serverInfos An array of ServerInfos objects that defines the secure service and token endpoint. The IdentityManager makes its best guess to determine the location of the secure server and token endpoint. Therefore, in most cases calling this method is not necessary. However, if the location of your server or token endpoint is not standard, use this method to register the location. + * + */ registerServers(serverInfos: ServerInfo[]): void; + /** + * Registers the given OAuth 2.0 access token or ArcGIS Server token with the IdentityManager. See [registerOAuthInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerOAuthInfos) for additional information. The `registerToken` method is an advanced workflow for pre-registering long-term tokens for when you don't want users to sign in. See also [resource-proxy](https://github.com/Esri/resource-proxy) for another workflow to achieve this result. Once a user logs in, the access token is registered with the IdentityManager. Subsequently, every AJAX request made by the application forwards this token when accessing web maps and other items stored in ArcGIS Online, or resources on your server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerToken) + * + * @param properties See the table below for the structure of the **properties** object. + * @param properties.expires Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. + * @param properties.server For ArcGIS Online or Portal, this is https://www.arcgis.com/sharing/rest or similar to https://www.example.com/portal/sharing/rest. For ArcGIS Server this is similar to https://www.example.com/arcgis/rest/services. + * @param properties.ssl Set this to `true` if the user has an ArcGIS Online organizational account and the organization is configured to allow access to resources only through SSL. + * @param properties.token The access token. + * @param properties.userId The id of the user who owns the access token. + * + */ registerToken(properties: IdentityManagerBaseRegisterTokenProperties): void; + /** + * When accessing secured resources, the IdentityManager may prompt for username and password and send them to the server using a secure connection. Due to potential browser limitations, it may not be possible to establish a secure connection with the server if the application is being run over HTTP protocol. In such cases, the Identity Manager will abort the request to fetch the secured resource. To resolve this issue, configure your web application server with HTTPS support and run the application over HTTPS. This is the recommended solution for production environments. However, for internal development environments that don't have HTTPS support, you can define a protocol error handler that allows the Identity Manager to continue with the process over HTTP protocol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) + * + * @param handlerFunction The function to call when the protocol is mismatched. + * @param handlerFunction.resourceUrl The secure resource URL. + * @param handlerFunction.serverInfo ServerInfo object describing the server where the secure resource is hosted. + * + */ setProtocolErrorHandler(handlerFunction: IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction): void; + /** + * When accessing secure resources from ArcGIS.com or one of its subdomains, the IdentityManager redirects the user to the ArcGIS.com sign-in page. Once the user successfully logs in they are redirected back to the application. Use this method if the application needs to execute custom logic before the page is redirected by creating a custom redirection handler. The IdentityManager calls the custom handler function with an object containing the redirection properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * @param handlerFunction The function passed to setRedirectionHandler receives an object containing redirection properties. These properties are listed in the table below. + * @param handlerFunction.resourceUrl The URL of the secure resource that triggers the redirection to the ArcGIS.com sign-in page. + * @param handlerFunction.returnUrlParamName The application URL where the sign-in page redirects after a successful login. To create the return URL, append the application's URL to signInPage as a parameter. The *returnUrlParamName* contains the name of the parameter. + * @param handlerFunction.serverInfo The ServerInfo object describing the server where the secure resource is hosted. + * @param handlerFunction.signInPage URL of the sign-in page where users will be redirected. + * + */ setRedirectionHandler(handlerFunction: IdentityManagerBaseSetRedirectionHandlerHandlerFunction): void; + /** + * Subclasses must implement this method to create and manage the user interface used to obtain a username and password from the end user. It should perform the following tasks: + * * challenge the user for a username and password, + * * generate a token and return it to the caller. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) + * + * @param url URL for the secured resource. + * @param serverInfo A ServerInfo object that contains the token service URL. + * @param options See the table below for the structure of the **options** object. + * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. + * + */ signIn(url: string, serverInfo: ServerInfo, options?: IdentityManagerBaseSignInOptions): IPromise; + /** + * Return properties of this object in JSON format. It can be stored in a cookie or persisted in HTML5 LocalStorage and later used to: + * * Initialize the IdentityManager the next time a user opens your application. + * * Share the state of the IdentityManager between multiple web pages of your website. This way users will not be asked to sign in repeatedly when they launch your app multiple times or when navigating between multiple web pages in your website. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) + * + * + */ toJSON(): any; } interface IdentityManagerBaseConstructor { + /** + * This class provides the framework and helper methods required to implement a solution for managing user credentials. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html) + */ + new(): IdentityManagerBase; } export const IdentityManagerBase: IdentityManagerBaseConstructor; - export interface IdentityManagerBaseGenerateTokenOptions { + + export interface IdentityManagerBaseGenerateTokenOptions extends Object { + /** + * The server URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + */ serverUrl: string; + /** + * The server token. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + */ token: string; + /** + * Indicates if the server requires SSL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + */ ssl: boolean; } - export interface IdentityManagerBaseGetCredentialOptions { + + export interface IdentityManagerBaseGetCredentialOptions extends Object { + /** + * Error object returned by the server from a previous attempt to fetch the given URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + */ error?: Error; + /** + * If set to *false*, the user will not be shown a dialog before the OAuth popup window is opened. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + * + * @default true + */ oAuthPopupConfirmation?: boolean; + /** + * Determines if the method should make additional attempts to get the credentials after a failure. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + */ retry?: boolean; + /** + * Token used for a previous unsuccessful attempt to fetch the given URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + */ token?: string; } - export interface IdentityManagerBaseOAuthSignInOptions { - error: Error; - oAuthPopupConfirmation: boolean; - token: string; + + export interface IdentityManagerBaseOAuthSignInOptions extends Object { + /** + * Error object returned by the server from a previous attempt to fetch the given URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) + */ + error?: Error; + /** + * Indicates whether the user will be shown a dialog before the OAuth popup window is opened. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) + * + * @default true + */ + oAuthPopupConfirmation?: boolean; + /** + * Token used for previous unsuccessful attempts to fetch the given URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) + */ + token?: string; } - export interface IdentityManagerBaseRegisterTokenProperties { + + export interface IdentityManagerBaseRegisterTokenProperties extends Object { + /** + * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. + * + * [Read more...](properties.html) + */ expires?: number; + /** + * For ArcGIS Online or Portal, this is https://www.arcgis.com/sharing/rest or similar to https://www.example.com/portal/sharing/rest. For ArcGIS Server this is similar to https://www.example.com/arcgis/rest/services. + * + * [Read more...](properties.html) + */ server: string; + /** + * Set this to `true` if the user has an ArcGIS Online organizational account and the organization is configured to allow access to resources only through SSL. + * + * [Read more...](properties.html) + */ ssl?: boolean; + /** + * The access token. + * + * [Read more...](properties.html) + */ token: string; + /** + * The id of the user who owns the access token. + * + * [Read more...](properties.html) + */ userId?: string; } - export interface IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction { + + export interface IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction extends Object { + /** + * The secure resource URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) + */ resourceUrl: string; + /** + * ServerInfo object describing the server where the secure resource is hosted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) + */ serverInfo: ServerInfo; } - export interface IdentityManagerBaseSetRedirectionHandlerHandlerFunction { + + export interface IdentityManagerBaseSetRedirectionHandlerHandlerFunction extends Object { + /** + * The URL of the secure resource that triggers the redirection to the ArcGIS.com sign-in page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + */ resourceUrl: string; + /** + * The application URL where the sign-in page redirects after a successful login. To create the return URL, append the application's URL to signInPage as a parameter. The *returnUrlParamName* contains the name of the parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + */ returnUrlParamName: string; + /** + * The ServerInfo object describing the server where the secure resource is hosted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + */ serverInfo: ServerInfo; + /** + * URL of the sign-in page where users will be redirected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + */ signInPage: string; } - export interface IdentityManagerBaseSignInOptions { + + export interface IdentityManagerBaseSignInOptions extends Object { + /** + * Error object returned by the server from a previous attempt to fetch the given URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) + */ error: Error; } interface OAuthInfo extends Accessor, JSONSupport { + /** + * The registered application id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#appId) + */ appId: string; + /** + * Applications with the same value will share the stored token on the same host. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#authNamespace) + * + * @default / (forward slash) + */ authNamespace: string; + /** + * The number of minutes that the token is valid. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#expiration) + * + * @default 20160 (two weeks) + */ expiration: number; + /** + * The locale for the OAuth sign in page. The default locale is based on your browser/OS and the organization locale. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#locale) + * + * @default Based on your browser/OS and the organization locale. + */ locale: string; + /** + * The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#minTimeUntilExpiration) + * + * @default 30 + */ minTimeUntilExpiration: number; + /** + * Set to `true` to show the OAuth sign in page in a popup window. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popup) + * + * @default false + */ popup: boolean; + /** + * Applicable if working with the popup user-login workflow. This is a relative page URL that redirects the user back to the secured application after successful login. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupCallbackUrl) + * + * @default "oauth-callback.html" + */ popupCallbackUrl: string; + /** + * The window features passed to [window.open()](https://developer.mozilla.org/en-US/docs/Web/API/Window/open). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupWindowFeatures) + * + * @default height=490,width=800,resizable,scrollbars,status + */ popupWindowFeatures: string; + /** + * The ArcGIS for Portal URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#portalUrl) + * + * @default "https://www.arcgis.com" + */ portalUrl: string; + /** + * Creates a copy of the OAuthInfo object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#clone) + * + * + */ clone(): OAuthInfo; } interface OAuthInfoConstructor { + + new(properties?: OAuthInfoProperties): OAuthInfo; fromJSON(json: any): OAuthInfo; @@ -1159,26 +4764,114 @@ declare namespace __esri { export const OAuthInfo: OAuthInfoConstructor; interface OAuthInfoProperties { + /** + * The registered application id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#appId) + */ appId?: string; + /** + * Applications with the same value will share the stored token on the same host. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#authNamespace) + * + * @default / (forward slash) + */ authNamespace?: string; + /** + * The number of minutes that the token is valid. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#expiration) + * + * @default 20160 (two weeks) + */ expiration?: number; + /** + * The locale for the OAuth sign in page. The default locale is based on your browser/OS and the organization locale. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#locale) + * + * @default Based on your browser/OS and the organization locale. + */ locale?: string; + /** + * The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#minTimeUntilExpiration) + * + * @default 30 + */ minTimeUntilExpiration?: number; + /** + * Set to `true` to show the OAuth sign in page in a popup window. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popup) + * + * @default false + */ popup?: boolean; + /** + * Applicable if working with the popup user-login workflow. This is a relative page URL that redirects the user back to the secured application after successful login. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupCallbackUrl) + * + * @default "oauth-callback.html" + */ popupCallbackUrl?: string; + /** + * The window features passed to [window.open()](https://developer.mozilla.org/en-US/docs/Web/API/Window/open). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupWindowFeatures) + * + * @default height=490,width=800,resizable,scrollbars,status + */ popupWindowFeatures?: string; + /** + * The ArcGIS for Portal URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#portalUrl) + * + * @default "https://www.arcgis.com" + */ portalUrl?: string; } interface ServerInfo extends Accessor, JSONSupport { + /** + * The token service URL used to generate tokens for ArcGIS Server Admin resources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#adminTokenServiceUrl) + */ adminTokenServiceUrl: string; + /** + * Version of the ArcGIS Server deployed on this server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#currentVersion) + */ currentVersion: number; + /** + * The server URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#server) + */ server: string; + /** + * Validity of short-lived token in minutes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#shortLivedTokenValidity) + */ shortLivedTokenValidity: number; + /** + * The token service URL used to generate tokens for the secured resources on the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#tokenServiceUrl) + */ tokenServiceUrl: string; } interface ServerInfoConstructor { + + new(properties?: ServerInfoProperties): ServerInfo; fromJSON(json: any): ServerInfo; @@ -1187,262 +4880,961 @@ declare namespace __esri { export const ServerInfo: ServerInfoConstructor; interface ServerInfoProperties { + /** + * The token service URL used to generate tokens for ArcGIS Server Admin resources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#adminTokenServiceUrl) + */ adminTokenServiceUrl?: string; + /** + * Version of the ArcGIS Server deployed on this server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#currentVersion) + */ currentVersion?: number; + /** + * The server URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#server) + */ server?: string; + /** + * Validity of short-lived token in minutes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#shortLivedTokenValidity) + */ shortLivedTokenValidity?: number; + /** + * The token service URL used to generate tokens for the secured resources on the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#tokenServiceUrl) + */ tokenServiceUrl?: string; } + interface kernel { - version: string; + /** + * Current version of the ArcGIS API for JavaScript. + * ```js + * require([ + * "esri/kernel" + * ], function(esriNS) { + * console.log(esriNS.version); + * }); + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-kernel.html#version) + */ + readonly version: string; } export const kernel: kernel; - interface BaseDynamicLayer extends Layer, ScaleRangeLayer { + interface BaseDynamicLayer extends Layer, ScaleRangeLayer, RefreshableLayer { + /** + * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loaded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#addResolvingPromise) + * + * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loaded). + * + */ addResolvingPromise(promiseToLoad: IPromise): IPromise; + /** + * This method fetches the image for the specified extent and size. Override this method if the data returned from the server needs to be processed before it can be displayed. For example, if the server returns binary data, override this method to convert the binary data to an image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#fetchImage) + * + * @param extent The extent of the view. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param width The width of the view in pixels. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param height The height of the view in pixels. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param options Optional settings for the image request. The options have the following properties. + * @param options.allowImageDataAccess Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. + * + */ fetchImage(extent: Extent, width: number, height: number, options?: BaseDynamicLayerFetchImageOptions): IPromise; + /** + * This method returns a URL to an image for a given extent, width, and height. Override this method to construct the URL for the image based on user interaction. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#getImageUrl) + * + * @param extent Extent of the view. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param width Width of the view in pixels. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param height Height of the view in pixels. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * + */ getImageUrl(extent: Extent, width: number, height: number): IPromise | string; + on(name: "layerview-create", eventHandler: BaseDynamicLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: BaseDynamicLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: BaseDynamicLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseDynamicLayerLayerviewDestroyEventHandler): IHandle; } interface BaseDynamicLayerConstructor { + /** + * This class may be extended to create dynamic map layers. Dynamic layers display an image dynamically generated on the server based on a request, including the extent and size of the image. The exported image covers the entire view extent. Each interaction on the view (e.g. panning, zooming) will result in an export of a new image on the server. Each export is unique so it cannot be cached in the browser. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html) + */ + new(properties?: BaseDynamicLayerProperties): BaseDynamicLayer; } export const BaseDynamicLayer: BaseDynamicLayerConstructor; - interface BaseDynamicLayerProperties extends LayerProperties, ScaleRangeLayerProperties { + interface BaseDynamicLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { } - export interface BaseDynamicLayerFetchImageOptions { + + export interface BaseDynamicLayerFetchImageOptions extends Object { + /** + * Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#fetchImage) + */ allowImageDataAccess?: boolean; } export interface BaseDynamicLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface BaseDynamicLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface BaseElevationLayer extends Layer { + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#spatialReference) + * + * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} + */ spatialReference: SpatialReference; + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#tileInfo) + */ tileInfo: TileInfo; + /** + * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loaded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#addResolvingPromise) + * + * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loaded). + * + */ addResolvingPromise(promiseToLoad: IPromise): IPromise; + /** + * Fetches a tile at the given level, row, and column present in the view. This method must be overwritten to display custom elevation values in the [Map.ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground). Note that this method must return a promise that resolves to an object with the properties defined in [ElevationTileData](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData). See the following samples for examples of how to overwrite this method: + * * [Sample - Custom ElevationLayer: Exaggerating elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-exaggerated/index.html) + * * [Sample - Custom ElevationLayer: Thematic data as elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-thematic/index.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) + * + * @param level The level of detail of the tile to fetch. + * @param row The row (y) position of the tile to fetch. + * @param column The column (x) position of the tile to fetch. + * @param options Optional settings for the tile request. + * @param options.noDataValue The value representing pixels in the tile that don't contain an elevation value. + * + */ fetchTile(level: number, row: number, column: number, options?: BaseElevationLayerFetchTileOptions): IPromise; + /** + * Returns the bounds of the tile as an array of four numbers that can be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. See the table in the `returns` section below for more details about the values returned by this method. This function can be used inside [fetchTile()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) so you can get the bounds of the current tile, convert it to an extent object, and request the desired data for the given extent. See the [Custom ElevationLayer: Thematic data as elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-thematic/index.html) sample for an example of how this method works. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#getTileBounds) + * + * @param level The level of detail (LOD) of the tile. + * @param row The tile's row (y) position in the dataset. + * @param column The tiles column (x) position in the dataset. + * @param out Array for storing the tile bounds or extent. + * + */ getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; + on(name: "layerview-create", eventHandler: BaseElevationLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: BaseElevationLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: BaseElevationLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseElevationLayerLayerviewDestroyEventHandler): IHandle; } interface BaseElevationLayerConstructor { + /** + * BaseElevationLayer is intended to be extended for creating custom elevation layers. You create a custom [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) by calling [createSubclass()](https://dojotoolkit.org/reference-guide/1.10/dojo/_base/declare.html#createsubclass) on the `BaseElevationLayer`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html) + */ + new(properties?: BaseElevationLayerProperties): BaseElevationLayer; } export const BaseElevationLayer: BaseElevationLayerConstructor; interface BaseElevationLayerProperties extends LayerProperties { + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#spatialReference) + * + * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} + */ spatialReference?: SpatialReferenceProperties; + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#tileInfo) + */ tileInfo?: TileInfoProperties; } - export interface BaseElevationLayerFetchTileOptions { + + export interface BaseElevationLayerFetchTileOptions extends Object { + /** + * The value representing pixels in the tile that don't contain an elevation value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) + */ noDataValue?: number; } - export interface ElevationTileData { + /** + * Describes elevation contained in the pixels that comprise an elevation tile. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) + */ + export interface ElevationTileData extends Object { + /** + * The elevation values of each pixel in the tile. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) + */ values: number[]; + /** + * The width of the tile in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) + */ width: number; + /** + * The height of the tile in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) + */ height: number; + /** + * The maximum allowed error of the Z-value for each value in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) + */ maxZError: number; + /** + * Indicating the pixel values where no elevation data is present. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) + */ noDataValue: number; } export interface BaseElevationLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface BaseElevationLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - interface BaseTileLayer extends Layer, ScaleRangeLayer { + interface BaseTileLayer extends Layer, ScaleRangeLayer, RefreshableLayer { + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#spatialReference) + * + * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} + */ spatialReference: SpatialReference; + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#tileInfo) + */ tileInfo: TileInfo; + /** + * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loaded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#addResolvingPromise) + * + * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loaded). + * + */ addResolvingPromise(promiseToLoad: IPromise): IPromise; + /** + * This method fetches a tile for the given level, row and column present in the view. Override this method if the data or image returned from the server needs to be processed before it can be displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#fetchTile) + * + * @param level Level of detail of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param row The row (y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param column The column (x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param options Optional settings for the tile request. The options have the following properties. + * @param options.allowImageDataAccess Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. + * + */ fetchTile(level: number, row: number, column: number, options?: BaseTileLayerFetchTileOptions): IPromise; + /** + * Returns the bounds of the tile as an array of four numbers that be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. The value for each item in the array is described in the following table: + * + * Index | Value + * ------|------ + * 0 | Minimum x-value + * 1 | Minimum y-value + * 2 | Maximum x-value + * 3 | Maximum y-value + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#getTileBounds) + * + * @param level The level of detail (LOD) of the tile. + * @param row The tile's row (y) position in the dataset. + * @param column The tiles column (x) position in the dataset. + * @param out Array for storing the tile bounds or extent. + * + */ getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; + /** + * This method returns a URL to an image for a given level, row and column. Override this method to construct the URL for the image based on user interaction. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#getTileUrl) + * + * @param level Level of detail. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param row Tile row. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param column Tile column. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * + */ getTileUrl(level: number, row: number, column: number): string | IPromise; + on(name: "layerview-create", eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: BaseTileLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: BaseTileLayerLayerviewDestroyEventHandler): IHandle; } interface BaseTileLayerConstructor { + /** + * This class may be extended to create a custom [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html). Tile layers are composed of images, such as satellite imagery, that are composed of square tiles mosaicked together in columns and rows, giving the layer the appearance that it is one continuous image. These layers have several levels of detail (LOD) that permit users to zoom in to any region of the map and load additional tiles that depict features in higher resolution at larger map scales. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html) + */ + new(properties?: BaseTileLayerProperties): BaseTileLayer; } export const BaseTileLayer: BaseTileLayerConstructor; - interface BaseTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties { + interface BaseTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#spatialReference) + * + * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} + */ spatialReference?: SpatialReferenceProperties; + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#tileInfo) + */ tileInfo?: TileInfoProperties; } - export interface BaseTileLayerFetchTileOptions { + + export interface BaseTileLayerFetchTileOptions extends Object { + /** + * Indicates if access to pixels of the image is allowed. This value must be set to `true` if the layer will be drawn in 3D and [WebGL textures](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Getting_started_with_WebGL) are required to display the layer. Loading of WebGL textures is dependent on [cross-domain access](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL#Cross-domain_textures) controls. This option allows cross-domain access to create WebGL textures. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#fetchTile) + */ allowImageDataAccess?: boolean; } export interface BaseTileLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface BaseTileLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface CSVLayer extends Layer { + /** + * Copyright information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#copyright) + */ copyright: string; + /** + * The column delimiter. See the table below for possible values. + * + * | Value | Description| + * | --- | --- | + * | `,` | comma | + * | ` ` | space | + * | `;` | semicolon | + * | `|` | pipe | + * | `\t` | tab-delimited | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#delimiter) + */ delimiter: string; + /** + * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) + */ elevationInfo: CSVLayerElevationInfo; + /** + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) + */ featureReduction: CSVLayerFeatureReduction; + /** + * An array of fields in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#fields) + */ fields: Field[]; + /** + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. + * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic 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-CSVLayer.html#labelingInfo) + */ labelingInfo: LabelClass[]; + /** + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. + * > **Known Limitations** There is no support for labeling in 2D. Labeling is only 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#labelsVisible) + * + * @default false + */ labelsVisible: boolean; + /** + * The latitude field name. If not specified, the API will look for following field names in the CSV source: "lat", "latitude", "y", "ycenter", "latitude83", "latdecdeg", "POINT-Y". + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#latitudeField) + */ latitudeField: string; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#legendEnabled) + * + * @default true + */ legendEnabled: boolean; + /** + * The longitude field name. If not specified, the API will look for following field names in the CSV source: "lon", "lng", "long", "longitude", "x", "xcenter", "longitude83", "longdecdeg", "POINT-X". + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#longitudeField) + */ longitudeField: string; + /** + * The maximum scale 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) + * + * @default 0 + */ maxScale: number; + /** + * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) + * + * @default 0 + */ minScale: number; + /** + * An array of field names to include in the CSVLayer. If not specified, the layer will include all fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#outFields) + */ outFields: string[]; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupEnabled) + * + * @default true + */ popupEnabled: boolean; + /** + * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupTemplate) + */ popupTemplate: PopupTemplate; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#renderer) + */ renderer: Renderer; + /** + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#screenSizePerspectiveEnabled) + * + * @default true + */ screenSizePerspectiveEnabled: boolean; + /** + * The URL of the CSV file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#url) + */ url: string; + on(name: "layerview-create", eventHandler: CSVLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: CSVLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: CSVLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: CSVLayerLayerviewDestroyEventHandler): IHandle; } interface CSVLayerConstructor { + /** + * The CSVLayer is a point layer based on a CSV file (.csv, .txt). CSV is a plain-text file format used to represent tabular data, including geographic point features (latitude, longitude). Typically the latitude coordinate is the Y value, and the longitude coordinate is the X value. Features from the CSV file are accessible via the API so you can query features and use them as input to geometry or geoprocessing services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) + */ + new(properties?: CSVLayerProperties): CSVLayer; } export const CSVLayer: CSVLayerConstructor; interface CSVLayerProperties extends LayerProperties { + /** + * Copyright information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#copyright) + */ copyright?: string; + /** + * The column delimiter. See the table below for possible values. + * + * | Value | Description| + * | --- | --- | + * | `,` | comma | + * | ` ` | space | + * | `;` | semicolon | + * | `|` | pipe | + * | `\t` | tab-delimited | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#delimiter) + */ delimiter?: string; + /** + * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) + */ elevationInfo?: CSVLayerElevationInfo; + /** + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) + */ featureReduction?: CSVLayerFeatureReduction; + /** + * An array of fields in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#fields) + */ fields?: FieldProperties[]; + /** + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. + * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic 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-CSVLayer.html#labelingInfo) + */ labelingInfo?: LabelClassProperties[]; + /** + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. + * > **Known Limitations** There is no support for labeling in 2D. Labeling is only 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#labelsVisible) + * + * @default false + */ labelsVisible?: boolean; + /** + * The latitude field name. If not specified, the API will look for following field names in the CSV source: "lat", "latitude", "y", "ycenter", "latitude83", "latdecdeg", "POINT-Y". + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#latitudeField) + */ latitudeField?: string; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#legendEnabled) + * + * @default true + */ legendEnabled?: boolean; + /** + * The longitude field name. If not specified, the API will look for following field names in the CSV source: "lon", "lng", "long", "longitude", "x", "xcenter", "longitude83", "longdecdeg", "POINT-X". + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#longitudeField) + */ longitudeField?: string; + /** + * The maximum scale 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) + * + * @default 0 + */ maxScale?: number; + /** + * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) + * + * @default 0 + */ minScale?: number; + /** + * An array of field names to include in the CSVLayer. If not specified, the layer will include all fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#outFields) + */ outFields?: string[]; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupEnabled) + * + * @default true + */ popupEnabled?: boolean; + /** + * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupTemplate) + */ popupTemplate?: PopupTemplateProperties; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#renderer) + */ renderer?: RendererProperties; + /** + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#screenSizePerspectiveEnabled) + * + * @default true + */ screenSizePerspectiveEnabled?: boolean; + /** + * The URL of the CSV file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#url) + */ url?: string; } - export interface CSVLayerElevationInfo { + + 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. + * + * Mode | Description + * ------|------------ + * on-the-ground | Graphics are draped on the terrain surface. This is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) + * geometries rendered with [ObjectSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). + * relative-to-ground | Graphics are placed at an elevation relative to the terrain surface. The graphic's elevation is determined + * by summing up the terrain elevation and the result of `featureExpressionInfo` (if defined). This is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html). absolute-height | Graphics are placed at an absolute height above sea level. This height is determined by the result of `featureExpressionInfo` (if defined). This mode doesn't take the elevation of the terrain into account. relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) + */ mode: string; + /** + * An elevation offset, which is added to the vertical position of the graphic. If `unit` is not defined, the offset is in `meters`. When `mode = "on-the-ground"`, this property has no effect. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) + */ offset?: number; + /** + * This object contains information about setting a custom height on the graphic. If this property is set, then z values are not considered for calculating graphic height. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) + */ featureExpressionInfo?: CSVLayerElevationInfoFeatureExpressionInfo; + /** + * The unit for `featureExpressionInfo` and `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) + */ unit?: string; } - export interface CSVLayerElevationInfoFeatureExpressionInfo { + + export interface CSVLayerElevationInfoFeatureExpressionInfo extends Object { + /** + * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the height of the graphic. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) + */ expression?: string; } - export interface CSVLayerFeatureReduction { + + export interface CSVLayerFeatureReduction extends Object { + /** + * Type of the decluttering method. The only supported type at the moment is `"selection"`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) + */ type: string; } export interface CSVLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface CSVLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } 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.allowImageDataAccess Indicates if the access to the pixels of the image is required. + * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS for 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 for 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 { + + export interface DynamicLayerFetchImageOptions extends Object { + /** + * Indicates if the access to the pixels of the image is required. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#fetchImage) + */ allowImageDataAccess?: boolean; + /** + * The rotation in degrees of the exported image. Available since ArcGIS for 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 { + + 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 for Server 10.3. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#getImageUrl) + */ rotation?: number; } interface ElevationLayer extends Layer, ArcGISMapService, ArcGISCachedService, PortalLayer, TiledLayer { + /** + * URL pointing to the Elevation layer resource on an ArcGIS Image Server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#url) + */ url: string; + /** + * Requests a tile from the service and decodes the data into a linear array of elevation values. The returned promise resolves with a plain object describing the obtained elevation data for the tile. The object has the following properties: + * + * Property | Type | Description + * ----------|--------------|------------ + * values | Float32Array | The elevation values contained in the tile. + * width | number | The number of elevation values in one row of the tile. + * height | number | The number of elevation values in one column of the tile. + * maxZError | number | The upper bound for the compression error on the elevation values. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#fetchTile) + * + * @param level the tile level. + * @param row the tile row. + * @param column the tile column. + * @param noDataValue the value to use when a tile is partially missing data. + * + */ fetchTile(level: number, row: number, column: number, noDataValue?: number): IPromise; + /** + * Queries the service layer for elevation values for the given geometry. The returned result contains a copy of the geometry with z-values sampled from elevation data from the service. The resolution from which the elevation is queried can be set using the `demResolution` option. In many cases, `auto` demResolution can be used to get high quality elevation samples without the need to know exactly where the data in the service is located. This is particularly useful for services which combine elevation data from many sources (such as the world elevation service). If more control, or higher quality samples are required, use either `finest-contiguous` or a fixed `{number}` resolution. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) + * + * @param geometry The geometry to use for sampling elevation data. + * @param options Additional query options. See the table below. + * @param options.demResolution + * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. + * + * demResolution | Description + * -----------------------|------------- + * `auto` | Automatically chooses an appropriate resolution for each coordinate of the input geometry. The current implementation will try to use the finest available resolution given that the total required number of tile requests does not exceed a certain maximum amount (currently 100). Note that this may result in values being sampled from different resolutions. + * `finest-contiguous` | Sample elevation from the finest available resolution (cell size) across the entire geometry. + * `{number}` | Sample elevation from the resolution closest to the specified resolution (in meters). + * @param options.returnSampleInfo Indicates whether to return additional sample information for each coordinate. + * @param options.noDataValue The value to use when there is no data available. + * + */ queryElevation(geometry: Point | Multipoint | Polyline, options?: ElevationLayerQueryElevationOptions): IPromise; + on(name: "layerview-create", eventHandler: ElevationLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: ElevationLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: ElevationLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: ElevationLayerLayerviewDestroyEventHandler): IHandle; } interface ElevationLayerConstructor { + /** + * ElevationLayer is a tile layer used for rendering elevations in [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A default [world elevation layer](http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer) can be added to the map by setting the [map's ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) property to `world-elevation`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) + */ + new(properties?: ElevationLayerProperties): ElevationLayer; fromJSON(json: any): ElevationLayer; @@ -1451,84 +5843,409 @@ declare namespace __esri { export const ElevationLayer: ElevationLayerConstructor; interface ElevationLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, PortalLayerProperties, TiledLayerProperties { + /** + * URL pointing to the Elevation layer resource on an ArcGIS Image Server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#url) + */ url?: string; } - export interface ElevationLayerQueryElevationOptions { + + export interface ElevationLayerQueryElevationOptions extends Object { + /** + * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. + * + * demResolution | Description + * -----------------------|------------- + * `auto` | Automatically chooses an appropriate resolution for each coordinate of the input geometry. The current implementation will try to use the finest available resolution given that the total required number of tile requests does not exceed a certain maximum amount (currently 100). Note that this may result in values being sampled from different resolutions. + * `finest-contiguous` | Sample elevation from the finest available resolution (cell size) across the entire geometry. + * `{number}` | Sample elevation from the resolution closest to the specified resolution (in meters). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) + * + * @default auto + */ demResolution?: number | string; + /** + * Indicates whether to return additional sample information for each coordinate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) + * + * @default false + */ returnSampleInfo?: boolean; + /** + * The value to use when there is no data available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) + * + * @default 0 + */ noDataValue?: number; } - export interface ElevationLayerElevationQueryResult { + /** + * Object returned when [queryElevation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) promise resolves: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) + */ + export interface ElevationLayerElevationQueryResult extends Object { + /** + * The geometry with sampled z-values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) + */ geometry: Point | Multipoint | Polyline; - sampleInfo: ElevationLayerElevationQueryResultSampleInfo[]; + /** + * Contains additional information about how the geometry was sampled. This property is present depending on whether the user set `options.returnSampleInfo = true`, for each coordinate in the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) + */ + sampleInfo?: ElevationLayerElevationQueryResultSampleInfo[]; + /** + * The value used when there is no data available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) + */ noDataValue: number; } export interface ElevationLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface ElevationLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export interface ElevationLayerElevationQueryResultSampleInfo { + + export interface ElevationLayerElevationQueryResultSampleInfo extends Object { + /** + * The resolution at which the z-value was sampled. If no data was available for sampling for a given coordinate, the dem resolution value will be -1 for that coordinate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) + */ demResolution: number; } - interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer { - capabilities: FeatureLayerCapabilities; + interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { + /** + * Indicates the layer's supported capabilities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ + readonly capabilities: FeatureLayerCapabilities; + /** + * The copyright text as defined by the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#copyright) + */ copyright: string; + /** + * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. + * > **Known Limitations** Definition expressions will not be honored when working with FeatureLayers created from client-side graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) + */ definitionExpression: string; + /** + * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#displayField) + */ displayField: string; + /** + * 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-FeatureLayer.html#elevationInfo) + */ elevationInfo: FeatureLayerElevationInfo; + /** + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) + */ featureReduction: FeatureLayerFeatureReduction; + /** + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) + */ fields: Field[]; - gdbVersion: string; + /** + * The version of the geodatabase of the feature service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#gdbVersion) + */ + readonly gdbVersion: string; + /** + * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), and [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) + */ geometryType: string; - hasAttachments: boolean; - hasM: boolean; - hasZ: boolean; + /** + * Value is `true` if attachments are enabled on the feature layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasAttachments) + * + * @default false + */ + readonly hasAttachments: boolean; + /** + * Indicates if the features in the layer have M values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasM) + * + * @default false + */ + readonly hasM: boolean; + /** + * Indicates if the features in the layer have Z values. See [elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for details regarding placement and rendering of graphics with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasZ) + * + * @default false + */ + 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. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true`. + * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](esri-layers-support-LabelClass.html) with different [where](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-FeatureLayer.html#labelingInfo) + */ labelingInfo: LabelClass[]; + /** + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. + * > **Known Limitations** There is no support for labeling in 2D. Labeling is only 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#labelsVisible) + * + * @default false + */ labelsVisible: boolean; + /** + * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property. + * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) directly to the Feature Service. + * + * + * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) + */ layerId: number; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEnabled) + * + * @default true + */ legendEnabled: boolean; + /** + * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) + */ objectIdField: string; + /** + * An array of field names from the service to include in the FeatureLayer. If not specified, the layer will only return the `OBJECTID` field. To fetch the values from all fields in the layer, use `["*"]`. This is particularly useful when editing features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) + */ outFields: string[]; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupEnabled) + * + * @default true + */ popupEnabled: boolean; + /** + * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) + */ popupTemplate: PopupTemplate; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) + */ renderer: Renderer; + /** + * When `true`, indicates that M values will be returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnM) + * + * @default false + */ returnM: boolean; + /** + * When `true`, indicates that Z values will be returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) + * + * @default false + */ returnZ: boolean; + /** + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#screenSizePerspectiveEnabled) + * + * @default true + */ screenSizePerspectiveEnabled: boolean; + /** + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) + */ source: Collection; + /** + * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) + */ spatialReference: SpatialReference; + /** + * An array of feature templates defined in the feature layer. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#templates) + */ templates: FeatureTemplate[]; - token: string; + /** + * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#token) + */ + readonly token: string; + /** + * The name of the field holding the type ID or subtypes for the features. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#typeIdField) + */ typeIdField: string; + /** + * An array of subtypes defined in the feature service exposed by ArcGIS REST API. Each item includes information about the type, such as the type ID, name, and definition expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#types) + */ types: FeatureType[]; + /** + * The URL of the REST endpoint of the layer or service. The URL may either point to a resource on ArcGIS for Server, Portal for ArcGIS, 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; - version: number; + /** + * The version of ArcGIS Server in which the layer is published. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#version) + */ + readonly version: number; + /** + * Applies edits to features in a feature layer. New features can be created and existing features can be updated or deleted. Feature geometries and/or attributes may be modified. Only applicable to layers in a [feature service](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Feature_Service/02r3000000z2000000/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) + * + * @param edits Object containing features to be added, updated or deleted. + * @param edits.addFeatures Array of features to be added. Values of non nullable fields must be provided when adding new features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. + * @param edits.updateFeatures Array of features to be updated. Each feature must have valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). Values of non nullable fields must be provided when updating features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. + * @param edits.deleteFeatures An array of features or objects to be deleted. When an array of features is passed, each feature must have a valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). When an array of objects is used, each object must have a valid `objectId` property. + * + */ applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; + /** + * Creates query parameters that can be used to fetch features that satisfy the layer's current filters, and definitions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery) + * + * + */ createQuery(): Query; + /** + * Returns the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) associated with the given field name. The domain can be either a [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getFieldDomain) + * + * @param fieldName Name of the field. + * @param options An object specifying additional options. See the object specification table below for the required properties of this object. + * @param options.feature The feature to which the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) is assigned. + * + */ getFieldDomain(fieldName: string, options?: FeatureLayerGetFieldDomainOptions): Domain; - queryExtent(params?: Query): IPromise; - queryFeatureCount(params?: Query): IPromise; - queryFeatures(params?: Query): IPromise; - queryObjectIds(params?: Query): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. This is valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. + * > To query for the extent of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) + * + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. If working with a FeatureLayer created from a FeatureCollection (via [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source)), only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. + * + */ + queryExtent(params?: Query | QueryProperties): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the number of features that satisfy the query. If no parameters are specified, then the total number of features satisfying the layer's configuration/filters is returned. + * > To query for the count of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatureCount) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) + * + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the total number of features satisfying the layer's configuration/filters is returned. If working with a FeatureLayer created from a FeatureCollection (via [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source)), only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. + * + */ + queryFeatureCount(params?: Query | QueryProperties): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. + * > To query features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) + * + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then all features satisfying the layer's configuration/filters are returned. If working with a FeatureLayer created from a FeatureCollection (via [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source)), only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. + * + */ + queryFeatures(params?: Query | QueryProperties): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. + * > To query for ObjectIDs of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryObjectIds) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds) + * + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. If working with a FeatureLayer created from a FeatureCollection (via [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source)), only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. + * + */ + queryObjectIds(params?: Query | QueryProperties): IPromise; + on(name: "layerview-create", eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: FeatureLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: FeatureLayerLayerviewDestroyEventHandler): IHandle; } 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 for Portal items; or from an array of client-side graphics. It is composed of discrete features, each of which has a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered in either a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) as a [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) with spatial context. Features also contain data [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) that provide additional information about the real-world feature it represents; attributes may be viewed in [popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) windows and used for [rendering](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) the layer. FeatureLayers may be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures), [analyzed](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html), and [rendered](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) to visualize data in a spatial context. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) + */ + new(properties?: FeatureLayerProperties): FeatureLayer; fromJSON(json: any): FeatureLayer; @@ -1536,238 +6253,870 @@ declare namespace __esri { export const FeatureLayer: FeatureLayerConstructor; - interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { - capabilities?: FeatureLayerCapabilities; + interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + /** + * The copyright text as defined by the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#copyright) + */ copyright?: string; + /** + * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. + * > **Known Limitations** Definition expressions will not be honored when working with FeatureLayers created from client-side graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) + */ definitionExpression?: string; + /** + * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#displayField) + */ displayField?: string; + /** + * 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-FeatureLayer.html#elevationInfo) + */ elevationInfo?: FeatureLayerElevationInfo; + /** + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) + */ featureReduction?: FeatureLayerFeatureReduction; + /** + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side graphics you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) + */ fields?: FieldProperties[]; - gdbVersion?: string; + /** + * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). However, when creating a FeatureLayer from client-side graphics, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), and [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. **Possible Values:** point | mulitpoint | polyline | polygon | extent + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) + */ geometryType?: string; - hasAttachments?: boolean; - hasM?: boolean; - 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. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true`. + * > **Known Limitations** There is no support for labeling in 2D. Labeling is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Each graphic can have only one label. Multiple [Label classes](esri-layers-support-LabelClass.html) with different [where](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-FeatureLayer.html#labelingInfo) + */ labelingInfo?: LabelClassProperties[]; + /** + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. + * > **Known Limitations** There is no support for labeling in 2D. Labeling is only 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#labelsVisible) + * + * @default false + */ labelsVisible?: boolean; + /** + * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property. + * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) directly to the Feature Service. + * + * + * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) + */ layerId?: number; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEnabled) + * + * @default true + */ legendEnabled?: boolean; + /** + * The name of one of the provided [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) for each graphic containing a unique value or identifier for that graphic. This is required when constructing a FeatureLayer from a collection of client-side [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). When creating a FeatureLayer from client-side graphics, the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) + */ objectIdField?: string; + /** + * An array of field names from the service to include in the FeatureLayer. If not specified, the layer will only return the `OBJECTID` field. To fetch the values from all fields in the layer, use `["*"]`. This is particularly useful when editing features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) + */ outFields?: string[]; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupEnabled) + * + * @default true + */ popupEnabled?: boolean; + /** + * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) + */ popupTemplate?: PopupTemplateProperties; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) + */ renderer?: RendererProperties; + /** + * When `true`, indicates that M values will be returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnM) + * + * @default false + */ returnM?: boolean; + /** + * When `true`, indicates that Z values will be returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) + * + * @default false + */ returnZ?: boolean; + /** + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#screenSizePerspectiveEnabled) + * + * @default true + */ screenSizePerspectiveEnabled?: boolean; + /** + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. This property should only used when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) + */ source?: CollectionProperties; + /** + * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. This property should be set explicitly when creating a FeatureLayer from client-side graphics. When creating a FeatureLayer from client-side graphics, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties must also be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; + /** + * An array of feature templates defined in the feature layer. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#templates) + */ templates?: FeatureTemplateProperties[]; - token?: string; + /** + * The name of the field holding the type ID or subtypes for the features. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#typeIdField) + */ typeIdField?: string; + /** + * An array of subtypes defined in the feature service exposed by ArcGIS REST API. Each item includes information about the type, such as the type ID, name, and definition expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#types) + */ types?: FeatureTypeProperties[]; + /** + * The URL of the REST endpoint of the layer or service. The URL may either point to a resource on ArcGIS for Server, Portal for ArcGIS, 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; - version?: number; } - export interface FeatureEditResult { + /** + * FeatureEditResult represents the result of adding, updating or deleting a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) + */ + export interface FeatureEditResult extends Object { + /** + * Object Id of the feature that was edited. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) + */ objectId: number; + /** + * If the edit failed, the edit result includes an error. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) + */ error: FeatureEditResultError; } - export interface FeatureLayerApplyEditsEdits { + + export interface FeatureLayerApplyEditsEdits extends Object { + /** + * Array of features to be added. Values of non nullable fields must be provided when adding new features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) + */ addFeatures?: Graphic[]; + /** + * Array of features to be updated. Each feature must have valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). Values of non nullable fields must be provided when updating features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) + */ updateFeatures?: Graphic[]; + /** + * An array of features or objects to be deleted. When an array of features is passed, each feature must have a valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). When an array of objects is used, each object must have a valid `objectId` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) + */ deleteFeatures?: Graphic[] | any[]; } - export interface FeatureLayerCapabilities { + + export interface FeatureLayerCapabilities extends Object { + /** + * Indicates data capabilities that can be performed on features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ data: FeatureLayerCapabilitiesData; + /** + * Indicates editing capabilities that can be performed on the features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ editing: FeatureLayerCapabilitiesEditing; + /** + * Indicates operations that can be performed on features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ operations: FeatureLayerCapabilitiesOperations; + /** + * Indicates query operations that can be performed on features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ query: FeatureLayerCapabilitiesQuery; + /** + * Indicates if the layer's query operation supports querying features or records related to features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ queryRelated: FeatureLayerCapabilitiesQueryRelated; } - export interface FeatureLayerCapabilitiesData { + + export interface FeatureLayerCapabilitiesData extends Object { + /** + * Indicates if the attachment is enabled on the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsAttachment: boolean; + /** + * Indicates if the features in the layer support M values. Requires ArcGIS Server service 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsM: boolean; + /** + * Indicates if the features in the layer support Z values. Requires ArcGIS Server service 10.1 or greater. See [elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for details regarding placement and rendering of graphics with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsZ: boolean; } - export interface FeatureLayerCapabilitiesEditing { + + export interface FeatureLayerCapabilitiesEditing extends Object { + /** + * Indicates if anonymous users can delete features created by others. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsDeleteByAnonymous: boolean; + /** + * Indicates if logged in users can delete features created by others. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsDeleteByOthers: boolean; + /** + * Indicates if the geometry of the features in the layer can be edited. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsGeometryUpdate: boolean; + /** + * Indicates if the `globalid` values provided by the client are used in [applyEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsGlobalId: boolean; + /** + * Indicates if the `rollbackOnFailure` parameter can be set to `true` or `false` when running the synchronizeReplica operation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsRollbackOnFailure: boolean; + /** + * Indicates if anonymous users can update features created by others. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsUpdateByAnonymous: boolean; + /** + * Indicates if logged in users can update features created by others. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsUpdateByOthers: boolean; + /** + * Indicates if `m-values` must be provided when updating features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsUpdateWithoutM: boolean; + /** + * Indicates if the layer supports uploading attachments by [UploadId](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Item/02r3000000vq000000/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsUploadWithItemId: boolean; } - export interface FeatureLayerCapabilitiesOperations { + + export interface FeatureLayerCapabilitiesOperations extends Object { + /** + * Indicates if new features can be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) to the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsAdd: boolean; + /** + * Indicates if features can be [deleted](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) from the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsDelete: boolean; + /** + * Indicates if features in the layer can be [updated](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsUpdate: boolean; + /** + * Indicates if features in the layer can be [edited](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). Use `supportsAdd`, `supportsUpdate` and `supportsDelete` to determine which editing operations are supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsEditing: boolean; + /** + * Indicates if values of one or more field values in the layer can be updated. See the [Calculate REST operation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Calculate_Feature_Service_Layer/02r30000029n000000/) document for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsCalculate: boolean; + /** + * Indicates if features in the layer can be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsQuery: boolean; + /** + * Indicates if the layer supports a SQL-92 expression or where clause. This operation is only supported in ArcGIS Online hosted feature services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsValidateSql: boolean; } - export interface FeatureLayerCapabilitiesQuery { + + export interface FeatureLayerCapabilitiesQuery 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-FeatureLayer.html#capabilities) + */ supportsCentroid: boolean; + /** + * Indicates if the layer's query operation supports a buffer distance for input geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsDistance: boolean; + /** + * Indicates if the layer supports queries for distinct values based on fields specified in the [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsDistinct: boolean; + /** + * Indicates if the layer's query response includes the extent of features. At 10.3, this option is only available for hosted feature services. At 10.3.1, it is available for hosted and non-hosted feature services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsExtent: boolean; + /** + * Indicates if the layer's query response contains geometry attributes, including shape area and length attributes. This operation is only supported in ArcGIS Online hosted feature services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsGeometryProperties: boolean; + /** + * Indicates if features returned in the query response can be ordered by one or more fields. Requires an ArcGIS Server service 10.3 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsOrderBy: boolean; + /** + * Indicates if the query response supports pagination. Requires an ArcGIS Server service 10.3 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsPagination: boolean; + /** + * Indicates if the query operation supports the projection of geometries onto a virtual grid. Requires an ArcGIS Server service 10.3 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsQuantization: boolean; + /** + * Indicates if the number of features returned by the query operation can be controlled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsResultType: boolean; + /** + * Indicates if the query operation supports SQL expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsSqlExpression: boolean; + /** + * Indicates if the query operation supports using standardized queries. Learn more about [standardized queries here](http://server.arcgis.com/en/server/latest/administer/linux/about-standardized-queries.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsStandardizedQueriesOnly: boolean; + /** + * Indicates if the layer supports field-based statistical functions. Requires ArcGIS Server service 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsStatistics: boolean; } - export interface FeatureLayerCapabilitiesQueryRelated { + + export interface FeatureLayerCapabilitiesQueryRelated extends Object { + /** + * Indicates if the layer's query response includes the number of features or records related to features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsCount: boolean; + /** + * Indicates if the related features or records returned in the query response can be ordered by one or more fields. Requires ArcGIS Server service 10.3 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsOrderBy: boolean; + /** + * Indicates if the query response supports pagination for related features or records. Requires ArcGIS Server service 10.3 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ supportsPagination: boolean; } - export interface FeatureLayerElevationInfo { + + export interface FeatureLayerElevationInfo extends Object { + /** + * Defines how the graphic is placed with respect to the terrain surface. [returnZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) must be set to `true` if z-values of the features should be considered for the elevation mode. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. + * + * Mode | Description + * ------|------------ + * on-the-ground | Graphics are draped on the terrain surface. This is the default value for features with [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries and features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [ObjectSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). + * relative-to-ground | Graphics are placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing up the terrain elevation and the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. `relative-to-ground` is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html). + * absolute-height | Graphics are placed at an absolute height above sea level. This height is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. This mode doesn't take the elevation of the terrain into account. This is the default value of features with any geometry type where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasZ) is `true`. + * relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. In this mode z-values are ignored. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) + */ mode: string; + /** + * An elevation offset, which is added to the vertical position of the graphic. If `unit` is not defined, the offset is in `meters`. When `mode = "on-the-ground"`, this property has no effect. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) + */ offset?: number; + /** + * This object contains information about setting a custom height on the graphic. If this property is set, then z values are not considered for calculating graphic height. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) + */ featureExpressionInfo?: FeatureLayerElevationInfoFeatureExpressionInfo; + /** + * The unit for `featureExpressionInfo` and `offset` values. It doesn't apply to z-values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) + */ unit?: string; } - export interface FeatureLayerElevationInfoFeatureExpressionInfo { + + export interface FeatureLayerElevationInfoFeatureExpressionInfo extends Object { + /** + * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the height of the graphic. If the geometry has z-values, they will be ignored and only `featureExpressionInfo` is used to calculate the vertical position of the graphic. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) + */ expression?: string; } - export interface FeatureLayerFeatureReduction { + + export interface FeatureLayerFeatureReduction extends Object { + /** + * Type of the decluttering method. The only supported type at the moment is `"selection"`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) + */ type: string; } - export interface FeatureLayerGetFieldDomainOptions { + + export interface FeatureLayerGetFieldDomainOptions extends Object { + /** + * The feature to which the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) is assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getFieldDomain) + */ feature: Graphic; } export interface FeatureLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface FeatureLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export interface FeatureEditResultError { + + export interface FeatureEditResultError extends Object { + /** + * Error name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) + */ name: string; + /** + * Message describing the error. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) + */ message: string; } interface GeoRSSLayer extends Layer, ScaleRangeLayer { + /** + * Symbol used to represent line features from the GeoRSS feed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#lineSymbol) + */ lineSymbol: SimpleLineSymbol; + /** + * Symbol used to represent point features from the GeoRSS feed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#pointSymbol) + */ pointSymbol: PictureMarkerSymbol; + /** + * Symbol used to represent polygon features from the GeoRSS feed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#polygonSymbol) + */ polygonSymbol: SimpleFillSymbol; + /** + * The URL pointing to a GeoRSS file. This must be publicly available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#url) + */ url: string; + on(name: "layerview-create", eventHandler: GeoRSSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: GeoRSSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: GeoRSSLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: GeoRSSLayerLayerviewDestroyEventHandler): IHandle; } interface GeoRSSLayerConstructor { + /** + * The GeoRSSLayer class is used to create a layer based on [GeoRSS](http://www.georss.org/). GeoRSS is a way to add geographic information to an RSS feed. The GeoRSSLayer supports both `GeoRSS-Simple` and `GeoRSS GML` encodings, and multiple geometry types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html) + */ + new(properties?: GeoRSSLayerProperties): GeoRSSLayer; } export const GeoRSSLayer: GeoRSSLayerConstructor; interface GeoRSSLayerProperties extends LayerProperties, ScaleRangeLayerProperties { + /** + * Symbol used to represent line features from the GeoRSS feed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#lineSymbol) + */ lineSymbol?: SimpleLineSymbolProperties; + /** + * Symbol used to represent point features from the GeoRSS feed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#pointSymbol) + */ pointSymbol?: PictureMarkerSymbolProperties; + /** + * Symbol used to represent polygon features from the GeoRSS feed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#polygonSymbol) + */ polygonSymbol?: SimpleFillSymbolProperties; + /** + * The URL pointing to a GeoRSS file. This must be publicly available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#url) + */ url?: string; } export interface GeoRSSLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface GeoRSSLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface GraphicsLayer extends Layer, ScaleRangeLayer { + /** + * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) + */ elevationInfo: GraphicsLayerElevationInfo; + /** + * A collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the layer. Each graphic is a vector representation of the location of a real-world feature. Each graphic in a single GraphicsLayer may contain either a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry). In addition, each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the collection may contain its own [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes), [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html), and [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). To add a graphic to the GraphicsLayer use [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add), or [GraphicsLayer.graphics.add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) + */ graphics: Collection; + /** + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#screenSizePerspectiveEnabled) + * + * @default true + */ screenSizePerspectiveEnabled: boolean; + /** + * Adds a graphic to the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add) + * + * @param graphic The graphic to add to the layer. + * + */ add(graphic: Graphic): void; + /** + * Adds an array of graphics to the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#addMany) + * + * @param graphics The graphic(s) to add to the layer. + * + */ addMany(graphics: Graphic[]): void; + /** + * Removes a graphic from the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#remove) + * + * @param graphic The graphic to remove from the layer. + * + */ remove(graphic: Graphic): void; + /** + * Clears all the graphics from the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#removeAll) + * + * + */ removeAll(): void; + /** + * Removes an array of graphics from the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#removeMany) + * + * @param graphics The graphics to remove from the layer. + * + */ removeMany(graphics: Graphic[]): void; + on(name: "layerview-create", eventHandler: GraphicsLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: GraphicsLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: GraphicsLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: GraphicsLayerLayerviewDestroyEventHandler): IHandle; } interface GraphicsLayerConstructor { + /** + * A GraphicsLayer contains one or more client-side [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). Each [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) in the GraphicsLayer is rendered in a [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) inside either a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). The [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) contain discrete vector [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that represent real-world phenomena. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) + */ + new(properties?: GraphicsLayerProperties): GraphicsLayer; } export const GraphicsLayer: GraphicsLayerConstructor; interface GraphicsLayerProperties extends LayerProperties, ScaleRangeLayerProperties { + /** + * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) + */ elevationInfo?: GraphicsLayerElevationInfo; + /** + * A collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the layer. Each graphic is a vector representation of the location of a real-world feature. Each graphic in a single GraphicsLayer may contain either a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry). In addition, each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the collection may contain its own [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes), [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html), and [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). To add a graphic to the GraphicsLayer use [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add), or [GraphicsLayer.graphics.add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) + */ graphics?: CollectionProperties; + /** + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#screenSizePerspectiveEnabled) + * + * @default true + */ screenSizePerspectiveEnabled?: boolean; } - export interface GraphicsLayerElevationInfo { + + export interface GraphicsLayerElevationInfo extends Object { + /** + * Defines how the graphic is placed with respect to the terrain surface. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. + * + * Mode | Description + * ------|------------ + * on-the-ground | Graphics are placed on the terrain surface. + * relative-to-ground | Graphics are placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing up + * the terrain elevation, and the geometry's z-value (if present). In case `featureExpressionInfo` is defined, the result of the expression is used + * instead of the geometry’s z-value. absolute-height | Graphics are placed at an absolute height above sea level. This height is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. It doesn't take the elevation of the terrain into account. relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. In this mode z-values are ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) + */ mode: string; + /** + * An elevation offset, which is added to the vertical position of the graphic. If `unit` is not defined, the offset is in `meters`. When `mode = "on-the-ground"`, this property has no effect. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) + */ offset?: number; + /** + * This object contains information about setting a custom height on the graphic. If this property is set, then z values are not considered for calculating graphic height. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) + */ featureExpressionInfo?: GraphicsLayerElevationInfoFeatureExpressionInfo; + /** + * The unit for `featureExpressionInfo` and `offset` values. It doesn't apply to z-values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) + */ unit?: string; } - export interface GraphicsLayerElevationInfoFeatureExpressionInfo { + + export interface GraphicsLayerElevationInfoFeatureExpressionInfo extends Object { + /** + * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the height of the graphic. If the geometry has z-values, they will be ignored and only `featureExpressionInfo` is used to calculate the vertical position of the graphic. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) + */ expression?: string; } export interface GraphicsLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface GraphicsLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface GroupLayer extends Layer, LayersMixin, PortalLayer { + /** + * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. + * + * Value | Description + * ------|------------ + * independent | Each child layer manages its visibility independent from other layers. + * inherited | Each child layer's visibility matches the [GroupLayer’s visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visible). + * exclusive | Only one child layer is visible at a time. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode) + */ visibilityMode: string; + on(name: "layerview-create", eventHandler: GroupLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: GroupLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: GroupLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: GroupLayerLayerviewDestroyEventHandler): IHandle; } interface GroupLayerConstructor { + /** + * GroupLayer provides the ability to organize several sublayers into one common layer. Suppose there are several [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that all represent water features in different dimensions. For example, wells (points), streams (lines), and lakes (polygons). The GroupLayer provides the functionality to treat them as one layer called "Water Features" even though they are stored as separate feature layers. To accomplish this, create a new GroupLayer and use the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#add) method to add each of the water layers to the GroupLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) + */ + new(properties?: GroupLayerProperties): GroupLayer; fromJSON(json: any): GroupLayer; @@ -1776,34 +7125,89 @@ declare namespace __esri { export const GroupLayer: GroupLayerConstructor; interface GroupLayerProperties extends LayerProperties, LayersMixinProperties, PortalLayerProperties { + /** + * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. + * + * Value | Description + * ------|------------ + * independent | Each child layer manages its visibility independent from other layers. + * inherited | Each child layer's visibility matches the [GroupLayer’s visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visible). + * exclusive | Only one child layer is visible at a time. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode) + */ visibilityMode?: string; } export interface GroupLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface GroupLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - interface ImageryLayer extends Layer, ArcGISImageService, ScaleRangeLayer { + interface ImageryLayer extends Layer, ArcGISImageService, ScaleRangeLayer, RefreshableLayer { + /** + * A function that processes [pixelData](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData). The `pixelData` object contains a [pixelBlock](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html) property that gives you access to all of the pixels in the raster on the client. Inside the `pixelFilter` you may loop through all the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) found in the `pixelBlock` property of the `pixelData` object and process them. This function may be used to hide some pixels from the view, alter their values, and change their color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) + */ pixelFilter: Function; + /** + * Indicates whether to display popups when the layer is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupEnabled) + * + * @default true + */ popupEnabled: boolean; + /** + * The portal item from which the layer is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#portalItem) + */ portalItem: PortalItem; - token: string; + /** + * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#token) + */ + readonly token: string; + /** + * Executes the [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function and redraws the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#redraw) + * + * + */ redraw(): void; + on(name: "layerview-create", eventHandler: ImageryLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: ImageryLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: ImageryLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: ImageryLayerLayerviewDestroyEventHandler): IHandle; } interface ImageryLayerConstructor { + /** + * Represents an image service resource as a layer. An ImageryLayer retrieves and displays data from image services. ImageryLayer allows you to and apply client side [pixel filtering](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter), server defined or client-defined [rendering rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#renderingRule) (e.g. remap, colormap), and [mosaic rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#mosaicRule). This layer is particularly useful when you need to interactively change pixel manipulation criteria and get an immediate response on the client. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) + */ + new(properties?: ImageryLayerProperties): ImageryLayer; fromJSON(json: any): ImageryLayer; @@ -1811,33 +7215,68 @@ declare namespace __esri { export const ImageryLayer: ImageryLayerConstructor; - interface ImageryLayerProperties extends LayerProperties, ArcGISImageServiceProperties, ScaleRangeLayerProperties { + interface ImageryLayerProperties extends LayerProperties, ArcGISImageServiceProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + /** + * A function that processes [pixelData](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData). The `pixelData` object contains a [pixelBlock](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html) property that gives you access to all of the pixels in the raster on the client. Inside the `pixelFilter` you may loop through all the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) found in the `pixelBlock` property of the `pixelData` object and process them. This function may be used to hide some pixels from the view, alter their values, and change their color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) + */ pixelFilter?: Function; + /** + * Indicates whether to display popups when the layer is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupEnabled) + * + * @default true + */ popupEnabled?: boolean; + /** + * The portal item from which the layer is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#portalItem) + */ portalItem?: PortalItemProperties; - token?: string; } export interface ImageryLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface ImageryLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface IntegratedMeshLayer extends Layer, SceneService, PortalLayer { + /** + * Specifies how the mesh is placed on the vertical axis (z). This property only affects [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) when using the `absolute-height` mode. Integrated mesh layers always render in front of the ground surface, so setting negative offset values will not render them below the ground. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) + */ elevationInfo: IntegratedMeshLayerElevationInfo; + on(name: "layerview-create", eventHandler: IntegratedMeshLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: IntegratedMeshLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: IntegratedMeshLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: IntegratedMeshLayerLayerviewDestroyEventHandler): IHandle; } interface IntegratedMeshLayerConstructor { + /** + * The IntegratedMeshLayer is designed for visualizing accurate representations in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) of infrastructure and natural landscapes that are difficult to access. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) + */ + new(properties?: IntegratedMeshLayerProperties): IntegratedMeshLayer; fromJSON(json: any): IntegratedMeshLayer; @@ -1846,39 +7285,90 @@ declare namespace __esri { export const IntegratedMeshLayer: IntegratedMeshLayerConstructor; interface IntegratedMeshLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + /** + * Specifies how the mesh is placed on the vertical axis (z). This property only affects [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) when using the `absolute-height` mode. Integrated mesh layers always render in front of the ground surface, so setting negative offset values will not render them below the ground. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) + */ elevationInfo?: IntegratedMeshLayerElevationInfo; } - export interface IntegratedMeshLayerElevationInfo { + + export interface IntegratedMeshLayerElevationInfo extends Object { + /** + * Defines how the mesh is placed on the vertical axis (z). Currently only `absolute-height` is supported. + * + * Mode | Description + * ------|------------ + * absolute-height | The mesh is placed at an absolute height above sea level. This height is determined by summing up the `offset` value and the mesh's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for an IntegratedMeshLayer. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) + */ mode: string; + /** + * An elevation offset, which is added to the vertical position of the mesh. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) + * + * @default 0 + */ offset?: number; + /** + * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) + * + * @default meters + */ + unit?: string; } export interface IntegratedMeshLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface IntegratedMeshLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface KMLLayer extends Layer, PortalLayer, ScaleRangeLayer { - allVisibleMapImages: Collection; - allVisiblePoints: Collection; - allVisiblePolygons: Collection; - allVisiblePolylines: Collection; + /** + * A collection of [KMLSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#sublayers) + */ sublayers: Collection; + /** + * The publicly accessible URL for a .kml or .kmz file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#url) + */ url: string; + on(name: "layerview-create", eventHandler: KMLLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: KMLLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: KMLLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: KMLLayerLayerviewDestroyEventHandler): IHandle; } interface KMLLayerConstructor { + /** + * The KMLLayer class is used to create a layer based on a KML file (.kml, .kmz). KML is an XML-based file format used to represent geographic features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) + */ + new(properties?: KMLLayerProperties): KMLLayer; fromJSON(json: any): KMLLayer; @@ -1887,75 +7377,240 @@ declare namespace __esri { export const KMLLayer: KMLLayerConstructor; interface KMLLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { - allVisibleMapImages?: CollectionProperties; - allVisiblePoints?: CollectionProperties; - allVisiblePolygons?: CollectionProperties; - allVisiblePolylines?: CollectionProperties; + /** + * A collection of [KMLSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#sublayers) + */ sublayers?: CollectionProperties; + /** + * The publicly accessible URL for a .kml or .kmz file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#url) + */ url?: string; } export interface KMLLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface KMLLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface Layer extends Accessor, Loadable, Evented { + /** + * The full extent of the layer. By default, this is worldwide. This property may be used to set the extent of the view to match a layer's extent so that its features appear to fill the view. See the sample snippet below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fullExtent) + */ fullExtent: Extent; + /** + * The unique ID assigned to the layer. If not set by the developer, it is automatically generated when the layer is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) + */ id: string; + /** + * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The known values are listed below. + * + * Value | Description + * ------|------------ + * show | The layer is visible in the table of contents. + * hide | The layer is hidden in the table of contents. + * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), hide the children layers from the table of contents. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) + * + * @default show + */ listMode: string; - loaded: boolean; + /** + * Indicates whether the layer's resources have loaded. When `true`, all the properties of the object can be accessed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#loaded) + * + * @default false + */ + readonly loaded: boolean; + /** + * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent transparent and `1` is completely opaque. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#opacity) + * + * @default 1 + */ opacity: number; + /** + * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widgets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#title) + */ title: string; - type: string; + /** + * The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. **Possible values:** base-dynamic | base-elevation | base-tile | elevation | feature | graphics | group | imagery | integrated-mesh | map-image | open-street-map | point-cloud | scene | stream | tile | unknown | unsupported | vector-tile | web-tile + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#type) + */ + readonly type: string; + /** + * Indicates if the layer is visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). When `false`, the layer may still be added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance that is referenced in a view, but its features will not be visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#visible) + * + * @default true + */ visible: boolean; + /** + * Fetches custom attribution data for the layer when it becomes available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fetchAttributionData) + * + * + */ fetchAttributionData(): IPromise; } interface LayerConstructor { + /** + * The layer is the most fundamental component of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). It is a collection of spatial data in the form of vector graphics or raster images that represent real-world phenomena. Layers may contain discrete features that store vector data or continuous cells/pixels that store raster data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) + */ + new(properties?: LayerProperties): Layer; + /** + * Creates a new layer instance from an ArcGIS Server URL. Depending on the URL, the returned layer type may be a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html), [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) or [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). This is useful when you work with various ArcGIS Server URLs, but you don't necessarily know which layer type(s) they create. This method creates the appropriate layer type for you. In case of a feature service or a scene service, when the URL points to the service and the service has multiple layers, the returned promise will resolve to a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServerUrl) + * + * @param params Input parameters for creating the layer. + * @param params.url The ArcGIS Server URL used to create the layer. + * @param params.properties Set any of the layer's properties here for constructing the layer instance (e.g. popupTemplate, renderer, etc.). + * + */ fromArcGISServerUrl(params: LayerFromArcGISServerUrlParams): IPromise; + /** + * Creates a new layer instance of the appropriate layer class from an ArcGIS Online or ArcGIS for Portal [portal item](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). If the item points to a feature service with multiple layers, then a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is created. If the item points to a service with a single layer, then it resolves to a layer of the same type of class as the service. See also: [isLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#isLayer) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromPortalItem) + * + * @param params The parameters for loading the portal item. + * @param params.portalItem The object representing an ArcGIS Online or ArcGIS for Portal item from which to load the layer. + * + */ fromPortalItem(params: LayerFromPortalItemParams): IPromise; } export const Layer: LayerConstructor; interface LayerProperties extends LoadableProperties { + /** + * The full extent of the layer. By default, this is worldwide. This property may be used to set the extent of the view to match a layer's extent so that its features appear to fill the view. See the sample snippet below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fullExtent) + */ fullExtent?: ExtentProperties; + /** + * The unique ID assigned to the layer. If not set by the developer, it is automatically generated when the layer is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) + */ id?: string; + /** + * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The known values are listed below. + * + * Value | Description + * ------|------------ + * show | The layer is visible in the table of contents. + * hide | The layer is hidden in the table of contents. + * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), hide the children layers from the table of contents. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) + * + * @default show + */ listMode?: string; - loaded?: boolean; + /** + * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent transparent and `1` is completely opaque. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#opacity) + * + * @default 1 + */ opacity?: number; + /** + * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widgets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#title) + */ title?: string; - type?: string; + /** + * Indicates if the layer is visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). When `false`, the layer may still be added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance that is referenced in a view, but its features will not be visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#visible) + * + * @default true + */ visible?: boolean; } - export interface LayerFromArcGISServerUrlParams { + + export interface LayerFromArcGISServerUrlParams extends Object { + /** + * The ArcGIS Server URL used to create the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServerUrl) + */ url: string; + /** + * Set any of the layer's properties here for constructing the layer instance (e.g. popupTemplate, renderer, etc.). + * + * [Read more...](properties.html) + */ properties?: any; } - export interface LayerFromPortalItemParams { + + export interface LayerFromPortalItemParams extends Object { + /** + * The object representing an ArcGIS Online or ArcGIS for Portal item from which to load the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromPortalItem) + */ portalItem: PortalItem; } - interface MapImageLayer extends Layer, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer, ScaleRangeLayer { + interface MapImageLayer extends Layer, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer, ScaleRangeLayer, RefreshableLayer { + on(name: "layerview-create", eventHandler: MapImageLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: MapImageLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: MapImageLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: MapImageLayerLayerviewDestroyEventHandler): IHandle; } interface MapImageLayerConstructor { + /** + * MapImageLayer allows you to display and analyze data from [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) defined in a [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm), exporting images instead of features. Map service images are dynamically generated on the server based on a request, which includes an LOD (level of detail), a bounding box, dpi, spatial reference and other options. The exported image is of the entire map extent specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) + */ + new(properties?: MapImageLayerProperties): MapImageLayer; fromJSON(json: any): MapImageLayer; @@ -1963,28 +7618,42 @@ declare namespace __esri { export const MapImageLayer: MapImageLayerConstructor; - interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISDynamicMapServiceProperties, DynamicLayerProperties, ScaleRangeLayerProperties { + interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISDynamicMapServiceProperties, DynamicLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { } export interface MapImageLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface MapImageLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface MapNotesLayer extends Layer, PortalLayer, ScaleRangeLayer { + on(name: "layerview-create", eventHandler: MapNotesLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: MapNotesLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: MapNotesLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: MapNotesLayerLayerviewDestroyEventHandler): IHandle; } interface MapNotesLayerConstructor { + /** + * The MapNotesLayer is used to create layers based on Map Notes within a WebMap or PortalItem. Map notes are part of web maps, and are typically created with ArcGIS Online MapViewer. For additional information, please refer to the ArcGIS Online documentation on how to [Add Map notes](http://doc.arcgis.com/en/arcgis-online/create-maps/add-layers.htm#ESRI_SECTION1_0C90A3B63ABD49D5B9535055991F4684). Within the [web map specification](https://developers.arcgis.com/web-map-specification/), map notes are a special type of [FeatureCollections](https://developers.arcgis.com/web-map-specification/objects/featureCollection/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapNotesLayer.html) + */ + new(properties?: MapNotesLayerProperties): MapNotesLayer; fromJSON(json: any): MapNotesLayer; @@ -1997,23 +7666,49 @@ declare namespace __esri { } export interface MapNotesLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface MapNotesLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface ArcGISCachedService { + /** + * Contains information about the tiling scheme for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#tileInfo) + */ tileInfo: TileInfo; + /** + * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#fromJSON) + * + * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Classification_objects/02r30000019z000000/) for examples of the structure of various input JSON objects. + * + */ fromJSON(json: any): any; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#toJSON) + * + * + */ toJSON(): any; } interface ArcGISCachedServiceConstructor { + + new(properties?: ArcGISCachedServiceProperties): ArcGISCachedService; fromJSON(json: any): ArcGISCachedService; @@ -2022,76 +7717,362 @@ declare namespace __esri { export const ArcGISCachedService: ArcGISCachedServiceConstructor; interface ArcGISCachedServiceProperties { + /** + * Contains information about the tiling scheme for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#tileInfo) + */ tileInfo?: TileInfoProperties; } interface ArcGISDynamicMapService { - allSublayers: Collection; + /** + * A flat [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of all the [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#sublayers) in the MapImageLayer including the sublayers of its sublayers. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#allSublayers) + */ + readonly allSublayers: Collection; + /** + * The output dots per inch (DPI) of the MapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#dpi) + * + * @default 96 + */ dpi: number; + /** + * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#gdbVersion) + */ gdbVersion: string; + /** + * The output image type. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageFormat) + * + * @default png24 + */ imageFormat: string; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxHeight) + * + * @default 2048 + */ imageMaxHeight: number; + /** + * Indicates the maximum width of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxWidth) + * + * @default 2048 + */ imageMaxWidth: number; + /** + * Indicates whether the background of the image exported by the service is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageTransparency) + * + * @default true + */ imageTransparency: boolean; + /** + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). They may be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add), [removed](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove), or [reordered](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder) using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. Because [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) extends [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html), its properties may be [watched](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html#watchProperties). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#sublayers) + */ sublayers: Collection; + /** + * Returns a deep clone of a map service's [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) as defined by the service. This is useful for scenarios when the developer is unfamiliar with the service sublayers and needs to "reset" the layer's sublayers to match those defined by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createServiceSublayers) + * + * + */ createServiceSublayers(): Collection; + /** + * Returns the sublayer with the given layerId. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#findSublayerById) + * + * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) of the sublayer. + * + */ findSublayerById(id: number): Sublayer; + /** + * Gets the parameters of the exported image to use when calling the [export REST operation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Map/02r3000000v7000000/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#getExportImageParameters) + * + * @param extent The extent of the exported image + * @param width The width of the exported image + * @param height The height of the exported image + * @param options The parameter options is an object with the following properties. + * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS for Server 10.3. + * + */ getExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceGetExportImageParametersOptions): any; } interface ArcGISDynamicMapServiceConstructor { + + new(): ArcGISDynamicMapService; } export const ArcGISDynamicMapService: ArcGISDynamicMapServiceConstructor; interface ArcGISDynamicMapServiceProperties { - allSublayers?: CollectionProperties; + /** + * The output dots per inch (DPI) of the MapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#dpi) + * + * @default 96 + */ dpi?: number; + /** + * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#gdbVersion) + */ gdbVersion?: string; + /** + * The output image type. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageFormat) + * + * @default png24 + */ imageFormat?: string; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxHeight) + * + * @default 2048 + */ imageMaxHeight?: number; + /** + * Indicates the maximum width of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxWidth) + * + * @default 2048 + */ imageMaxWidth?: number; + /** + * Indicates whether the background of the image exported by the service is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageTransparency) + * + * @default true + */ imageTransparency?: boolean; + /** + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). They may be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add), [removed](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove), or [reordered](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder) using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. Because [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) extends [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html), its properties may be [watched](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html#watchProperties). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#sublayers) + */ sublayers?: CollectionProperties; } - export interface ArcGISDynamicMapServiceGetExportImageParametersOptions { + + export interface ArcGISDynamicMapServiceGetExportImageParametersOptions extends Object { + /** + * The rotation in degrees of the exported image. Available since ArcGIS for Server 10.3. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#getExportImageParameters) + */ rotation?: number; } interface ArcGISImageService { + /** + * The compression quality value. This controls how much loss the image will be subjected to. Only valid when using `jpg` [image format](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionQuality) + */ compressionQuality: number; + /** + * The output image compression tolerance value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionTolerance) + * + * @default 0.01 + */ compressionTolerance: number; + /** + * The copyright text as defined by the image service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#copyright) + */ copyright: string; + /** + * The SQL where clause used to filter rasters on the client. Only the rasters that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#definitionExpression) + */ definitionExpression: string; + /** + * An array of fields in the layer for which a [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) has been defined. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#domainFields) + */ domainFields: Field[]; + /** + * An array of fields in the layer. Each field represents an attribute that may contain a value for each raster in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fields) + */ fields: Field[]; + /** + * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Known Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format) + * + * @default jpgpng + */ format: string; + /** + * The full extent of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fullExtent) + */ fullExtent: Extent; + /** + * Indicates if the Image Service has [multidimensionalInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasMultidimensions) + */ hasMultidimensions: boolean; + /** + * Indicates if the Image Service has a [raster attribute table](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable). If `true`, the raster attribute table can be accessed with the [rasterAttributeTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) property after the layer has [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasRasterAttributeTable) + */ hasRasterAttributeTable: boolean; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxHeight) + * + * @default 4100 + */ imageMaxHeight: number; + /** + * Indicates the maximum width of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxWidth) + * + * @default 15000 + */ imageMaxWidth: number; + /** + * Defines how overlapping images should be mosaicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule) + */ mosaicRule: MosaicRule; + /** + * The multidimensional information associated with the service. This will have a value if `serviceInfo` has `hasMultidimensionalInfo = true`. If defined, multidimensional information contains various "dimensions" of data for a particular value, such as time, depth, altitude, etc. Defining slices of particular dimensions in the layer is handled with the [multidimensionalDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) property of the [mosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo) + */ multidimensionalInfo: any; + /** + * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelType) + */ pixelType: string; + /** + * The popup template for the layer. When set on the layer, the popupTemplate allows users to access attributes and display their values using text and/or charts in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a pixel is clicked. See [this sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-popup/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#popupTemplate) + */ popupTemplate: PopupTemplate; + /** + * The raster attribute table associated with the service. To access the raster attribute table, the layer must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) + */ rasterAttributeTable: any; + /** + * Prefix used to define the fields from the raster attribute table. It's primarily used for [popups](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTableFieldPrefix) + * + * @default Raster. + */ rasterAttributeTableFieldPrefix: string; + /** + * A complete list of fields that consists of fields from the layer, pixel value fields and the attribute table fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterFields) + */ rasterFields: Field[]; + /** + * Specifies the rule for how the requested image should be rendered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#renderingRule) + */ renderingRule: RasterFunction; - spatialReference: SpatialReference; + /** + * The spatial reference of the image service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#spatialReference) + */ + readonly spatialReference: SpatialReference; + /** + * The URL to the REST endpoint of the layer. The URL may either point to a resource on ArcGIS for Server, Portal for ArcGIS, or ArcGIS Online. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#url) + */ url: string; - version: number; + /** + * The version of ArcGIS Server in which the image service is published. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#version) + */ + readonly version: number; + /** + * Returns an image using the [export REST operation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Image/02r3000000wm000000/) that displays data from an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fetchImage) + * + * @param extent The extent of the image to export. + * @param width The width of the image in pixels. + * @param height The height of the image in pixels. + * + */ fetchImage(extent: Extent, width: number, height: number): IPromise; + /** + * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fromJSON) + * + * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Classification_objects/02r30000019z000000/) for examples of the structure of various input JSON objects. + * + */ fromJSON(json: any): any; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#toJSON) + * + * + */ toJSON(): any; } interface ArcGISImageServiceConstructor { + + new(properties?: ArcGISImageServiceProperties): ArcGISImageService; fromJSON(json: any): ArcGISImageService; @@ -2100,39 +8081,174 @@ declare namespace __esri { export const ArcGISImageService: ArcGISImageServiceConstructor; interface ArcGISImageServiceProperties { + /** + * The compression quality value. This controls how much loss the image will be subjected to. Only valid when using `jpg` [image format](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionQuality) + */ compressionQuality?: number; + /** + * The output image compression tolerance value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionTolerance) + * + * @default 0.01 + */ compressionTolerance?: number; + /** + * The copyright text as defined by the image service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#copyright) + */ copyright?: string; + /** + * The SQL where clause used to filter rasters on the client. Only the rasters that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#definitionExpression) + */ definitionExpression?: string; + /** + * An array of fields in the layer for which a [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) has been defined. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#domainFields) + */ domainFields?: FieldProperties[]; + /** + * An array of fields in the layer. Each field represents an attribute that may contain a value for each raster in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fields) + */ fields?: FieldProperties[]; + /** + * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Known Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format) + * + * @default jpgpng + */ format?: string; + /** + * The full extent of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fullExtent) + */ fullExtent?: ExtentProperties; + /** + * Indicates if the Image Service has [multidimensionalInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasMultidimensions) + */ hasMultidimensions?: boolean; + /** + * Indicates if the Image Service has a [raster attribute table](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable). If `true`, the raster attribute table can be accessed with the [rasterAttributeTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) property after the layer has [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasRasterAttributeTable) + */ hasRasterAttributeTable?: boolean; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxHeight) + * + * @default 4100 + */ imageMaxHeight?: number; + /** + * Indicates the maximum width of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxWidth) + * + * @default 15000 + */ imageMaxWidth?: number; + /** + * Defines how overlapping images should be mosaicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule) + */ mosaicRule?: MosaicRuleProperties; + /** + * The multidimensional information associated with the service. This will have a value if `serviceInfo` has `hasMultidimensionalInfo = true`. If defined, multidimensional information contains various "dimensions" of data for a particular value, such as time, depth, altitude, etc. Defining slices of particular dimensions in the layer is handled with the [multidimensionalDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) property of the [mosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo) + */ multidimensionalInfo?: any; + /** + * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelType) + */ pixelType?: string; + /** + * The popup template for the layer. When set on the layer, the popupTemplate allows users to access attributes and display their values using text and/or charts in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a pixel is clicked. See [this sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-popup/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#popupTemplate) + */ popupTemplate?: PopupTemplateProperties; + /** + * The raster attribute table associated with the service. To access the raster attribute table, the layer must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) + */ rasterAttributeTable?: any; + /** + * Prefix used to define the fields from the raster attribute table. It's primarily used for [popups](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTableFieldPrefix) + * + * @default Raster. + */ rasterAttributeTableFieldPrefix?: string; + /** + * A complete list of fields that consists of fields from the layer, pixel value fields and the attribute table fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterFields) + */ rasterFields?: FieldProperties[]; + /** + * Specifies the rule for how the requested image should be rendered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#renderingRule) + */ renderingRule?: RasterFunctionProperties; - spatialReference?: SpatialReferenceProperties; + /** + * The URL to the REST endpoint of the layer. The URL may either point to a resource on ArcGIS for Server, Portal for ArcGIS, or ArcGIS Online. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#url) + */ url?: string; - version?: number; } interface ArcGISMapService { + /** + * The copyright text as defined by the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) + */ copyright: string; + /** + * The full extent of the layer as defined by the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#fullExtent) + */ fullExtent: Extent; - spatialReference: SpatialReference; - token: string; + /** + * The spatial reference of the layer as defined by the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#spatialReference) + */ + readonly spatialReference: SpatialReference; + /** + * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#token) + */ + readonly token: string; } interface ArcGISMapServiceConstructor { + + new(properties?: ArcGISMapServiceProperties): ArcGISMapService; fromJSON(json: any): ArcGISMapService; @@ -2141,17 +8257,32 @@ declare namespace __esri { export const ArcGISMapService: ArcGISMapServiceConstructor; interface ArcGISMapServiceProperties { + /** + * The copyright text as defined by the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) + */ copyright?: string; + /** + * The full extent of the layer as defined by the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#fullExtent) + */ fullExtent?: ExtentProperties; - spatialReference?: SpatialReferenceProperties; - token?: string; } interface PortalLayer { + /** + * The portal item from which the layer is loaded. If the portal item references a Feature Service or Scene Service, then you can specify a single layer to load with the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#layerId) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#portalItem) + */ portalItem: PortalItem; } interface PortalLayerConstructor { + + new(properties?: PortalLayerProperties): PortalLayer; fromJSON(json: any): PortalLayer; @@ -2160,35 +8291,149 @@ declare namespace __esri { export const PortalLayer: PortalLayerConstructor; interface PortalLayerProperties { + /** + * The portal item from which the layer is loaded. If the portal item references a Feature Service or Scene Service, then you can specify a single layer to load with the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#layerId) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#portalItem) + */ portalItem?: PortalItemProperties; } + interface RefreshableLayer { + /** + * Refresh interval of the layer in minutes. Minimum refresh interval is 0.1 minute (6 seconds). Value of `0` indicates no refresh. + * > **Known Limitations** Refreshing is only supported in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refreshInterval) + * + * @default 0 + */ + refreshInterval: number; + + /** + * Fetches all the data for the layer. + * > **Known Limitations** Refreshing is only supported in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refresh) + * + * + */ + refresh(): void; + } + + interface RefreshableLayerConstructor { + + + new(): RefreshableLayer; + } + + export const RefreshableLayer: RefreshableLayerConstructor; + + interface RefreshableLayerProperties { + /** + * Refresh interval of the layer in minutes. Minimum refresh interval is 0.1 minute (6 seconds). Value of `0` indicates no refresh. + * > **Known Limitations** Refreshing is only supported in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refreshInterval) + * + * @default 0 + */ + refreshInterval?: number; + } + interface ScaleRangeLayer { + /** + * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) + * + * @default 0 + */ maxScale: number; + /** + * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) + * + * @default 0 + */ minScale: number; } interface ScaleRangeLayerConstructor { + + new(): ScaleRangeLayer; } export const ScaleRangeLayer: ScaleRangeLayerConstructor; interface ScaleRangeLayerProperties { + /** + * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) + * + * @default 0 + */ maxScale?: number; + /** + * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) + * + * @default 0 + */ minScale?: number; } interface SceneService { + /** + * The copyright text as defined by the scene service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#copyright) + */ copyright: string; + /** + * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single SceneLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property. + * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) directly to the Scene Service. + * + * + * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) + */ layerId: number; + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#spatialReference) + */ spatialReference: SpatialReference; - token: string; + /** + * 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 Server, Portal for ArcGIS, or ArcGIS Online. The layer may be specified using the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) property when the url points directly to a service and not a specific layer. If [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) is not specified, then it will default to the first layer in the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) + */ url: string; - version: SceneServiceVersion; + /** + * The version of the scene service specification used for this service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) + */ + readonly version: SceneServiceVersion; } interface SceneServiceConstructor { + + new(properties?: SceneServiceProperties): SceneService; fromJSON(json: any): SceneService; @@ -2197,28 +8442,77 @@ declare namespace __esri { export const SceneService: SceneServiceConstructor; interface SceneServiceProperties { + /** + * The copyright text as defined by the scene service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#copyright) + */ copyright?: string; + /** + * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single SceneLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property. + * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) directly to the Scene Service. + * + * + * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) + */ layerId?: number; + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; - token?: string; + /** + * The URL of the REST endpoint of the layer or scene service. The URL may either point to a resource on ArcGIS Server, Portal for ArcGIS, or ArcGIS Online. The layer may be specified using the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) property when the url points directly to a service and not a specific layer. If [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) is not specified, then it will default to the first layer in the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) + */ url?: string; - version?: SceneServiceVersion; } - export interface SceneServiceVersion { + + export interface SceneServiceVersion extends Object { + /** + * The major version of the scene layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) + */ major: number; + /** + * The minor version of the scene layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) + */ minor: number; + /** + * The complete version string of the scene layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) + */ versionString: string; } interface OpenStreetMapLayer extends WebTileLayer { + on(name: "layerview-create", eventHandler: OpenStreetMapLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: OpenStreetMapLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: OpenStreetMapLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: OpenStreetMapLayerLayerviewDestroyEventHandler): IHandle; } interface OpenStreetMapLayerConstructor { + /** + * Allows you to use [basemaps](http://wiki.openstreetmap.org/wiki/List_of_OSM-based_services) from [OpenStreetMap](http://www.openstreetmap.org/). Set the [tileservers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OpenStreetMapLayer.html#tileServers) property to change which OpenStreetMap tiles you want to use. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OpenStreetMapLayer.html) + */ + new(properties?: OpenStreetMapLayerProperties): OpenStreetMapLayer; fromJSON(json: any): OpenStreetMapLayer; @@ -2231,28 +8525,64 @@ declare namespace __esri { } export interface OpenStreetMapLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface OpenStreetMapLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface PointCloudLayer extends Layer, SceneService, PortalLayer { + /** + * Specifies how points are placed on the vertical axis (z). This property only affects [PointCloudLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) when using the `absolute-height` mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) + */ elevationInfo: PointCloudLayerElevationInfo; + /** + * An array of fields accessible in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#fields) + */ fields: Field[]; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#legendEnabled) + * + * @default true + */ legendEnabled: boolean; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each point in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#renderer) + */ renderer: PointCloudRenderer; + on(name: "layerview-create", eventHandler: PointCloudLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: PointCloudLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: PointCloudLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: PointCloudLayerLayerviewDestroyEventHandler): IHandle; } interface PointCloudLayerConstructor { + /** + * The PointCloudLayer is designed for visualizing large collections of points in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) + */ + new(properties?: PointCloudLayerProperties): PointCloudLayer; fromJSON(json: any): PointCloudLayer; @@ -2261,56 +8591,248 @@ declare namespace __esri { export const PointCloudLayer: PointCloudLayerConstructor; interface PointCloudLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + /** + * Specifies how points are placed on the vertical axis (z). This property only affects [PointCloudLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) when using the `absolute-height` mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) + */ elevationInfo?: PointCloudLayerElevationInfo; + /** + * An array of fields accessible in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#fields) + */ fields?: FieldProperties[]; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#legendEnabled) + * + * @default true + */ legendEnabled?: boolean; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each point in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#renderer) + */ renderer?: PointCloudRendererProperties; } export interface PointCloudLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface PointCloudLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export interface PointCloudLayerElevationInfo { + + export interface PointCloudLayerElevationInfo extends Object { + /** + * Defines how the points are placed on the vertical axis (z). Currently only `absolute-height` mode is supported. + * + * Mode | Description + * ------|------------ + * absolute-height | Points are placed at an absolute height above sea level. This height is determined by summing up the `offset` value and the point's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) + */ mode: string; + /** + * An elevation offset, which is added to the vertical position of each point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) + * + * @default 0 + */ offset?: number; + /** + * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) + * + * @default meters + */ + unit?: string; } interface SceneLayer extends Layer, SceneService, PortalLayer { + /** + * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#definitionExpression) + */ definitionExpression: string; + /** + * Specifies how graphics are placed on the vertical axis (z). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. This property only affects 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) when using the `absolute-height` mode. [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries support all the elevation modes listed below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) + */ elevationInfo: SceneLayerElevationInfo; + /** + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) + */ featureReduction: SceneLayerFeatureReduction; + /** + * An array of fields accessible in the layer. Depending on the scene service, fields may have limited support for certain capabilities. Use [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) to query the contexts (rendering, labeling, popups or querying) for which a particular field may be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) + */ fields: Field[]; + /** + * The geometry type of features in the layer. **Possible Values:** point | mesh + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) + */ geometryType: string; + /** + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. + * > **Known Limitations** This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. Each point can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) + */ labelingInfo: LabelClass[]; + /** + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) property. This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) + * + * @default false + */ labelsVisible: boolean; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#legendEnabled) + * + * @default true + */ legendEnabled: boolean; + /** + * The name of the field containing each graphic's Object ID. If this is not explicitly specified, this is automatically derived from the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) of the service by taking the first field of type `oid`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#objectIdField) + */ objectIdField: string; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupEnabled) + * + * @default true + */ popupEnabled: boolean; + /** + * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) + */ popupTemplate: PopupTemplate; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer) + */ renderer: Renderer; + /** + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#screenSizePerspectiveEnabled) + * + * @default true + */ screenSizePerspectiveEnabled: boolean; + /** + * Creates a query object that can be used to fetch features that satisfy the layer's current definition expression. The query should only be used on the layer and not on the layer view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#createQuery) + * + * + */ createQuery(): Query; + /** + * Gets field usage information. The usage of a field depends on whether it is stored as part of the scene service cache. The returned object contains the following usage information: + * + * Property | Type | Description + * ----------------------|---------|------------ + * supportsRenderer | boolean | Indicates that a field can be used in a renderer (e.g. in visual variables), [see renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer). + * supportsLabelingInfo | boolean | Indicates that a field can be used for labeling, [see labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo). + * supportsPopupTemplate | boolean | Indicates that a field can be used in a popup template, [see popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate). + * supportsLayerQuery | boolean | Indicates that a field can be used in layer queries, [see queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) + * + * @param fieldName The name of the field to get usage info for. + * + */ getFieldUsageInfo(fieldName: string): any; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns the 2D [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. At the moment the 3D Extent can be returned by using [SceneLayerView.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryExtent), but this will return the 3D extent only for features currently in the view. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryExtent) + * + * @param params Specifies the query parameters. + * + */ queryExtent(params?: Query): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns the number of the features that satisfy the query. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatureCount) + * + * @param params Specifies the query parameters. + * + */ queryFeatureCount(params?: Query): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures) + * + * @param params Specifies the query parameters. + * + */ queryFeatures(params?: Query): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns an array of the ObjectIDs of features that satisfy the input query. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryObjectIds) + * + * @param params Specifies the query parameters. + * + */ queryObjectIds(params?: Query): IPromise; + on(name: "layerview-create", eventHandler: SceneLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: SceneLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: SceneLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: SceneLayerLayerviewDestroyEventHandler): IHandle; } interface SceneLayerConstructor { + /** + * The SceneLayer is a layer type designed for on-demand streaming and displaying large amounts of data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). SceneLayers support two geometry types: [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and 3D Objects (e.g. Buildings). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) + */ + new(properties?: SceneLayerProperties): SceneLayer; fromJSON(json: any): SceneLayer; @@ -2319,55 +8841,209 @@ declare namespace __esri { export const SceneLayer: SceneLayerConstructor; interface SceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + /** + * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#definitionExpression) + */ definitionExpression?: string; + /** + * Specifies how graphics are placed on the vertical axis (z). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. This property only affects 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) when using the `absolute-height` mode. [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries support all the elevation modes listed below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) + */ elevationInfo?: SceneLayerElevationInfo; + /** + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/latest/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) + */ featureReduction?: SceneLayerFeatureReduction; + /** + * An array of fields accessible in the layer. Depending on the scene service, fields may have limited support for certain capabilities. Use [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) to query the contexts (rendering, labeling, popups or querying) for which a particular field may be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) + */ fields?: FieldProperties[]; + /** + * The geometry type of features in the layer. **Possible Values:** point | mesh + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) + */ geometryType?: string; + /** + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. + * > **Known Limitations** This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. Each point can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) + */ labelingInfo?: LabelClassProperties[]; + /** + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) property. This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) + * + * @default false + */ labelsVisible?: boolean; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#legendEnabled) + * + * @default true + */ legendEnabled?: boolean; + /** + * The name of the field containing each graphic's Object ID. If this is not explicitly specified, this is automatically derived from the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) of the service by taking the first field of type `oid`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#objectIdField) + */ objectIdField?: string; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupEnabled) + * + * @default true + */ popupEnabled?: boolean; + /** + * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) + */ popupTemplate?: PopupTemplateProperties; + /** + * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer) + */ renderer?: RendererProperties; + /** + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#screenSizePerspectiveEnabled) + * + * @default true + */ screenSizePerspectiveEnabled?: boolean; } export interface SceneLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface SceneLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export interface SceneLayerElevationInfo { + + 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. + * + * Mode | Description + * ------|------------ + * on-the-ground | Graphics are draped on the terrain surface. This is the default value for features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [ObjectSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). + * relative-to-ground | The graphic is placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing up the terrain elevation, the `offset` value and the geometry's z-value (if present). This is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html). + * absolute-height | Graphics are placed at an absolute height above sea level. This height is determined by summing up the `offset` value and the geometry's z-value (if present). It doesn't take the elevation of the terrain into account. This is the default value for features with 3D Object geometries and [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#hasZ) is `true`. + * relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If present, z-values will be ignored. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) + */ mode: string; + /** + * An elevation offset which is added to the vertical position of the graphic. When `mode = "on-the-ground"`, this property has no effect. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) + * + * @default 0 + */ offset?: number; + /** + * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) + * + * @default meters + */ + unit?: string; } - export interface SceneLayerFeatureReduction { + + export interface SceneLayerFeatureReduction extends Object { + /** + * Type of the decluttering method. The only supported type at the moment is `"selection"`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) + */ type: string; } interface StreamLayer extends FeatureLayer { - filter: StreamLayerFilter; + /** + * Contains the attribute and spatial filters used to filter messages sent to the client by a Stream Service. This property can be set in the constructor but is `read-only` after the layer is created. To change the filter after the layer is created, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) + */ + readonly filter: StreamLayerFilter; + /** + * An extent object used to filter features. Only features intersecting the extent are displayed in the view. Instead of using this property, use [StreamLayer.filter.geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) when creating the service or [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) when changing the spatial filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#geometryDefinition) + */ geometryDefinition: Extent; + /** + * Maximum number of features to show per trackId + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#maximumTrackPoints) + */ maximumTrackPoints: number; + /** + * Options for purging stale features. Use these options to avoid overloading the browser with graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) + */ purgeOptions: StreamLayerPurgeOptions; + /** + * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) on the layer. The filter is updated on all views that contain the layer. If the input `filterChanges` object is `undefined` or `null`, the spatial and attribute filters are removed. To update the filter on a single layer view associated with the layer, use the [StreamLayerView.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) method after getting the layer view object. Filter changes only apply to incoming features. Features already displayed in the view are not filtered. Therefore, you may want to clear the graphics in the layer view prior to applying a new filter. To do so, get the layer view then call [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) on the [StreamLayerView.graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics). You may also filter features already present in the view using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. See the examples below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) + * + * @param filterChanges Updates the spatial and attribute [filters](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) on the layer and all of its associated views. If `null`, all filters are cleared. + * @param filterChanges.geometry A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view(s). If `null`, the spatial filter is cleared. + * @param filterChanges.where A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. + * + */ updateFilter(filterChanges: StreamLayerUpdateFilterFilterChanges): IPromise; + on(name: "layerview-create", eventHandler: StreamLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: StreamLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: StreamLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: StreamLayerLayerviewDestroyEventHandler): IHandle; } interface StreamLayerConstructor { + /** + * The stream layer extends the feature layer to add the ability to connect to a stream of data using HTML5 WebSockets. It connects to a server that emits geographic features continuously. While the feature layer is used to map relatively static data, the stream layer is suitable when you would like to map dynamic streams of data that are unbounded and continuous. When a stream layer is added to a map, users are able to see real-time updates pushed out by the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) + */ + new(properties?: StreamLayerProperties): StreamLayer; fromJSON(json: any): StreamLayer; @@ -2376,44 +9052,116 @@ declare namespace __esri { export const StreamLayer: StreamLayerConstructor; interface StreamLayerProperties extends FeatureLayerProperties { + /** + * Contains the attribute and spatial filters used to filter messages sent to the client by a Stream Service. This property can be set in the constructor but is `read-only` after the layer is created. To change the filter after the layer is created, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) + */ filter?: StreamLayerFilter; + /** + * An extent object used to filter features. Only features intersecting the extent are displayed in the view. Instead of using this property, use [StreamLayer.filter.geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) when creating the service or [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) when changing the spatial filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#geometryDefinition) + */ geometryDefinition?: ExtentProperties; + /** + * Maximum number of features to show per trackId + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#maximumTrackPoints) + */ maximumTrackPoints?: number; + /** + * Options for purging stale features. Use these options to avoid overloading the browser with graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) + */ purgeOptions?: StreamLayerPurgeOptions; } export interface StreamLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface StreamLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export interface StreamLayerFilter { + + export interface StreamLayerFilter extends Object { + /** + * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) + */ geometry?: Extent; + /** + * A SQL where clause used to filter features by attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) + */ where?: string; } - export interface StreamLayerPurgeOptions { + + export interface StreamLayerPurgeOptions extends Object { + /** + * The maximum number of features to display. Excess features are purged from the beginning of the graphics array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) + */ displayCount: number; + /** + * The maximum time in minutes that a feature should be kept. After this time, the feature is removed from the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) + */ age: number; } - export interface StreamLayerUpdateFilterFilterChanges { + + export interface StreamLayerUpdateFilterFilterChanges extends Object { + /** + * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view(s). If `null`, the spatial filter is cleared. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) + */ geometry: Extent; + /** + * A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) + */ where: string; } interface CodedValueDomain extends Domain { + /** + * An array of the coded values in the domain. See the object specification table below for the properties each item in the array should contain. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) + */ codedValues: CodedValueDomainCodedValues[]; + /** + * Returns the name of the coded-value associated with the specified code. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#getName) + * + * @param code The code associated with the desired name. + * + */ getName(code: string | number): string; } interface CodedValueDomainConstructor { + + new(properties?: CodedValueDomainProperties): CodedValueDomain; fromJSON(json: any): CodedValueDomain; @@ -2422,35 +9170,99 @@ declare namespace __esri { export const CodedValueDomain: CodedValueDomainConstructor; interface CodedValueDomainProperties extends DomainProperties { + /** + * An array of the coded values in the domain. See the object specification table below for the properties each item in the array should contain. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) + */ codedValues?: CodedValueDomainCodedValues[]; } - export interface CodedValueDomainCodedValues { + + export interface CodedValueDomainCodedValues extends Object { + /** + * The name of the coded value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) + */ name: string; + /** + * The value of the code. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) + */ code: string | number; } interface DimensionalDefinition { + /** + * The dimension associated with the variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#dimensionName) + */ dimensionName: string; + /** + * Indicates whether the values indicate slices (rather than ranges). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#isSlice) + * + * @default false + */ isSlice: boolean; + /** + * An array of tuples [min, max] each defining a range of valid values along the specified dimension. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#values) + */ values: any[]; + /** + * The variable name by which to filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#variableName) + */ variableName: string; + /** + * Returns a serialized JSON object representation of the dimensional definition in the format of the ArcGIS Platform. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#toJSON) + * + * + */ toJSON(): any; } interface DimensionalDefinitionConstructor { + /** + * A dimensional definition defines a filter based on one variable and one dimension. You can filter with one or multiple dimensional slices. Instances of this class are typically used when filtering data based on [slices](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#isSlice) or ranges in one or more dimensions with [MosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html) + */ + + new(properties?: any): DimensionalDefinition; } export const DimensionalDefinition: DimensionalDefinitionConstructor; interface Domain extends Accessor, JSONSupport { + /** + * The domain name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#name) + */ name: string; + /** + * The domain type. **Possible Values:** range | coded-value | inherited + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#type) + */ type: string; } interface DomainConstructor { + + new(properties?: DomainProperties): Domain; fromJSON(json: any): Domain; @@ -2459,19 +9271,56 @@ declare namespace __esri { export const Domain: DomainConstructor; interface DomainProperties { + /** + * The domain name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#name) + */ name?: string; + /** + * The domain type. **Possible Values:** range | coded-value | inherited + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#type) + */ type?: string; } interface FeatureTemplate extends Accessor, JSONSupport { + /** + * Description of the feature template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description) + */ description: string; + /** + * Name of the default drawing tool defined for the template to create a feature. **Known Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#drawingTool) + */ drawingTool: string; + /** + * Name of the feature template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name) + */ name: string; + /** + * An instance of the prototypical feature described by the [feature template](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html). It specifies default values for the attribute fields and does not contain geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#prototype) + */ prototype: any; + /** + * An object used to create a thumbnail image that represents a feature type in the feature template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) + */ thumbnail: FeatureTemplateThumbnail; } interface FeatureTemplateConstructor { + + new(properties?: FeatureTemplateProperties): FeatureTemplate; fromJSON(json: any): FeatureTemplate; @@ -2480,28 +9329,96 @@ declare namespace __esri { export const FeatureTemplate: FeatureTemplateConstructor; interface FeatureTemplateProperties { + /** + * Description of the feature template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description) + */ description?: string; + /** + * Name of the default drawing tool defined for the template to create a feature. **Known Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#drawingTool) + */ drawingTool?: string; + /** + * Name of the feature template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name) + */ name?: string; + /** + * An instance of the prototypical feature described by the [feature template](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html). It specifies default values for the attribute fields and does not contain geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#prototype) + */ prototype?: any; + /** + * An object used to create a thumbnail image that represents a feature type in the feature template. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) + */ thumbnail?: FeatureTemplateThumbnail; } - export interface FeatureTemplateThumbnail { + + export interface FeatureTemplateThumbnail extends Object { + /** + * The MIME type of the image. **Known Values:** image | png | jpg | jpeg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) + */ contentType: any; + /** + * The [base64EncodedImageData](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding) presenting the thumbnail image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) + */ imageData: string; + /** + * The height of the thumbnail. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) + */ height: number; + /** + * The width of the thumbnail. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) + */ width: number; } interface FeatureType extends Accessor, JSONSupport { + /** + * Domains associated with the feature type. It is an object where the name of each property corresponds with the name of a field containing a domain. If a field's domain is an instance of [InheritedDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-InheritedDomain.html), the application will use the domain defined for the field from the layer. If the domain is an instance of [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) then the domain is defined specifically for the given feature type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#domains) + */ domains: any; + /** + * The feature type identifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#id) + */ id: number | string; + /** + * The feature type name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#name) + */ name: string; + /** + * Array of [feature templates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) associated with the feature type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#templates) + */ templates: FeatureTemplate[]; } interface FeatureTypeConstructor { + + new(properties?: FeatureTypeProperties): FeatureType; fromJSON(json: any): FeatureType; @@ -2510,23 +9427,80 @@ declare namespace __esri { export const FeatureType: FeatureTypeConstructor; interface FeatureTypeProperties { + /** + * Domains associated with the feature type. It is an object where the name of each property corresponds with the name of a field containing a domain. If a field's domain is an instance of [InheritedDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-InheritedDomain.html), the application will use the domain defined for the field from the layer. If the domain is an instance of [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) then the domain is defined specifically for the given feature type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#domains) + */ domains?: any; + /** + * The feature type identifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#id) + */ id?: number | string; + /** + * The feature type name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#name) + */ name?: string; + /** + * Array of [feature templates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) associated with the feature type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#templates) + */ templates?: FeatureTemplateProperties[]; } interface Field extends Accessor, JSONSupport { + /** + * The alias name for the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) + */ alias: string; + /** + * The domain associated with the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#domain) + */ domain: Domain; + /** + * Indicates whether the field is editable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#editable) + */ editable: boolean; + /** + * The field length. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#length) + */ length: number; + /** + * The name of the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#name) + */ name: string; + /** + * Indicates if the field can accept `null` values. *Requires ArcGIS Server version 10.1 or greater.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#nullable) + */ nullable: boolean; + /** + * The data type of the field. **Possible Values:** small-integer | integer | single | double | long | string | date | oid | geometry | blob | raster | guid | global-id | xml + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type) + */ type: string; } interface FieldConstructor { + + new(properties?: FieldProperties): Field; fromJSON(json: any): Field; @@ -2535,46 +9509,202 @@ declare namespace __esri { export const Field: FieldConstructor; interface FieldProperties { + /** + * The alias name for the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) + */ alias?: string; + /** + * The domain associated with the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#domain) + */ domain?: DomainProperties; + /** + * Indicates whether the field is editable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#editable) + */ editable?: boolean; + /** + * The field length. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#length) + */ length?: number; + /** + * The name of the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#name) + */ name?: string; + /** + * Indicates if the field can accept `null` values. *Requires ArcGIS Server version 10.1 or greater.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#nullable) + */ nullable?: boolean; + /** + * The data type of the field. **Possible Values:** small-integer | integer | single | double | long | string | date | oid | geometry | blob | raster | guid | global-id | xml + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type) + */ type?: string; } interface ImageParameters extends Accessor { + /** + * Dots per inch setting for an module:esri/layersMapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#dpi) + * + * @default 96 + */ dpi: number; + /** + * Extent of map to be exported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#extent) + */ extent: Extent; + /** + * Map image format. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#format) + * + * @default png8 + */ format: string; + /** + * Requested image height in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#height) + */ height: number; + /** + * Spatial reference of exported map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#imageSpatialReference) + */ imageSpatialReference: SpatialReference; + /** + * Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. Layer definitions with semicolons or colons are supported if using a map service published using ArcGIS Server 10 or later. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerDefinitions) + */ layerDefinitions: string[]; + /** + * A list of layer IDs, that represent which layers to include in the exported map. Use in combination with [layerOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) to specify how layer visibility is handled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerIds) + */ layerIds: number[]; + /** + * The option for displaying or hiding the layer. **Known Values:** show | hide | include | exclude + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) + */ layerOption: string; + /** + * Indicates whether or not the background of the dynamic image is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#transparent) + * + * @default true + */ transparent: boolean; + /** + * Requested image width in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#width) + */ width: number; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#toJSON) + * + * + */ toJSON(): any; } interface ImageParametersConstructor { + + new(properties?: ImageParametersProperties): ImageParameters; } export const ImageParameters: ImageParametersConstructor; interface ImageParametersProperties { + /** + * Dots per inch setting for an module:esri/layersMapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#dpi) + * + * @default 96 + */ dpi?: number; + /** + * Extent of map to be exported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#extent) + */ extent?: ExtentProperties; + /** + * Map image format. **Known Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#format) + * + * @default png8 + */ format?: string; + /** + * Requested image height in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#height) + */ height?: number; + /** + * Spatial reference of exported map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#imageSpatialReference) + */ imageSpatialReference?: SpatialReferenceProperties; + /** + * Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. Layer definitions with semicolons or colons are supported if using a map service published using ArcGIS Server 10 or later. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerDefinitions) + */ layerDefinitions?: string[]; + /** + * A list of layer IDs, that represent which layers to include in the exported map. Use in combination with [layerOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) to specify how layer visibility is handled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerIds) + */ layerIds?: number[]; + /** + * The option for displaying or hiding the layer. **Known Values:** show | hide | include | exclude + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) + */ layerOption?: string; + /** + * Indicates whether or not the background of the dynamic image is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#transparent) + * + * @default true + */ transparent?: boolean; + /** + * Requested image width in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#width) + */ width?: number; } @@ -2582,6 +9712,8 @@ declare namespace __esri { } interface InheritedDomainConstructor { + + new(properties?: InheritedDomainProperties): InheritedDomain; fromJSON(json: any): InheritedDomain; @@ -2594,20 +9726,53 @@ declare namespace __esri { } interface KMLSublayer extends Accessor, JSONSupport { + /** + * Description for the KML sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#description) + */ description: string; + /** + * The id for the KML sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#id) + */ id: number; + /** + * The [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to which the sublayer belongs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#layer) + */ layer: KMLLayer; - mapImages: Collection; - networkLink: KMLSublayerNetworkLink; - points: Collection; - polygons: Collection; - polylines: Collection; + /** + * Network link info for the current layer. A link info object with properties that describe the network link. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#networkLink) + */ + networkLink: any; + /** + * A collection of [KMLSublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#sublayers) + */ sublayers: Collection; + /** + * The title of the KML sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#title) + */ title: string; + /** + * Indicates if the sublayer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#visible) + */ visible: boolean; } interface KMLSublayerConstructor { + + new(properties?: KMLSublayerProperties): KMLSublayer; fromJSON(json: any): KMLSublayer; @@ -2616,47 +9781,122 @@ declare namespace __esri { export const KMLSublayer: KMLSublayerConstructor; interface KMLSublayerProperties { + /** + * Description for the KML sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#description) + */ description?: string; + /** + * The id for the KML sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#id) + */ id?: number; + /** + * The [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to which the sublayer belongs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#layer) + */ layer?: KMLLayerProperties; - mapImages?: CollectionProperties; - networkLink?: KMLSublayerNetworkLink; - points?: CollectionProperties; - polygons?: CollectionProperties; - polylines?: CollectionProperties; + /** + * Network link info for the current layer. A link info object with properties that describe the network link. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#networkLink) + */ + networkLink?: any; + /** + * A collection of [KMLSublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#sublayers) + */ sublayers?: CollectionProperties; + /** + * The title of the KML sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#title) + */ title?: string; + /** + * Indicates if the sublayer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#visible) + */ visible?: boolean; } - export interface KMLSublayerNetworkLink { - id: number; - name: string; - description: string; - visibility: number; - refreshMode: string; - refreshInterval: number; - viewRefreshMode: string; - viewRefreshTime: number; - viewBoundScale: number; - viewFormat: string; - httpQuery: string; - } - interface LabelClass extends Accessor, JSONSupport { + /** + * Defines the content of label text for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). If working with [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), use [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) instead. Attribute values may be included in labels using SQL syntax. To include an attribute value in a label, wrap the name of the field in square brackets `[]`. See the example snippet below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) + */ labelExpression: string; + /** + * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. Attribute values may be included in label expressions. To include an attribute value in a label, wrap the name of the field in curly braces. See the example snippet below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) + */ labelExpressionInfo: LabelClassLabelExpressionInfo; + /** + * The position of the label. Known values are based on the feature type. This property requires a value for labels to be visible. **Known Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Known Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Known Values (Polygons):** always-horizontal + * > **Known Limitations** Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) then only "above-center" is supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) + */ labelPlacement: string; + /** + * The maximum scale to show labels. The value of maxScale should always be less than the value of [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale). If the value is `0`, then the label's visibility isn't dependent on maximum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) + * + * @default 0 + */ maxScale: number; + /** + * The minimum scale to show labels. The value of minScale should always be greater than the value of [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale). If the value of this property is `0`, then the visibility of labels isn't dependent on minimum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) + * + * @default 0 + */ minScale: number; + /** + * Defines the symbol used for rendering the label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#symbol) + */ symbol: TextSymbol | LabelSymbol3D; + /** + * Indicates whether to use domain names if the fields in the [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) or [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) have domains. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#useCodedValues) + */ useCodedValues: boolean; + /** + * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) + */ where: string; + /** + * Creates a deep clone of the LabelClass. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#clone) + * + * + */ clone(): LabelClass; } interface LabelClassConstructor { + /** + * Defines label expressions, symbols, scale ranges, label priorities, and sets of label placement options for different groups of labels on a layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) + */ + new(properties?: LabelClassProperties): LabelClass; fromJSON(json: any): LabelClass; @@ -2665,29 +9905,107 @@ declare namespace __esri { export const LabelClass: LabelClassConstructor; interface LabelClassProperties { + /** + * Defines the content of label text for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). If working with [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), use [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) instead. Attribute values may be included in labels using SQL syntax. To include an attribute value in a label, wrap the name of the field in square brackets `[]`. See the example snippet below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) + */ labelExpression?: string; + /** + * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. Attribute values may be included in label expressions. To include an attribute value in a label, wrap the name of the field in curly braces. See the example snippet below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) + */ labelExpressionInfo?: LabelClassLabelExpressionInfo; + /** + * The position of the label. Known values are based on the feature type. This property requires a value for labels to be visible. **Known Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Known Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Known Values (Polygons):** always-horizontal + * > **Known Limitations** Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) then only "above-center" is supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) + */ labelPlacement?: string; + /** + * The maximum scale to show labels. The value of maxScale should always be less than the value of [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale). If the value is `0`, then the label's visibility isn't dependent on maximum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) + * + * @default 0 + */ maxScale?: number; + /** + * The minimum scale to show labels. The value of minScale should always be greater than the value of [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale). If the value of this property is `0`, then the visibility of labels isn't dependent on minimum scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) + * + * @default 0 + */ minScale?: number; + /** + * Defines the symbol used for rendering the label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#symbol) + */ symbol?: TextSymbolProperties | LabelSymbol3DProperties; + /** + * Indicates whether to use domain names if the fields in the [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) or [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) have domains. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#useCodedValues) + */ useCodedValues?: boolean; + /** + * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) + */ where?: string; } - export interface LabelClassLabelExpressionInfo { + + export interface LabelClassLabelExpressionInfo extends Object { + /** + * The expression defining the content of the label text. **Deprecated as of v4.5. Use `expression` instead.** + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) + */ value?: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that evaluates to a string used to label features in the layer. The most simple expressions return field values. For example, to label a layer of cities with their names, simply reference the field value with the global variable: `$feature.CITY_NAME`. Expressions can be more sophisticated and use logical functions. This may be useful if you want to use classed labels. For example, the following expression appends `city` to the end of the label if the feature's population field contains a number greater than 10,000. Otherwise, `town` is appended to the end of the label. `IIF($feature.POPULATION > 10000, $feature.NAME + ' city', $feature.NAME + ' town')` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) + */ expression: string; } interface LOD extends Accessor, JSONSupport { + /** + * ID for each level. The top most level is `0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#level) + */ level: number; + /** + * String to be used when constructing a URL to access a tile from this LOD. If `levelValue` is not defined, level will be used for the tile access URL. This property is useful when an LOD object represents a WMTS TileMatrix with non-numeric matrix identifiers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#levelValue) + */ levelValue: string; + /** + * Resolution in map units of each pixel in a tile for each level. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#resolution) + */ resolution: number; + /** + * Scale for each level. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#scale) + */ scale: number; } interface LODConstructor { + + new(properties?: LODProperties): LOD; fromJSON(json: any): LOD; @@ -2696,23 +10014,84 @@ declare namespace __esri { export const LOD: LODConstructor; interface LODProperties { + /** + * ID for each level. The top most level is `0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#level) + */ level?: number; + /** + * String to be used when constructing a URL to access a tile from this LOD. If `levelValue` is not defined, level will be used for the tile access URL. This property is useful when an LOD object represents a WMTS TileMatrix with non-numeric matrix identifiers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#levelValue) + */ levelValue?: string; + /** + * Resolution in map units of each pixel in a tile for each level. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#resolution) + */ resolution?: number; + /** + * Scale for each level. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#scale) + */ scale?: number; } interface MapImage extends Accessor, JSONSupport { + /** + * The extent of the exported map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#extent) + */ extent: Extent; + /** + * The requested image height in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#height) + */ height: number; + /** + * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Known Values:** gif | jpg | png | bmp + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#href) + */ href: string; + /** + * The opacity of the image. Value can be any number between `0` and `1` where `0` is 100% transparent, `0.5` is 50% transparent and `1` is fully opaque. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#opacity) + * + * @default 1 + */ opacity: number; + /** + * Scale of the requested dynamic map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#scale) + */ scale: number; + /** + * Indicates if the requested image is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#visible) + * + * @default true + */ visible: boolean; + /** + * The requested image width in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#width) + */ width: number; } interface MapImageConstructor { + + new(properties?: MapImageProperties): MapImage; fromJSON(json: any): MapImage; @@ -2721,29 +10100,126 @@ declare namespace __esri { export const MapImage: MapImageConstructor; interface MapImageProperties { + /** + * The extent of the exported map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#extent) + */ extent?: ExtentProperties; + /** + * The requested image height in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#height) + */ height?: number; + /** + * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Known Values:** gif | jpg | png | bmp + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#href) + */ href?: string; + /** + * The opacity of the image. Value can be any number between `0` and `1` where `0` is 100% transparent, `0.5` is 50% transparent and `1` is fully opaque. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#opacity) + * + * @default 1 + */ opacity?: number; + /** + * Scale of the requested dynamic map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#scale) + */ scale?: number; + /** + * Indicates if the requested image is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#visible) + * + * @default true + */ visible?: boolean; + /** + * The requested image width in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#width) + */ width?: number; } interface MosaicRule extends Accessor, JSONSupport { + /** + * Indicates whether the sort should be ascending. This property applies to all mosaic [methods](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) where an ordering is defined except `seamline`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#ascending) + * + * @default true + */ ascending: boolean; + /** + * An array of raster Ids. All the rasters with the given list of raster Ids are selected to participate in the mosaic. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel size range of the locked rasters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#lockRasterIds) + */ lockRasterIds: number[]; + /** + * The mosaic method determines how the selected rasters are ordered. **Known Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) + */ method: string; + /** + * A multiple dimensional service can have multiple dimensions for one or more variables. Use multiDimensionalDefinitions to filter data based on a slice or range of data. For example, a single ImageryLayer may have a `depth` dimension storing sea temperatures for the same pixel location at various depths. Another dimension could be `time`, where the same pixel stores multiple values based on a window of time. This property can be used to filter and display ImageryLayer pixels for specific "slices" in those dimensions (e.g. display sea temperature at 1000m below sea level for a specific week in the year). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) + */ multidimensionalDefinition: DimensionalDefinition[]; + /** + * Defines a selection using a set of ObjectIDs. This property applies to all mosaic methods. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#objectIds) + */ objectIds: number[]; + /** + * Defines the mosaic operation used to resolve overlapping pixels. **Known Values:** first | last | min | max | mean | blend + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#operation) + */ operation: string; + /** + * The name of the attribute field that is used with a constant sortValue to define the mosaicking order when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. The ordering is defined by the absolute value of the difference between the specified sort field value and the sort base value. For example, if the sort field is `Month` and the sort value is `7 (July)`, then the ordering is defined by `ABS(Month -7)`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortField) + */ sortField: string; + /** + * A constant value defining a reference or base value for the sort field when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortValue) + */ sortValue: string; + /** + * Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#viewpoint) + */ viewpoint: Point; + /** + * The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#where) + */ where: string; } interface MosaicRuleConstructor { + /** + * Specifies the mosaic rule when defining how individual images should be mosaicked. It specifies selection, mosaic method, sort order, overlapping pixel resolution, etc. Mosaic rules are for mosaicking rasters in the mosaic dataset. A mosaic rule is used to define: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html) + */ + new(properties?: MosaicRuleProperties): MosaicRule; fromJSON(json: any): MosaicRule; @@ -2752,64 +10228,248 @@ declare namespace __esri { export const MosaicRule: MosaicRuleConstructor; interface MosaicRuleProperties { + /** + * Indicates whether the sort should be ascending. This property applies to all mosaic [methods](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) where an ordering is defined except `seamline`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#ascending) + * + * @default true + */ ascending?: boolean; + /** + * An array of raster Ids. All the rasters with the given list of raster Ids are selected to participate in the mosaic. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel size range of the locked rasters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#lockRasterIds) + */ lockRasterIds?: number[]; + /** + * The mosaic method determines how the selected rasters are ordered. **Known Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) + */ method?: string; + /** + * A multiple dimensional service can have multiple dimensions for one or more variables. Use multiDimensionalDefinitions to filter data based on a slice or range of data. For example, a single ImageryLayer may have a `depth` dimension storing sea temperatures for the same pixel location at various depths. Another dimension could be `time`, where the same pixel stores multiple values based on a window of time. This property can be used to filter and display ImageryLayer pixels for specific "slices" in those dimensions (e.g. display sea temperature at 1000m below sea level for a specific week in the year). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) + */ multidimensionalDefinition?: DimensionalDefinition[]; + /** + * Defines a selection using a set of ObjectIDs. This property applies to all mosaic methods. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#objectIds) + */ objectIds?: number[]; + /** + * Defines the mosaic operation used to resolve overlapping pixels. **Known Values:** first | last | min | max | mean | blend + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#operation) + */ operation?: string; + /** + * The name of the attribute field that is used with a constant sortValue to define the mosaicking order when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. The ordering is defined by the absolute value of the difference between the specified sort field value and the sort base value. For example, if the sort field is `Month` and the sort value is `7 (July)`, then the ordering is defined by `ABS(Month -7)`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortField) + */ sortField?: string; + /** + * A constant value defining a reference or base value for the sort field when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortValue) + */ sortValue?: string; + /** + * Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#viewpoint) + */ viewpoint?: PointProperties; + /** + * The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#where) + */ where?: string; } interface PixelBlock extends Accessor { + /** + * The height (or number of rows) of the PixelBlock in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) + */ height: number; + /** + * An array of numbers representing pixels to show and pixels to hide from the view. The length of this array is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). It's arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, .....]` where `p_xy` is the pixel value at the column `x` and row `y`. The mask is per pixel, not per band. Items in the mask array with a value of `0` indicates [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) to not display in the view at that index. Items with a value of `1` indicate to display the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) at there corresponding indices. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#mask) + */ mask: number[]; + /** + * A two dimensional array representing the pixels from the Image Service displayed on the client. The length of the first dimension is the same as the number of bands in the layer. The length of the second dimension is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). The length of each band is the same. The pixels in each band are arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, ...]` where `p_xy` is the pixel value at the column `x` and row `y`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) + */ pixels: number[][]; + /** + * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixelType) + */ pixelType: string; + /** + * An array of objects containing numeric statistical properties. Each object has the following specification if defined: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) + */ statistics: PixelBlockStatistics[]; + /** + * The width (or number of columns) of the PixelBlock in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width) + */ width: number; + /** + * Adds another plane to the PixelBlock. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) + * + * @param planeData The data to add to the PixelBlock. + * @param planeData.pixels A two dimensional array representing the pixels to add. + * @param planeData.statistics An array of objects containing numeric statistical properties. See [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) for details on the specifications of each object. + * + */ addData(planeData: PixelBlockAddDataPlaneData): void; + /** + * Returns pixels and masks using a single array in bip format (e.g. [p_00_r, p_00_g, p_00_b, p_00_a, p_10_r, p_10_g, p_10_b, p_10_a, .....]). Use this method to get an unsigned 8 bit pixel array. The result can be used to create a webgl texture. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBA) + * + * + */ getAsRGBA(): number[]; + /** + * Similar to [getAsRGBA](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBA), but returns floating point data. The result can be used to create a webgl texture (OES_texture_float). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getAsRGBAFloat) + * + * + */ getAsRGBAFloat(): number[]; + /** + * Returns the plane band count of the PixelBlock. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#getPlaneCount) + * + * + */ getPlaneCount(): number; } interface PixelBlockConstructor { + + new(properties?: PixelBlockProperties): PixelBlock; } export const PixelBlock: PixelBlockConstructor; interface PixelBlockProperties { + /** + * The height (or number of rows) of the PixelBlock in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) + */ height?: number; + /** + * An array of numbers representing pixels to show and pixels to hide from the view. The length of this array is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). It's arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, .....]` where `p_xy` is the pixel value at the column `x` and row `y`. The mask is per pixel, not per band. Items in the mask array with a value of `0` indicates [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) to not display in the view at that index. Items with a value of `1` indicate to display the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) at there corresponding indices. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#mask) + */ mask?: number[]; + /** + * A two dimensional array representing the pixels from the Image Service displayed on the client. The length of the first dimension is the same as the number of bands in the layer. The length of the second dimension is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). The length of each band is the same. The pixels in each band are arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, ...]` where `p_xy` is the pixel value at the column `x` and row `y`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) + */ pixels?: number[][]; + /** + * The pixel type. **Known Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixelType) + */ pixelType?: string; + /** + * An array of objects containing numeric statistical properties. Each object has the following specification if defined: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) + */ statistics?: PixelBlockStatistics[]; + /** + * The width (or number of columns) of the PixelBlock in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width) + */ width?: number; } - export interface PixelBlockAddDataPlaneData { + + export interface PixelBlockAddDataPlaneData extends Object { + /** + * A two dimensional array representing the pixels to add. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) + */ pixels: number[][]; + /** + * An array of objects containing numeric statistical properties. See [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) for details on the specifications of each object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#addData) + */ statistics: any[]; } - export interface PixelBlockStatistics { + + export interface PixelBlockStatistics extends Object { + /** + * The maximum pixel value in the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) + */ maxValue?: number; + /** + * The minimum pixel value in the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) + */ minValue?: number; + /** + * Value representing areas of no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) + */ noDataValue?: number; } interface RangeDomain extends Domain { + /** + * The maximum valid value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#maxValue) + */ maxValue: number; + /** + * The minimum valid value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#minValue) + */ minValue: number; } interface RangeDomainConstructor { + + new(properties?: RangeDomainProperties): RangeDomain; fromJSON(json: any): RangeDomain; @@ -2818,18 +10478,56 @@ declare namespace __esri { export const RangeDomain: RangeDomainConstructor; interface RangeDomainProperties extends DomainProperties { + /** + * The maximum valid value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#maxValue) + */ maxValue?: number; + /** + * The minimum valid value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#minValue) + */ minValue?: number; } interface RasterFunction extends Accessor, JSONSupport { + /** + * The arguments for the raster function. The structure depends on the function specified. See [raster functions](http://resources.arcgis.com/en/help/arcgis-rest-api/#/Raster_Function_Objects/02r3000000rv000000/) for a list of functions and their arguments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments) + */ functionArguments: any; + /** + * The raster function name. See [raster functions](http://resources.arcgis.com/en/help/arcgis-rest-api/#/Raster_Function_Objects/02r3000000rv000000/) for a list of functions and their arguments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionName) + */ functionName: string; + /** + * Defines the pixel type of the output image. **Known Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#outputPixelType) + * + * @default unknown + */ outputPixelType: string; + /** + * The variable name for the raster function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#variableName) + */ variableName: any; } interface RasterFunctionConstructor { + /** + * Specifies processing to be done to the image service. See [raster functions](http://resources.arcgis.com/en/help/arcgis-rest-api/#/Raster_Function_Objects/02r3000000rv000000/) for a list of functions and their [arguments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments). The following image shows a landcover ImageryLayer rendered with two chained client-side raster functions used to reclass pixel values (Remap) and assign each pixel a new color (Colormap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html) + */ + new(properties?: RasterFunctionProperties): RasterFunction; fromJSON(json: any): RasterFunction; @@ -2838,145 +10536,754 @@ declare namespace __esri { export const RasterFunction: RasterFunctionConstructor; interface RasterFunctionProperties { + /** + * The arguments for the raster function. The structure depends on the function specified. See [raster functions](http://resources.arcgis.com/en/help/arcgis-rest-api/#/Raster_Function_Objects/02r3000000rv000000/) for a list of functions and their arguments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments) + */ functionArguments?: any; + /** + * The raster function name. See [raster functions](http://resources.arcgis.com/en/help/arcgis-rest-api/#/Raster_Function_Objects/02r3000000rv000000/) for a list of functions and their arguments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionName) + */ functionName?: string; + /** + * Defines the pixel type of the output image. **Known Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#outputPixelType) + * + * @default unknown + */ outputPixelType?: string; + /** + * The variable name for the raster function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#variableName) + */ variableName?: any; } interface Sublayer extends Accessor { + /** + * A SQL where clause used to filter features in the image. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Definition expressions may be set when a sublayer is constructed prior to it loading in the view or after it has been added to the MapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) + */ definitionExpression: string; + /** + * The sublayer's layer ID. When a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) is not defined on the layer, this value represents the id of the sublayer defined by the map service. If creating a [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) or a [MapDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#MapDataLayer) and adding it to the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) property of the sublayer, the value of this property can be anything set by the developer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) + */ id: number; + /** + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) objects. Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) property of the sublayer must be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo) + */ labelingInfo: LabelClass[]; + /** + * Indicates if labels for the sublayer will be visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) + * + * @default false + */ labelsVisible: boolean; + /** + * The [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) to which the sublayer belongs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#layer) + */ layer: MapImageLayer; + /** + * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#legendEnabled) + * + * @default true + */ legendEnabled: boolean; + /** + * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The user or developer can only set `minScale` and `maxScale` if the new values are within the scale range defined in the map service. + * ```js + * // the service specifies minScale = 10000 and maxScale = 500000 + * + * // this is valid + * sublayer.minScale = 30000; + * sublayer.maxScale = 100000; + * + * // this is not valid because the values are + * // outside the range specified by the service + * sublayer.minScale = 5000; + * sublayer.maxScale = 1000000; + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) + */ maxScale: number; + /** + * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The user or developer can only set `minScale` and `maxScale` if the new values are within the scale range defined in the map service. + * ```js + * // the service specifies minScale = 10000 and maxScale = 500000 + * + * // this is valid + * sublayer.minScale = 30000; + * sublayer.maxScale = 100000; + * + * // this is not valid because the values are + * // outside the range specified by the service + * sublayer.minScale = 5000; + * sublayer.maxScale = 1000000; + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) + */ minScale: number; + /** + * The level of opacity to set on the sublayer on a scale from 0.0 - 1.0 where `0` is fully transparent and `1.0` is fully opaque. If the [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) is set, the actual opacity value of the sublayer will be the value of [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) multiplied by the sublayer's opacity. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#opacity) + */ opacity: number; + /** + * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) + */ popupTemplate: PopupTemplate; + /** + * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. + * > **Known Limitations** + * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not supported in renderers set on MapImageLayer sublayers. + * * [visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) are not supported in renderers set on MapImageLayer sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer) + */ renderer: Renderer; + /** + * An object that allows you to create a dynamic layer with data either from the map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) + */ source: DynamicMapLayer | DynamicDataLayer; + /** + * If a sublayer contains sublayers, this property is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects belonging to the given sublayer with sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) + */ sublayers: Collection; + /** + * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This value can be defined in the map service or programmatically by the developer. It can also be useful for finding a specific sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#title) + */ title: string; + /** + * The URL to the REST endpoint of the sublayer. This allows you to view the schema of fields and query tables located in registered workspaces. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#url) + */ url: string; + /** + * Indicates if the layer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) + */ visible: boolean; + /** + * Creates a deep clone of the sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#clone) + * + * + */ clone(): Sublayer; + /** + * Creates a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) object with default values representing the layer's state, including filters (definition expression) on the layer's features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createQuery) + * + * + */ createQuery(): Query; - queryFeatures(params?: Query): IPromise; + /** + * Executes a [query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) against features in the sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#queryFeatures) + * + * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then all features satisfying the layer's configuration/filters are returned. + * + */ + queryFeatures(params?: Query | QueryProperties): IPromise; } interface SublayerConstructor { + /** + * Represents a sublayer in a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). MapImageLayer allows you to display, query, and analyze layers from data defined in a [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm). Map services contain sublayers with properties such as [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer), [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo), and [definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression), and others that are defined on the server. The properties of each sublayer on the map service may be dynamically changed by the user or developer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) + */ + new(properties?: SublayerProperties): Sublayer; } export const Sublayer: SublayerConstructor; interface SublayerProperties { + /** + * A SQL where clause used to filter features in the image. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Definition expressions may be set when a sublayer is constructed prior to it loading in the view or after it has been added to the MapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) + */ definitionExpression?: string; + /** + * The sublayer's layer ID. When a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) is not defined on the layer, this value represents the id of the sublayer defined by the map service. If creating a [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) or a [MapDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#MapDataLayer) and adding it to the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) property of the sublayer, the value of this property can be anything set by the developer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) + */ id?: number; + /** + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) objects. Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) property of the sublayer must be `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo) + */ labelingInfo?: LabelClassProperties[]; + /** + * Indicates if labels for the sublayer will be visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) + * + * @default false + */ labelsVisible?: boolean; + /** + * The [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) to which the sublayer belongs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#layer) + */ layer?: MapImageLayerProperties; + /** + * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#legendEnabled) + * + * @default true + */ legendEnabled?: boolean; + /** + * The maximum scale at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The user or developer can only set `minScale` and `maxScale` if the new values are within the scale range defined in the map service. + * ```js + * // the service specifies minScale = 10000 and maxScale = 500000 + * + * // this is valid + * sublayer.minScale = 30000; + * sublayer.maxScale = 100000; + * + * // this is not valid because the values are + * // outside the range specified by the service + * sublayer.minScale = 5000; + * sublayer.maxScale = 1000000; + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) + */ maxScale?: number; + /** + * The minimum scale at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The user or developer can only set `minScale` and `maxScale` if the new values are within the scale range defined in the map service. + * ```js + * // the service specifies minScale = 10000 and maxScale = 500000 + * + * // this is valid + * sublayer.minScale = 30000; + * sublayer.maxScale = 100000; + * + * // this is not valid because the values are + * // outside the range specified by the service + * sublayer.minScale = 5000; + * sublayer.maxScale = 1000000; + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) + */ minScale?: number; + /** + * The level of opacity to set on the sublayer on a scale from 0.0 - 1.0 where `0` is fully transparent and `1.0` is fully opaque. If the [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) is set, the actual opacity value of the sublayer will be the value of [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) multiplied by the sublayer's opacity. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#opacity) + */ opacity?: number; + /** + * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) + */ popupTemplate?: PopupTemplateProperties; + /** + * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. + * > **Known Limitations** + * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not supported in renderers set on MapImageLayer sublayers. + * * [visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) are not supported in renderers set on MapImageLayer sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer) + */ renderer?: RendererProperties; + /** + * An object that allows you to create a dynamic layer with data either from the map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) + */ source?: DynamicMapLayer | DynamicDataLayer; + /** + * If a sublayer contains sublayers, this property is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects belonging to the given sublayer with sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) + */ sublayers?: CollectionProperties; + /** + * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This value can be defined in the map service or programmatically by the developer. It can also be useful for finding a specific sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#title) + */ title?: string; + /** + * The URL to the REST endpoint of the sublayer. This allows you to view the schema of fields and query tables located in registered workspaces. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#url) + */ url?: string; + /** + * Indicates if the layer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) + */ visible?: boolean; } - export interface DynamicDataLayer { + /** + * A dynamic data layer is a layer created on-the-fly with data stored in a [registered workspace](https://server.arcgis.com/en/server/latest/publish-services/windows/overview-register-data-with-arcgis-server.htm). This is data that can be rendered and queried on the fly, but that isn't explicitly exposed as a service sublayer. Depending on the type of data source, these layers are classified as one of the following: + * + * Data source | Description + * ------------|------------ + * [TableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) | A feature class with geometries or table without geometries. When a table data source does not contain geometries, it may be used as one of the sources in a [join operation](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource). Feature class tables may be used on their own since they contain a geometry field. + * [QueryTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) | A feature class or table that may be queried on the fly with a SQL where clause. This data source is useful for scenarios where you have a table containing unique geometries and another table with multiple records that match to each geometry. You can use the QueryTableDataSource to select only a subset of those matching records (so records in both tables have a one-to-one relationship with each other) and join them to the table with geometries. + * [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) | A raster dataset used for visualization purposes only. + * [JoinTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) | This data source consists of two data sources joined by a common attribute or key. The left table data source typically contains geometries, while the right source may be a table or query table without geometries. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) + */ + export interface DynamicDataLayer extends Object { + /** + * This value is always `data-layer` and is inferred when the `dataSource` property is set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) + */ type: string; + /** + * A table, feature class, or raster that resides in a registered workspace (either a folder or geodatabase). The data sources are not visible in the Services Directory by default. They may be viewed, published, and configured using the ArcGIS Server Manager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) + */ dataSource: TableDataSource | QueryTableDataSource | RasterDataSource | JoinTableDataSource; + /** + * Controls field visibility in the layer. Only specified fields will be visible. If `null`, all fields are visible in the dynamic layer. The specification for a field object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) + */ fields: DynamicDataLayerFields[]; } - export interface DynamicMapLayer { + /** + * A dynamic map layer refers to a layer published in a map service that has dynamic layers enabled. This layer type may be used to create multiple [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) that point to the same service layer, but are assigned different definition expressions, renderers, and other properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) + */ + export interface DynamicMapLayer extends Object { + /** + * This value is always `map-layer` and is inferred when the `mapLayerId` property is set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) + */ type: string; + /** + * The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) of the service sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) + */ mapLayerId: number; + /** + * An optional property for specifying the GDB version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) + */ gdbVersion: string; } - export interface JoinTableDataSource { + /** + * The result of an on-the-fly join operation at runtime. Nested joins are supported. To use nested joins, set either `leftTableSource` or `rightTableSource` to `join-table`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) + */ + export interface JoinTableDataSource extends Object { + /** + * This value is always `join-table` and is inferred when other join table properties of this object are set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) + */ type: string; + /** + * The field name used for joining or matching records in the left table to records in the right table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) + */ leftTableKey: string; + /** + * The field name used for joining or matching records in the right table to records in the left table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) + */ rightTableKey: string; + /** + * The left table for joining to the right table source. This can either be a dynamic map layer or a dynamic data layer. The dynamic data layer may contain another join data source used for nested joining. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) + */ leftTableSource: DynamicMapLayer | DynamicDataLayer; + /** + * The right table for joining to the left table source. This can either be a dynamic map layer or a dynamic data layer. The dynamic data layer may contain another join data source used for nested joining. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) + */ rightTableSource: DynamicMapLayer | DynamicDataLayer; + /** + * The type of join that will be performed. + * + * Possible Value | Description + * ---------------|------------ + * left-outer-join | Unmatched records in the left table source are preserved and joined with `null` values in the right table source. + * left-inner-join | Records in the left table source are discarded if they are unmatched with records in the right table source. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) + */ joinType: string; } - export interface QueryTableDataSource { + /** + * A query table is a feature class or table defined by a SQL query on the fly. Query layers allow both spatial and nonspatial information stored in a database to be easily integrated into map service operations. Since a query table uses SQL to directly query database tables and views, spatial information used by a query table is not required to be in a geodatabase. This data source is useful for scenarios where you have a table containing multiple records that match to a single geometry in either another table or a map service layer. You can use the QueryTableDataSource to select only a subset of those matching records and join them to the table with geometries so records in both tables have a one-to-one relationship with each other. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) + */ + export interface QueryTableDataSource extends Object { + /** + * This value is always `query-table` and is inferred when the `query` property of this object is set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) + */ type: string; + /** + * The workspace where the data resides (defined in ArcGIS Server Manager). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) + */ workspaceId: string; + /** + * The SQL query used to filter records. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) + */ query: string; + /** + * The field name(s) containing the unique IDs for each record in the table. This can be a comma separated list if the query table is used in a [JoinTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinDataTableSource). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) + */ oidFields: string; + /** + * The spatial reference of the geometry of each feature in the table source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) + */ spatialReference: SpatialReference; + /** + * The geometry type of each record in the table. **Possible Values:** point | multipoint | polyline | polygon | multipatch + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) + */ geometryType: string; } - export interface RasterDataSource { + /** + * A file-based raster that resides in a registered raster workspace. The raster may only be displayed in the view, not queried or assigned a renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) + */ + export interface RasterDataSource extends Object { + /** + * This value is always `raster`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) + */ type: string; + /** + * The workspace where the raster resides as defined in the ArcGIS Server Manager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) + */ workspaceId: string; + /** + * The name of the raster in the registered workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) + */ dataSourceName: string; } - export interface TableDataSource { + /** + * A table or feature class that resides in a registered workspace (either a folder or geodatabase). In the case of a geodatabase, if versioned, use `version` to switch to an alternate geodatabase version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) + */ + export interface TableDataSource extends Object { + /** + * This value is always `table`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) + */ type: string; + /** + * The workspace where the table resides as defined in the ArcGIS Server Manager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) + */ workspaceId: string; + /** + * The name of the table in the registered workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) + */ dataSourceName: string; + /** + * References the geodatabase version if multiple versions exist in the geodatabase. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) + */ gdbVersion: string; } - export interface DynamicDataLayerFields { + + export interface DynamicDataLayerFields extends Object { + /** + * The name of the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) + */ name: string; + /** + * The alias of the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) + */ alias: string; } interface TileInfo extends Accessor, JSONSupport { + /** + * The dots per inch (DPI) of the tiling scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#dpi) + */ dpi: number; + /** + * Image format of the cached tiles. **Possible Values:** png | png24 | png32 | jpg | dib | tiff | emf | ps | pdf | gif | svg | svgz | mixed | lerc + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#format) + */ format: string; + /** + * Indicates if the tiling scheme supports wrap around. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#isWrappable) + */ isWrappable: boolean; + /** + * An array of levels of detail that define the tiling scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) + */ lods: LOD[]; + /** + * The tiling scheme origin. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#origin) + */ origin: Point; + /** + * Size of tiles in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#size) + */ size: number[]; + /** + * The spatial reference of the tiling schema. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#spatialReference) + */ spatialReference: SpatialReference; + + /** + * Utility method used to convert a scale value to its corresponding zoom value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#scaleToZoom) + * + * @param scale The scale value to convert. + * + */ + scaleToZoom(scale: number): number; + /** + * Utility method used to convert a zoom value to its corresponding scale value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#zoomToScale) + * + * @param zoom The zoom value to convert. + * + */ + zoomToScale(zoom: number): number; } interface TileInfoConstructor { + + new(properties?: TileInfoProperties): TileInfo; + + /** + * A convenience method used to create a new TileInfo instance with preset properties like [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods). Optionally, properties such as `size`, `scales[]`, and a `[SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html)` can also be set to calculate [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) for each TileInfo. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) + * + * @param options An object that contains the size, scales, and/or [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) used to compute the new TileInfo instance. + * @param options.size The size of each tile in pixels. + * @param options.spatialReference The spatial reference for the new TileInfo instance. If the spatial reference is not WGS84 nor WebMercator, the origin of the TileInfo is `0.0`. + * @param options.scales An array of scale values to use for the TileInfo. If none are specified, the scales from the [ArcGIS Online basemaps](https://www.arcgis.com/home/group.html?id=702026e41f6641fb85da88efe79dc166#overview) are used from level 0 through 24. + * + */ + create(options?: TileInfoCreateOptions): TileInfo; + fromJSON(json: any): TileInfo; } export const TileInfo: TileInfoConstructor; interface TileInfoProperties { + /** + * The dots per inch (DPI) of the tiling scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#dpi) + */ dpi?: number; + /** + * Image format of the cached tiles. **Possible Values:** png | png24 | png32 | jpg | dib | tiff | emf | ps | pdf | gif | svg | svgz | mixed | lerc + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#format) + */ format?: string; + /** + * Indicates if the tiling scheme supports wrap around. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#isWrappable) + */ isWrappable?: boolean; + /** + * An array of levels of detail that define the tiling scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) + */ lods?: LODProperties[]; + /** + * The tiling scheme origin. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#origin) + */ origin?: PointProperties; + /** + * Size of tiles in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#size) + */ size?: number[]; + /** + * The spatial reference of the tiling schema. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; } + + export interface TileInfoCreateOptions extends Object { + /** + * The size of each tile in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) + * + * @default 256 + */ + size?: number; + /** + * The spatial reference for the new TileInfo instance. If the spatial reference is not WGS84 nor WebMercator, the origin of the TileInfo is `0.0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) + * + * @default WebMercator + */ + spatialReference?: SpatialReference; + /** + * An array of scale values to use for the TileInfo. If none are specified, the scales from the [ArcGIS Online basemaps](https://www.arcgis.com/home/group.html?id=702026e41f6641fb85da88efe79dc166#overview) are used from level 0 through 24. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) + * + * @default The scales provided by ArcGIS Online basemaps + */ + scales?: number[]; + } + interface TileMatrixSet extends Accessor, JSONSupport { + /** + * The full extent of the TileMatrixSet. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#fullExtent) + */ fullExtent: Extent; + /** + * The unique ID assigned to the TileMatrixSet. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#id) + */ id: string; + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#tileInfo) + */ tileInfo: TileInfo; + /** + * Creates a deep clone of this TileMatrixSet. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#clone) + * + * + */ clone(): TileMatrixSet; } interface TileMatrixSetConstructor { + + new(properties?: TileMatrixSetProperties): TileMatrixSet; fromJSON(json: any): TileMatrixSet; @@ -2985,45 +11292,256 @@ declare namespace __esri { export const TileMatrixSet: TileMatrixSetConstructor; interface TileMatrixSetProperties { + /** + * The full extent of the TileMatrixSet. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#fullExtent) + */ fullExtent?: ExtentProperties; + /** + * The unique ID assigned to the TileMatrixSet. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#id) + */ id?: string; + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#tileInfo) + */ tileInfo?: TileInfoProperties; } - interface WMSSublayer { + interface WMSSublayer extends Accessor { + /** + * Description for the WMS sublayer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#description) + */ description: string; + /** + * The full extent of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#fullExtent) + */ fullExtent: Extent; + /** + * The id for the WMS sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) + */ id: number; + /** + * The [WMSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html) to which the sublayer belongs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#layer) + */ layer: WMSLayer; + /** + * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendEnabled) + * + * @default true + */ legendEnabled: boolean; + /** + * A string url pointing to a legend image for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendUrl) + */ legendUrl: string; + /** + * Name of the WMS sublayer. This defaults to the value of the Name property from the WMS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#name) + */ name: string; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#popupEnabled) + * + * @default false + */ popupEnabled: boolean; + /** + * Indicates if the layer can be queried, i.e. the service supports GetFeatureInfo with either text/html or text/plain formats. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#queryable) + * + * @default false + */ queryable: boolean; + /** + * List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#spatialReferences) + */ spatialReferences: number[]; + /** + * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#sublayers) + */ sublayers: Collection; + /** + * The title of the WMS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#title) + */ title: string; + /** + * Indicates if the layer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#visible) + */ visible: boolean; + /** + * Creates a deep clone of the WMS sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#clone) + * + * + */ clone(): WMSSublayer; } interface WMSSublayerConstructor { - new(properties?: any): WMSSublayer; + + + new(properties?: WMSSublayerProperties): WMSSublayer; } export const WMSSublayer: WMSSublayerConstructor; + interface WMSSublayerProperties { + /** + * Description for the WMS sublayer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#description) + */ + description?: string; + /** + * The full extent of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#fullExtent) + */ + fullExtent?: ExtentProperties; + /** + * The id for the WMS sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) + */ + id?: number; + /** + * The [WMSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html) to which the sublayer belongs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#layer) + */ + layer?: WMSLayerProperties; + /** + * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendEnabled) + * + * @default true + */ + legendEnabled?: boolean; + /** + * A string url pointing to a legend image for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendUrl) + */ + legendUrl?: string; + /** + * Name of the WMS sublayer. This defaults to the value of the Name property from the WMS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#name) + */ + name?: string; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#popupEnabled) + * + * @default false + */ + popupEnabled?: boolean; + /** + * Indicates if the layer can be queried, i.e. the service supports GetFeatureInfo with either text/html or text/plain formats. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#queryable) + * + * @default false + */ + queryable?: boolean; + /** + * List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#spatialReferences) + */ + spatialReferences?: number[]; + /** + * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#sublayers) + */ + sublayers?: CollectionProperties; + /** + * The title of the WMS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#title) + */ + title?: string; + /** + * Indicates if the layer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#visible) + */ + visible?: boolean; + } + interface WMTSStyle extends Accessor, JSONSupport { + /** + * Description for the WMTS style. This defaults to the value of the Abstract property from the WMTS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#description) + */ description: string; + /** + * The unique ID assigned to the style. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#id) + */ id: string; + /** + * The URL to the legend which gets used in [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This defaults to the value of the LegendURL property from the WMTS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#legendUrl) + */ legendUrl: string; + /** + * The title of the WMTS style. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#title) + */ title: string; + /** + * Creates a deep clone of the WMTSStyle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#clone) + * + * + */ clone(): WMTSStyle; } interface WMTSStyleConstructor { + + new(properties?: WMTSStyleProperties): WMTSStyle; fromJSON(json: any): WMTSStyle; @@ -3032,30 +11550,119 @@ declare namespace __esri { export const WMTSStyle: WMTSStyleConstructor; interface WMTSStyleProperties { + /** + * Description for the WMTS style. This defaults to the value of the Abstract property from the WMTS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#description) + */ description?: string; + /** + * The unique ID assigned to the style. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#id) + */ id?: string; + /** + * The URL to the legend which gets used in [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This defaults to the value of the LegendURL property from the WMTS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#legendUrl) + */ legendUrl?: string; + /** + * The title of the WMTS style. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#title) + */ title?: string; } interface WMTSSublayer extends Accessor, JSONSupport { + /** + * Description for the WMTS sublayer. This defaults to the value of the Abstract property from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#description) + */ description: string; + /** + * The full extent of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#fullExtent) + */ fullExtent: Extent; + /** + * The unique ID assigned to the sublayer. If not set by the developer, it is automatically generated when the layer is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) + */ id: string; + /** + * The map image format (MIME type) to request. Defaults to the first item in [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). Must be one of the supported [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormat) + */ imageFormat: string; + /** + * Supported image formats as retrieved from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats) + */ imageFormats: string[]; + /** + * The [WMTSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html) to which the sublayer belongs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#layer) + */ layer: WMTSLayer; + /** + * The [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html) to request. Defaults to the id of the first item in [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). Should be one of the supported [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styleId) + */ styleId: string; + /** + * A collection of supported [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html)s as retrieved from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles) + */ styles: Collection; + /** + * The [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) + */ tileMatrixSet: TileMatrixSet; + /** + * The id of the [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the id of the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSetId) + */ tileMatrixSetId: string; + /** + * A collection of supported [TileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSets) + */ tileMatrixSets: Collection; + /** + * The title of the WMTS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMTS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#title) + */ title: string; + /** + * Creates a deep clone of the WMTS sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#clone) + * + * + */ clone(): WMTSSublayer; } interface WMTSSublayerConstructor { + + new(properties?: WMTSSublayerProperties): WMTSSublayer; fromJSON(json: any): WMTSSublayer; @@ -3064,25 +11671,92 @@ declare namespace __esri { export const WMTSSublayer: WMTSSublayerConstructor; interface WMTSSublayerProperties { + /** + * Description for the WMTS sublayer. This defaults to the value of the Abstract property from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#description) + */ description?: string; + /** + * The full extent of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#fullExtent) + */ fullExtent?: ExtentProperties; + /** + * The unique ID assigned to the sublayer. If not set by the developer, it is automatically generated when the layer is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) + */ id?: string; + /** + * The map image format (MIME type) to request. Defaults to the first item in [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). Must be one of the supported [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormat) + */ imageFormat?: string; + /** + * Supported image formats as retrieved from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats) + */ imageFormats?: string[]; + /** + * The [WMTSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html) to which the sublayer belongs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#layer) + */ layer?: WMTSLayerProperties; + /** + * The [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html) to request. Defaults to the id of the first item in [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). Should be one of the supported [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styleId) + */ styleId?: string; + /** + * A collection of supported [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html)s as retrieved from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles) + */ styles?: CollectionProperties; + /** + * The [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) + */ tileMatrixSet?: TileMatrixSetProperties; + /** + * The id of the [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the id of the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSetId) + */ tileMatrixSetId?: string; + /** + * A collection of supported [TileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSets) + */ tileMatrixSets?: CollectionProperties; + /** + * The title of the WMTS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMTS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#title) + */ title?: string; } interface TiledLayer { + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TiledLayer.html#tileInfo) + */ tileInfo: TileInfo; } interface TiledLayerConstructor { + + new(properties?: TiledLayerProperties): TiledLayer; fromJSON(json: any): TiledLayer; @@ -3091,26 +11765,90 @@ declare namespace __esri { export const TiledLayer: TiledLayerConstructor; interface TiledLayerProperties { + /** + * The tiling scheme information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TiledLayer.html#tileInfo) + */ tileInfo?: TileInfoProperties; } - interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, ScaleRangeLayer, PortalLayer, TiledLayer { - attributionDataUrl: string; - hasAttributionData: boolean; + interface TileLayer extends Layer, ArcGISMapService, ArcGISCachedService, RefreshableLayer, ScaleRangeLayer, PortalLayer, TiledLayer { + /** + * The URL that points to the location of the layer's attribution data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#attributionDataUrl) + */ + readonly attributionDataUrl: string; + /** + * Indicates if the layer has attribution data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#hasAttributionData) + */ + readonly hasAttributionData: boolean; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#legendEnabled) + * + * @default true + */ legendEnabled: boolean; + /** + * An array of tile servers used for changing map tiles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#tileServers) + */ tileServers: string[]; + /** + * The URL of the REST endpoint of the layer. The URL may either point to a resource on ArcGIS for Server, Portal for ArcGIS, or ArcGIS Online. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#url) + */ url: string; + /** + * This method fetches a tile for the given level, row and column present in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) + * + * @param level Level of detail of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param row The row(y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param column The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). + * @param options Optional settings for the tile request. The options have the following properties. + * @param options.allowImageDataAccess Indicates if the access to pixels of the image is allowed. + * + */ fetchTile(level: number, row: number, column: number, options?: TileLayerFetchTileOptions): IPromise; + /** + * This method returns a URL to a tile for a given level, row and column. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#getTileUrl) + * + * @param level The requested tile's level. + * @param row The requested tile's row. + * @param col The requested tile's column. + * + */ getTileUrl(level: number, row: number, col: number): string; + on(name: "layerview-create", eventHandler: TileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: TileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: TileLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: TileLayerLayerviewDestroyEventHandler): IHandle; } interface TileLayerConstructor { + /** + * The TileLayer allows you work with a cached [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm) exposed by the ArcGIS Server REST API and add it to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) as a tile layer. A cached service accesses tiles from a cache instead of dynamically rendering images. Because they are cached, tiled layers render faster than [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). To create an instance of TileLayer, you must reference the URL of the cached map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) + */ + new(properties?: TileLayerProperties): TileLayer; fromJSON(json: any): TileLayer; @@ -3118,36 +11856,71 @@ declare namespace __esri { export const TileLayer: TileLayerConstructor; - interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, ScaleRangeLayerProperties, PortalLayerProperties, TiledLayerProperties { - attributionDataUrl?: string; - hasAttributionData?: boolean; + interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, PortalLayerProperties, TiledLayerProperties { + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#legendEnabled) + * + * @default true + */ legendEnabled?: boolean; + /** + * An array of tile servers used for changing map tiles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#tileServers) + */ tileServers?: string[]; + /** + * The URL of the REST endpoint of the layer. The URL may either point to a resource on ArcGIS for Server, Portal for ArcGIS, or ArcGIS Online. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#url) + */ url?: string; } export interface TileLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface TileLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export interface TileLayerFetchTileOptions { + + export interface TileLayerFetchTileOptions extends Object { + /** + * Indicates if the access to pixels of the image is allowed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) + */ allowImageDataAccess?: boolean; } interface UnknownLayer extends Layer { + on(name: "layerview-create", eventHandler: UnknownLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: UnknownLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: UnknownLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: UnknownLayerLayerviewDestroyEventHandler): IHandle; } interface UnknownLayerConstructor { + /** + * Represents a layer whose type could not be determined. For example, when loading a layer from a URL and the layer type cannot be determined, then it is represented as an instance of this class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-UnknownLayer.html) + */ + new(properties?: UnknownLayerProperties): UnknownLayer; } @@ -3158,23 +11931,33 @@ declare namespace __esri { } export interface UnknownLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface UnknownLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface UnsupportedLayer extends Layer { + on(name: "layerview-create", eventHandler: UnsupportedLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: UnsupportedLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: UnsupportedLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: UnsupportedLayerLayerviewDestroyEventHandler): IHandle; } interface UnsupportedLayerConstructor { + + new(properties?: UnsupportedLayerProperties): UnsupportedLayer; } @@ -3185,31 +11968,84 @@ declare namespace __esri { } export interface UnsupportedLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface UnsupportedLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface VectorTileLayer extends Layer, PortalLayer, ScaleRangeLayer, TiledLayer { - attributionDataUrl: string; - currentStyleInfo: VectorTileLayerCurrentStyleInfo; + /** + * The URL that points to the location of the layer's attribution data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#attributionDataUrl) + */ + readonly attributionDataUrl: string; + /** + * The current style information of the VectorTileLayer. See the object specification below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) + */ + readonly currentStyleInfo: VectorTileLayerCurrentStyleInfo; + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#spatialReference) + */ spatialReference: SpatialReference; - token: string; - url: string | any; + /** + * A style JSON object of vector tiles that will be used to render the layer. If initializing the layer with a style JSON object, the tiles are fetched from the tile servers specified in the style object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#style) + */ + style: any; + /** + * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#token) + */ + readonly token: string; + /** + * The URL to the vector tile service, or the URL to the style resource of vector tiles that will be used to render the layer. If specifying a URL to a style, the tiles are fetched from the tile servers specified in the style object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#url) + */ + url: string; + /** + * Loads a style to render a layer from the specified URL to a style resource or style JSON object. It is equivalent of changing the entire CSS style sheet for web page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#loadStyle) + * + * @param style The URL to a style of vector tiles or style JSON object. + * + */ loadStyle(style: string | any): IPromise; + on(name: "layerview-create", eventHandler: VectorTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: VectorTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: VectorTileLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: VectorTileLayerLayerviewDestroyEventHandler): IHandle; } interface VectorTileLayerConstructor { + /** + * A VectorTileLayer accesses cached tiles of data and renders it in vector format. It is similar to a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) in the context of caching; however, a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) renders as a series of images, not vector data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html) + */ + new(properties?: VectorTileLayerProperties): VectorTileLayer; fromJSON(json: any): VectorTileLayer; @@ -3218,46 +12054,131 @@ declare namespace __esri { export const VectorTileLayer: VectorTileLayerConstructor; interface VectorTileLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TiledLayerProperties { - attributionDataUrl?: string; - currentStyleInfo?: VectorTileLayerCurrentStyleInfo; + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; - token?: string; - url?: string | any; + /** + * A style JSON object of vector tiles that will be used to render the layer. If initializing the layer with a style JSON object, the tiles are fetched from the tile servers specified in the style object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#style) + */ + style?: any; + /** + * The URL to the vector tile service, or the URL to the style resource of vector tiles that will be used to render the layer. If specifying a URL to a style, the tiles are fetched from the tile servers specified in the style object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#url) + */ + url?: string; } export interface VectorTileLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface VectorTileLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export interface VectorTileLayerCurrentStyleInfo { + + export interface VectorTileLayerCurrentStyleInfo extends Object { + /** + * The URL of a vector tile service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) + */ serviceUrl: string; + /** + * The URL of a style for vector tiles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) + */ styleUrl: string; + /** + * The sprite URL included in a style. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) + */ spriteUrl: string; + /** + * The template URL of font sets for vector tiles. The URL includes `{fontstack}` and `{range}` tokens. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) + */ glyphsUrl: string; + /** + * Style JSON object for vector tiles. Style object includes `version` of the style specification, `sprite` and `glyphs` properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) + */ style: any; + /** + * Vector tile service information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) + */ layerDefinition: any; } - interface WebTileLayer extends Layer, TiledLayer, ScaleRangeLayer { + interface WebTileLayer extends Layer, TiledLayer, ScaleRangeLayer, RefreshableLayer { + /** + * The attribution information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#copyright) + */ copyright: string; - spatialReference: SpatialReference; + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#spatialReference) + * + * @default Web Mercator Auxiliary Sphere (wkid: 3857) + */ + readonly spatialReference: SpatialReference; + /** + * A string of subDomain names where tiles are served to speed up tile retrieval. If subDomains are specified, the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) should include a `{subDomain}` place holder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) + */ subDomains: string[]; + /** + * The tile server names for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileServers) + */ tileServers: string[]; + /** + * URL template for the hosted tiles. The `urlTemplate` should contain a `{subDomain}` place holder if [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) are specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) + */ urlTemplate: string; + on(name: "layerview-create", eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: WebTileLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: WebTileLayerLayerviewDestroyEventHandler): IHandle; } interface WebTileLayerConstructor { + /** + * WebTileLayer provides a simple way to add non-ArcGIS Server map tiles as a layer to a map. The constructor takes a URL template that usually follows a pattern of `http://some.domain.com/{level}/{col}/{row}/` where `level` corresponds to a zoom level, and `column` and `row` represent tile column and row, respectively. This pattern is not required, but is the most common one currently on the web. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) + */ + new(properties?: WebTileLayerProperties): WebTileLayer; fromJSON(json: any): WebTileLayer; @@ -3265,53 +12186,197 @@ declare namespace __esri { export const WebTileLayer: WebTileLayerConstructor; - interface WebTileLayerProperties extends LayerProperties, TiledLayerProperties, ScaleRangeLayerProperties { + interface WebTileLayerProperties extends LayerProperties, TiledLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + /** + * The attribution information for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#copyright) + */ copyright?: string; - spatialReference?: SpatialReferenceProperties; + /** + * A string of subDomain names where tiles are served to speed up tile retrieval. If subDomains are specified, the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) should include a `{subDomain}` place holder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) + */ subDomains?: string[]; + /** + * The tile server names for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileServers) + */ tileServers?: string[]; + /** + * URL template for the hosted tiles. The `urlTemplate` should contain a `{subDomain}` place holder if [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) are specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) + */ urlTemplate?: string; } export interface WebTileLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface WebTileLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - interface WMSLayer extends Layer, PortalLayer, ScaleRangeLayer { + interface WMSLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { + /** + * Copyright information for the WMS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#copyright) + */ copyright: string; + /** + * Use this to append different custom parameters to the WMS map requests. The custom layer parameters are applied to GetMap and GetFeatureInfo. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customLayerParameters) + */ customLayerParameters: any; + /** + * Use this to append custom parameters to all WMS requests. The custom parameters are applied to GetCapabilities, GetMap and GetFeatureInfo. For example, if an access key is required, the key can be configured as a custom parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customParameters) + */ customParameters: any; + /** + * Description for the WMS layer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#description) + */ description: string; + /** + * Return format of feature information (MIME type). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoFormat) + */ featureInfoFormat: string; + /** + * The URL for the WMS GetFeatureInfo call. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoUrl) + */ featureInfoUrl: string; + /** + * All bounding boxes defined for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fullExtents) + */ fullExtents: Extent[]; + /** + * The map image format (MIME type) to request. Defaults to `image/png` if the WMS service supports it. If not, it defaults to the value of the first `` in `` in the GetCapabilities response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageFormat) + */ imageFormat: string; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxHeight) + * + * @default 2048 + */ imageMaxHeight: number; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxWidth) + * + * @default 2048 + */ imageMaxWidth: number; + /** + * Indicates whether the background of the image exported by the service is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageTransparency) + * + * @default true + */ imageTransparency: boolean; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#legendEnabled) + * + * @default true + */ legendEnabled: boolean; + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReference) + */ spatialReference: SpatialReference; + /** + * List of spatialReference well known ids derived from the CRS elements of the first layer in the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReferences) + */ spatialReferences: number[]; + /** + * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#sublayers) + */ sublayers: Collection; + /** + * The URL of the WMS service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#url) + */ url: string; + /** + * Version of the [WMS specification](http://www.opengeospatial.org/standards/wms) to use. For example, `1.3.0`, `1.1.1`, `1.1` or `1.0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#version) + */ version: string; + /** + * Fetching the WMS image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) + * + * @param extent The extent of the view. + * @param width The width of the view in pixels. + * @param height The height of the view in pixels. + * @param options The parameter options is an object with the following properties. + * @param options.allowImageDataAccess Indicates if the access to the pixels of the image is required. + * @param options.pixelRatio The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. + * @param options.rotation The rotation in degrees of the exported image. + * + */ fetchImage(extent: Extent, width: number, height: number, options?: WMSLayerFetchImageOptions): IPromise; + /** + * Returns a [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html) based on the given sublayer id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#findSublayerById) + * + * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) of the WMS sublayer. + * + */ findSublayerById(id: number): WMSSublayer; + on(name: "layerview-create", eventHandler: WMSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: WMSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: WMSLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: WMSLayerLayerviewDestroyEventHandler): IHandle; } interface WMSLayerConstructor { + + new(properties?: WMSLayerProperties): WMSLayer; fromJSON(json: any): WMSLayer; @@ -3319,61 +12384,230 @@ declare namespace __esri { export const WMSLayer: WMSLayerConstructor; - interface WMSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + interface WMSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + /** + * Copyright information for the WMS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#copyright) + */ copyright?: string; + /** + * Use this to append different custom parameters to the WMS map requests. The custom layer parameters are applied to GetMap and GetFeatureInfo. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customLayerParameters) + */ customLayerParameters?: any; + /** + * Use this to append custom parameters to all WMS requests. The custom parameters are applied to GetCapabilities, GetMap and GetFeatureInfo. For example, if an access key is required, the key can be configured as a custom parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customParameters) + */ customParameters?: any; + /** + * Description for the WMS layer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#description) + */ description?: string; + /** + * Return format of feature information (MIME type). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoFormat) + */ featureInfoFormat?: string; + /** + * The URL for the WMS GetFeatureInfo call. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoUrl) + */ featureInfoUrl?: string; + /** + * All bounding boxes defined for the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fullExtents) + */ fullExtents?: ExtentProperties[]; + /** + * The map image format (MIME type) to request. Defaults to `image/png` if the WMS service supports it. If not, it defaults to the value of the first `` in `` in the GetCapabilities response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageFormat) + */ imageFormat?: string; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxHeight) + * + * @default 2048 + */ imageMaxHeight?: number; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxWidth) + * + * @default 2048 + */ imageMaxWidth?: number; + /** + * Indicates whether the background of the image exported by the service is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageTransparency) + * + * @default true + */ imageTransparency?: boolean; + /** + * Indicates whether the layer will be included in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#legendEnabled) + * + * @default true + */ legendEnabled?: boolean; + /** + * The spatial reference of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; + /** + * List of spatialReference well known ids derived from the CRS elements of the first layer in the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReferences) + */ spatialReferences?: number[]; - sublayers?: CollectionProperties; + /** + * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#sublayers) + */ + sublayers?: CollectionProperties; + /** + * The URL of the WMS service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#url) + */ url?: string; + /** + * Version of the [WMS specification](http://www.opengeospatial.org/standards/wms) to use. For example, `1.3.0`, `1.1.1`, `1.1` or `1.0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#version) + */ version?: string; } export interface WMSLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface WMSLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } - export interface WMSLayerFetchImageOptions { + + export interface WMSLayerFetchImageOptions extends Object { + /** + * Indicates if the access to the pixels of the image is required. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) + */ allowImageDataAccess?: boolean; + /** + * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) + */ pixelRatio?: number; + /** + * The rotation in degrees of the exported image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) + */ rotation?: number; } - interface WMTSLayer extends Layer, PortalLayer, ScaleRangeLayer { + interface WMTSLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { + /** + * Currently active sublayer. Defaults to the first sublayer in [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#activeLayer) + */ activeLayer: WMTSSublayer; + /** + * Copyright information for the WMTS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#copyright) + */ copyright: string; + /** + * Use this to append different custom parameters to the WMTS tile requests. The custom layer parameters are applied to GetTile. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customLayerParameters) + */ customLayerParameters: any; + /** + * Use this to append custom parameters to all WMTS requests. The custom parameters are applied to GetCapabilities and GetTile. For example, if an access key is required, the key can be configured as a custom parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customParameters) + */ customParameters: any; + /** + * The service mode for the WMTS layer. If not specified, the API will first make a getCapabilities request using `RESTful`. If that fails, it will try using `KVP`. **Possible Values:** RESTful | KVP + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#serviceMode) + * + * @default RESTful + */ serviceMode: string; + /** + * A collection of [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) objects. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers) + */ sublayers: Collection; + /** + * The URL of the WMTS service. The URL for the GetCapabilities is created based on the url and serviceMode properties. For example https://gibs.earthdata.nasa.gov/wmts/epsg4326/best. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#url) + */ url: string; + /** + * Version of the [WMTS specification](http://www.opengeospatial.org/standards/wmts) to use. Probably `1.0.0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#version) + */ version: string; + /** + * Returns a [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) based on the given sublayer id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#findSublayerById) + * + * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) of the WMTS sublayer. + * + */ findSublayerById(id: string): WMTSSublayer; + on(name: "layerview-create", eventHandler: WMTSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: WMTSLayerLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: WMTSLayerLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: WMTSLayerLayerviewDestroyEventHandler): IHandle; } interface WMTSLayerConstructor { + + new(properties?: WMTSLayerProperties): WMTSLayer; fromJSON(json: any): WMTSLayer; @@ -3381,58 +12615,239 @@ declare namespace __esri { export const WMTSLayer: WMTSLayerConstructor; - interface WMTSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + interface WMTSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + /** + * Currently active sublayer. Defaults to the first sublayer in [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#activeLayer) + */ activeLayer?: WMTSSublayerProperties; + /** + * Copyright information for the WMTS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#copyright) + */ copyright?: string; + /** + * Use this to append different custom parameters to the WMTS tile requests. The custom layer parameters are applied to GetTile. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customLayerParameters) + */ customLayerParameters?: any; + /** + * Use this to append custom parameters to all WMTS requests. The custom parameters are applied to GetCapabilities and GetTile. For example, if an access key is required, the key can be configured as a custom parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customParameters) + */ customParameters?: any; + /** + * The service mode for the WMTS layer. If not specified, the API will first make a getCapabilities request using `RESTful`. If that fails, it will try using `KVP`. **Possible Values:** RESTful | KVP + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#serviceMode) + * + * @default RESTful + */ serviceMode?: string; + /** + * A collection of [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) objects. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers) + */ sublayers?: CollectionProperties; + /** + * The URL of the WMTS service. The URL for the GetCapabilities is created based on the url and serviceMode properties. For example https://gibs.earthdata.nasa.gov/wmts/epsg4326/best. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#url) + */ url?: string; + /** + * Version of the [WMTS specification](http://www.opengeospatial.org/standards/wmts) to use. Probably `1.0.0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#version) + */ version?: string; } export interface WMTSLayerLayerviewCreateEvent { + layerView: LayerView; + view: View; } export interface WMTSLayerLayerviewDestroyEvent { + layerView: LayerView; + view: View; } interface Map extends Accessor, LayersMixin { - allLayers: Collection; + /** + * A flat collection of all the [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) in the map. This collection contains [basemap layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground). [Group Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) and their [children layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#layers) are also part of this collection. Reference layers in the basemap will always be included at the end of the collection. Layers should not be added directly to this collection. They must only be added via the [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers), [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#allLayers) + */ + readonly allLayers: Collection; + /** + * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * + * Value | Description + * ------|------------ + * streets | ![basemap-streets](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) + * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/satellite.jpg) + * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/hybrid.jpg) + * topo | ![basemap-topo](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) + * gray | ![basemap-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) + * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) + * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/oceans.jpg) + * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/national-geographic.jpg) + * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/terrain.jpg) + * osm | ![basemap-osm](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/osm.jpg) + * dark-gray-vector | ![dark-gray-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) + * gray-vector | ![gray-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) + * streets-vector | ![streets-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) + * topo-vector | ![topo-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) + * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-night.jpg) + * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-relief.jpg) + * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-navigation.jpg) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) + */ basemap: Basemap; + /** + * Specifies the surface properties for the map. This property is only relevant when adding the map to a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It renders the terrain or topographical variations in the real world on the map's surface with a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html). This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), or the string `world-elevation` for a default instance of ground using the [World Elevation Service](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer). The ground may not be set to `null` or `undefined`, it is guaranteed to always contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). The elevation can be removed from the ground by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) instance or by removing all the ground layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) + */ ground: Ground; } interface MapConstructor { + /** + * The Map class contains properties and methods for storing, managing, and overlaying [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) common to both 2D and 3D viewing. Layers can be added and removed from the map, but are rendered via a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) (for viewing data in 2D) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) (for viewing data in 3D). Thus a map instance is a simple container that holds the layers, while the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is the means of displaying and interacting with a map's layers and basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) + */ + new(properties?: MapProperties): Map; } export const Map: MapConstructor; interface MapProperties extends LayersMixinProperties { - allLayers?: CollectionProperties; - basemap?: BasemapProperties; - ground?: GroundProperties; + /** + * 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/latest/assets/img/apiref/basemap/streets.jpg) + * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/satellite.jpg) + * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/hybrid.jpg) + * topo | ![basemap-topo](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) + * gray | ![basemap-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) + * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) + * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/oceans.jpg) + * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/national-geographic.jpg) + * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/terrain.jpg) + * osm | ![basemap-osm](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/osm.jpg) + * dark-gray-vector | ![dark-gray-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) + * gray-vector | ![gray-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) + * streets-vector | ![streets-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) + * topo-vector | ![topo-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) + * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-night.jpg) + * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-relief.jpg) + * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets-navigation.jpg) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) + */ + basemap?: BasemapProperties | string; + /** + * Specifies the surface properties for the map. This property is only relevant when adding the map to a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It renders the terrain or topographical variations in the real world on the map's surface with a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html). This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), or the string `world-elevation` for a default instance of ground using the [World Elevation Service](https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer). The ground may not be set to `null` or `undefined`, it is guaranteed to always contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). The elevation can be removed from the ground by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) instance or by removing all the ground layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) + */ + ground?: GroundProperties | string; } interface PopupTemplate extends Accessor, JSONSupport { - actions: Collection>; + /** + * 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-Action.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) + */ + actions: Collection; + /** + * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. + * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. These values are referenced via placeholders. Within the string, placeholders are denoted by `{fieldName}` or `{expression/expressionName}` which are used to specify which values from field attributes or expressions to display within certain locations in the string. When the application runs, substitution occurs and the placeholder is replaced with the actual attribute or expression value for the selected feature. The string can also include HTML markup and formatting functions. + * * **Popup elements** - You can also display content as popup elements defined as an array of Objects. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. + * * **text** - Object that provides descriptive text as content. This object must be defined using the [text popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text). + * * **media** - Array of objects used to display media such as charts and/or images. This object must be defined using the [media popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media). + * * **fields** - Array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) objects. If `fieldInfos` is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. This must be defined using the [fields popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields). + * * **attachments** - Array of attachmentInfos objects listed in the popup. This object must be defined using the [attachments popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments). + * * **promise** - The PopupTemplate's content may also be defined with a promise that resolves to any of the above-mentioned elements. This is useful for cases when you run a task or execute a query and want to display the results in the popup. Simply pass the promise to the popupTemplate's content and ensure that it resolves to a string or other popup element. + * * **function** - Content may be defined with a JavaScript function that returns any of the above-mentioned elements. This is handy when your popup requires additional processing or functionality than what is provided with the four content types listed above. For example, let’s assume that you would like to display charts using third-party JavaScript libraries or categorize information into separate tabs. In these cases, you can use a function that returns either a string, a reference to an HTML element, a popup element, or a promise. When the feature is clicked, the feature is passed as an argument to the function and provides access to the feature’s graphic and attributes. The function then executes and returns a value to display in the popup template. It is also possible to check a specific feature attribute and determine whether to apply a function based on its value. Out-of-the-box formatting functions can be used to format date, time, and number values. The syntax for using an out-of-the-box formatting function is: `{field-name:format-function-name(option-a: value, option-b: value)}` + * + * + * The formatter functions are described below: + * + * Type | Description + * ----- | ----------- + * DateString | Formats the date into a human-readable format. Supports the following options: `hideTime: false` - When `true` shows time. Default value is `false`. `local: false` - Displays date and time in the local time zone. Default value is `false`. When `false` the date will display in UTC. `systemLocale: false` - Displays date and time in the system locale (local time zone). Default value is `false`. + * DateFormat | Converts date fields into a human-readable format using [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html) method. Supports the same options as [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html). The following snippets show some usage examples: `{DATE_FIELD:DateFormat}` produces `3/8/08 4:00 PM`. `{DATE_FIELD:DateFormat(selector: 'date', fullYear: true)}` produces `4/8/2009`. + * NumberFormat | Formats numbers into various formats using the [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format) method. Supports the same set of options as [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format). The following snippets show examples of usage pattern examples: `{Magnitude:NumberFormat}` produces `4.23456`. `{Magnitude:NumberFormat(places:2)}` produces `4.23`. + * + * Out-of-the-box formatting functions and custom functions are supported as of version 4.1. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) + */ content: string | any[] | Function | IPromise; + /** + * An array of objects that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. These expressions evaluate to either a number or a string value on a feature-by-feature basis at runtime. The values display within the view's popup as if they are field values. They can be displayed in a table using the `fieldInfos` of the popupTemplate's content or referenced within a simple string. See the object specification table below for a description of the properties that may be set in each object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) + */ expressionInfos: PopupTemplateExpressionInfos[]; + /** + * An array of objects that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object contains properties for a single field or expression. See the object specification table below for available options to set on each field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ fieldInfos: PopupTemplateFieldInfos[]; + /** + * Additional options that can be defined for the popup layer. Currently supports one property, `showNoDataRecords`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) + * + * @default null + */ layerOptions: PopupTemplateLayerOptions; + /** + * Indicates whether actions should replace existing [popup actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions) + * + * @default false + */ overwriteActions: boolean; + /** + * The template for defining how to format the title used in a popup. You can format the title by specifying either a string value or a function that returns a simple string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#title) + */ title: string | Function; - - clone(): PopupTemplate; } interface PopupTemplateConstructor { + /** + * A PopupTemplate formats and defines the content of a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for a specific [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) or [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). A PopupTemplate allows the user to access values from feature attributes and values returned from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions when a feature in the view is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) + */ + new(properties?: PopupTemplateProperties): PopupTemplate; fromJSON(json: any): PopupTemplate; @@ -3441,325 +12856,1652 @@ declare namespace __esri { export const PopupTemplate: PopupTemplateConstructor; interface PopupTemplateProperties { - actions?: CollectionProperties>; + /** + * 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-Action.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) + */ + actions?: CollectionProperties; + /** + * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. + * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. These values are referenced via placeholders. Within the string, placeholders are denoted by `{fieldName}` or `{expression/expressionName}` which are used to specify which values from field attributes or expressions to display within certain locations in the string. When the application runs, substitution occurs and the placeholder is replaced with the actual attribute or expression value for the selected feature. The string can also include HTML markup and formatting functions. + * * **Popup elements** - You can also display content as popup elements defined as an array of Objects. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. + * * **text** - Object that provides descriptive text as content. This object must be defined using the [text popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text). + * * **media** - Array of objects used to display media such as charts and/or images. This object must be defined using the [media popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media). + * * **fields** - Array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) objects. If `fieldInfos` is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. This must be defined using the [fields popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields). + * * **attachments** - Array of attachmentInfos objects listed in the popup. This object must be defined using the [attachments popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments). + * * **promise** - The PopupTemplate's content may also be defined with a promise that resolves to any of the above-mentioned elements. This is useful for cases when you run a task or execute a query and want to display the results in the popup. Simply pass the promise to the popupTemplate's content and ensure that it resolves to a string or other popup element. + * * **function** - Content may be defined with a JavaScript function that returns any of the above-mentioned elements. This is handy when your popup requires additional processing or functionality than what is provided with the four content types listed above. For example, let’s assume that you would like to display charts using third-party JavaScript libraries or categorize information into separate tabs. In these cases, you can use a function that returns either a string, a reference to an HTML element, a popup element, or a promise. When the feature is clicked, the feature is passed as an argument to the function and provides access to the feature’s graphic and attributes. The function then executes and returns a value to display in the popup template. It is also possible to check a specific feature attribute and determine whether to apply a function based on its value. Out-of-the-box formatting functions can be used to format date, time, and number values. The syntax for using an out-of-the-box formatting function is: `{field-name:format-function-name(option-a: value, option-b: value)}` + * + * + * The formatter functions are described below: + * + * Type | Description + * ----- | ----------- + * DateString | Formats the date into a human-readable format. Supports the following options: `hideTime: false` - When `true` shows time. Default value is `false`. `local: false` - Displays date and time in the local time zone. Default value is `false`. When `false` the date will display in UTC. `systemLocale: false` - Displays date and time in the system locale (local time zone). Default value is `false`. + * DateFormat | Converts date fields into a human-readable format using [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html) method. Supports the same options as [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html). The following snippets show some usage examples: `{DATE_FIELD:DateFormat}` produces `3/8/08 4:00 PM`. `{DATE_FIELD:DateFormat(selector: 'date', fullYear: true)}` produces `4/8/2009`. + * NumberFormat | Formats numbers into various formats using the [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format) method. Supports the same set of options as [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format). The following snippets show examples of usage pattern examples: `{Magnitude:NumberFormat}` produces `4.23456`. `{Magnitude:NumberFormat(places:2)}` produces `4.23`. + * + * Out-of-the-box formatting functions and custom functions are supported as of version 4.1. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) + */ content?: string | any[] | Function | IPromise; + /** + * An array of objects that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. These expressions evaluate to either a number or a string value on a feature-by-feature basis at runtime. The values display within the view's popup as if they are field values. They can be displayed in a table using the `fieldInfos` of the popupTemplate's content or referenced within a simple string. See the object specification table below for a description of the properties that may be set in each object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) + */ expressionInfos?: PopupTemplateExpressionInfos[]; + /** + * An array of objects that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object contains properties for a single field or expression. See the object specification table below for available options to set on each field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ fieldInfos?: PopupTemplateFieldInfos[]; + /** + * Additional options that can be defined for the popup layer. Currently supports one property, `showNoDataRecords`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) + * + * @default null + */ layerOptions?: PopupTemplateLayerOptions; + /** + * Indicates whether actions should replace existing [popup actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions) + * + * @default false + */ overwriteActions?: boolean; + /** + * The template for defining how to format the title used in a popup. You can format the title by specifying either a string value or a function that returns a simple string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#title) + */ title?: string | Function; } - export interface Attachments { + /** + * Attachments are a type of popup element. Similar to text and media elements, attachments can only be set within the content. ![popuptemplate-attachments-element](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-attachments-element.png) The object specification for the fields popup element is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments) + */ + export interface Attachments extends Object { + /** + * **Required.** The type of popup element to display. To list attachments, set this to `attachments`. The attachmentInfos are queried from the service and will list within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments) + */ type: string; } - export interface Fields { + /** + * It is possible to set the fieldInfos directly within the PopupTemplate's content. If the fieldInfos is not set within the content, it will revert to whatever may be set within the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. ![popuptemplate-fields-element](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-fields-element.png) The object specification for the fields popup element is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) + */ + export interface Fields extends Object { + /** + * **Required.** The type of popup element to display. To display tabular field data, set this to `fields`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) + */ type: string; + /** + * Object array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos). If the `fieldInfos` property is not provided directly within the content, the popup will display whatever is set directly in the `PopupTemplate.fieldInfos`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) + */ fieldInfos: any[]; } - export interface Media { + /** + * It is possible to set media elements such as charts and/or images within the PopupTemplate's content. This content is set within the mediaInfos. You will need to reference a dijit stylesheet and reference its class within the `` HTML div. You can see this in the [Multiple popup elements sample](https://developers.arcgis.com/javascript/latest/sample-code/popup-multipleelements/index.html). ![popuptemplate-media-element](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-media-element.png) The object specification for the media popup element is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ + export interface Media extends Object { + /** + * **Required.** The type of popup element to display. To display charts or images, set this to `media`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ type: string; + /** + * **Required.** Object array of mediaInfos representing images or charts for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ mediaInfos: MediaMediaInfos[]; } - export interface PopupTemplateExpressionInfos { + + export interface PopupTemplateExpressionInfos extends Object { + /** + * The name of the expression. This is used to reference the value of the given `expression` in the popupTemplate's [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) property by wrapping it in curly braces and prefacing it with `expression/` (e.g. `{expression/expressionName}`). See the code snippets below for more examples. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) + */ name: string; + /** + * The title used to describe the value returned by the expression in the popup. This will display if the value is referenced in a `fieldInfos` table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) + */ title?: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) + */ expression: string; + /** + * Indicates the return type of the Arcade expression. This is an optional property. **Known Values:** string | number + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) + */ returnType?: string; } - export interface PopupTemplateFieldInfos { + + export interface PopupTemplateFieldInfos extends Object { + /** + * **Required.** The field name as defined by the service or the `name` of an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. Arcade expression names are defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. When referencing Arcade expressions, you must preface the name with `expression/`, such as `expression/percent-total`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ fieldName: string; + /** + * An object used with numerical or date fields to provide more detail about how the value should be displayed in a popup. When formatting Number fields, you must set both the `digitSeparator` and `places` properties for the formatting to take effect. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ format?: PopupTemplateFieldInfosFormat; + /** + * The field alias to display in place of the `fieldName` in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ label?: string; + /** + * For editable popups, defines the text box format. **Known Values:** rich-text | text-area | text-box + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ stringFieldOption?: string; + /** + * Defines a tooltip for editable popup fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ tooltip?: string; + /** + * Defines whether the field is visible in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ visible?: boolean; } - export interface PopupTemplateFieldInfosFormat { + + export interface PopupTemplateFieldInfosFormat extends Object { + /** + * Used only with Date fields. Specifies how the date should appear in a popup. **Known Values:** short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ dateFormat?: string; + /** + * Used only with Number fields. A value of `true` indicates the number should have a digit (or thousands) separator when the value appears in popups. A value of `false` means that no separator will be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ digitSeparator?: boolean; + /** + * Used only with Number fields to specify the number of supported decimal places that should appear in popups. Any places beyond this value are rounded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) + */ places?: number; } - export interface PopupTemplateLayerOptions { + + export interface PopupTemplateLayerOptions extends Object { + /** + * Applicable to [Imagery Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). Indicates whether records without data should display within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) + */ showNoDataRecords: boolean; } - export interface Text { + /** + * An object used to define descriptive text as an element within the PopupTemplate's content. The text may reference values returned from a field attribute or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. ![popuptemplate-text-element](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-text-element.png) The object specification for the text popup element is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) + */ + export interface Text extends Object { + /** + * **Required.** The type of popup element to display. For descriptive text, set this to `text`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) + */ type: string; + /** + * **Required.** The formatted string content to display. This may contain a field name enclosed in `{}`, such as `{FIELDNAME}`, or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression name, referenced as `{expression/EXPRESSIONNAME}`. Text content may also leverage HTML tags such as ``, `

`, and `
` for formatting the look and feel of the content. To use this element, set the `type` property to `text`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) + */ text: string; } - export interface MediaMediaInfos { + + export interface MediaMediaInfos extends Object { + /** + * Defines the media title. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ title: string; + /** + * Defines a caption for the media. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ caption: string; + /** + * **Since: 4.5** Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of `0` indicates auto refresh is not enabled. If the property does not exist, it is equivalent to having a value of `0`. Only applicable when `type` is set to `image`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ refreshInterval: number; + /** + * Defines the media type. **Possible Values:** image | pie-chart | bar-chart | column-chart | line-chart + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ type: string; + /** + * Defines the value format. This depends on the media type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ value: MediaMediaInfosValue; } - export interface MediaMediaInfosValue { + + export interface MediaMediaInfosValue extends Object { + /** + * Use this for image values. It defines the sourceURL pointing to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ sourceURL: string; + /** + * Used for chart values. An array of strings indicating field names from the specified layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ fields: string[]; + /** + * Used for chart values. A field used to normalize data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ normalizationField: string; + /** + * Used for chart values. Defines a new dojo theme, only valid for chart types. View the [Dojox Charting Theme Preview](https://download.dojotoolkit.org/release-1.10.0/dojo-release-1.10.0/dojox/charting/tests/theme_preview.html) to see some of the theme options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ theme: string; + /** + * Used for chart values. Defines the tooltip display field that displays when hovering over the chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) + */ tooltipField: string; } interface Portal extends Accessor, Loadable { + /** + * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Known Values:** public | private + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#access) + */ access: string; + /** + * When `true`, access to the organization's Portal resources must occur over SSL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#allSSL) + */ allSSL: boolean; + /** + * The authentication mode for handling authentication when the user attempts to access a secure resource. + * + * Possible Value | Description + * ---------------|------------ + * anonymous | An error will be returned when a secure resource is requested. + * auto | The user will be signed in when a secure resource is requested. + * immediate | The user will be signed in when the Portal is loaded. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authMode) + * + * @default auto + */ authMode: string; + /** + * Array of trusted servers to send credentials to when making Cross-Origin Resource Sharing (CORS) requests to access services secured with web-tier authentication. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authorizedCrossOriginDomains) + */ authorizedCrossOriginDomains: string[]; + /** + * The query that defines the basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is not true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery) + */ basemapGalleryGroupQuery: string; + /** + * The Bing key to use for web maps using Bing Maps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#bingKey) + */ bingKey: string; + /** + * Indicates whether an organization can list applications in the marketplace . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListApps) + */ canListApps: boolean; + /** + * Indicates whether an organization can list data services in the marketplace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListData) + */ canListData: boolean; + /** + * Indicates whether an organization can list pre-provisioned items in the marketplace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListPreProvisionedItems) + */ canListPreProvisionedItems: boolean; + /** + * Indicates whether an organization can provision direct purchases in the marketplace without customer request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canProvisionDirectPurchase) + */ canProvisionDirectPurchase: boolean; + /** + * When `true`, the organization's public items, groups and users are included in search queries. When `false`, no public items outside of the organization are included. However, public items which are part of the organization are included. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSearchPublic) + */ canSearchPublic: boolean; + /** + * The Bing key can be shared to the public and is returned as part of a portal's description call (`/sharing/rest/portals/`). This requires the access of the portal to be set to public. The canShareBingPublic property is not returned publicly but only shown to users within the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canShareBingPublic) + * + * @default false + */ canShareBingPublic: boolean; + /** + * When `true`, members of the organization can share resources outside the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSharePublic) + * + * @default false + */ canSharePublic: boolean; + /** + * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the ArcGIS sign in. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInArcGIS) + * + * @default false + */ canSignInArcGIS: boolean; + /** + * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the enterprise sign in. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInIDP) + * + * @default false + */ canSignInIDP: boolean; + /** + * The query that identifies the group containing the color sets used for rendering in the map viewer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#colorSetsGroupQuery) + */ colorSetsGroupQuery: string; + /** + * Indicates whether to allow the organization to disable commenting. When commentsEnabled is false, comments are hidden and not removed. numComments are set to zero for all items in the organization. Calls to add a comment and view comments will fail. If the organization re-enables comments, the comments display and numComments are restored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#commentsEnabled) + * + * @default false + */ commentsEnabled: boolean; + /** + * Date the organization was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#created) + */ created: Date; + /** + * The default locale (language and country) information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#culture) + */ culture: string; + /** + * The custom base URL for the portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#customBaseUrl) + */ customBaseUrl: string; + /** + * The default basemap to use for the portal. Used in the map viewer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap) + */ defaultBasemap: Basemap; + /** + * The default extent to use for the portal. Used in the map viewer. The extent will be in the default basemap's spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultExtent) + */ defaultExtent: Extent; + /** + * The default vector basemap to use for the portal. Used in the map viewer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) + */ defaultVectorBasemap: Basemap; + /** + * A description of the organization/portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#description) + */ description: string; + /** + * The featured groups for the portal. Returns an array of objects that provide access to the owner and title for each featured group. Each item in this array has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) + */ featuredGroups: PortalFeaturedGroups[]; + /** + * The query that defines the featured group. If null, then the most viewed items in the organization will be the featured items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredItemsGroupQuery) + */ featuredItemsGroupQuery: string; + /** + * The query that identifies the group containing features items for the gallery. Set a Group ID or, if null, then the most viewed items in your organization are displayed in the gallery. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#galleryTemplatesGroupQuery) + */ galleryTemplatesGroupQuery: string; + /** + * Helper services provided by the portal. For the detailed information about these services, see the [about utility services](https://server.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm) topic from the ArcGIS Server documentation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#helperServices) + */ helperServices: any; + /** + * The group that contains featured content to be displayed on the home page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContent) + */ homePageFeaturedContent: string; + /** + * The number of featured items that can be displayed on the home page. The max is 100. Accepts integers only. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContentCount) + */ homePageFeaturedContentCount: number; + /** + * The port used by the portal for HTTP communication. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpPort) + */ httpPort: number; + /** + * The port used by the portal for HTTPS communication. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpsPort) + */ httpsPort: number; + /** + * The id of the organization that owns this portal. If `null` then this is the default portal for anonymous and non-organizational users. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#id) + */ id: string; + /** + * The country code of the calling IP (ArcGIS Online only). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#ipCntryCode) + */ ipCntryCode: string; - isOrganization: boolean; + /** + * Indicates whether the portal is an organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isOrganization) + */ + readonly isOrganization: boolean; + /** + * Indicates if the portal is on-premises. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isPortal) + */ isPortal: boolean; + /** + * The query that identifies the group containing editing templates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#layerTemplatesGroupQuery) + */ layerTemplatesGroupQuery: string; - loaded: boolean; + /** + * Indicates whether the portal's resources have loaded. When `true`, all the properties of the object can be accessed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#loaded) + * + * @default false + */ + readonly loaded: boolean; + /** + * The maximum validity in minutes of tokens issued for users of the organization. -1 is the default and is a special value that indicates infinite timeout or permanent tokens. For tokens granted using OAuth 2.0 authorization grant, it represents the maximum validity of refresh tokens. For access tokens, the maximum validity is the lower of two weeks or this value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#maxTokenExpirationMinutes) + */ maxTokenExpirationMinutes: number; + /** + * Date the organization was last modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#modified) + */ modified: Date; + /** + * Name of the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#name) + */ name: string; + /** + * URL of the portal host. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalHostname) + */ portalHostname: string; + /** + * The portal mode. **Known Values:** multitenant | singletenant + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) + */ portalMode: string; + /** + * Properties specific to the organization, for example the "contact us" link. If the organization is public, the properties are visible to the anonymous user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalProperties) + */ portalProperties: any; + /** + * The region for the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region) + */ region: string; - restUrl: string; + /** + * The REST URL for the portal, for example "https://www.arcgis.com/sharing/rest" for ArcGIS Online and "https://www.example.com/arcgis/sharing/rest" for your in-house portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#restUrl) + */ + readonly restUrl: string; + /** + * Custom HTML for the home page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#rotatorPanels) + */ rotatorPanels: any[]; + /** + * Indicates whether the description of your organization displays on the home page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#showHomePageDescription) + */ showHomePageDescription: boolean; + /** + * Indicates whether hosted services are supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#supportsHostedServices) + * + * @default false + */ supportsHostedServices: boolean; + /** + * The query that defines the symbols sets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#symbolSetsGroupQuery) + */ symbolSetsGroupQuery: string; + /** + * The query that defines the collection of templates that will appear in the template gallery. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#templatesGroupQuery) + */ templatesGroupQuery: string; - thumbnailUrl: string; + /** + * The URL to the thumbnail of the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#thumbnailUrl) + */ + readonly thumbnailUrl: string; + /** + * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Known Values:** english | metric + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#units) + */ units: string; + /** + * The URL to the portal instance. Setting the location of the portal instance via [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) should be used in favor of setting it directly on this property. If using an on-premise portal, the syntax should look similar to: `https://www.example.com/arcgis` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#url) + * + * @default {@link module:esri/config#portalUrl esriConfig.portalUrl} + */ url: string; + /** + * The prefix selected by the organization's administrator to be used with the customBaseURL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#urlKey) + */ urlKey: string; + /** + * Information representing a registered user of the portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#user) + */ user: PortalUser; + /** + * When `true`, only simple where clauses that are compliant with SQL92 can be used when querying layers and tables. The recommended security setting is true. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useStandardizedQuery) + */ useStandardizedQuery: boolean; + /** + * When `true`, the organization has opted in to use the vector tile basemaps, and (a) [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) should be used instead of [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery), while (b) [defaultVectorBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) should be used instead of [defaultBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap). The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method automatically uses vectorBasemapGalleryGroupQuery. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) + */ useVectorBasemaps: boolean; + /** + * The query that defines the vector tiles basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) + */ vectorBasemapGalleryGroupQuery: string; + /** + * Fetches the [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) that are displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html). When [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is `true`, the basemaps will be based on [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery), and otherwise on [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) + * + * @param basemapGalleryGroupQuery When provided, this argument is used to fetch basemaps based on input query parameters. + * + */ fetchBasemaps(basemapGalleryGroupQuery?: string): IPromise; + /** + * Fetches the featured groups in the Portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchFeaturedGroups) + * + * + */ fetchFeaturedGroups(): IPromise; - queryGroups(queryParams: PortalQueryParams): IPromise; - queryItems(queryParams: PortalQueryParams): IPromise; - queryUsers(queryParams: PortalQueryParams): IPromise; + /** + * Executes a query against the Portal to return an array of [PortalGroup](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html) objects that match the input query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryGroups) + * + * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). + * + */ + queryGroups(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; + /** + * Executes a query against the Portal to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) + * + * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). + * + */ + queryItems(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; + /** + * Executes a query against the Portal to return an array of [PortalUser](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html) objects that match the input query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryUsers) + * + * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). + * + */ + queryUsers(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; } interface PortalConstructor { + /** + * The Portal class is part of the [ArcGIS Portal API](http://server.arcgis.com/en/portal/) which provides a way to build applications that work with content from [ArcGIS Online](http://www.arcgis.com/home/) or an [ArcGIS Portal API](http://server.arcgis.com/en/portal/). [ArcGIS Portal API](http://server.arcgis.com/en/portal/) is software from Esri that customers can deploy either on-premises or in the cloud. [ArcGIS Online](http://www.arcgis.com/home/) is Esri's Software as a Service offering that represents GIS as a Service and is implemented using the same technology as ArcGIS Portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) + */ + new(properties?: PortalProperties): Portal; + /** + * Returns a cached default Portal instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#getDefault) + * + * + */ getDefault(): Portal; } export const Portal: PortalConstructor; interface PortalProperties extends LoadableProperties { + /** + * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Known Values:** public | private + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#access) + */ access?: string; + /** + * When `true`, access to the organization's Portal resources must occur over SSL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#allSSL) + */ allSSL?: boolean; + /** + * The authentication mode for handling authentication when the user attempts to access a secure resource. + * + * Possible Value | Description + * ---------------|------------ + * anonymous | An error will be returned when a secure resource is requested. + * auto | The user will be signed in when a secure resource is requested. + * immediate | The user will be signed in when the Portal is loaded. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authMode) + * + * @default auto + */ authMode?: string; + /** + * Array of trusted servers to send credentials to when making Cross-Origin Resource Sharing (CORS) requests to access services secured with web-tier authentication. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authorizedCrossOriginDomains) + */ authorizedCrossOriginDomains?: string[]; + /** + * The query that defines the basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is not true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery) + */ basemapGalleryGroupQuery?: string; + /** + * The Bing key to use for web maps using Bing Maps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#bingKey) + */ bingKey?: string; + /** + * Indicates whether an organization can list applications in the marketplace . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListApps) + */ canListApps?: boolean; + /** + * Indicates whether an organization can list data services in the marketplace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListData) + */ canListData?: boolean; + /** + * Indicates whether an organization can list pre-provisioned items in the marketplace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListPreProvisionedItems) + */ canListPreProvisionedItems?: boolean; + /** + * Indicates whether an organization can provision direct purchases in the marketplace without customer request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canProvisionDirectPurchase) + */ canProvisionDirectPurchase?: boolean; + /** + * When `true`, the organization's public items, groups and users are included in search queries. When `false`, no public items outside of the organization are included. However, public items which are part of the organization are included. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSearchPublic) + */ canSearchPublic?: boolean; + /** + * The Bing key can be shared to the public and is returned as part of a portal's description call (`/sharing/rest/portals/`). This requires the access of the portal to be set to public. The canShareBingPublic property is not returned publicly but only shown to users within the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canShareBingPublic) + * + * @default false + */ canShareBingPublic?: boolean; + /** + * When `true`, members of the organization can share resources outside the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSharePublic) + * + * @default false + */ canSharePublic?: boolean; + /** + * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the ArcGIS sign in. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInArcGIS) + * + * @default false + */ canSignInArcGIS?: boolean; + /** + * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the enterprise sign in. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInIDP) + * + * @default false + */ canSignInIDP?: boolean; + /** + * The query that identifies the group containing the color sets used for rendering in the map viewer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#colorSetsGroupQuery) + */ colorSetsGroupQuery?: string; + /** + * Indicates whether to allow the organization to disable commenting. When commentsEnabled is false, comments are hidden and not removed. numComments are set to zero for all items in the organization. Calls to add a comment and view comments will fail. If the organization re-enables comments, the comments display and numComments are restored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#commentsEnabled) + * + * @default false + */ commentsEnabled?: boolean; + /** + * Date the organization was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#created) + */ created?: DateProperties; + /** + * The default locale (language and country) information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#culture) + */ culture?: string; + /** + * The custom base URL for the portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#customBaseUrl) + */ customBaseUrl?: string; + /** + * The default basemap to use for the portal. Used in the map viewer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap) + */ defaultBasemap?: BasemapProperties; + /** + * The default extent to use for the portal. Used in the map viewer. The extent will be in the default basemap's spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultExtent) + */ defaultExtent?: ExtentProperties; + /** + * The default vector basemap to use for the portal. Used in the map viewer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) + */ defaultVectorBasemap?: BasemapProperties; + /** + * A description of the organization/portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#description) + */ description?: string; + /** + * The featured groups for the portal. Returns an array of objects that provide access to the owner and title for each featured group. Each item in this array has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) + */ featuredGroups?: PortalFeaturedGroups[]; + /** + * The query that defines the featured group. If null, then the most viewed items in the organization will be the featured items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredItemsGroupQuery) + */ featuredItemsGroupQuery?: string; + /** + * The query that identifies the group containing features items for the gallery. Set a Group ID or, if null, then the most viewed items in your organization are displayed in the gallery. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#galleryTemplatesGroupQuery) + */ galleryTemplatesGroupQuery?: string; + /** + * Helper services provided by the portal. For the detailed information about these services, see the [about utility services](https://server.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm) topic from the ArcGIS Server documentation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#helperServices) + */ helperServices?: any; + /** + * The group that contains featured content to be displayed on the home page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContent) + */ homePageFeaturedContent?: string; + /** + * The number of featured items that can be displayed on the home page. The max is 100. Accepts integers only. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContentCount) + */ homePageFeaturedContentCount?: number; + /** + * The port used by the portal for HTTP communication. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpPort) + */ httpPort?: number; + /** + * The port used by the portal for HTTPS communication. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpsPort) + */ httpsPort?: number; + /** + * The id of the organization that owns this portal. If `null` then this is the default portal for anonymous and non-organizational users. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#id) + */ id?: string; + /** + * The country code of the calling IP (ArcGIS Online only). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#ipCntryCode) + */ ipCntryCode?: string; - isOrganization?: boolean; + /** + * Indicates if the portal is on-premises. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isPortal) + */ isPortal?: boolean; + /** + * The query that identifies the group containing editing templates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#layerTemplatesGroupQuery) + */ layerTemplatesGroupQuery?: string; - loaded?: boolean; + /** + * The maximum validity in minutes of tokens issued for users of the organization. -1 is the default and is a special value that indicates infinite timeout or permanent tokens. For tokens granted using OAuth 2.0 authorization grant, it represents the maximum validity of refresh tokens. For access tokens, the maximum validity is the lower of two weeks or this value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#maxTokenExpirationMinutes) + */ maxTokenExpirationMinutes?: number; + /** + * Date the organization was last modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#modified) + */ modified?: DateProperties; + /** + * Name of the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#name) + */ name?: string; + /** + * URL of the portal host. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalHostname) + */ portalHostname?: string; + /** + * The portal mode. **Known Values:** multitenant | singletenant + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) + */ portalMode?: string; + /** + * Properties specific to the organization, for example the "contact us" link. If the organization is public, the properties are visible to the anonymous user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalProperties) + */ portalProperties?: any; + /** + * The region for the organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region) + */ region?: string; - restUrl?: string; + /** + * Custom HTML for the home page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#rotatorPanels) + */ rotatorPanels?: any[]; + /** + * Indicates whether the description of your organization displays on the home page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#showHomePageDescription) + */ showHomePageDescription?: boolean; + /** + * Indicates whether hosted services are supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#supportsHostedServices) + * + * @default false + */ supportsHostedServices?: boolean; + /** + * The query that defines the symbols sets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#symbolSetsGroupQuery) + */ symbolSetsGroupQuery?: string; + /** + * The query that defines the collection of templates that will appear in the template gallery. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#templatesGroupQuery) + */ templatesGroupQuery?: string; - thumbnailUrl?: string; + /** + * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Known Values:** english | metric + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#units) + */ units?: string; + /** + * The URL to the portal instance. Setting the location of the portal instance via [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) should be used in favor of setting it directly on this property. If using an on-premise portal, the syntax should look similar to: `https://www.example.com/arcgis` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#url) + * + * @default {@link module:esri/config#portalUrl esriConfig.portalUrl} + */ url?: string; + /** + * The prefix selected by the organization's administrator to be used with the customBaseURL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#urlKey) + */ urlKey?: string; + /** + * Information representing a registered user of the portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#user) + */ user?: PortalUserProperties; + /** + * When `true`, only simple where clauses that are compliant with SQL92 can be used when querying layers and tables. The recommended security setting is true. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useStandardizedQuery) + */ useStandardizedQuery?: boolean; + /** + * When `true`, the organization has opted in to use the vector tile basemaps, and (a) [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) should be used instead of [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery), while (b) [defaultVectorBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) should be used instead of [defaultBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap). The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method automatically uses vectorBasemapGalleryGroupQuery. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) + */ useVectorBasemaps?: boolean; + /** + * The query that defines the vector tiles basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) + */ vectorBasemapGalleryGroupQuery?: string; } - export interface PortalFeaturedGroups { + + export interface PortalFeaturedGroups extends Object { + /** + * Name of the group owner. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) + */ owner: string; + /** + * Group title. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) + */ title: string; } interface PortalFolder extends Accessor { + /** + * The date the folder was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#created) + */ created: Date; + /** + * The unique id of the folder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#id) + */ id: string; + /** + * The portal associated with the folder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#portal) + */ portal: Portal; + /** + * The title of the folder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#title) + */ title: string; - url: string; + /** + * The URL to the folder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#url) + */ + readonly url: string; } interface PortalFolderConstructor { + + new(properties?: PortalFolderProperties): PortalFolder; } export const PortalFolder: PortalFolderConstructor; interface PortalFolderProperties { + /** + * The date the folder was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#created) + */ created?: DateProperties; + /** + * The unique id of the folder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#id) + */ id?: string; + /** + * The portal associated with the folder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#portal) + */ portal?: PortalProperties; + /** + * The title of the folder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#title) + */ title?: string; - url?: string; } interface PortalGroup extends Accessor { + /** + * The access privileges on the group which determines who can see and access the group. **Known Values:** private | org | public + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#access) + */ access: string; + /** + * The date the group was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#created) + */ created: Date; + /** + * A detailed description of the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#description) + */ description: string; + /** + * The unique id for the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#id) + */ id: string; + /** + * If set to `true`, then users will not be able to apply to join the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#isInvitationOnly) + * + * @default false + */ isInvitationOnly: boolean; + /** + * The date the group was last modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#modified) + */ modified: Date; + /** + * The username of the group's owner. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#owner) + */ owner: string; + /** + * The portal associated with the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#portal) + */ portal: Portal; + /** + * A short summary that describes the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#snippet) + */ snippet: string; + /** + * User defined tags that describe the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#tags) + */ tags: string[]; - thumbnailUrl: string; + /** + * The URL to the thumbnail used for the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#thumbnailUrl) + */ + readonly thumbnailUrl: string; + /** + * The title of the group. This is the name that is displayed to users. It is also used to refer to the group. Every group must have a title and it must be unique. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#title) + */ title: string; - url: string; + /** + * The URL to the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#url) + */ + readonly url: string; + /** + * Fetches the current members of the group. This method is only available to members or administrators of the group. View the ArcGIS Portal API REST documentation for the [Group Users](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Group_Users/02r30000006p000000/) for more details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#fetchMembers) + * + * + */ fetchMembers(): IPromise; + /** + * Get the URL to the thumbnail image for the group. Available width sizes: 150, 300 and 600. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#getThumbnailUrl) + * + * @param width The desired image width. + * + */ getThumbnailUrl(width?: number): string; - queryItems(queryParams?: PortalQueryParams): IPromise; + /** + * Executes a query against the group to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems) + * + * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). + * + */ + queryItems(queryParams?: PortalQueryParams | PortalQueryParamsProperties): IPromise; } interface PortalGroupConstructor { + + new(properties?: PortalGroupProperties): PortalGroup; } export const PortalGroup: PortalGroupConstructor; interface PortalGroupProperties { + /** + * The access privileges on the group which determines who can see and access the group. **Known Values:** private | org | public + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#access) + */ access?: string; + /** + * The date the group was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#created) + */ created?: DateProperties; + /** + * A detailed description of the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#description) + */ description?: string; + /** + * The unique id for the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#id) + */ id?: string; + /** + * If set to `true`, then users will not be able to apply to join the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#isInvitationOnly) + * + * @default false + */ isInvitationOnly?: boolean; + /** + * The date the group was last modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#modified) + */ modified?: DateProperties; + /** + * The username of the group's owner. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#owner) + */ owner?: string; + /** + * The portal associated with the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#portal) + */ portal?: PortalProperties; + /** + * A short summary that describes the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#snippet) + */ snippet?: string; + /** + * User defined tags that describe the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#tags) + */ tags?: string[]; - thumbnailUrl?: string; + /** + * The title of the group. This is the name that is displayed to users. It is also used to refer to the group. Every group must have a title and it must be unique. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#title) + */ title?: string; - url?: string; } interface PortalItem extends Accessor, Loadable, JSONSupport { + /** + * Indicates the level of access to this item: `private`, `shared`, `org`, or `public`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#access) + */ access: string; + /** + * Information on the source of the item and its copyright status. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#accessInformation) + */ accessInformation: string; + /** + * Average rating. Uses a weighted average called "Bayesian average." + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating) + */ avgRating: number; + /** + * The date the item was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#created) + */ created: Date; + /** + * The item's locale information (language and country). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#culture) + */ culture: string; + /** + * The detailed description of the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#description) + */ description: string; + /** + * The geographic extent, or bounding rectangle, of the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent) + */ extent: Extent; + /** + * The unique id for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#id) + */ id: string; - isLayer: boolean; - itemControl: string; - itemUrl: string; + /** + * Indicates whether a layer can be created from this item using [Layer.fromPortalItem()](esri-layers-Layer.html#fromPortalItem). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#isLayer) + */ + readonly isLayer: boolean; + /** + * Indicates whether an item can be updated and deleted. + * + * Possible Value | Description + * ---------------|------------ + * admin | The item can be updated or deleted. + * update | The item can be updated, but not deleted. + * null | The item cannot be updated nor deleted. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemControl) + */ + readonly itemControl: string; + /** + * The URL to the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemUrl) + */ + readonly itemUrl: string; + /** + * Information on license or restrictions related to the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#licenseInfo) + */ licenseInfo: string; - loaded: boolean; + /** + * Indicates whether the item's resources have loaded from the portal. When `true`, all the properties of the object can be accessed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#loaded) + * + * @default false + */ + readonly loaded: boolean; + /** + * The date the item was last modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#modified) + */ modified: Date; + /** + * The name of the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#name) + */ name: string; + /** + * Number of comments on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numComments) + */ numComments: number; + /** + * Number of ratings on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numRatings) + */ numRatings: number; + /** + * Number of views on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numViews) + */ numViews: number; + /** + * The username of the user who owns this item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#owner) + */ owner: string; + /** + * The portal that contains the item. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). Suggested to use [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) instead of this property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) + */ portal: Portal; + /** + * The size of the item (in bytes). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#size) + */ size: number; + /** + * A summary description of the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#snippet) + */ snippet: string; + /** + * User defined tags that describe the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#tags) + */ tags: string[]; - thumbnailUrl: string; + /** + * The URL to the thumbnail used for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#thumbnailUrl) + */ + readonly thumbnailUrl: string; + /** + * The title for the item. This is the name that is displayed to users and used to refer to the item. Every item must have a title. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#title) + */ title: string; + /** + * The GIS content type of this item. Example types include Web Map, Map Service, Shapefile, and Web Mapping Application. See the [ArcGIS REST API Items and Items Types Reference](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Items_and_item_types/02r3000000ms000000/) to get an understanding of the item type hierarchy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#type) + */ type: string; + /** + * Type keywords that describe the type of content of this item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#typeKeywords) + */ typeKeywords: string[]; + /** + * The service URL of this item. Only certain layer item types such as "Feature Service", "Map Service", "Image Service", "Scene Service", "WMS" and "KML" have service URLs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#url) + */ url: string; + /** + * Adds a rating to an accessible item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#addRating) + * + * @param rating Rating to set for the item. Rating must be a number between 1.0 and 5.0. + * + */ addRating(rating: number | PortalRating): IPromise; + /** + * Deletes a rating for the specified item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#deleteRating) + * + * + */ deleteRating(): IPromise; + /** + * Requests a PortalItem in the format specified in `responseType`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchData) + * + * @param responseType The format of the response. **Known Values:** json | xml | text | blob | array-buffer | document + * + */ fetchData(responseType?: string): IPromise; + /** + * Returns the rating (if any) given to the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRating) + * + * + */ fetchRating(): IPromise; + /** + * Gets all the related items of a certain relationship type for the portal item. An optional direction can be specified if the direction of the relationship is ambiguous. Otherwise, the service will try to infer it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) + * + * @param params See the object specifications table below for the parameters that may be passed as properties in this object. + * @param params.relationshipType The type of relationship between the two items. See [Relationship types](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000mm000000) for a complete listing of types. + * @param params.direction The direction of the relationship. Can either be `forward` (from origin to destination) or `reverse` (from destination to origin). **Possible Values:** forward | reverse + * + */ fetchRelatedItems(params: PortalItemFetchRelatedItemsParams): IPromise; + /** + * Get the URL to the thumbnail image for the item. Available width sizes: 200, 400, 800 and 2400. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#getThumbnailUrl) + * + * @param width The desired image width. + * + */ getThumbnailUrl(width?: number): string; + /** + * Updates the item's properties to the portal, and optionally its data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) + * + * @param params See the object specifications table below for the parameters that may be passed as properties in this object. + * @param params.data **Optional**. The component used to stream the data represented by the item to the client. + * + */ update(params?: PortalItemUpdateParams): IPromise; + /** + * Updates the item's thumbnail on the portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#updateThumbnail) + * + * @param params See the object specification table below for the parameters that may be passed as properties in this object. + * @param params.thumbnail A URL, Data URI, Blob, or File. The accepted formats are `GIF`, `JPG`, and `PNG`. + * + */ updateThumbnail(params: PortalItemUpdateThumbnailParams): IPromise; } interface PortalItemConstructor { + + new(properties?: PortalItemProperties): PortalItem; fromJSON(json: any): PortalItem; @@ -3768,198 +14510,896 @@ declare namespace __esri { export const PortalItem: PortalItemConstructor; interface PortalItemProperties extends LoadableProperties { + /** + * Indicates the level of access to this item: `private`, `shared`, `org`, or `public`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#access) + */ access?: string; + /** + * Information on the source of the item and its copyright status. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#accessInformation) + */ accessInformation?: string; + /** + * Average rating. Uses a weighted average called "Bayesian average." + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating) + */ avgRating?: number; + /** + * The date the item was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#created) + */ created?: DateProperties; + /** + * The item's locale information (language and country). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#culture) + */ culture?: string; + /** + * The detailed description of the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#description) + */ description?: string; + /** + * The geographic extent, or bounding rectangle, of the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent) + */ extent?: ExtentProperties; + /** + * The unique id for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#id) + */ id?: string; - isLayer?: boolean; - itemControl?: string; - itemUrl?: string; + /** + * Information on license or restrictions related to the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#licenseInfo) + */ licenseInfo?: string; - loaded?: boolean; + /** + * The date the item was last modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#modified) + */ modified?: DateProperties; + /** + * The name of the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#name) + */ name?: string; + /** + * Number of comments on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numComments) + */ numComments?: number; + /** + * Number of ratings on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numRatings) + */ numRatings?: number; + /** + * Number of views on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numViews) + */ numViews?: number; + /** + * The username of the user who owns this item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#owner) + */ owner?: string; + /** + * The portal that contains the item. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). Suggested to use [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) instead of this property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) + */ portal?: PortalProperties; + /** + * The size of the item (in bytes). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#size) + */ size?: number; + /** + * A summary description of the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#snippet) + */ snippet?: string; + /** + * User defined tags that describe the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#tags) + */ tags?: string[]; - thumbnailUrl?: string; + /** + * The title for the item. This is the name that is displayed to users and used to refer to the item. Every item must have a title. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#title) + */ title?: string; + /** + * The GIS content type of this item. Example types include Web Map, Map Service, Shapefile, and Web Mapping Application. See the [ArcGIS REST API Items and Items Types Reference](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Items_and_item_types/02r3000000ms000000/) to get an understanding of the item type hierarchy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#type) + */ type?: string; + /** + * Type keywords that describe the type of content of this item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#typeKeywords) + */ typeKeywords?: string[]; + /** + * The service URL of this item. Only certain layer item types such as "Feature Service", "Map Service", "Image Service", "Scene Service", "WMS" and "KML" have service URLs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#url) + */ url?: string; } - export interface PortalItemFetchRelatedItemsParams { + + export interface PortalItemFetchRelatedItemsParams extends Object { + /** + * The type of relationship between the two items. See [Relationship types](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000mm000000) for a complete listing of types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) + */ relationshipType: string; + /** + * The direction of the relationship. Can either be `forward` (from origin to destination) or `reverse` (from destination to origin). **Possible Values:** forward | reverse + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) + */ direction?: string; } - export interface PortalItemUpdateParams { + + export interface PortalItemUpdateParams extends Object { + /** + * **Optional**. The component used to stream the data represented by the item to the client. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) + */ data: string | any; } - export interface PortalItemUpdateThumbnailParams { + + export interface PortalItemUpdateThumbnailParams extends Object { + /** + * A URL, Data URI, Blob, or File. The accepted formats are `GIF`, `JPG`, and `PNG`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#updateThumbnail) + */ thumbnail: Blob | string; } interface PortalQueryParams extends Accessor { + /** + * Only relevant when querying for [PortalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). When specified, restricts the results of the query to the extent defined here. The [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#spatialReference) of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#extent) + */ extent: Extent; + /** + * The maximum number of results to be included in the [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) set response. The maximum value allowed is `100`. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property combined with the `num` property can be used to paginate the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) + * + * @default 10 + */ num: number; + /** + * The query string used for the search. View the [ArcGIS REST API Search Reference](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000mn000000) for details on constructing a valid query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#query) + */ query: string; + /** + * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. + * + * Field name | Query functionality + * ---------------|------------ + * title | search, group + * uploaded | search + * modified | search + * username | user + * created | user, group + * type | search + * owner | search, group + * avg-rating | search + * num-ratings | search + * num-comments | search + * num-views | search + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortField) + */ sortField: string; + /** + * The order in which to sort the results. + * + * Possible Value | Description + * ---------------|------------ + * asc | Sort the results in ascending order. + * desc | Sort the results in descending order. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortOrder) + * + * @default asc + */ sortOrder: string; + /** + * The index of the first entry in the result set response. The index is 1-based. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property, along with the [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) property can be used to paginate the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) + * + * @default 1 + */ start: number; + /** + * Creates a deep clone of the instance of PortalQueryParams that calls this method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#clone) + * + * + */ clone(): PortalQueryParams; } interface PortalQueryParamsConstructor { + + new(properties?: PortalQueryParamsProperties): PortalQueryParams; } export const PortalQueryParams: PortalQueryParamsConstructor; interface PortalQueryParamsProperties { + /** + * Only relevant when querying for [PortalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). When specified, restricts the results of the query to the extent defined here. The [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#spatialReference) of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#extent) + */ extent?: ExtentProperties; + /** + * The maximum number of results to be included in the [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) set response. The maximum value allowed is `100`. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property combined with the `num` property can be used to paginate the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) + * + * @default 10 + */ num?: number; + /** + * The query string used for the search. View the [ArcGIS REST API Search Reference](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000mn000000) for details on constructing a valid query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#query) + */ query?: string; + /** + * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. + * + * Field name | Query functionality + * ---------------|------------ + * title | search, group + * uploaded | search + * modified | search + * username | user + * created | user, group + * type | search + * owner | search, group + * avg-rating | search + * num-ratings | search + * num-comments | search + * num-views | search + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortField) + */ sortField?: string; + /** + * The order in which to sort the results. + * + * Possible Value | Description + * ---------------|------------ + * asc | Sort the results in ascending order. + * desc | Sort the results in descending order. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortOrder) + * + * @default asc + */ sortOrder?: string; + /** + * The index of the first entry in the result set response. The index is 1-based. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property, along with the [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) property can be used to paginate the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) + * + * @default 1 + */ start?: number; } interface PortalQueryResult extends Accessor { + /** + * The query parameters for the next set of results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#nextQueryParams) + */ nextQueryParams: PortalQueryParams; + /** + * The query parameters for the first set of results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#queryParams) + */ queryParams: PortalQueryParams; + /** + * An array of result item objects. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) + */ results: any[]; + /** + * The total number of results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#total) + */ total: number; } interface PortalQueryResultConstructor { + + new(properties?: PortalQueryResultProperties): PortalQueryResult; } export const PortalQueryResult: PortalQueryResultConstructor; interface PortalQueryResultProperties { + /** + * The query parameters for the next set of results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#nextQueryParams) + */ nextQueryParams?: PortalQueryParamsProperties; + /** + * The query parameters for the first set of results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#queryParams) + */ queryParams?: PortalQueryParamsProperties; + /** + * An array of result item objects. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) + */ results?: any[]; + /** + * The total number of results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#total) + */ total?: number; } interface PortalRating extends Accessor { + /** + * Date the rating was added to the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#created) + */ created: Date; + /** + * A rating between 1.0 and 5.0 for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#rating) + */ rating: number; } interface PortalRatingConstructor { + + new(properties?: PortalRatingProperties): PortalRating; } export const PortalRating: PortalRatingConstructor; interface PortalRatingProperties { + /** + * Date the rating was added to the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#created) + */ created?: DateProperties; + /** + * A rating between 1.0 and 5.0 for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#rating) + */ rating?: number; } interface PortalUser extends Accessor { + /** + * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Known Values:** private | org | public + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#access) + */ access: string; + /** + * The date the user was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#created) + */ created: Date; + /** + * The culture information for the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#culture) + */ culture: string; + /** + * A description of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#description) + */ description: string; + /** + * The user's e-mail address. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#email) + */ email: string; + /** + * The user's full name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fullName) + */ fullName: string; + /** + * The date the user was last modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#modified) + */ modified: Date; + /** + * The ID of the organization the user belongs to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#orgId) + */ orgId: string; + /** + * The portal associated with the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#portal) + */ portal: Portal; + /** + * The user's preferred view for content, either web or GIS. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#preferredView) + */ preferredView: string; + /** + * The user preferred region, used to set the featured maps on the home page, content in the gallery, and the default extent of new maps in the Viewer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#region) + */ region: string; + /** + * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Known Values:** org_admin | org_publisher | org_user + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) + */ role: string; + /** + * The ID of the user's role. Only set if the user is assigned a custom role. When present, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will indicate the "base" role of the custom role based on the privileges the custom role contains. For example, if the custom role contains some publisher privileges, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will be set to `org_publisher`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) + */ roleId: string; - thumbnailUrl: string; + /** + * The URL to the thumbnail image for the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#thumbnailUrl) + */ + readonly thumbnailUrl: string; + /** + * The user's personal units of measure setting. **Known Values:** english | metric + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#units) + */ units: string; - userContentUrl: string; + /** + * The URL for the user's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#userContentUrl) + */ + readonly userContentUrl: string; + /** + * The username of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#username) + */ username: string; + /** + * Adds an item to the user's portal content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) + * + * @param params See the object specifications table below for the parameters that may be passed as properties in this object. + * @param params.item The item to add to the user's content. + * @param params.data The component used to stream the data represented by the item to the client. + * @param params.folder The portal folder in which to store the item. + * + */ addItem(params: PortalUserAddItemParams): IPromise; + /** + * Deletes an item from the user's portal content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#deleteItem) + * + * @param item The portal item to remove. + * + */ deleteItem(item: PortalItem): IPromise; + /** + * Fetches all of the user's folders used to organize portal content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchFolders) + * + * + */ fetchFolders(): IPromise; + /** + * Fetches all the groups that the portal user has permission to access. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchGroups) + * + * + */ fetchGroups(): IPromise; - fetchItems(params: PortalUserFetchItemsParams): IPromise; + /** + * Retrieves all the items in the specified folder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) + * + * @param params See the object specifications table below for the parameters that may be passed as properties in this object. + * @param params.folder The folder to retrieve items from. + * @param params.num The maximum number of results to be included in the result set response. The maximum value allowed is 100. The start property combined with the num property can be used to paginate the search results. + * @param params.start The index of the first entry in the result set response. The index is 1-based. + * + */ + fetchItems(params?: PortalUserFetchItemsParams): IPromise; + /** + * Get the URL to the thumbnail image for the user. Available width sizes: 150, 300 and 600. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#getThumbnailUrl) + * + * @param width The desired image width. + * + */ getThumbnailUrl(width?: number): string; + /** + * Executes a query against the user's favorite group to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#queryFavorites) + * + * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). This object may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/). + * + */ queryFavorites(queryParams?: PortalQueryParams): IPromise; } interface PortalUserConstructor { + + new(properties?: PortalUserProperties): PortalUser; } export const PortalUser: PortalUserConstructor; interface PortalUserProperties { + /** + * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Known Values:** private | org | public + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#access) + */ access?: string; + /** + * The date the user was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#created) + */ created?: DateProperties; + /** + * The culture information for the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#culture) + */ culture?: string; + /** + * A description of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#description) + */ description?: string; + /** + * The user's e-mail address. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#email) + */ email?: string; + /** + * The user's full name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fullName) + */ fullName?: string; + /** + * The date the user was last modified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#modified) + */ modified?: DateProperties; + /** + * The ID of the organization the user belongs to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#orgId) + */ orgId?: string; + /** + * The portal associated with the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#portal) + */ portal?: PortalProperties; + /** + * The user's preferred view for content, either web or GIS. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#preferredView) + */ preferredView?: string; + /** + * The user preferred region, used to set the featured maps on the home page, content in the gallery, and the default extent of new maps in the Viewer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#region) + */ region?: string; + /** + * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Known Values:** org_admin | org_publisher | org_user + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) + */ role?: string; + /** + * The ID of the user's role. Only set if the user is assigned a custom role. When present, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will indicate the "base" role of the custom role based on the privileges the custom role contains. For example, if the custom role contains some publisher privileges, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will be set to `org_publisher`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) + */ roleId?: string; - thumbnailUrl?: string; + /** + * The user's personal units of measure setting. **Known Values:** english | metric + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#units) + */ units?: string; - userContentUrl?: string; + /** + * The username of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#username) + */ username?: string; } - export interface PortalUserAddItemParams { + + export interface PortalUserAddItemParams extends Object { + /** + * The item to add to the user's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) + */ item: PortalItem; + /** + * The component used to stream the data represented by the item to the client. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) + */ data?: string | any; + /** + * The portal folder in which to store the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) + */ folder?: PortalFolder; } - export interface PortalUserFetchItemsParams { - folder: PortalFolder; - num: number; - start: number; + + export interface PortalUserFetchItemsParams extends Object { + /** + * The folder to retrieve items from. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) + */ + folder?: PortalFolder; + /** + * The maximum number of results to be included in the result set response. The maximum value allowed is 100. The start property combined with the num property can be used to paginate the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) + * + * @default 10 + */ + num?: number; + /** + * The index of the first entry in the result set response. The index is 1-based. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) + * + * @default 1 + */ + start?: number; } interface ClassBreaksRenderer extends Renderer, VisualVariablesMixin { + /** + * When symbolizing polygon features with graduated symbols, set a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) on this property to visualize the boundaries of each feature. Use a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) of varying sizes in the [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) to indicate the quantity. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#backgroundFillSymbol) + */ backgroundFillSymbol: FillSymbol; + /** + * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) + */ classBreakInfos: ClassBreaksRendererClassBreakInfos[]; + /** + * The classification method used to generate class breaks if the renderer was generated with either of the two following methods: + * * [colorRendererCreator.createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * * [sizeRendererCreator.createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * + * **Known Values:** equal-interval | natural-breaks | quantile | standard-deviation + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classificationMethod) + */ + classificationMethod: string; + /** + * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. + * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) + */ defaultSymbol: Symbol; + /** + * The name of the attribute field the renderer uses to render data. A function may also be used to return a numeric value if the data does not already explicitly exist in a field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) + */ field: string | Function; + /** + * If `true`, graphics with attribute values equal to the max value of a class will be included in that class. Set this property to `false` if the desired behavior is to make a class include values less than, but not equal to the max value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#isMaxInclusive) + * + * @default true + */ isMaxInclusive: boolean; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) + */ legendOptions: ClassBreaksRendererLegendOptions; + /** + * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `field`, this property contains the attribute field name used for normalization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) + */ normalizationField: string; + /** + * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `percent-of-total`, this property contains the total of all data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) + */ normalizationTotal: number; + /** + * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * field | Divides the data value using the attribute value of the field specified in the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) property. This value is set by default if the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) is provided. + * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. + * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) to define the total value by which to normalize. This value is set by default if the [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) is provided. + * + * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) + */ normalizationType: string; - type: string; + /** + * The type of renderer. For ClassBreaksRenderer this value is always `class-breaks`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#type) + */ + readonly type: "class-breaks"; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) for data-driven visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) + */ valueExpression: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle) + */ valueExpressionTitle: string; + /** + * Adds a class break to the renderer. You can provide the minimum, maximum and symbol values as individual arguments or by using the info object. The range of the break is greater than or equal to the minimum value and less than the maximum value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#addClassBreakInfo) + * + * @param min The minimum value to use in the break. This can be a number or an info object as defined in [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos). + * @param max The maximum value to use in the break. + * @param symbol Symbol to use for the break. + * + */ addClassBreakInfo(min: number | any, max: number, symbol: Symbol): void; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#clone) + * + * + */ clone(): ClassBreaksRenderer; + /** + * Returns the [classBreakInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) information (as defined by the renderer) associated with the given graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#getClassBreakInfo) + * + * @param graphic The graphic whose rendering information will be returned. + * + */ getClassBreakInfo(graphic: Graphic): any; + /** + * Removes a break from the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#removeClassBreakInfo) + * + * @param min Minimum value in the break to remove + * @param max Maximum value in the break to remove. + * + */ removeClassBreakInfo(min: number, max: number): void; } interface ClassBreaksRendererConstructor { + /** + * ClassBreaksRenderer defines the symbol of each feature in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on the value of a numeric attribute. Symbols are assigned based on classes or ranges of data. Each feature is assigned a symbol based on the class break in which the value of the attribute falls. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) + */ + new(properties?: ClassBreaksRendererProperties): ClassBreaksRenderer; fromJSON(json: any): ClassBreaksRenderer; @@ -3968,41 +15408,185 @@ declare namespace __esri { export const ClassBreaksRenderer: ClassBreaksRendererConstructor; interface ClassBreaksRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + /** + * When symbolizing polygon features with graduated symbols, set a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) on this property to visualize the boundaries of each feature. Use a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) of varying sizes in the [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) to indicate the quantity. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#backgroundFillSymbol) + */ backgroundFillSymbol?: FillSymbolProperties; + /** + * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) + */ classBreakInfos?: ClassBreaksRendererClassBreakInfos[]; + /** + * The classification method used to generate class breaks if the renderer was generated with either of the two following methods: + * * [colorRendererCreator.createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * * [sizeRendererCreator.createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * + * **Known Values:** equal-interval | natural-breaks | quantile | standard-deviation + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classificationMethod) + */ + classificationMethod?: string; + /** + * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. + * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) + */ defaultSymbol?: SymbolProperties; + /** + * The name of the attribute field the renderer uses to render data. A function may also be used to return a numeric value if the data does not already explicitly exist in a field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) + */ field?: string | Function; + /** + * If `true`, graphics with attribute values equal to the max value of a class will be included in that class. Set this property to `false` if the desired behavior is to make a class include values less than, but not equal to the max value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#isMaxInclusive) + * + * @default true + */ isMaxInclusive?: boolean; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) + */ legendOptions?: ClassBreaksRendererLegendOptions; + /** + * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `field`, this property contains the attribute field name used for normalization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) + */ normalizationField?: string; + /** + * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `percent-of-total`, this property contains the total of all data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) + */ normalizationTotal?: number; + /** + * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * field | Divides the data value using the attribute value of the field specified in the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) property. This value is set by default if the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) is provided. + * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. + * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) to define the total value by which to normalize. This value is set by default if the [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) is provided. + * + * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) + */ normalizationType?: string; - type?: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) for data-driven visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) + */ valueExpression?: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle) + */ valueExpressionTitle?: string; } - export interface ClassBreaksRendererClassBreakInfos { + + export interface ClassBreaksRendererClassBreakInfos extends Object { + /** + * The minimum value of the break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) + */ minValue: number; + /** + * The maximum value of the break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) + */ maxValue: number; + /** + * The symbol used to style features whose values are between the `minValue` and `maxValue` of the break. This value may be autocast by specifying the symbol `type`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) + */ symbol: Symbol; + /** + * The label used to describe features in the break in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) + */ label?: string; } - export interface ClassBreaksRendererLegendOptions { + + export interface ClassBreaksRendererLegendOptions extends Object { + /** + * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) or [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) + */ title: string; } interface PointCloudClassBreaksRenderer extends PointCloudRenderer { + /** + * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) + */ colorClassBreakInfos: PointCloudClassBreaksRendererColorClassBreakInfos[]; + /** + * The name of the field that is used to drive the color visualization for the renderer. The value of this field determines which class break each point is assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#field) + */ field: string; + /** + * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#fieldTransformType) + * + * @default null + */ fieldTransformType: string; - type: string; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) + */ + legendOptions: PointCloudClassBreaksRendererLegendOptions; + /** + * The type of renderer. For PointCloudClassBreaksRenderer this value is always `point-cloud-class-breaks`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#type) + */ + readonly type: "point-cloud-class-breaks"; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#clone) + * + * + */ clone(): PointCloudClassBreaksRenderer; } interface PointCloudClassBreaksRendererConstructor { + /** + * This class defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a numeric attribute. Colors are assigned based on classes or ranges of data. Each point is assigned a symbol based on the class break in which the value of the attribute falls. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html) + */ + new(properties?: PointCloudClassBreaksRendererProperties): PointCloudClassBreaksRenderer; fromJSON(json: any): PointCloudClassBreaksRenderer; @@ -4011,28 +15595,107 @@ declare namespace __esri { export const PointCloudClassBreaksRenderer: PointCloudClassBreaksRendererConstructor; interface PointCloudClassBreaksRendererProperties extends PointCloudRendererProperties { + /** + * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) + */ colorClassBreakInfos?: PointCloudClassBreaksRendererColorClassBreakInfos[]; + /** + * The name of the field that is used to drive the color visualization for the renderer. The value of this field determines which class break each point is assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#field) + */ field?: string; + /** + * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#fieldTransformType) + * + * @default null + */ fieldTransformType?: string; - type?: string; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) + */ + legendOptions?: PointCloudClassBreaksRendererLegendOptions; } - export interface PointCloudClassBreaksRendererColorClassBreakInfos { + + export interface PointCloudClassBreaksRendererColorClassBreakInfos extends Object { + /** + * The minimum value of the break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) + */ minValue: number; + /** + * The maximum value of the break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) + */ maxValue: number; + /** + * The color used to colorize the points where values are between the `minValue` and `maxValue` of the break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) + */ color: Color; + /** + * The label used to describe point in the break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) + */ label?: string; } + + export interface PointCloudClassBreaksRendererLegendOptions extends Object { + /** + * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) + */ + title?: string; + } + interface PointCloudRenderer extends Accessor, JSONSupport { + /** + * Reduces the brightness of the point's color, based on the value of another field, usually `intensity`. High values leave the color unchanged, while low values darken the color of the point. This helps to display the scanned surface in a more realistic way. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) + */ colorModulation: PointCloudRendererColorModulation; + /** + * Specifies how the size of the points in the point cloud is computed for rendering. The splat algorithm automatically computes a size based on the density, which varies with the Level of Detail that is currently displayed. The fixed size algorithm displays all points with the same size, either in screen space or real world units. When `pointSizeAlgorithm` is not set, the default is `splat`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) + */ pointSizeAlgorithm: PointCloudRendererPointSizeAlgorithm; + /** + * The number of points to draw per display inch. This property determines the level of detail in the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointsPerInch) + * + * @default 10 + */ pointsPerInch: number; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#clone) + * + * + */ clone(): PointCloudRenderer; } interface PointCloudRendererConstructor { + + new(properties?: PointCloudRendererProperties): PointCloudRenderer; fromJSON(json: any): PointCloudRenderer; @@ -4041,33 +15704,121 @@ declare namespace __esri { export const PointCloudRenderer: PointCloudRendererConstructor; interface PointCloudRendererProperties { + /** + * Reduces the brightness of the point's color, based on the value of another field, usually `intensity`. High values leave the color unchanged, while low values darken the color of the point. This helps to display the scanned surface in a more realistic way. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) + */ colorModulation?: PointCloudRendererColorModulation; + /** + * Specifies how the size of the points in the point cloud is computed for rendering. The splat algorithm automatically computes a size based on the density, which varies with the Level of Detail that is currently displayed. The fixed size algorithm displays all points with the same size, either in screen space or real world units. When `pointSizeAlgorithm` is not set, the default is `splat`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) + */ pointSizeAlgorithm?: PointCloudRendererPointSizeAlgorithm; + /** + * The number of points to draw per display inch. This property determines the level of detail in the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointsPerInch) + * + * @default 10 + */ pointsPerInch?: number; } - export interface PointCloudRendererColorModulation { + + export interface PointCloudRendererColorModulation extends Object { + /** + * Field to use for the color modulation. Commonly modulation is used with the `intensity` field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) + */ field: string; + /** + * Field value at which the point color becomes darkest. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) + * + * @default 0 + */ minValue?: number; + /** + * Field value at which the point color will be left unchanged. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) + * + * @default 255 + */ maxValue?: number; } - export interface PointCloudRendererPointSizeAlgorithm { + + export interface PointCloudRendererPointSizeAlgorithm extends Object { + /** + * `fixed-size` or `splat`. Choosing `fixed-size` implies setting `size` and `useRealWorldSymbolSizes`. If `splat` is chosen then `scaleFactor` should be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) + */ type: string; + /** + * Specifies whether `size` is in real world units or screen-space units. Applies to `fixed-size` only. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) + */ useRealWorldSymbolSizes?: boolean; + /** + * Point size in meters (`useRealWorldSymbolSizes = true`) or points. Applies to `fixed-size` only. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) + */ size?: number; + /** + * Specifies the scale factor that is applied to the size estimated by the density. Applies to `splat` only. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) + * + * @default 1 + */ scaleFactor?: number; + /** + * Minimum screen space size in points. Applies to `splat` only. **Deprecated since version 4.5** + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) + */ minSize?: number; } interface PointCloudRGBRenderer extends PointCloudRenderer { + /** + * The name of the field containing RGB values used to drive the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#field) + */ field: string; - type: string; + /** + * The type of Renderer. For PointCloudRGBRenderer this value is always `point-cloud-rgb`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#type) + */ + readonly type: "point-cloud-rgb"; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#clone) + * + * + */ clone(): PointCloudRGBRenderer; } interface PointCloudRGBRendererConstructor { + /** + * PointCloudRGBRenderer defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a color attribute. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) + */ + new(properties?: PointCloudRGBRendererProperties): PointCloudRGBRenderer; fromJSON(json: any): PointCloudRGBRenderer; @@ -4076,20 +15827,65 @@ declare namespace __esri { export const PointCloudRGBRenderer: PointCloudRGBRendererConstructor; interface PointCloudRGBRendererProperties extends PointCloudRendererProperties { + /** + * The name of the field containing RGB values used to drive the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#field) + */ field?: string; - type?: string; } interface PointCloudStretchRenderer extends PointCloudRenderer { + /** + * The name of the number field whose values are used to drive the continuous color visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#field) + */ field: string; + /** + * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#fieldTransformType) + * + * @default null + */ fieldTransformType: string; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) + */ + legendOptions: PointCloudStretchRendererLegendOptions; + /** + * An array of color value pairs. Points with values between the specified stops are colorized with linearly interpolated colors. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) + */ stops: PointCloudStretchRendererStops[]; - type: string; + /** + * The type of Renderer. For PointCloudStretchRenderer this value is always `point-cloud-stretch`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#type) + */ + readonly type: "point-cloud-stretch"; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#clone) + * + * + */ clone(): PointCloudStretchRenderer; } interface PointCloudStretchRendererConstructor { + /** + * PointCloudStretchRenderer defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a numeric attribute. It allows you to easily map continuous color ramps to minimum and maximum data values of one of the layer's numeric attribute fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html) + */ + new(properties?: PointCloudStretchRendererProperties): PointCloudStretchRenderer; fromJSON(json: any): PointCloudStretchRenderer; @@ -4098,28 +15894,117 @@ declare namespace __esri { export const PointCloudStretchRenderer: PointCloudStretchRendererConstructor; interface PointCloudStretchRendererProperties extends PointCloudRendererProperties { + /** + * The name of the number field whose values are used to drive the continuous color visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#field) + */ field?: string; + /** + * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#fieldTransformType) + * + * @default null + */ fieldTransformType?: string; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) + */ + legendOptions?: PointCloudStretchRendererLegendOptions; + /** + * An array of color value pairs. Points with values between the specified stops are colorized with linearly interpolated colors. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) + */ stops?: PointCloudStretchRendererStops[]; - type?: string; } - export interface PointCloudStretchRendererStops { + + export interface PointCloudStretchRendererLegendOptions extends Object { + /** + * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) + */ + title?: string; + } + + + export interface PointCloudStretchRendererStops extends Object { + /** + * The value for this stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) + */ value: number; + /** + * The label for this stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) + */ label?: string; + /** + * The color value for this stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) + */ color: Color; } interface PointCloudUniqueValueRenderer extends PointCloudRenderer { + /** + * Each element in the array is an object that matches a unique value with a specific color. Features with equal values to those specified here will be assigned the associated color. For example, you may choose to visualize points representing low vegetation with a green color and points representing power lines with a gray color. Each object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) + */ colorUniqueValueInfos: PointCloudUniqueValueRendererColorUniqueValueInfos[]; + /** + * The name of the field whose values are used to drive the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#field) + */ field: string; + /** + * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#fieldTransformType) + * + * @default null + */ fieldTransformType: string; - type: string; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) + */ + legendOptions: PointCloudUniqueValueRendererLegendOptions; + /** + * The type of Renderer. For PointCloudUniqueValueRenderer this value is always `point-cloud-unique-value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#type) + */ + readonly type: "point-cloud-unique-value"; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#clone) + * + * + */ clone(): PointCloudUniqueValueRenderer; } interface PointCloudUniqueValueRendererConstructor { + /** + * PointCloudUniqueValueRenderer allows you to colorize points in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on an attribute value. This is done by assigning unique colors to represent points with equal attribute values. This renderer is used to visualize points of the same type, not interpolate colors along a continuous ramp mapped to numbers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html) + */ + new(properties?: PointCloudUniqueValueRendererProperties): PointCloudUniqueValueRenderer; fromJSON(json: any): PointCloudUniqueValueRenderer; @@ -4128,23 +16013,82 @@ declare namespace __esri { export const PointCloudUniqueValueRenderer: PointCloudUniqueValueRendererConstructor; interface PointCloudUniqueValueRendererProperties extends PointCloudRendererProperties { + /** + * Each element in the array is an object that matches a unique value with a specific color. Features with equal values to those specified here will be assigned the associated color. For example, you may choose to visualize points representing low vegetation with a green color and points representing power lines with a gray color. Each object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) + */ colorUniqueValueInfos?: PointCloudUniqueValueRendererColorUniqueValueInfos[]; + /** + * The name of the field whose values are used to drive the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#field) + */ field?: string; + /** + * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#fieldTransformType) + * + * @default null + */ fieldTransformType?: string; - type?: string; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) + */ + legendOptions?: PointCloudUniqueValueRendererLegendOptions; } - export interface PointCloudUniqueValueRendererColorUniqueValueInfos { - values: number[]; + + export interface PointCloudUniqueValueRendererColorUniqueValueInfos extends Object { + /** + * A unique combination of values that will be represented with the given `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) + */ + values: string[]; + /** + * The color used to represent points whose value matches `values`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) + */ color: Color; + /** + * Label used to describe points matched to the unique value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) + */ label?: string; } + + export interface PointCloudUniqueValueRendererLegendOptions extends Object { + /** + * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) + */ + title?: string; + } + interface Renderer extends Accessor, JSONSupport { + /** + * Authoring metadata only included in renderers generated from one of the Smart Mapping creator methods, such as [sizeRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) or [colorRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer). This includes information from UI elements such as sliders and selected classification methods and themes. This allows the authoring clients to save specific overridable settings so that next time it is accessed via the UI, their selections can be remembered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#authoringInfo) + */ authoringInfo: AuthoringInfo; } interface RendererConstructor { + /** + * Renderers define how to visually represent each feature in one of the following layer types: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) + */ + new(properties?: RendererProperties): Renderer; fromJSON(json: any): Renderer; @@ -4153,118 +16097,795 @@ declare namespace __esri { export const Renderer: RendererConstructor; interface RendererProperties { - authoringInfo?: AuthoringInfo; + /** + * Authoring metadata only included in renderers generated from one of the Smart Mapping creator methods, such as [sizeRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) or [colorRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer). This includes information from UI elements such as sliders and selected classification methods and themes. This allows the authoring clients to save specific overridable settings so that next time it is accessed via the UI, their selections can be remembered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#authoringInfo) + */ + authoringInfo?: AuthoringInfoProperties; } - export interface AuthoringInfo { + /** + * Defines a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) with minimum and maximum bounds. When an object with this specification is applied to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of a renderer, then feature sizes are bounded by min and max data values. Features with values greater than the provided max value are assigned the specified maximum size. Likewise, features with values less than the provied min value are assigned the specified minimum size. Features with values between the min and the max are assigned a corresponding size that is linearly interpolated between the provided min and max size values. The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + export interface BoundedMinMax extends Object { + /** + * The size used to render a feature containing the maximum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + maxSize: string | number; + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ type: string; - fields: string[]; - classificationMethod: string; - standardDeviationInterval: number; - visualVariables: AuthoringInfoVisualVariables[]; + /** + * The name of the numeric attribute field used to normalize the data in `field`. If this field is used, then the values in `maxDataValue` and `minDataValue` should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + normalizationField?: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + valueExpression?: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + valueExpressionTitle?: string; + /** + * The maximum data value used in the size ramp. Features with this value or higher will be rendered at the size defined in `maxSize`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + maxDataValue: number; + /** + * Indicates the source of the data values used to determine the size of each feature. + * + * Value Type | Description + * ------|----------- + * String | The name of the numeric attribute field that contains the data values used to determine the size of each feature. + * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the value used to determine the size of the given feature. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + field?: string | Function; + /** + * The minimum data value used in the size ramp. Features with this value or lower will be rendered at the size defined in `minSize`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + minDataValue: number; + /** + * The size used to render a feature containing the minimum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + minSize: string | number; + /** + * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + legendOptions?: BoundedMinMaxLegendOptions; + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. + * + * Possible Value | Description + * ----------------|----------- + * width | The diameter of the symbol from east to west. + * depth | The diameter of the symbol from north to south. + * height | The height of the symbol. + * width-and-depth | Applies the size visual variable to both width and depth axes. + * all | Applies the size visual variable to all axes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + axis?: string; + /** + * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + useSymbolValue?: boolean; } - export interface ColorVisualVariable { + /** + * The **color** visual variable defines how a continuous color ramp is applied to features based on the values of a numeric attribute field. The minimum and maximum values of the data should be indicated along with their respective color values. You must specify `stops` to construct the color ramp, and either `field` or `valueExpression` to define the driving value. [![renderer-vv-color](https://developers.arcgis.com/javascript/latest/assets/img/samples/7-vv-color.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-color/index.html) The object specification for color is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ + export interface ColorVisualVariable extends Object { + /** + * **Required.** Value must be `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ type: string; + /** + * Indicates the source of the data values used to determine the color of each feature. + * + * Value Type | Description + * ------|----------- + * String | The name of the numeric attribute field that contains the data values used to determine the color of each feature. + * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) including a feature's attributes and returns the value used to determine the color of the given feature. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ field: string | Function; + /** + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in `stops` should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ normalizationField: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ valueExpression: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ valueExpressionTitle: string; + /** + * An object providing options for displaying the color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ legendOptions: ColorVisualVariableLegendOptions; + /** + * An array of objects that defines the color ramp in a sequence of stops. At least two stops are required. Features with values between the given stops will be assigned colors along the ramp proportional to the minimum and maximum values used. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ stops: ColorVisualVariableStops[]; } - export interface OpacityVisualVariable { + /** + * The **opacity** visual variable defines the opacity of each feature's symbol based on a numeric attribute field value. The minimum and maximum values of the data should be indicated along with their respective opacity values. The specification for this object is provided below. You must specify `stops` to construct the opacity ramp, and either `field` or `valueExpression` to define the driving value. [![renderer-vv-opacity](https://developers.arcgis.com/javascript/latest/assets/img/samples/12-vv-transparency.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-opacity/index.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ + export interface OpacityVisualVariable extends Object { + /** + * **Required.** Value must be `opacity`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ type: string; + /** + * Indicates the source of the data values used to determine the opacity of each feature. + * + * Value Type | Description + * ------|----------- + * String | The name of the numeric attribute field that contains the data values used to determine the opacity of each feature. + * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) including the attributes of the feature and returns the value used to determine the opacity of the given feature. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ field: string | Function; + /** + * Name of the attribute field by which to normalize the data. If this field is used, then the values in `stops` should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ normalizationField: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ valueExpression: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ valueExpressionTitle: string; + /** + * An object providing options for displaying the opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ legendOptions: OpacityVisualVariableLegendOptions; + /** + * An array of objects that defines the thematic opacity ramp in a sequence of stops. At least two stops are required. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ stops: OpacityVisualVariableStops[]; } - export interface RotationVisualVariable { + /** + * Defines a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) where data values are interpreted as real-world sizes based on a given unit. Features are then sized according to the real-world measurements, not thematic values and screen units. [![renderer-vv-rw](https://developers.arcgis.com/javascript/latest/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + export interface RealWorldSize extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ type: string; - field: string | Function; - valueExpression: string; - axis: string; - rotationType: string; - } - - export interface SizeVisualVariable { - maxDataValue: number; - type: string; - normalizationField: string; - valueExpression: string; - valueExpressionTitle: string; - legendOptions: SizeVisualVariableLegendOptions; - axis: string; - expression: string; - field: string | Function; - minDataValue: number; - maxSize: string | number | SizeVisualVariable; - minSize: string | number | SizeVisualVariable; - stops: SizeVisualVariableStops[]; + /** + * Indicates the source of the data values used to determine the size of each feature. + * + * Value Type | Description + * ------|----------- + * String | The name of the numeric attribute field that contains the data values used to determine the size of each feature. + * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the value used to determine the size of the given feature. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + field?: string | Function; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + valueExpression?: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + valueExpressionTitle?: string; + /** + * Indicates the unit of measurement used to interpret the value returned by `field` or `valueExpression`. For 3D volumetric symbols the default is `meters`. This property should not be used if the data value represents a thematic quantity (e.g. traffic count, census data, etc.). **Possible Values:** unknown | inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ valueUnit: string; + /** + * Specifies how to apply the data value when mapping real-world sizes. See table below for supported values. + * + * Value | Description + * ------|----------- + * radius | The point data value represents the radius of a circular feature. + * diameter | The point data value represents the diameter of a circular feature. + * area | The point data value represents the area of a feature. + * width | The polyline data value represents the width of a line. + * distance | The polyline data value represents the distance from the center line (one half of the width). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ valueRepresentation: string; - useSymbolValue: boolean; + /** + * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + legendOptions?: RealWorldSizeLegendOptions; + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. + * + * Possible Value | Description + * ----------------|----------- + * width | The diameter of the symbol from east to west. + * depth | The diameter of the symbol from north to south. + * height | The height of the symbol. + * width-and-depth | Applies the size visual variable to both width and depth axes. + * all | Applies the size visual variable to all axes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + axis?: string; + /** + * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + useSymbolValue?: boolean; } - export interface AuthoringInfoVisualVariables { + /** + * The **rotation** visual variable defines how features rendered with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) or [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) in a MapView or [3D object symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) in a SceneView are rotated. The rotation value is determined by mapping the values to data in a field, or by other arithmetic means with a function. This object may be used to depict variables such as wind direction, vehicle heading, etc. [![renderer-vv-rotation](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-vv-rotation.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-rotation/index.html) + * > **Known Limitations** In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) rotation visual variables are not supported with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html), [3D icon symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) and [3D text symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) + */ + export interface RotationVisualVariable extends Object { + /** + * **Required.** Value must be `rotation`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) + */ type: string; - field: string; - minSliderValue: number; - maxSliderValue: number; - theme: string; - style: string; - units: string; - startTime: string | number; - endTime: string | number; + /** + * Indicates the source of the rotation angle of each feature. + * + * Value Type | Description + * ------|----------- + * String | The name of the numeric attribute field that contains the rotation angle of each feature. + * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the rotation angle of the given feature. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) + */ + field: string | Function; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) + */ + valueExpression: string; + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the rotation visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then the following rotation axis will rotate the symbol as indicated by their name. + * + * Possible Value | Description + * ----------------|----------- + * heading | The rotation of the symbol in the horizontal plane (i.e., around the z axis). + * tilt | The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). + * roll | The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) + */ + axis?: string; + /** + * Defines the origin and direction of rotation depending on how the angle of rotation was measured. See the table below for a list of possible values. This property only applies to rotations around the `heading` axis. + * + * Value | Description + * ------|------------ + * geographic | Rotates the symbol from the north in a clockwise direction. + * arithmetic | Rotates the symbol from the east in a counter-clockwise direction. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) + */ + rotationType?: string; } - export interface ColorVisualVariableLegendOptions { + /** + * **Only applicable to [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)**. Defines icon sizes in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) based on minimum and maximum bounds similar to the [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) case. However, this specification allows the developer to specify various min and max sizes based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). Features with values greater than the provided max value are assigned the specified maximum size for the given view scale. Likewise, features with values less than the provied min value are assigned the specified minumum size for the given view scale. Features with values between the min and the max are assigned a corresponding size that is linearly interpolated between the provided min and max size values for the given scale value. The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + export interface ScaleDependentIcons extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + type: string; + /** + * Indicates the source of the data values used to determine the size of each feature. + * + * Value Type | Description + * ------|----------- + * String | The name of the numeric attribute field that contains the data values used to determine the size of each feature. + * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the value used to determine the size of the given feature. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + field?: string | Function; + /** + * The name of the numeric attribute field used to normalize the data in `field`. If this field is used, then the values in `maxDataValue` and `minDataValue` should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + normalizationField?: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + valueExpression?: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + valueExpressionTitle?: string; + /** + * The maximum data value used in the size ramp. Features with this value or higher will be rendered at the size defined in `maxSize`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + maxDataValue: number; + /** + * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is greater than or equal to the `maxDataValue` for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + maxSize: ScaleDependentStops; + /** + * The minimum data value used in the size ramp. Features with this value or lower will be rendered at the size defined in `minSize`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + minDataValue: number; + /** + * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is less than or equal to the `minDataValue` for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + minSize: ScaleDependentStops; + /** + * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + legendOptions?: ScaleDependentIconsLegendOptions; + } + + /** + * **Only applicable to [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)**. Defines feature sizes and outline widths in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). It also provides the specification of the `minSize` and `maxSize` properties in a [ScaleDependentIcons](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) size visual variable. The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) + */ + export interface ScaleDependentStops extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) + */ + type: string; + /** + * This value must be `$view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) + */ + valueExpression: string; + /** + * **Deprecated since version 4.2. Use `valueExpression` instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) + */ + expression?: string; + /** + * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) + */ + target?: string; + /** + * An array of objects that define the size of the icon (or alternatively the width of the polygon outline) at the given scale `value`. At least two stops are required. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) + */ + stops: ScaleDependentStopsStops[]; + } + + /** + * The **size** visual variable defines the size of individual features in a layer based on a numeric (often thematic) value. This value comes from one of the following: + * * An attribute `field` + * * The value of an attribute `field` divided by a `normalizationField` + * * A value returned from an [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) specified in `valueExpression`. + * + * + * Size is defined in the form of a continuous ramp, which may be applied to renderers in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Symbol size may be applied either thematically, or literally using real-world units. See the following object specification tables for details about each potential use of a size visual variable: + * * **[BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax)** - Feature sizes are bounded by min and max data values. + * * **[ThematicStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops)** - Defines two or more stops at which feature sizes are mapped to data values. + * * **[ScaleDependentIcons](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons)** - Icons sizes are bounded by min and max data values, but the min and max sizes (and interpolated sizes) change based on the scale of the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * * **[ScaleDependentStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops)** - Defines the width of polygon outlines at various view scales. + * * **[RealWorldSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize)** - Feature sizes are determined based on real-world measurements and units, not thematic values and screen units. + * + * + * [![renderer-unique-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) + */ + export interface SizeVisualVariable extends Object { + } + + /** + * Defines two or more stops at which feature sizes are mapped to data values in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable). Setting two stops will have the same effect as creating a [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) size visual variable. Adding additional stops allows you to map specific sizes with data values. Sizes are interpolated linearly between stop values. The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + export interface ThematicStops extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + type: string; + /** + * Indicates the source of the data values used to determine the size of each feature. + * + * Value Type | Description + * ------|----------- + * String | The name of the numeric attribute field that contains the data values used to determine the size of each feature. + * Function | A function that iterates through each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html), which includes the feature's attributes, and returns the value used to determine the size of the given feature. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + field?: string | Function; + /** + * The name of the numeric attribute field used to normalize the data in `field`. If this field is used, then the values in `stops` should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + normalizationField?: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + valueExpression?: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + valueExpressionTitle?: string; + /** + * An array of objects that defines the thematic size ramp in a sequence of data or expression stops. At least two stops are required. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + stops: ThematicStopsStops[]; + /** + * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + legendOptions?: ThematicStopsLegendOptions; + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. + * + * Possible Value | Description + * ----------------|----------- + * width | The diameter of the symbol from east to west. + * depth | The diameter of the symbol from north to south. + * height | The height of the symbol. + * width-and-depth | Applies the size visual variable to both width and depth axes. + * all | Applies the size visual variable to all axes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + axis?: string; + /** + * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + useSymbolValue?: boolean; + } + + + export interface BoundedMinMaxLegendOptions extends Object { + /** + * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + title?: string; + /** + * Indicates whether to show the size ramp in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) + */ + showLegend?: boolean; + } + + + export interface ColorVisualVariableLegendOptions extends Object { + /** + * The title describing the visualization of the color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ title: string; + /** + * Indicates whether to show the color ramp in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ showLegend: boolean; } - export interface ColorVisualVariableStops { + + export interface ColorVisualVariableStops extends Object { + /** + * **Required**. Specifies the data value to map with the given `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ value: number; + /** + * **Required**. The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given `value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ color: Color; + /** + * A string value used to label the stop in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) + */ label: string; } - export interface OpacityVisualVariableLegendOptions { + + export interface OpacityVisualVariableLegendOptions extends Object { + /** + * The title describing the visualization of the opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ title: string; + /** + * Indicates whether to show the opacity ramp in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ showLegend: boolean; } - export interface OpacityVisualVariableStops { + + export interface OpacityVisualVariableStops extends Object { + /** + * **Required**. Specifies the data value to map with the given `opacity`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ value: number; + /** + * **Required**. The opacity value used to render features containing the specified `value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ opacity: number; + /** + * A string value used to label the stop in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) + */ label: string; } - export interface SizeVisualVariableLegendOptions { - title: string; - showLegend: boolean; + + export interface RealWorldSizeLegendOptions extends Object { + /** + * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + title?: string; + /** + * Indicates whether to show the size ramp in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) + */ + showLegend?: boolean; } - export interface SizeVisualVariableStops { + + export interface ScaleDependentIconsLegendOptions extends Object { + /** + * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + title?: string; + /** + * Indicates whether to show the size ramp in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) + */ + showLegend?: boolean; + } + + + export interface ScaleDependentStopsStops extends Object { + /** + * Specifies the scale value to map with the given `size`. When the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) equals the given number then icons (or outlines) will be rendered with the given size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) + */ value: number; - size: string | number | any; - label: string; + /** + * The size at which to render features at the specified scale `value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) + */ + size: string | number; + } + + + export interface ThematicStopsLegendOptions extends Object { + /** + * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + title?: string; + /** + * Indicates whether to show the size ramp in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + showLegend?: boolean; + } + + + export interface ThematicStopsStops extends Object { + /** + * Specifies the data or expression value to map with the given `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + value: number; + /** + * The size at which to render features containing the specified `value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + size: number | string; + /** + * A string value used to label the stop in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) + */ + label?: string; } interface SimpleRenderer extends Renderer, VisualVariablesMixin { + /** + * The label for the renderer. This describes what features with the given [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) represent in the real world. This will display next to the layer's [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) inside the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This text is not displayed in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) when [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) are used. When the renderer contains [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables), you should set the `title` property in `legendOptions` on each visual variable to describe the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#label) + */ label: string; + /** + * The symbol used by the renderer to visualize all features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) + */ symbol: Symbol; - type: string; + /** + * The type of renderer. For SimpleRenderer this value is always `simple`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#type) + */ + readonly type: "simple"; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#clone) + * + * + */ clone(): SimpleRenderer; } interface SimpleRendererConstructor { + /** + * SimpleRenderer renders all features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with one [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html). This renderer may be used to simply visualize the location of geographic features. For example, layers representing political boundaries, cities, buildings, rivers, etc. that are typically used for providing geographic context in an application may be defined with a single symbol per layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html) + */ + new(properties?: SimpleRendererProperties): SimpleRenderer; fromJSON(json: any): SimpleRenderer; @@ -4273,358 +16894,2515 @@ declare namespace __esri { export const SimpleRenderer: SimpleRendererConstructor; interface SimpleRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + /** + * The label for the renderer. This describes what features with the given [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) represent in the real world. This will display next to the layer's [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) inside the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This text is not displayed in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) when [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) are used. When the renderer contains [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables), you should set the `title` property in `legendOptions` on each visual variable to describe the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#label) + */ label?: string; + /** + * The symbol used by the renderer to visualize all features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) + */ symbol?: SymbolProperties; - type?: string; } + /** + * This object contains helper methods for generating data-driven visualizations with continuous color or class breaks based on a field value or expression from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The methods in this module generate renderer or visual variable objects that may be applied directly to a supported layer. The renderers specify how features should be visualized based on data values and colors optimized based on the indicated basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) + */ interface color { + /** + * Generates a [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) that may be applied directly to the layer used to call this method. The resulting renderer defines the symbol color of each feature based on the value of the given `field` value. A default color scheme is determined based on the given `basemap`. Depending on the `classificationMethod`, class breaks (or data ranges) are generated based on the statistics of the data. Each feature is assigned a color based on the class break in which the value of the `field` falls. In most cases you will provide a `layer`, `basemap`, `field`, and `classificationMethod` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what colors to use in the visualization. The other options are provided for convenience for more involved custom visualization authoring applications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * + * @param params Input parameters for generating a classed color visualization based on data returned from a given field or expression. See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.field The name of the field whose data will be queried for statistics and classified. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.normalizationType With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. + * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. + * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. + * + * @param params.normalizationTotal When `normalizationType` is `percent-of-total`, this property contains the total of all data values. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.classificationMethod + * The classification method used for generating breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. + * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information. + * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes. + * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean. + * @param params.standardDeviationInterval If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks. **Possible Values:** 1 | 0.5 | 0.33 | 0.25 + * @param params.numClasses The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified. + * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.legendOptions Provides options for setting a title to describe a field instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.minValue A minimum value set by the user. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break. + * @param params.maxValue A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, but isn't required for layers with a `mesh` geometry type. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + */ + createClassBreaksRenderer(params: colorCreateClassBreaksRendererParams): IPromise; + /** + * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to the layer used to call this method. The renderer contains a continuous color visual variable that maps optimal colors based on the indicated basemap to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, `field`, and `theme` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what colors to use in the visualization. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + * + * @param params Input parameters for generating a continuous color visualization based on data returned from a given field or expression. See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.theme + * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. + * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned color visual variable. + * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, but isn't required for layers with a `mesh` geometry type. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + */ createContinuousRenderer(params: colorCreateContinuousRendererParams): IPromise; + /** + * Generates a [PointCloudStretchRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html) with a color scheme best-suited for the given basemap based on statistics returned from a given field of a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). All that's required is a layer instance, field name, and basemap ID. You can optionally set the size and density of the points to suit the needs of the desired visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) + * + * @param params Input parameters for generating a renderer based on the given field of the input layer. See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. The only field names used for this renderer type are `elevation` and `intensity`. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.size The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. + * @param params.density The number of points per inch in the view. + * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the stats object here to avoid making a second statistics query to the server. + * + */ createPCContinuousRenderer(params: colorCreatePCContinuousRendererParams): IPromise; + /** + * Generates a [PointCloudRGBRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) based on the `RGB` field of a given [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). This method simplifies the experience of creating a [PointCloudRGBRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) manually. All that's required is a layer instance. You can optionally set the size and density of the points to suit the needs of the desired visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) + * + * @param params Input parameters for generating a true color visualization based on the `RGB` field of the input layer. See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.size The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. + * @param params.density The number of points per inch in the view. + * + */ createPCTrueColorRenderer(params: colorCreatePCTrueColorRendererParams): IPromise; + /** + * This method generates a color visual variable with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and colors based on the input basemap. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, `field`, and `theme`. This is the scenario where the statistics of the data aren't well known and the user doesn't know what colors to use. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the object in the `statistics` parameter to avoid making an extra call to the server. You can also provide a `colorScheme` if you don't want one picked for you. In this case the `basemap` and `theme` options would be ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + * + * @param params Input parameters for generating a color visual variable based on data returned from a given field or expression. See the table below for details of each parameter. + * @param params.layer The layer for which the visual variable is generated. + * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.theme + * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. + * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned color visual variable. + * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. + * @param params.view The SceneView instance in which the visualization will be rendered. This property is only applicable to generating visualizations with 3D symbols, except for layers with a `mesh` geometry type. + * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology, except for layers with a `mesh` geometry type. A `view` must be provided if this property is set to `true`. + * + */ createVisualVariable(params: colorCreateVisualVariableParams): IPromise; } export const color: color; - export interface colorCreateContinuousRendererParams { + /** + * The result object of the [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) + */ + export interface ClassBreaksRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) + */ + renderer: ClassBreaksRenderer; + /** + * This object describes class breaks generated from data in a layer for a given field with a specified classification method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) + */ + classBreaksResult: ClassBreaksResult; + /** + * The color scheme used for the class breaks. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) + */ + colorScheme: ColorScheme; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) + */ + defaultValuesUsed: boolean; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) + */ + basemapId: string; + } + + + export interface colorCreateClassBreaksRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ layer: FeatureLayer | SceneLayer; + /** + * The name of the field whose data will be queried for statistics and classified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ normalizationField?: string; + /** + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. + * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. + * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. + * + * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ + normalizationType?: string; + /** + * When `normalizationType` is `percent-of-total`, this property contains the total of all data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ + normalizationTotal?: number; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * + * @default gray + */ basemap?: string | Basemap; - theme?: string; + /** + * The classification method used for generating breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. + * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information. + * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes. + * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * + * @default equal-interval + */ + classificationMethod?: string; + /** + * If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks. **Possible Values:** 1 | 0.5 | 0.33 | 0.25 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * + * @default 1 + */ + standardDeviationInterval?: number; + /** + * The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * + * @default 5 + */ + numClasses?: number; + /** + * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ colorScheme?: ColorScheme; - legendOptions?: colorCreateContinuousRendererParamsLegendOptions; - statistics?: SummaryStatisticsResult; + /** + * Provides options for setting a title to describe a field instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ + legendOptions?: colorCreateClassBreaksRendererParamsLegendOptions; + /** + * A minimum value set by the user. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ minValue?: number; + /** + * A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ maxValue?: number; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * + * @default true + */ defaultSymbolEnabled?: boolean; + /** + * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, but isn't required for layers with a `mesh` geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ view?: SceneView; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * + * @default 2d + */ symbolType?: string; + /** + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + * + * @default replace + */ colorMixMode?: string; } - export interface colorCreateContinuousRendererParamsLegendOptions { - title: string; + + export interface colorCreateClassBreaksRendererParamsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) + */ + title?: string; } - export interface colorCreatePCContinuousRendererParams { - layer: PointCloudLayer; - field: string; - basemap?: string | Basemap; - size?: string; - density?: number; - colorScheme?: ColorScheme; - statistics?: SummaryStatisticsResult; - } - export interface colorCreatePCTrueColorRendererParams { - layer: PointCloudLayer; - size?: string; - density?: number; - } - - export interface colorCreateVisualVariableParams { + export interface colorCreateContinuousRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ layer: FeatureLayer | SceneLayer; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ normalizationField?: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + * + * @default gray + */ basemap?: string | Basemap; + /** + * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ theme?: string; + /** + * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ colorScheme?: ColorScheme; - legendOptions?: colorCreateVisualVariableParamsLegendOptions; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ + legendOptions?: colorCreateContinuousRendererParamsLegendOptions; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ statistics?: SummaryStatisticsResult; + /** + * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned color visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ minValue?: number; + /** + * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ maxValue?: number; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + * + * @default true + */ + defaultSymbolEnabled?: boolean; + /** + * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, but isn't required for layers with a `mesh` geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ view?: SceneView; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + * + * @default 2d + */ + symbolType?: string; + /** + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + * + * @default replace + */ + colorMixMode?: string; + } + + + export interface colorCreateContinuousRendererParamsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ + title?: string; + /** + * Indicates whether to describe the renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) + */ + showLegend?: boolean; + } + + + export interface colorCreatePCContinuousRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) + */ + layer: PointCloudLayer; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. The only field names used for this renderer type are `elevation` and `intensity`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) + */ + field: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) + * + * @default gray + */ + basemap?: string | Basemap; + /** + * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) + * + * @default 100% + */ + size?: string; + /** + * The number of points per inch in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) + * + * @default 25 + */ + density?: number; + /** + * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) + */ + colorScheme?: ColorScheme; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the stats object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) + */ + statistics?: SummaryStatisticsResult; + } + + + export interface colorCreatePCTrueColorRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) + */ + layer: PointCloudLayer; + /** + * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) + * + * @default 100% + */ + size?: string; + /** + * The number of points per inch in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) + * + * @default 25 + */ + density?: number; + } + + + export interface colorCreateVisualVariableParams extends Object { + /** + * The layer for which the visual variable is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + layer: FeatureLayer | SceneLayer; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + normalizationField?: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + * + * @default gray + */ + basemap?: string | Basemap; + /** + * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + theme?: string; + /** + * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + colorScheme?: ColorScheme; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + legendOptions?: colorCreateVisualVariableParamsLegendOptions; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + statistics?: SummaryStatisticsResult; + /** + * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned color visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + minValue?: number; + /** + * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + maxValue?: number; + /** + * The SceneView instance in which the visualization will be rendered. This property is only applicable to generating visualizations with 3D symbols, except for layers with a `mesh` geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + view?: SceneView; + /** + * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology, except for layers with a `mesh` geometry type. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ worldScale?: boolean; } - export interface colorCreateVisualVariableParamsLegendOptions { - title: string; + + export interface colorCreateVisualVariableParamsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + title?: string; + /** + * Indicates whether to describe the renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) + */ + showLegend?: boolean; } - export interface ContinuousRendererResult { + /** + * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) + */ + export interface ContinuousRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) + */ renderer: ClassBreaksRenderer; + /** + * A color visual variable configured based on the statistics of the data and the given basemap and scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) + */ visualVariable: ColorVisualVariable; + /** + * The color scheme used by the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) + */ colorScheme: ColorScheme; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) + */ defaultValuesUsed: boolean; + /** + * Basic statistics returned from a query to the service for data from the given field name or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) + */ statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) + */ basemapId: string; } - export interface PCContinuousRendererResult { + /** + * The result object of the [createPCContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) + */ + export interface PCContinuousRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap and the spread of the data. Set this object on the input layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) + */ renderer: PointCloudStretchRenderer; + /** + * The color scheme used by the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) + */ colorScheme: ColorScheme; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) + */ defaultValuesUsed: boolean; + /** + * Basic statistics returned from a query to the service for data from the given field name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) + */ statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal color scheme for the output renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) + */ basemapId: string; } - export interface PCTrueColorRendererResult { + /** + * The result object of the [createPCTrueColorRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCTrueColorRendererResult) + */ + export interface PCTrueColorRendererResult extends Object { + /** + * The renderer object configured to represent the true color of each point in the point cloud. This gives the PointCloudLayer a realistic visualization of how it looks in the real world. Set this object on the input layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCTrueColorRendererResult) + */ renderer: PointCloudRGBRenderer; } - export interface VisualVariableResult { + /** + * The result object of the [createVisualVariable()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) + */ + export interface VisualVariableResult extends Object { + /** + * A color visual variable configured based on the statistics of the data and the given basemap and scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) + */ visualVariable: ColorVisualVariable; + /** + * The color scheme used by the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) + */ colorScheme: ColorScheme; + /** + * Basic statistics returned from a query to the service for the given field or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) + */ statistics: SummaryStatisticsResult; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) + */ defaultValuesUsed: boolean; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) + */ basemapId: string; + /** + * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) + */ authoringInfo: AuthoringInfo; } + /** + * This object contains helper methods for generating location-only visualizations (not data-driven) in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) method generates a [SimpleRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html) object that may be applied directly to the layer. This renderer contains a single symbol with a color optimally selected based on the indicated basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html) + */ interface location { + /** + * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a supported [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The renderer contains a single symbol with a color optimally chosen based on the indicated basemap. In most cases you will provide a `layer` and `basemap` to generate this renderer. If working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), then the `view` and `symbolType` options should be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + * + * @param params Input parameters for generating a location-based visualization. See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.locationScheme In authoring apps, the user may select a pre-defined location scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + */ createRenderer(params: locationCreateRendererParams): IPromise; } export const location: location; - export interface locationCreateRendererParams { + + export interface locationCreateRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + */ layer: FeatureLayer | SceneLayer; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + * + * @default gray + */ basemap?: string | Basemap; + /** + * In authoring apps, the user may select a pre-defined location scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + */ locationScheme?: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + /** + * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + */ view?: SceneView; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + * + * @default 2d + */ symbolType?: string; + /** + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) + * + * @default replace + */ colorMixMode?: string; } - export interface RendererResult { + /** + * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) + */ + export interface RendererResult extends Object { + /** + * A simple renderer configured with a single color best suited to match the given basemap. Set this to a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) + */ renderer: SimpleRenderer; + /** + * The location scheme used by the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) + */ locationScheme: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) + */ basemapId: string; } + /** + * This object contains a helper method for generating data-driven visualizations with continuous opacity based on data returned from a field value or expression in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html) + */ + interface opacity { + /** + * This method generates an opacity visual variable with default alpha values optimally mapped to data values based on the statistics queried for the indicated field or expression. There are several ways this method may be called. The most common case is by providing a `layer` and a `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know the which alpha values to map to data values. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the stats in the `statistics` parameter to avoid making an extra call to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + * + * @param params Input parameters for generating an opacity visual variable based on data returned from a given field or expression. See the table below for details of each parameter. + * @param params.layer The layer for which the visual variable is generated. + * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variable. + * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variable. + * + */ + createVisualVariable(params: opacityCreateVisualVariableParams): IPromise; + } + + export const opacity: opacity; + + + export interface opacityCreateVisualVariableParams extends Object { + /** + * The layer for which the visual variable is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + */ + layer: FeatureLayer | SceneLayer; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + */ + field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + */ + normalizationField?: string; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + */ + legendOptions?: opacityCreateVisualVariableParamsLegendOptions; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + */ + statistics?: SummaryStatisticsResult; + /** + * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + */ + minValue?: number; + /** + * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + */ + maxValue?: number; + } + + + export interface opacityCreateVisualVariableParamsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) + */ + title?: string; + } + + /** + * The result object of the [createVisualVariable()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) + */ + export interface opacityVisualVariableResult extends Object { + /** + * An opacity visual variable configured based on the statistics of the data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) + */ + visualVariable: OpacityVisualVariable; + /** + * Basic statistics returned from a query to the service for the given field or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) + */ + statistics: SummaryStatisticsResult; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) + */ + defaultValuesUsed: boolean; + /** + * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) + */ + authoringInfo: AuthoringInfo; + } + + /** + * This object contains helper methods for generating data-driven visualizations with continuous size or class breaks based on a field value or expression from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The methods in this module generate renderer or visual variable objects that may be applied directly to a supported layer. The renderers specify how features should be visualized based on data values and sizes optimized based on the indicated basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html) + */ interface size { + /** + * Generates a [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) that may be applied directly to the layer used to call this method. The resulting renderer defines the symbol size of each feature based on the value of the given `field` value. A default size scheme is determined based on the given `basemap`. Depending on the `classificationMethod`, class breaks (or data ranges) are generated based on the statistics of the data. Each feature is assigned a color based on the class break in which the value of the `field` falls. In most cases you will provide a `layer`, `basemap`, `field`, and `classificationMethod` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what sizes to use in the visualization. The other options are provided for convenience for more involved custom visualization authoring applications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * @param params Input parameters for generating a classed size visualization based on data returned from a given field or expression. See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.field The name of the field whose data will be queried for statistics and classified. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.normalizationType With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. + * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. + * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. + * + * @param params.normalizationTotal When `normalizationType` is `percent-of-total`, this property contains the total of all data values. + * @param params.classificationMethod + * The classification method used for generating breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. + * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information. + * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes. + * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean. + * @param params.standardDeviationInterval If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks. **Possible Values:** 1 | 0.5 | 0.33 | 0.25 + * @param params.numClasses The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified. + * @param params.sizeScheme In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.legendOptions Provides options for setting a title to describe a field instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.minValue A minimum value set by the user. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break. + * @param params.maxValue A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric" or "3d-volumetric-uniform"`. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | + * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | + * + */ + createClassBreaksRenderer(params: sizeCreateClassBreaksRendererParams): IPromise; + /** + * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to the layer used to call this method. The renderer contains a continuous size visual variable that maps marker sizes to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, and `field` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what 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-size.html#createContinuousRenderer) + * + * @param params Input parameters for generating size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. + * @param params.layer The layer for which the renderer is generated. + * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.sizeScheme In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned size visual variable. + * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric" or "3d-volumetric-uniform"`. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | + * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | + * + */ createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; + /** + * This method generates an array of size visual variables with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and mapped to appropriate sizes. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, and `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know what colors to use. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the object in the `statistics` parameter to avoid making an extra call to the server. You can also provide a `colorScheme` if you don't want one picked for you. In this case the `basemap` and `theme` options would be ignored. The resulting array of visual variables will contain exactly one size visual variable unless the `axis` parameter is set to "height". + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + * + * @param params Input parameters for generating size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. + * @param params.layer The layer for which the visual variables are generated. + * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.sizeScheme In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.legendOptions Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned size visual variable. + * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. + * @param params.view The SceneView instance in which the visualization will be rendered. This property is only applicable to generating visualizations with 3D symbols. + * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * @param params.axis When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height + * + */ createVisualVariables(params: sizeCreateVisualVariablesParams): IPromise; } export const size: size; - export interface sizeContinuousRendererResult { + /** + * The result object of the [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) + */ + export interface sizeClassBreaksRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) + */ renderer: ClassBreaksRenderer; - visualVariables: SizeVisualVariable[]; + /** + * This object describes class breaks generated from data in a layer for a given field with a specified classification method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) + */ + classBreaksResult: ClassBreaksResult; + /** + * The size scheme used by the visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) + */ sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) + */ defaultValuesUsed: boolean; - statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) + */ basemapId: string; } - export interface sizeCreateContinuousRendererParams { + /** + * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) + */ + export interface sizeContinuousRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) + */ + renderer: ClassBreaksRenderer; + /** + * Size visual variables configured based on the statistics of the data and the given basemap and scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) + */ + visualVariables: SizeVisualVariable[]; + /** + * The size scheme used by the visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) + */ + sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + /** + * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) + */ + defaultValuesUsed: boolean; + /** + * Basic statistics returned from a query to the service for data from the given field name or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) + */ + statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) + */ + basemapId: string; + } + + + export interface sizeCreateClassBreaksRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ layer: FeatureLayer | SceneLayer; - field: string; - normalizationField?: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * @default gray + */ basemap?: string | Basemap; + /** + * The name of the field whose data will be queried for statistics and classified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ + field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ + normalizationField?: string; + /** + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. + * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. + * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. + * + * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ + normalizationType?: string; + /** + * When `normalizationType` is `percent-of-total`, this property contains the total of all data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ + normalizationTotal?: number; + /** + * The classification method used for generating breaks. See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------ + * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. + * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information. + * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes. + * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * @default equal-interval + */ + classificationMethod?: string; + /** + * If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks. **Possible Values:** 1 | 0.5 | 0.33 | 0.25 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * @default 1 + */ + standardDeviationInterval?: number; + /** + * The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * @default 5 + */ + numClasses?: number; + /** + * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; - legendOptions?: sizeCreateContinuousRendererParamsLegendOptions; - statistics?: SummaryStatisticsResult; + /** + * Provides options for setting a title to describe a field instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ + legendOptions?: sizeCreateClassBreaksRendererParamsLegendOptions; + /** + * A minimum value set by the user. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ minValue?: number; + /** + * A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ maxValue?: number; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * @default true + */ defaultSymbolEnabled?: boolean; + /** + * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric" or "3d-volumetric-uniform"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ view?: SceneView; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | + * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + * + * @default 2d + */ symbolType?: string; } - export interface sizeCreateContinuousRendererParamsLegendOptions { - title: string; + + export interface sizeCreateClassBreaksRendererParamsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) + */ + title?: string; } - export interface sizeCreateVisualVariablesParams { + + export interface sizeCreateContinuousRendererParams extends Object { + /** + * The layer for which the renderer is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ layer: FeatureLayer | SceneLayer; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ normalizationField?: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + * + * @default gray + */ basemap?: string | Basemap; + /** + * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; - legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ + legendOptions?: sizeCreateContinuousRendererParamsLegendOptions; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ statistics?: SummaryStatisticsResult; + /** + * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned size visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ minValue?: number; + /** + * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ maxValue?: number; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + * + * @default true + */ + defaultSymbolEnabled?: boolean; + /** + * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric" or "3d-volumetric-uniform"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ view?: SceneView; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | + * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + * + * @default 2d + */ + symbolType?: string; + } + + + export interface sizeCreateContinuousRendererParamsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ + title?: string; + /** + * Indicates whether to describe the renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) + */ + showLegend?: boolean; + } + + + export interface sizeCreateVisualVariablesParams extends Object { + /** + * The layer for which the visual variables are generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + layer: FeatureLayer | SceneLayer; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + normalizationField?: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + * + * @default gray + */ + basemap?: string | Basemap; + /** + * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + statistics?: SummaryStatisticsResult; + /** + * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned size visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + minValue?: number; + /** + * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + maxValue?: number; + /** + * The SceneView instance in which the visualization will be rendered. This property is only applicable to generating visualizations with 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + view?: SceneView; + /** + * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ worldScale?: boolean; + /** + * When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + * + * @default all + */ axis?: boolean; } - export interface sizeCreateVisualVariablesParamsLegendOptions { - title: string; + + export interface sizeCreateVisualVariablesParamsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + title?: string; + /** + * Indicates whether to describe the renderer in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) + */ + showLegend?: boolean; } - export interface sizeVisualVariableResult { + /** + * The result object of the [createVisualVariables()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) + */ + export interface sizeVisualVariableResult extends Object { + /** + * An array of size visual variables configured based on the statistics of the data and the view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) + */ visualVariables: SizeVisualVariable[]; + /** + * The size scheme used by the main visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) + */ sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + /** + * Indicates whether default values were used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) + */ defaultValuesUsed: boolean; + /** + * Basic statistics returned from a query to the service for the given field or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) + */ statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) + */ basemapId: string; + /** + * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) + */ authoringInfo: AuthoringInfo; } + /** + * This object contains helper methods for generating data-driven visualizations with unique types (or categories) based on a field value from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) method generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) object that may be applied directly to the layer used to generate it. This renderer contains unique values with colors best suited to the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html) + */ interface type { + /** + * Generates a [PointCloudUniqueValueRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html) based on a given field of a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). This renderer visualizes points of the same type, usually from the `CLASS_CODE` field or an equivalent field that stores information related to the classification of the data (e.g. low vegetation, high vegetation, ground, etc.). The generated renderer visualizes each point with a standard predefined color matching the class code of the point. All that's required is a layer instance and field name. You can optionally set the size and density of the points to suit the needs of the desired visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) + * + * @param params Input parameters for generating a renderer based on the given field of the input layer. See the table below for details of each parameter. + * @param params.layer The layer for which the visualization is generated. + * @param params.field The name of the field containing classification data for the given layer. A common field name used for this renderer type is `CLASS_CODE`, though other fields can be used. + * @param params.size The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. + * @param params.density The number of points per inch in the view. + * @param params.typeScheme In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.statistics A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + */ createPCClassRenderer(params: typeCreatePCClassRendererParams): IPromise; + /** + * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) that supports renderers. The renderer contains unique symbols representing a string or a numeric value returned from the indicated field. In most cases you will provide a `layer`, `basemap`, and `field` to generate this renderer. This is a scenario in which the values of the field aren't well known and the user doesn't know which colors to use in the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + * + * @param params Input parameters for generating symbols to represent unique types based on data returned from a given field. See the table below for details of each parameter. + * @param params.layer The layer for which the renderer is generated. + * @param params.field The name of the field from which to extract unique values that will be used for the basis of the data-driven visualization. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @param params.numTypes The number of types (or categories) displayed by the renderer. Use `-1` to display all returned types. + * @param params.sortBy + * Indicates how values should be sorted in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). See the table below for information about values that may be passed to this parameter. + * + * Possible Value | Description + * ---------------|------------ + * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. + * value | Unique values/types will be sorted in alphabetical order. + * + * **Known Values:** count | value + * @param params.typeScheme In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * @param params.legendOptions Provides options for setting a title to a field that will override the field alias defined in the service. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. + * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric" or "3d-volumetric-uniform"`, except for layers with a `mesh` geometry type. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | + * | 3d-volumetric-uniform | Generates a visualization using uniformly-sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | + * @param params.statistics A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + */ createRenderer(params: typeCreateRendererParams): IPromise; } export const type: type; - export interface PCClassRendererResult { + /** + * The result object of the [createPCClassRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#PCClassRendererResult) + */ + export interface PCClassRendererResult extends Object { + /** + * The renderer object configured to represent the class codes in the point cloud. Set this object on the input layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#PCClassRendererResult) + */ renderer: PointCloudUniqueValueRenderer; } - export interface typeRendererResult { + /** + * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ + export interface typeRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ renderer: UniqueValueRenderer; + /** + * An array of objects describing the value, symbol, and count of each unique type or category represented in the renderer. See the table below describing each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ uniqueValueInfos: RendererResultUniqueValueInfos[]; + /** + * An array of objects describing the values or categories excluded from consideration in visualizing data from the given field. The specification of each object matches that of the objects specified in the `uniqueValueInfos` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ excludedUniqueValueInfos: any[]; + /** + * The scheme used to represent each category within the `uniqueValueInfos`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ typeScheme: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme; + /** + * The ID of the basemap used to determine the optimal color scheme to represent the categorical variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ basemapId: string; } - export interface typeCreatePCClassRendererParams { + + export interface typeCreatePCClassRendererParams extends Object { + /** + * The layer for which the visualization is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) + */ layer: PointCloudLayer; + /** + * The name of the field containing classification data for the given layer. A common field name used for this renderer type is `CLASS_CODE`, though other fields can be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) + */ field: string; + /** + * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) + * + * @default 100% + */ size?: string; + /** + * The number of points per inch in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) + * + * @default 25 + */ density?: number; + /** + * In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) + */ typeScheme?: PointTypeScheme; + /** + * A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) + */ statistics?: UniqueValuesResult; } - export interface typeCreateRendererParams { + + export interface typeCreateRendererParams extends Object { + /** + * The layer for which the renderer is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + */ layer: FeatureLayer | SceneLayer; + /** + * The name of the field from which to extract unique values that will be used for the basis of the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + */ field: string; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + * + * @default gray + */ basemap?: string | Basemap; + /** + * The number of types (or categories) displayed by the renderer. Use `-1` to display all returned types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + * + * @default 10 + */ numTypes?: number; + /** + * Indicates how values should be sorted in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). See the table below for information about values that may be passed to this parameter. + * + * Possible Value | Description + * ---------------|------------ + * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. + * value | Unique values/types will be sorted in alphabetical order. + * + * **Known Values:** count | value + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + * + * @default count + */ sortBy?: string; + /** + * In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + */ typeScheme?: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme; + /** + * Provides options for setting a title to a field that will override the field alias defined in the service. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + */ legendOptions?: typeCreateRendererParamsLegendOptions; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + */ defaultSymbolEnabled?: boolean; + /** + * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric" or "3d-volumetric-uniform"`, except for layers with a `mesh` geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + */ view?: SceneView; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | + * | 3d-volumetric-uniform | Generates a visualization using uniformly-sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + * + * @default 2d + */ symbolType?: string; + /** + * A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + */ statistics?: UniqueValuesResult; + /** + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * + * Value | Description + * ------|------------ + * tint | Applies the symbol `color` to the desaturated geometry/texture color. + * replace | Removes the geometry/texture color and applies the symbol `color`. + * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + * + * @default replace + */ colorMixMode?: string; } - export interface typeCreateRendererParamsLegendOptions { + + export interface typeCreateRendererParamsLegendOptions extends Object { + /** + * The title used to represent the given field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) + */ title: string; } - export interface RendererResultUniqueValueInfos { + + export interface RendererResultUniqueValueInfos extends Object { + /** + * A unique value representing a type or category of features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ value: string | number; + /** + * The number of features assigned the given `value` (or belonging to the given category). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ count: number; + /** + * The label describing the value or category in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ label: string; + /** + * The symbol used to represent features belonging to the given category. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) + */ symbol: Symbol; } + /** + * This object contains helper methods for generating data-driven univariate visualizations using both continuous color and continuous size based on a field value or expression from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) method generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) object that may be applied directly to a supported layer. This renderer contains a continuous color and size ramp with optimal colors based on the indicated basemap and mapped to specific break values based on the statistics of the indicated field or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) + */ interface univariateColorSize { + /** + * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The renderer contains continuous color and size visual variables that map symbols with optimal colors and sizes based on the indicated basemap to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, `field`, and `theme` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what colors and sizes to use in the visualization. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + * + * @param params See the table below for details of each parameter that may be passed to this method. + * @param params.layer The layer for which the visual variable is generated. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @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. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variables. + * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variables. + * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * @param params.colorOptions Options for configuring the color portion of the visualization. + * @param params.sizeOptions Options for configuring the size portion of the visualization. + * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric" or "3d-volumetric-uniform"`. + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | + * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sizes uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | + * + */ createContinuousRenderer(params: univariateColorSizeCreateContinuousRendererParams): IPromise; + /** + * This method generates color and size visual variables, both based on the same given field or expression. These visual variables are generated with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and colors based on the input basemap. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, and `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know what colors to use. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the object in the `statistics` parameter to avoid making an extra call to the server. You can also provide a `colorScheme` and/or a `sizeScheme` if you don't want one picked for you. In this case the `basemap` and `theme` options would be ignored. The resulting array of visual variables will contain one color visual variable, and one or two size visual variables depending on the value of the `sizeOptions.axis` parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + * + * @param params Input parameters for generating color and size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. + * @param params.layer The layer for which the visual variable is generated. + * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * @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. + * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variables. + * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variables. + * @param params.colorOptions Options for configuring the color portion of the visualization. + * @param params.sizeOptions Options for configuring the size portion of the visualization. + * @param params.view The SceneView instance in which the visualization will be rendered. This property is only applicable to generating visualizations with 3D symbols. + * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + */ createVisualVariables(params: univariateColorSizeCreateVisualVariablesParams): IPromise; } export const univariateColorSize: univariateColorSize; - export interface univariateColorSizeContinuousRendererResult { + /** + * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ + export interface univariateColorSizeContinuousRendererResult extends Object { + /** + * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ renderer: ClassBreaksRenderer; + /** + * Object containing visual variable and scheme information for the color portion of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ color: ContinuousRendererResultColor; + /** + * Object containing visual variable and scheme information for the size portion of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ size: ContinuousRendererResultSize; + /** + * Indicates whether default values were used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ defaultValuesUsed: boolean; + /** + * Basic statistics returned from a query to the service for the given field or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ basemapId: string; } - export interface univariateColorSizeCreateContinuousRendererParams { + + export interface univariateColorSizeCreateContinuousRendererParams extends Object { + /** + * The layer for which the visual variable is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ layer: FeatureLayer | SceneLayer; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + * + * @default gray + */ basemap?: string | Basemap; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ normalizationField?: string; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ statistics?: SummaryStatisticsResult; + /** + * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ minValue?: number; + /** + * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ maxValue?: number; + /** + * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ defaultSymbolEnabled?: boolean; + /** + * Options for configuring the color portion of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ colorOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptions; + /** + * Options for configuring the size portion of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ sizeOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptions; + /** + * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric" or "3d-volumetric-uniform"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ view?: SceneView; + /** + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Known values are described below. + * + * | Value | Description | + * | ----- | ----------- | + * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | + * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | + * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | + * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sizes uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + * + * @default 2d + */ symbolType?: string; } - export interface univariateColorSizeCreateContinuousRendererParamsColorOptions { + + export interface univariateColorSizeCreateContinuousRendererParamsColorOptions extends Object { + /** + * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ theme?: string; + /** + * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ colorScheme?: ColorScheme; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ legendOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions; } - export interface univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions { + + export interface univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ title: string; } - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptions { + + export interface univariateColorSizeCreateContinuousRendererParamsSizeOptions extends Object { + /** + * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ legendOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions; } - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions { + + export interface univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) + */ title: string; } - export interface univariateColorSizeCreateVisualVariablesParams { + + export interface univariateColorSizeCreateVisualVariablesParams extends Object { + /** + * The layer for which the visual variable is generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ layer: FeatureLayer | SceneLayer; + /** + * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of the Esri basemap or basemap object that will be paired with the output visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + * + * @default gray + */ basemap?: string | Basemap; + /** + * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ field: string; + /** + * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ normalizationField?: string; + /** + * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ statistics?: SummaryStatisticsResult; + /** + * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ minValue?: number; + /** + * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ maxValue?: number; + /** + * Options for configuring the color portion of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ colorOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptions; + /** + * Options for configuring the size portion of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ sizeOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptions; + /** + * The SceneView instance in which the visualization will be rendered. This property is only applicable to generating visualizations with 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ view?: SceneView; + /** + * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ worldScale?: boolean; } - export interface univariateColorSizeCreateVisualVariablesParamsColorOptions { + + export interface univariateColorSizeCreateVisualVariablesParamsColorOptions extends Object { + /** + * Determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ theme?: string; + /** + * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ colorScheme?: ColorScheme; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ legendOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions; } - export interface univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions { + + export interface univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ title: string; } - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions { + + export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions extends Object { + /** + * When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + * + * @default all + */ axis?: boolean; + /** + * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ sizeScheme?: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; + /** + * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; } - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions { + + export interface univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions extends Object { + /** + * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) + */ title: string; } - export interface VisualVariablesResult { + /** + * The result object of the [createVisualVariables()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) method. See the table below for details of each property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ + export interface VisualVariablesResult extends Object { + /** + * Object containing visual variable and scheme information for the color portion of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ color: VisualVariablesResultColor; + /** + * Object containing visual variable and scheme information for the size portion of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ size: VisualVariablesResultSize; + /** + * Indicates whether default values were used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ defaultValuesUsed: boolean; + /** + * Basic statistics returned from a query to the service for the given field or expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ statistics: SummaryStatisticsResult; + /** + * The ID of the basemap used to determine the optimal fill color of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ basemapId: string; + /** + * Authoring information related to the creation of the visual variables. This includes inforamation related to UI inputs from sliders and selected themes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ authoringInfo: AuthoringInfo; } - export interface ContinuousRendererResultColor { + + export interface ContinuousRendererResultColor extends Object { + /** + * A color visual variable configured based on the statistics of the data and the given basemap and scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ visualVariable: ColorVisualVariable; + /** + * The color scheme used by the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ colorScheme: ColorScheme; } - export interface ContinuousRendererResultSize { + + export interface ContinuousRendererResultSize extends Object { + /** + * The size visual variable(s) configured based on the statistics of the data and the view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ visualVariables: SizeVisualVariable[]; + /** + * The size scheme used by the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) + */ sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; } - export interface VisualVariablesResultColor { + + export interface VisualVariablesResultColor extends Object { + /** + * A color visual variable configured based on the statistics of the data and the given basemap and scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ visualVariable: ColorVisualVariable; + /** + * The color scheme used by the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ colorScheme: ColorScheme; } - export interface VisualVariablesResultSize { + + export interface VisualVariablesResultSize extends Object { + /** + * The size visual variable(s) configured based on the statistics of the data and the view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ visualVariables: SizeVisualVariable[]; + /** + * The size scheme used by the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) + */ sizeScheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme; } + /** + * Function for generating class breaks for an input field in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) based on a given classification method and normalization type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html) + */ interface classBreaks { + /** + * Generates class breaks for an input field of a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) based on a given classification method and normalization type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + * + * @param params See the table below for details about parameters that may be passed to this function. + * @param params.layer The layer from which to generate class breaks. + * @param params.field The class breaks will be generated based on values of this field. If a field is provided, the values from the given field from all features will be queried in the service. + * @param params.normalizationField The field by which to normalize the values returned from the given `field`. + * @param params.classificationMethod + * The method for classifying the data. See the table below for a list of possible values. + * + * | Possible Value | Description | + * |---------------|------------ | + * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | + * | equal-interval | Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. | + * | quantile | Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. | + * | standard-deviation | Class breaks are placed above and below the mean value at intervals of `1`, `0.5`, or `0.25` standard deviations until all the data values are included in a class. | + * @param params.standardDeviationInterval When `classificationMethod = "standard-deviation"`, this sets the interval at which each class break should be set (e.g. `0.25`, `0.33`, `0.5`, `1`). + * @param params.minValue The minimum bounding value for the class breaks definition. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. + * @param params.maxValue The maximum bounding value for the class breaks definition. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. + * @param params.numClasses Indicates the number of classes to generate for the class breaks definition. + * + */ classBreaks(params: classBreaksClassBreaksParams): IPromise; } @@ -4632,30 +19410,150 @@ declare namespace __esri { export const classBreaks: typeof __classBreaksMapped.classBreaks; - export interface classBreaksClassBreaksParams { + + 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; + /** + * The class breaks will be generated based on values of this field. If a field is provided, the values from the given field from all features will be queried in the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + */ field?: string; + /** + * The field by which to normalize the values returned from the given `field`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + */ normalizationField?: string; + /** + * The method for classifying the data. See the table below for a list of possible values. + * + * | Possible Value | Description | + * |---------------|------------ | + * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | + * | equal-interval | Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. | + * | quantile | Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. | + * | standard-deviation | Class breaks are placed above and below the mean value at intervals of `1`, `0.5`, or `0.25` standard deviations until all the data values are included in a class. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + */ classificationMethod?: string; + /** + * When `classificationMethod = "standard-deviation"`, this sets the interval at which each class break should be set (e.g. `0.25`, `0.33`, `0.5`, `1`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + */ standardDeviationInterval?: number; + /** + * The minimum bounding value for the class breaks definition. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + */ minValue?: number; + /** + * The maximum bounding value for the class breaks definition. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + */ maxValue?: number; + /** + * Indicates the number of classes to generate for the class breaks definition. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) + */ numClasses?: number; } - export interface ClassBreaksResult { + /** + * Object returned from the [classBreaks()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) method. This object describes classes generated from data in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) for a given field with a specified classification method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + */ + export interface ClassBreaksResult extends Object { + /** + * An array of objects describing the class breaks generated from the [classBreaks()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + */ classBreaksInfos: ClassBreaksResultClassBreaksInfos[]; + /** + * The minimum value of features in the dataset. This will be the lower bound of the lowest class break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + */ minValue: number; + /** + * The maximum value of features in the dataset. This will be the upper bound of the highest class break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + */ maxValue: number; + /** + * The normalization total if `normalizationType` is set to `percent-of-total` when generating class breaks with [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + */ + normalizationTotal: number; } - export interface ClassBreaksResultClassBreaksInfos { + + export interface ClassBreaksResultClassBreaksInfos extends Object { + /** + * The label describing the given class break for use in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + */ label: string; + /** + * The lower bound of the class break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + */ minValue: number; + /** + * The upper bound of the class break. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) + */ maxValue: number; } + /** + * Generates a histogram based on data in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) for a given field. The returned object can be used for displaying a histogram in the UI within visualization authoring applications and analytical apps that query and display statistics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) + */ interface histogram { + /** + * Generates a histogram for data returned from a `field` in a given `layer`. The returned object can be used for displaying a histogram to the UI in visualization authoring applications and analytical apps that query and display statistics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + * + * @param params See the table below for details on parameters that may be passed to this function. + * @param params.layer The layer for which to generate a histogram. + * @param params.field The name of the numeric field for which the histogram will be generated. + * @param params.normalizationField The field by which to normalize the values returned from the given `field`. + * @param params.classificationMethod + * The method for classifying the data. See the table below for a list of possible values. + * + * | Possible Value | Description | + * |---------------|------------ | + * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | + * | equal-interval | Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. | + * | quantile | Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. | + * | standard-deviation | Class breaks are placed above and below the mean value at intervals of `1`, `0.5`, or `0.25` standard deviations until all the data values are included in a class. | + * @param params.standardDeviationInterval When `classificationMethod = "standard-deviation"`, this sets the interval at which each class break should be set (e.g. `0.25`, `0.33`, `0.5`, `1`). + * @param params.minValue The minimum bounding value for the histogram. Use this in conjunction with `maxValue` to generate a histogram between custom lower and upper bounds. + * @param params.maxValue The maximum bounding value for the histogram. Use this in conjunction with `minValue` to generate a histogram between custom lower and upper bounds. + * @param params.numBins Indicates the number of classes to generate for the histogram. + * + */ histogram(params: histogramHistogramParams): IPromise; } @@ -4663,30 +19561,136 @@ declare namespace __esri { export const histogram: typeof __histogramMapped.histogram; - export interface histogramHistogramParams { + + export interface histogramHistogramParams extends Object { + /** + * The layer for which to generate a histogram. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + */ layer: FeatureLayer | SceneLayer | PointCloudLayer; + /** + * The name of the numeric field for which the histogram will be generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + */ field?: string; + /** + * The field by which to normalize the values returned from the given `field`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + */ normalizationField?: string; + /** + * The method for classifying the data. See the table below for a list of possible values. + * + * | Possible Value | Description | + * |---------------|------------ | + * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | + * | equal-interval | Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. | + * | quantile | Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. | + * | standard-deviation | Class breaks are placed above and below the mean value at intervals of `1`, `0.5`, or `0.25` standard deviations until all the data values are included in a class. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + */ classificationMethod?: string; + /** + * When `classificationMethod = "standard-deviation"`, this sets the interval at which each class break should be set (e.g. `0.25`, `0.33`, `0.5`, `1`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + */ standardDeviationInterval?: number; + /** + * The minimum bounding value for the histogram. Use this in conjunction with `maxValue` to generate a histogram between custom lower and upper bounds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + */ minValue?: number; + /** + * The maximum bounding value for the histogram. Use this in conjunction with `minValue` to generate a histogram between custom lower and upper bounds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + */ maxValue?: number; + /** + * Indicates the number of classes to generate for the histogram. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) + * + * @default 10 + */ numBins?: number; } - export interface HistogramResult { + /** + * The result returned from the [histogram()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) + */ + export interface HistogramResult extends Object { + /** + * An array of objects representing each bin in the histogram. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) + */ bins: HistogramResultBins[]; + /** + * The minimum value returned by the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) + */ minValue: number; + /** + * The maximum value returned by the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) + */ maxValue: number; } - export interface HistogramResultBins { + + export interface HistogramResultBins extends Object { + /** + * The number of features that are contained between the indicated `minValue` and `maxValue`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) + */ count: number; + /** + * The minimum value of the bin. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) + */ minValue: number; + /** + * The maximum value of the bin. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) + */ maxValue: number; } + /** + * Function for generating attribute statistics in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on values returned from a given field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) + */ interface summaryStatistics { + /** + * Returns an object containing various statistics describing a set of values returned from a field in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + * + * @param params See the table below for details of each parameter. + * @param params.layer The layer from which to generate statistics for the given `field`. + * @param params.field The name of the numeric field for which the summary statistics will be generated. + * @param params.normalizationField The field by which to normalize the values returned from the given `field`. + * @param params.features If the FeatureLayer is constructed with client-side graphics or you would like to calculate statistics based on a subset of features, then pass the features in this parameter. + * @param params.minValue The minimum bounding value for the statistics calculation. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. + * @param params.maxValue The maximum bounding value for the statistics calculation. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. + * + */ summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; } @@ -4694,26 +19698,114 @@ declare namespace __esri { export const summaryStatistics: typeof __summaryStatisticsMapped.summaryStatistics; - export interface SummaryStatisticsResult { + /** + * The statistics returned from the [summaryStatistics()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) + */ + export interface SummaryStatisticsResult extends Object { + /** + * The average of all values returned from the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) + */ avg: number; + /** + * The number of features evaluated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) + */ count: number; + /** + * The maximum of all values returned from the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) + */ max: number; + /** + * The minimum of all values returned from the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) + */ min: number; + /** + * The standard deviation calculated from values returned from the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) + */ stddev: number; + /** + * The sum of all values returned from the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) + */ sum: number; + /** + * The calculated variance from all values returned from the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) + */ variance: number; } - export interface summaryStatisticsSummaryStatisticsParams { + + export interface summaryStatisticsSummaryStatisticsParams extends Object { + /** + * The layer from which to generate statistics for the given `field`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + */ layer: FeatureLayer | SceneLayer | PointCloudLayer; + /** + * The name of the numeric field for which the summary statistics will be generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + */ field?: string; + /** + * The field by which to normalize the values returned from the given `field`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + */ normalizationField?: string; + /** + * If the FeatureLayer is constructed with client-side graphics or you would like to calculate statistics based on a subset of features, then pass the features in this parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + */ features?: Graphic[]; + /** + * The minimum bounding value for the statistics calculation. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + */ minValue?: number; + /** + * The maximum bounding value for the statistics calculation. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) + */ maxValue?: number; } + /** + * A function that queries for unique values from a field in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) + */ interface uniqueValues { + /** + * Returns an object containing an array of unique values queried from a given field in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) along with the total count of features that belong to the given category. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) + * + * @param params See the table below for details of each parameter. + * @param params.layer The layer from which to query for unique values. + * @param params.field The name of the numeric or string field from which the unique values will be obtained. + * @param params.features If the `layer` is a FeatureLayer constructed with client-side graphics or you would like to calculate statistics based on a subset of features, then pass the features in this parameter. + * @param params.returnAllCodedValues Indicates that all domain codes should be returned if the given field has domain values. + * + */ uniqueValues(params: uniqueValuesUniqueValuesParams): IPromise; } @@ -4721,239 +19813,1298 @@ declare namespace __esri { export const uniqueValues: typeof __uniqueValuesMapped.uniqueValues; - export interface UniqueValuesResult { + /** + * An object that contains the unique values returned from the [uniqueValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) query of a layer's field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) + */ + export interface UniqueValuesResult extends Object { + /** + * An array of objects, each containing a unique value/type/category present in the field specifed in the [uniqueValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) query. See table below for the specification of each object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) + */ uniqueValueInfos: UniqueValuesResultUniqueValueInfos[]; } - export interface uniqueValuesUniqueValuesParams { + + export interface uniqueValuesUniqueValuesParams extends Object { + /** + * The layer from which to query for unique values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) + */ layer: FeatureLayer | SceneLayer | PointCloudLayer; + /** + * The name of the numeric or string field from which the unique values will be obtained. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) + */ field: string; + /** + * If the `layer` is a FeatureLayer constructed with client-side graphics or you would like to calculate statistics based on a subset of features, then pass the features in this parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) + */ features?: Graphic[]; + /** + * Indicates that all domain codes should be returned if the given field has domain values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) + */ returnAllCodedValues?: boolean; } - export interface UniqueValuesResultUniqueValueInfos { + + export interface UniqueValuesResultUniqueValueInfos extends Object { + /** + * A unique value representing a type or category of features in the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) + */ value: string | number; + /** + * The number of features assigned the given `value` (or belonging to the given category). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) + */ count: number; } + interface symbologyColor { + /** + * Clones a color scheme object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#cloneScheme) + * + * @param scheme The color scheme object to clone. + * + */ cloneScheme(scheme: ColorScheme): ColorScheme; + /** + * Flips the colors in reverse order of the input color scheme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#flipColors) + * + * @param scheme The color scheme to reverse. + * + */ flipColors(scheme: ColorScheme): ColorScheme; + /** + * Returns a primary scheme and secondary schemes defining symbol properties for data-driven color visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). The `basemap` parameter determines the color schemes of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) + * + * @param params See the table below for details of each parameter that may be passed to this function. + * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap. + * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * @param params.theme + * The theme determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + */ getSchemes(params: colorGetSchemesParams): any; + /** + * Returns metadata for the available themes. If a `basemap` is provided, returns themes that look best with the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getThemes) + * + * @param basemap The [Esri basemap string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or object that will be used with the returned theme(s). + * + */ getThemes(basemap?: string | Basemap): any[]; } export const symbologyColor: symbologyColor; - export interface colorGetSchemesParams { + + export interface colorGetSchemesParams extends Object { + /** + * The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) + */ basemap: string | Basemap; + /** + * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) + */ geometryType: string; + /** + * The theme determines which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) + */ theme: string; + /** + * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) + */ view?: SceneView; + /** + * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) + */ worldScale?: boolean; } - export interface ColorScheme { + /** + * Properties defining the symbology scheme used to visualize features with attribute data-driven color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ + export interface ColorScheme extends Object { + /** + * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ id: string; + /** + * Indicates which values will be emphasized in the continuous ramp and the map. Valid values are listed below. + * + * | Value | Description | Example | + * | ----- | ----------- | ------- | + * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-high-to-low.png) | + * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-above-and-below.png) | + * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-centered-on.png) | + * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/sm-extremes.png) | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ theme: string; + /** + * The continuous color ramp that will be applied to the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ colors: Color[]; + /** + * The color of the symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ noDataColor: Color; + /** + * Predefined classed color schemes to use for the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ colorsForClassBreaks: ColorSchemeColorsForClassBreaks[]; + /** + * Properties for defining the outline of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ outline: ColorSchemeOutline; + /** + * The default size of the symbol in pixels or points if the geometry type is `point`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ size: number; + /** + * The default width of the symbol in pixels or points if the geometry type is `polyline`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ width: number; + /** + * The opacity of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ opacity: number; } - export interface ColorSchemeColorsForClassBreaks { + + export interface ColorSchemeColorsForClassBreaks extends Object { + /** + * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ colors: Color[]; + /** + * The number of classes used in the classed color visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ numClasses: number; } - export interface ColorSchemeOutline { + + export interface ColorSchemeOutline extends Object { + /** + * The outline color of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ color: Color; + /** + * The width of the symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) + */ width: number; } + interface symbologyLocation { + /** + * Clones a location scheme object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#cloneScheme) + * + * @param scheme The location scheme object to clone. + * + */ cloneScheme(scheme: PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme): PointLocationScheme | PolylineLocationScheme | PolygonLocationScheme; + /** + * Returns a primary scheme and secondary schemes defining symbol properties for location-only visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) + * + * @param params See the table below for details of each parameter that may be passed to this function. + * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features on top of the given basemap. + * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + */ getSchemes(params: locationGetSchemesParams): any; } export const symbologyLocation: symbologyLocation; - export interface locationGetSchemesParams { + + export interface locationGetSchemesParams extends Object { + /** + * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features on top of the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) + */ basemap: string | Basemap; + /** + * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) + */ geometryType: string; + /** + * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) + */ view?: SceneView; + /** + * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) + */ worldScale?: boolean; } - export interface PointLocationScheme { + /** + * Properties defining the location-only symbology scheme used to visualize point features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + */ + export interface PointLocationScheme extends Object { + /** + * The fill color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + */ color: Color; + /** + * Properties for defining the outline of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + */ outline: PointLocationSchemeOutline; + /** + * The size of the marker symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + */ size: number; + /** + * The opacity of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + */ opacity: number; } - export interface PolygonLocationScheme { + /** + * Properties defining the location-only symbology scheme used to visualize polygon features driven by attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + */ + export interface PolygonLocationScheme extends Object { + /** + * The color of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + */ color: Color; + /** + * Properties for defining the outline of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + */ outline: PolygonLocationSchemeOutline; + /** + * The opacity of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + */ opacity: number; } - export interface PolylineLocationScheme { + /** + * Properties defining the location-only symbology scheme used to visualize polyline features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolylineLocationScheme) + */ + export interface PolylineLocationScheme extends Object { + /** + * The color of the line symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolylineLocationScheme) + */ color: Color; + /** + * The width of the line symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolylineLocationScheme) + */ width: number; + /** + * The opacity of the line symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolylineLocationScheme) + */ opacity: number; } - export interface PointLocationSchemeOutline { + + export interface PointLocationSchemeOutline extends Object { + /** + * The outline color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + */ color: Color; + /** + * The width of the marker symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PointLocationScheme) + */ width: number; } - export interface PolygonLocationSchemeOutline { + + export interface PolygonLocationSchemeOutline extends Object { + /** + * The outline color of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + */ color: Color; + /** + * The width of the fill symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#PolygonLocationScheme) + */ width: number; } + interface symbologySize { + /** + * Clones a size scheme object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#cloneScheme) + * + * @param scheme The SizeScheme object to clone. + * + */ cloneScheme(scheme: PointSizeScheme | PolylineSizeScheme | PolygonSizeScheme): any; + /** + * Returns a primary scheme and secondary schemes defining symbol properties for size-based data-driven visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) + * + * @param params See the table below for details of each parameter that may be passed to this function. + * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. + * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon + * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + */ getSchemes(params: sizeGetSchemesParams): any; } export const symbologySize: symbologySize; - export interface PointSizeScheme { + /** + * Properties defining the symbology scheme used to visualize point features driven by attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ + export interface PointSizeScheme extends Object { + /** + * The fill color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ color: Color; + /** + * The color of the marker symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ noDataColor: Color; + /** + * Properties for defining the outline of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ outline: PointSizeSchemeOutline; + /** + * The default size of the marker symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ size: number; + /** + * The size of the marker symbol (in pixels or points) used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ noDataSize: number; + /** + * The minimum size of a marker symbol in pixels or points representing features with low data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ minSize: number; + /** + * The maximum size of a marker symbol in pixels or points representing features with high data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ maxSize: number; + /** + * The opacity of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ opacity: number; } - export interface PolygonSizeScheme { + /** + * Properties defining the symbology scheme used to visualize polygon features driven by attribute data. When visualized by size, polygons are represented with marker symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + */ + export interface PolygonSizeScheme extends Object { + /** + * The scheme defining the symbology of the marker symbol used to represent polygon features by size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + */ marker: PointSizeScheme; + /** + * The schema defining the backgound symbol of the feature. This is a fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + */ background: PolygonSizeSchemeBackground; + /** + * The opacity of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + */ opacity: number; } - export interface PolylineSizeScheme { + /** + * Properties defining the symbology scheme used to visualize polyline features driven by attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) + */ + export interface PolylineSizeScheme extends Object { + /** + * The color of the line symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) + */ color: Color; + /** + * The color of the line symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) + */ noDataColor: Color; + /** + * The default width of the line symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) + */ width: number; + /** + * The width of the line symbol in pixels or points used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) + */ noDataWidth: number; + /** + * The minimum width of a line symbol in pixels or points representing features with low data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) + */ minWidth: number; + /** + * The maximum width of a line symbol in pixels or points representing features with high data values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) + */ maxWidth: number; + /** + * The opacity of the line symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolylineSizeScheme) + */ opacity: number; } - export interface sizeGetSchemesParams { + + export interface sizeGetSchemesParams extends Object { + /** + * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) + */ basemap: string | Basemap; + /** + * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) + */ geometryType: string; + /** + * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) + */ view?: SceneView; + /** + * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) + */ worldScale?: boolean; } - export interface PointSizeSchemeOutline { + + export interface PointSizeSchemeOutline extends Object { + /** + * The outline color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ color: Color; + /** + * The width of the marker symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PointSizeScheme) + */ width: number; } - export interface PolygonSizeSchemeBackground { + + export interface PolygonSizeSchemeBackground extends Object { + /** + * The color of the fill symbol representing the polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + */ color: Color; + /** + * Properties for defining the outline of the background fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + */ outline: PolygonSizeSchemeBackgroundOutline; } - export interface PolygonSizeSchemeBackgroundOutline { + + export interface PolygonSizeSchemeBackgroundOutline extends Object { + /** + * The outline color of the background fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + */ color: Color; + /** + * The width of the background fill symbol's outline in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#PolygonSizeScheme) + */ width: number; } + interface symbologyType { + /** + * Clones a type scheme object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#cloneScheme) + * + * @param scheme The type scheme object to clone. + * + */ cloneScheme(scheme: PointTypeScheme | PolylineTypeScheme | PolygonTypeScheme | MeshTypeScheme): any; + /** + * Returns a primary scheme and secondary schemes defining symbol properties for type-based data-driven visualizions in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) + * + * @param params See the table below for details of each parameter that may be passed to this function. + * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. + * @param params.geometryType The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * @param params.theme Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Known Values:** point-cloud-class | default + * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + */ getSchemes(params: typeGetSchemesParams): any; } export const symbologyType: symbologyType; - export interface MeshTypeScheme { + /** + * Properties defining the symbology scheme used to visualize mesh features driven by type-based attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#MeshTypeScheme) + */ + export interface MeshTypeScheme extends Object { + /** + * The fill colors of the symbols comprising the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#MeshTypeScheme) + */ colors: Color[]; + /** + * The color of the fill symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#MeshTypeScheme) + */ noDataColor: Color; + /** + * The opacity of the symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#MeshTypeScheme) + */ opacity: number; } - export interface PointTypeScheme { + /** + * Properties defining the symbology scheme used to visualize point features driven by type-based attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + */ + export interface PointTypeScheme extends Object { + /** + * The fill colors of the point symbols comprising the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + */ colors: Color[]; + /** + * The color of the point symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + */ noDataColor: Color; + /** + * Properties for defining the outline of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + */ outline: PointTypeSchemeOutline; + /** + * The default size of the point symbol in pixels, points, or real-world units. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + */ size: number; + /** + * The opacity of the point symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + */ opacity: number; } - export interface PolygonTypeScheme { + /** + * Properties defining the symbology scheme used to visualize polygon features driven by type-based attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + */ + export interface PolygonTypeScheme extends Object { + /** + * The fill colors of the symbols comprising the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + */ colors: Color[]; + /** + * The color of the fill symbol used to indicate features with no data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + */ noDataColor: Color; + /** + * Properties for defining the outline of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + */ outline: PolygonTypeSchemeOutline; + /** + * The opacity of the symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + */ opacity: number; } - export interface PolylineTypeScheme { + /** + * Properties defining the symbology scheme used to visualize polyline features driven by type-based attribute data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) + */ + export interface PolylineTypeScheme extends Object { + /** + * The colors of the line symbols comprising the theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) + */ colors: Color[]; + /** + * The color of the line symbol used to indicate features with no data and features that are out of range. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) + */ noDataColor: Color; + /** + * The default width of the line symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) + */ width: number; + /** + * The opacity of the line symbol (0 - 1). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolylineTypeScheme) + */ opacity: number; } - export interface typeGetSchemesParams { + + export interface typeGetSchemesParams extends Object { + /** + * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) + */ basemap: string | Basemap; + /** + * The geometry type of the features to visualize. **Known Values:** point | multipoint | polyline | polygon | mesh + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) + */ geometryType: string; + /** + * Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Known Values:** point-cloud-class | default + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) + * + * @default default + */ theme?: string; + /** + * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) + */ worldScale?: boolean; + /** + * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) + */ view?: SceneView; } - export interface PointTypeSchemeOutline { + + export interface PointTypeSchemeOutline extends Object { + /** + * The outline color of the marker symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + */ color: Color; + /** + * The width of the marker symbol in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PointTypeScheme) + */ width: number; } - export interface PolygonTypeSchemeOutline { + + export interface PolygonTypeSchemeOutline extends Object { + /** + * The outline color of the fill symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + */ color: Color; + /** + * The width of the fill symbol's outline in pixels or points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#PolygonTypeScheme) + */ width: number; } + 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. **Known Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) + */ + classificationMethod: string; + /** + * An array of string values representing field names used for creating predominance renderers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#fields) + */ + fields: string[]; + /** + * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Known Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#lengthUnit) + */ + lengthUnit: string; + /** + * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Known Values:** 0.25 | 0.33 | 0.5 | 1 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#standardDeviationInterval) + */ + standardDeviationInterval: number; + /** + * Indicates the renderer type generated from one of the Smart Mapping functions. **Known Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) + */ + type: string; + /** + * Contains authoring properties of visual variables generated from one of the Smart Mapping methods or sliders. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#visualVariables) + */ + visualVariables: AuthoringInfoVisualVariable[]; + + /** + * Creates a deep clone of the instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#clone) + * + * + */ + clone(): AuthoringInfo; + } + + interface AuthoringInfoConstructor { + + + new(properties?: AuthoringInfoProperties): AuthoringInfo; + + fromJSON(json: any): AuthoringInfo; + } + + export const AuthoringInfo: AuthoringInfoConstructor; + + interface AuthoringInfoProperties { + /** + * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Known Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) + */ + classificationMethod?: string; + /** + * An array of string values representing field names used for creating predominance renderers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#fields) + */ + fields?: string[]; + /** + * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Known Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#lengthUnit) + */ + lengthUnit?: string; + /** + * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Known Values:** 0.25 | 0.33 | 0.5 | 1 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#standardDeviationInterval) + */ + standardDeviationInterval?: number; + /** + * Indicates the renderer type generated from one of the Smart Mapping functions. **Known Values:** class-breaks-size | class-breaks-color | predominance | univariate-color-size + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) + */ + type?: string; + /** + * Contains authoring properties of visual variables generated from one of the Smart Mapping methods or sliders. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#visualVariables) + */ + visualVariables?: AuthoringInfoVisualVariableProperties[]; + } + + interface AuthoringInfoVisualVariable extends Accessor, JSONSupport { + /** + * If an age or timeline renderer was generated, indicates the end time of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#endTime) + */ + endTime: string | number; + /** + * Indicates the field name used for generating the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#field) + */ + field: string; + /** + * Indicates the value of the upper handle if a slider was used to generate the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#maxSliderValue) + */ + maxSliderValue: number; + /** + * Indicates the value of the lower handle if a slider was used to generate the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#minSliderValue) + */ + minSliderValue: number; + /** + * If an age or timeline renderer was generated, indicates the start time of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#startTime) + */ + startTime: string | number; + /** + * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Known Values:** percent | percent-of-total | ratio + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#style) + */ + style: string; + /** + * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Known Values:** above-and-below | centered-on | extremes | high-to-low + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#theme) + */ + theme: string; + /** + * The type of visual variable generated. **Known Values:** color | size | opacity + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#type) + */ + type: string; + /** + * If an age or timeline renderer was generated, indicates the time units used. **Known Values:** seconds | minutes | hours | days | months | years + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#units) + */ + units: string; + + /** + * Creates a deep clone of the instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#clone) + * + * + */ + clone(): AuthoringInfoVisualVariable; + } + + interface AuthoringInfoVisualVariableConstructor { + + + new(properties?: AuthoringInfoVisualVariableProperties): AuthoringInfoVisualVariable; + + fromJSON(json: any): AuthoringInfoVisualVariable; + } + + export const AuthoringInfoVisualVariable: AuthoringInfoVisualVariableConstructor; + + interface AuthoringInfoVisualVariableProperties { + /** + * If an age or timeline renderer was generated, indicates the end time of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#endTime) + */ + endTime?: string | number; + /** + * Indicates the field name used for generating the data-driven visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#field) + */ + field?: string; + /** + * Indicates the value of the upper handle if a slider was used to generate the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#maxSliderValue) + */ + maxSliderValue?: number; + /** + * Indicates the value of the lower handle if a slider was used to generate the visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#minSliderValue) + */ + minSliderValue?: number; + /** + * If an age or timeline renderer was generated, indicates the start time of the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#startTime) + */ + startTime?: string | number; + /** + * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Known Values:** percent | percent-of-total | ratio + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#style) + */ + style?: string; + /** + * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Known Values:** above-and-below | centered-on | extremes | high-to-low + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#theme) + */ + theme?: string; + /** + * The type of visual variable generated. **Known Values:** color | size | opacity + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#type) + */ + type?: string; + /** + * If an age or timeline renderer was generated, indicates the time units used. **Known Values:** seconds | minutes | hours | days | months | years + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#units) + */ + units?: string; + } + + interface supportJsonUtils { + /** + * Creates a new instance of an appropriate [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-jsonUtils.html#fromJSON) + * + * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Renderer_objects/02r30000019t000000/) for examples of the structure of various input JSON objects. + * + */ fromJSON(json: any): Renderer; } export const supportJsonUtils: supportJsonUtils; interface UniqueValueRenderer extends Renderer, VisualVariablesMixin { + /** + * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultLabel) + */ defaultLabel: string; + /** + * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. + * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) + */ defaultSymbol: Symbol; + /** + * The name of the attribute field the renderer uses to match unique values or types. A function may also be used to return a string value representing unique types if the desired type does not already explicitly exist in a field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) + */ field: string | Function; + /** + * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: + * ```js + * var renderer = { + * type: "unique-value", // autocasts as new UniqueValueRenderer() + * field: "REGION", + * field2: "RANK", + * fieldDelimiter: ", ", // comma + space used to separate values from all fields + * uniqueValueInfos: [ + * { + * value: "North, 1", // features in the "North" region and a rank of 1 + * symbol: sym1 // will be assigned sym1 + * }, { + * value: "North, 2", // features in the "North" region and a rank of 2 + * symbol: sym2 // will be assigned sym2 + * }, + * ... + * ] + * }; + * ``` + * + * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) and `field2` are unique values and + * may have their own symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2) + */ field2: string; + /** + * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: + * ```js + * var renderer = { + * type: "unique-value", // autocasts as new UniqueValueRenderer() + * field: "REGION", + * field2: "RANK", + * field3: "CLASS", + * fieldDelimiter: ", ", // comma + space used to separate values from all fields + * uniqueValueInfos: [ + * { + * value: "North, 1, medium", // features in the "North" region, a rank of 1, and "medium" class + * symbol: sym1 // will be assigned sym1 + * }, { + * value: "North, 2, medium", // features in the "North" region, a rank of 2, and a "medium class + * symbol: sym2 // will be assigned sym2 + * }, + * ... + * ] + * }; + * ``` + * + * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field), [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2), and `field3` are unique values and + * may have their own symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field3) + */ field3: string; + /** + * String inserted between the values if multiple attribute fields are specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#fieldDelimiter) + */ fieldDelimiter: string; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) + */ legendOptions: UniqueValueRendererLegendOptions; - type: string; + /** + * The type of Renderer. For UniqueValueRenderer this value is always `unique-value`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#type) + */ + readonly type: "unique-value"; + /** + * Each element in the array is an object that provides information about a unique value associated with the renderer. Each object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) + */ uniqueValueInfos: UniqueValueRendererUniqueValueInfos[]; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) for data-driven visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) + */ valueExpression: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle) + */ valueExpressionTitle: string; - addUniqueValueInfo(valueOrInfo: string | number | any, symbol?: Symbol): void; + /** + * Adds a unique value and symbol to the renderer. You can provide the value and its associated symbol as individual arguments or as an info object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#addUniqueValueInfo) + * + * @param valueOrInfo The value to match. The value can be provided as an individual argument or as an [info object described in uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos). + * @param symbol The symbol used to represent features matching the specified `value`. + * + */ + addUniqueValueInfo(valueOrInfo: string | number | any, symbol?: Symbol | SymbolProperties): void; + /** + * Creates a deep clone of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#clone) + * + * + */ clone(): UniqueValueRenderer; + /** + * Returns rendering and legend information (as defined by the renderer) associated with the given graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#getUniqueValueInfo) + * + * @param graphic The graphic whose rendering and legend information will be returned. + * + */ getUniqueValueInfo(graphic: Graphic): any; + /** + * Removes a unique value from the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#removeUniqueValueInfo) + * + * @param value Value to remove from [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos). + * + */ removeUniqueValueInfo(value: string): void; } interface UniqueValueRendererConstructor { + /** + * UniqueValueRenderer allows you to symbolize features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on one or more matching string attributes. This is typically done by using unique colors, fill styles, or images to represent features with equal values in a string field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html) + */ + new(properties?: UniqueValueRendererProperties): UniqueValueRenderer; fromJSON(json: any): UniqueValueRenderer; @@ -4962,44 +21113,218 @@ declare namespace __esri { export const UniqueValueRenderer: UniqueValueRendererConstructor; interface UniqueValueRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + /** + * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultLabel) + */ defaultLabel?: string; + /** + * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. + * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) + */ defaultSymbol?: SymbolProperties; + /** + * The name of the attribute field the renderer uses to match unique values or types. A function may also be used to return a string value representing unique types if the desired type does not already explicitly exist in a field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) + */ field?: string | Function; + /** + * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: + * ```js + * var renderer = { + * type: "unique-value", // autocasts as new UniqueValueRenderer() + * field: "REGION", + * field2: "RANK", + * fieldDelimiter: ", ", // comma + space used to separate values from all fields + * uniqueValueInfos: [ + * { + * value: "North, 1", // features in the "North" region and a rank of 1 + * symbol: sym1 // will be assigned sym1 + * }, { + * value: "North, 2", // features in the "North" region and a rank of 2 + * symbol: sym2 // will be assigned sym2 + * }, + * ... + * ] + * }; + * ``` + * + * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) and `field2` are unique values and + * may have their own symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2) + */ field2?: string; + /** + * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: + * ```js + * var renderer = { + * type: "unique-value", // autocasts as new UniqueValueRenderer() + * field: "REGION", + * field2: "RANK", + * field3: "CLASS", + * fieldDelimiter: ", ", // comma + space used to separate values from all fields + * uniqueValueInfos: [ + * { + * value: "North, 1, medium", // features in the "North" region, a rank of 1, and "medium" class + * symbol: sym1 // will be assigned sym1 + * }, { + * value: "North, 2, medium", // features in the "North" region, a rank of 2, and a "medium class + * symbol: sym2 // will be assigned sym2 + * }, + * ... + * ] + * }; + * ``` + * + * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field), [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2), and `field3` are unique values and + * may have their own symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field3) + */ field3?: string; + /** + * String inserted between the values if multiple attribute fields are specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#fieldDelimiter) + */ fieldDelimiter?: string; + /** + * An object providing options for displaying the renderer in the Legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) + */ legendOptions?: UniqueValueRendererLegendOptions; - type?: string; + /** + * Each element in the array is an object that provides information about a unique value associated with the renderer. Each object has the following specification: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) + */ uniqueValueInfos?: UniqueValueRendererUniqueValueInfos[]; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) for data-driven visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) + */ valueExpression?: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle) + */ valueExpressionTitle?: string; } - export interface UniqueValueRendererLegendOptions { + + export interface UniqueValueRendererLegendOptions extends Object { + /** + * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) or [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) + */ title?: string; } - export interface UniqueValueRendererUniqueValueInfos { + + export interface UniqueValueRendererUniqueValueInfos extends Object { + /** + * The unique value used to classify features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) + */ value: string | number; + /** + * The symbol used to style features whose value matches `value`. This value may be autocast by specifying the symbol `type`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) + */ symbol: Symbol; + /** + * Label used to describe features matched to this unique value in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) + */ label?: string; } interface VisualVariablesMixin { + /** + * Visual variables define the parameters for data-driven geographic visualizations of numeric data. They allow you to easily map continuous ramps of [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable), [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable), [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable), and/or [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) to minimum and maximum data values of one of the layer's numeric attribute fields. Visual variables can primarily be used in two ways. **1**. Thematic mapping Visual variables allow you to easily create stunning visualizations based on thematic attributes (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. This is accomplished by mapping data values from a numeric field attribute to color, size, and/or opacity values. The renderer then takes over and re-sizes or shades features based on the value of the given field and its position relative to the minimum and maximum values. The sample below uses three visual variables (size, color, and opacity). [![renderer-unique-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) **2**. Mapping real-world sizes The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) visual variable can be used to visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) based on their size in the real world. This can be particularly powerful when working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of building footprints that uses visual variables to extrude each feature to the true height of the buildings based on data stored in an attribute field. [![renderer-vv-rw](https://developers.arcgis.com/javascript/latest/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The `visualVariables` property of the renderer is an array of objects called "visual variables". Each object must indicate the type of visual variable to apply (e.g. color, size, opacity, rotation), the numeric field from which to drive the visualization, and the ramp of visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. + * + * Type | Object Specification | Legend Example + * -----|----------------------|--------------- + * color | [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-color-vv.png) + * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-size-vv.png) + * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-opacity-vv.png) + * rotation | [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) | - + * + * See the [Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) for an example of using multiple visual variables to visualize your data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-VisualVariablesMixin.html#visualVariables) + */ visualVariables: any[]; } interface VisualVariablesMixinConstructor { + + new(): VisualVariablesMixin; } export const VisualVariablesMixin: VisualVariablesMixinConstructor; interface VisualVariablesMixinProperties { + /** + * Visual variables define the parameters for data-driven geographic visualizations of numeric data. They allow you to easily map continuous ramps of [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable), [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable), [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable), and/or [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) to minimum and maximum data values of one of the layer's numeric attribute fields. Visual variables can primarily be used in two ways. **1**. Thematic mapping Visual variables allow you to easily create stunning visualizations based on thematic attributes (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. This is accomplished by mapping data values from a numeric field attribute to color, size, and/or opacity values. The renderer then takes over and re-sizes or shades features based on the value of the given field and its position relative to the minimum and maximum values. The sample below uses three visual variables (size, color, and opacity). [![renderer-unique-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) **2**. Mapping real-world sizes The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) visual variable can be used to visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) based on their size in the real world. This can be particularly powerful when working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of building footprints that uses visual variables to extrude each feature to the true height of the buildings based on data stored in an attribute field. [![renderer-vv-rw](https://developers.arcgis.com/javascript/latest/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The `visualVariables` property of the renderer is an array of objects called "visual variables". Each object must indicate the type of visual variable to apply (e.g. color, size, opacity, rotation), the numeric field from which to drive the visualization, and the ramp of visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. + * + * Type | Object Specification | Legend Example + * -----|----------------------|--------------- + * color | [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-color-vv.png) + * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-size-vv.png) + * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/latest/assets/img/apiref/renderers/legend-opacity-vv.png) + * rotation | [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) | - + * + * See the [Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) for an example of using multiple visual variables to visualize your data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-VisualVariablesMixin.html#visualVariables) + */ visualVariables?: any[]; } + interface request { + /** + * Retrieves data from a remote server or uploads a file from a user's computer. If the request returns an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html), the error object will include the details specified in [EsriErrorDetails](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * + * @param url The request URL. + * @param options An object with the following properties that describe the request. + * @param options.callbackParamName Name of the callback parameter (a special service parameter) to be specified when requesting data in JSONP format. It is ignored for all other data formats. For ArcGIS services the value is always `callback`. + * @param options.query If the request URL points to a web server that requires parameters, specify them here. + * @param options.responseType Response format. When this value is `image` the `method` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image + * @param options.headers Headers to use for the request. This is an object whose property names are header names. This is not applicable for non-XHR requests. + * @param options.timeout Indicates the amount of time in milliseconds to wait for a response from the server. Set to `0` to wait for the response indefinitely. This option is ignored when `responseType = "image"`. + * @param options.method Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. This option is ignored when `responseType = "image"`. **Known Values:** auto | post + * @param options.body If uploading a file, specify the form data or element used to submit the file here. If a form element is specified, the parameters of the `query` will be added to the URL. If not specified, then query parameters will only be added to the URL when a GET request is used. If POST is used, then query parameters will be added to the body. + * @param options.useProxy Indicates the request should use the proxy. By default this is determined automatically based on the domain of the request url. + * @param options.cacheBust Indicates whether to send an extra query parameter to ensure the server doesn't supply cached values. + * @param options.allowImageDataAccess Indicates whether apps are allowed to read image data (when used with Canvas) from images hosted on third-party sites. Only applicable when `responseType = "image"`. + * @param options.authMode + * Indicates if and how requests to ArcGIS Services are authenticated. Only applicable when [`esriConfig.request.useIdentity = true`](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request). + * + * | Known Value | Description | + * |-------------|-------------| + * | auto | The user will be signed in when a secure resource is requested. | + * | anonymous | An error will be returned when a secure resource is requested. | + * | immediate | The user will be signed in before the resource is requested. | + * | no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in. | + * + */ esriRequest(url: string, options?: requestEsriRequestOptions): IPromise; } @@ -5007,84 +21332,371 @@ declare namespace __esri { export const request: typeof __requestMapped.esriRequest; - export interface EsriErrorDetails { + /** + * The specification of the [details object](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#details) returned in an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ + export interface EsriErrorDetails extends Object { + /** + * A function to retrieve headers sent from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ getHeader: GetHeader; + /** + * The status of the http request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ httpStatus: number; + /** + * The error message code. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ messageCode: string; + /** + * Additional error message(s). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ messages: string[]; + /** + * The query parameters sent with the http request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ requestOptions: any; + /** + * Indicates if the request required https. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ ssl: boolean; + /** + * The error message subcode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ subCode: number; + /** + * The URL of the request that returned an error message. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) + */ url: string; } export type GetHeader = (headerName: string) => string; - export interface requestEsriRequestOptions { + + export interface requestEsriRequestOptions extends Object { + /** + * Name of the callback parameter (a special service parameter) to be specified when requesting data in JSONP format. It is ignored for all other data formats. For ArcGIS services the value is always `callback`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + */ callbackParamName?: string; + /** + * If the request URL points to a web server that requires parameters, specify them here. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + */ query?: any; + /** + * Response format. When this value is `image` the `method` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * + * @default json + */ responseType?: string; + /** + * Headers to use for the request. This is an object whose property names are header names. This is not applicable for non-XHR requests. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + */ headers?: any; + /** + * Indicates the amount of time in milliseconds to wait for a response from the server. Set to `0` to wait for the response indefinitely. This option is ignored when `responseType = "image"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * + * @default 60000 + */ timeout?: number; + /** + * Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. This option is ignored when `responseType = "image"`. **Known Values:** auto | post + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * + * @default auto + */ method?: string; + /** + * If uploading a file, specify the form data or element used to submit the file here. If a form element is specified, the parameters of the `query` will be added to the URL. If not specified, then query parameters will only be added to the URL when a GET request is used. If POST is used, then query parameters will be added to the body. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + */ body?: FormData | HTMLFormElement | string; + /** + * Indicates the request should use the proxy. By default this is determined automatically based on the domain of the request url. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * + * @default false + */ useProxy?: boolean; + /** + * Indicates whether to send an extra query parameter to ensure the server doesn't supply cached values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * + * @default false + */ cacheBust?: boolean; + /** + * Indicates whether apps are allowed to read image data (when used with Canvas) from images hosted on third-party sites. Only applicable when `responseType = "image"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * + * @default false + */ allowImageDataAccess?: boolean; + /** + * Indicates if and how requests to ArcGIS Services are authenticated. Only applicable when [`esriConfig.request.useIdentity = true`](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request). + * + * | Known Value | Description | + * |-------------|-------------| + * | auto | The user will be signed in when a secure resource is requested. | + * | anonymous | An error will be returned when a secure resource is requested. | + * | immediate | The user will be signed in before the resource is requested. | + * | no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in. | + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) + * + * @default auto + */ authMode?: string; } interface Action extends Accessor { + /** + * Adds a CSS class to the action's node. Can be used in conjunction with the `image` property or by itself. Any icon font may be used in this property. The [Esri Icon Font](https://developers.arcgis.com/javascript/latest/guide/esri-icon-font/index.html) is automatically made available via the ArcGIS API for JavaScript for you to use in styling custom actions. To use one of these provided icon fonts, you must prefix the class name with `esri-`. For example, the default `zoom-to` action in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) uses the font `esri-icon-zoom-in-magnifying-glass`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#className) + */ className: string; + /** + * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#event:trigger-action) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#id) + */ id: string; + /** + * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#image) + */ image: string; + /** + * The title of the action. _For popups_: When there are fewer than three actions defined in a popup, this text is displayed to the right of the icon or image representing the action. If there are three or more actions in the popup, then this text is used as a tooltip on the action. _For LayerList_: The first action is displayed in the layerlist with an icon. The layerlist has a menu that will display all actions with their titles + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#title) + */ title: string; + /** + * Indicates if the action is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#visible) + * + * @default true + */ visible: boolean; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#clone) + * + * + */ clone(): Action; } interface ActionConstructor { + + new(properties?: ActionProperties): Action; } export const Action: ActionConstructor; interface ActionProperties { + /** + * Adds a CSS class to the action's node. Can be used in conjunction with the `image` property or by itself. Any icon font may be used in this property. The [Esri Icon Font](https://developers.arcgis.com/javascript/latest/guide/esri-icon-font/index.html) is automatically made available via the ArcGIS API for JavaScript for you to use in styling custom actions. To use one of these provided icon fonts, you must prefix the class name with `esri-`. For example, the default `zoom-to` action in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) uses the font `esri-icon-zoom-in-magnifying-glass`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#className) + */ className?: string; + /** + * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#event:trigger-action) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#id) + */ id?: string; + /** + * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/latest/assets/img/guide/whats-new/41/default-action.png) will display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#image) + */ image?: string; + /** + * The title of the action. _For popups_: When there are fewer than three actions defined in a popup, this text is displayed to the right of the icon or image representing the action. If there are three or more actions in the popup, then this text is used as a tooltip on the action. _For LayerList_: The first action is displayed in the layerlist with an icon. The layerlist has a menu that will display all actions with their titles + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#title) + */ title?: string; + /** + * Indicates if the action is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html#visible) + * + * @default true + */ visible?: boolean; } interface LayersMixin { + /** + * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). + * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. + * > ```js + * > var layer = new GraphicsLayer(); + * > // The layer belongs to map1 + * > map1.layers.add(layer); + * > // The layer now belongs to map2 + * > // and implicitly does: map1.layers.remove(layer) + * > map2.layers.add(layer); + * > ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) + */ layers: Collection; - add(layers: Layer, index?: number): void; + /** + * Adds a layer to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) + * + * @param layer Layer to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). + * @param index A layer can be added at a specified index in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). If no index is specified or the index specified is greater than the current number of layers, the layer is automatically appended to the list of layers in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) and the index is normalized. + * + */ + add(layer: Layer, index?: number): void; + /** + * Adds a layer or an array of layers to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) + * + * @param layers Layer(s) to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). + * @param index A layer can be added at a specified index in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). If no index is specified or the index specified is greater than the current number of layers, the layer is automatically appended to the list of layers in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) and the index is normalized. + * + */ addMany(layers: Layer[], index?: number): void; + /** + * Returns a layer based on the given layer id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#findLayerById) + * + * @param layerId The ID assigned to the layer. + * + */ findLayerById(layerId: string): Layer; + /** + * Removes the specified layer from the layers collection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#remove) + * + * @param layer Layer to remove from the layers collection. + * + */ remove(layer: Layer): Layer; + /** + * Removes all layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#removeAll) + * + * + */ removeAll(): Layer[]; + /** + * Removes the specified layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#removeMany) + * + * @param layers Array of layers to remove from the layers collection. + * + */ removeMany(layers: Layer[]): Layer[]; + /** + * Changes the layer order. The first layer added is always the base layer, even if its order is changed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#reorder) + * + * @param layer The layer to be moved. + * @param index The index location for placing the layer. The bottom-most layer has an index of `0`. + * + */ reorder(layer: Layer, index: number): Layer; } interface LayersMixinConstructor { + + new(): LayersMixin; } export const LayersMixin: LayersMixinConstructor; interface LayersMixinProperties { - layers?: CollectionProperties; + /** + * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). + * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. + * > ```js + * > var layer = new GraphicsLayer(); + * > // The layer belongs to map1 + * > map1.layers.add(layer); + * > // The layer now belongs to map2 + * > // and implicitly does: map1.layers.remove(layer) + * > map2.layers.add(layer); + * > ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) + */ + layers?: CollectionProperties | LayerProperties[]; } interface Callout3D extends Accessor, JSONSupport { + /** + * Creates a deep clone of the callout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html#clone) + * + * + */ clone(): Callout3D; } interface Callout3DConstructor { + /** + * When symbols have an offset from their position, it's important to still see what the real location is. This can be achieved with callouts: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) + */ + new(properties?: Callout3DProperties): Callout3D; fromJSON(json: any): Callout3D; @@ -5097,15 +21709,52 @@ declare namespace __esri { } interface LineCallout3D extends Callout3D { + /** + * The border settings of the callout line. The border of the callout line can be used to improve the contrast of the callout line color against various background colors. If the border is `null`, then no border will be visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) + */ border: LineCallout3DBorder; + /** + * The color of the callout line. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#color) + * + * @default black + */ color: Color; + /** + * The width of the callout line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#size) + * + * @default 1px + */ size: number; + /** + * For LineCallout3D the type is always `line`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#type) + */ type: string; + /** + * Creates a deep clone of the callout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#clone) + * + * + */ clone(): LineCallout3D; } interface LineCallout3DConstructor { + /** + * This type of callout displays a line to connect a symbol or a label with its actual location in the scene. For example when displaying points of interest in a city, visualizing them with a callout line helps to understand where the points are actually located: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) + */ + new(properties?: LineCallout3DProperties): LineCallout3D; fromJSON(json: any): LineCallout3D; @@ -5114,26 +21763,92 @@ declare namespace __esri { export const LineCallout3D: LineCallout3DConstructor; interface LineCallout3DProperties extends Callout3DProperties { + /** + * The border settings of the callout line. The border of the callout line can be used to improve the contrast of the callout line color against various background colors. If the border is `null`, then no border will be visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) + */ border?: LineCallout3DBorderProperties; - color?: Color; - size?: number; + /** + * The color of the callout line. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#color) + * + * @default black + */ + color?: Color | number[] | string; + /** + * The width of the callout line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#size) + * + * @default 1px + */ + size?: number | string; + /** + * For LineCallout3D the type is always `line`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#type) + */ type?: string; } - export interface LineCallout3DBorderProperties { + + export interface LineCallout3DBorderProperties extends Object { + /** + * The color of the callout line border. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) + * + * @default white + */ color?: Color; } - export interface LineCallout3DBorder extends Accessor { + + export interface LineCallout3DBorder extends AnonymousAccessor { + /** + * The color of the callout line border. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) + * + * @default white + */ color?: Color; } interface ExtrudeSymbol3DLayer extends Symbol3DLayer { + /** + * The height of the extrusion in meters. Negative values will extrude the polygon surface downward towards or below the ground. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#size) + * + * @default 1 + */ size: number; + /** + * For ExtrudeSymbol3DLayer the type is always `extrude`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#type) + */ + readonly type: "extrude"; + /** + * Creates a deep clone of the symbol layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#clone) + * + * + */ clone(): ExtrudeSymbol3DLayer; } interface ExtrudeSymbol3DLayerConstructor { + /** + * ExtrudeSymbol3DLayer is used to render [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries by extruding them upward from the ground, creating a 3D volumetric object. This is done with a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html) + */ + new(properties?: ExtrudeSymbol3DLayerProperties): ExtrudeSymbol3DLayer; fromJSON(json: any): ExtrudeSymbol3DLayer; @@ -5142,14 +21857,32 @@ declare namespace __esri { export const ExtrudeSymbol3DLayer: ExtrudeSymbol3DLayerConstructor; interface ExtrudeSymbol3DLayerProperties extends Symbol3DLayerProperties { + /** + * The height of the extrusion in meters. Negative values will extrude the polygon surface downward towards or below the ground. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#size) + * + * @default 1 + */ size?: number; } interface FillSymbol extends Symbol { + /** + * The outline of the polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html#outline) + */ outline: SimpleLineSymbol; } interface FillSymbolConstructor { + /** + * Fill symbols are used to draw [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) graphics in a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) or a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). To create new fill symbols, use either [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html) or [PictureFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) + */ + new(properties?: FillSymbolProperties): FillSymbol; fromJSON(json: any): FillSymbol; @@ -5158,16 +21891,45 @@ declare namespace __esri { export const FillSymbol: FillSymbolConstructor; interface FillSymbolProperties extends SymbolProperties { + /** + * The outline of the polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html#outline) + */ outline?: SimpleLineSymbolProperties; } interface FillSymbol3DLayer extends Symbol3DLayer { + /** + * The outline used to draw a line around the filled geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) + */ outline: FillSymbol3DLayerOutline; + /** + * For FillSymbol3DLayer the type is always `fill`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#type) + */ + readonly type: "fill"; + /** + * Creates a deep clone of the symbol layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#clone) + * + * + */ clone(): FillSymbol3DLayer; } interface FillSymbol3DLayerConstructor { + /** + * FillSymbol3DLayer is used to render the surfaces of flat 2D [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries and 3D volumetric meshes in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html) + */ + new(properties?: FillSymbol3DLayerProperties): FillSymbol3DLayer; fromJSON(json: any): FillSymbol3DLayer; @@ -5176,19 +21938,63 @@ declare namespace __esri { export const FillSymbol3DLayer: FillSymbol3DLayerConstructor; interface FillSymbol3DLayerProperties extends Symbol3DLayerProperties { - outline?: FillSymbol3DLayerOutline; + /** + * The outline used to draw a line around the filled geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) + */ + outline?: FillSymbol3DLayerOutlineProperties; } - export interface FillSymbol3DLayerOutline { + + export interface FillSymbol3DLayerOutlineProperties extends Object { + /** + * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) + */ + color?: Color | number[] | string; + /** + * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) + */ + size?: number | string; + } + + export interface FillSymbol3DLayerOutline extends AnonymousAccessor { + /** + * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) + */ color: Color; + /** + * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) + */ size: number; } interface Font extends Accessor, JSONSupport { + /** + * Creates a deep clone of the font object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#clone) + * + * + */ clone(): Font; } interface FontConstructor { + /** + * The font used to display [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) added to the [graphics layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html) + */ + new(properties?: FontProperties): Font; fromJSON(json: any): Font; @@ -5201,15 +22007,60 @@ declare namespace __esri { } interface IconSymbol3DLayer extends Symbol3DLayer { + /** + * The positioning of the icon relative to the geometry. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) + * + * @default center + */ anchor: string; + /** + * The outline of the icon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) + */ outline: IconSymbol3DLayerOutline; + /** + * The shape (`primitive`) or image URL (`href`) used to visualize the features. If both properties are present, `href` takes precedence and `primitive` is ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) + * + * @default { primitive: "circle" } + */ resource: IconSymbol3DLayerResource; + /** + * The size of the icon in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#size) + * + * @default 12 + */ size: number; + /** + * For IconSymbol3DLayer the type is always `icon`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#type) + */ + readonly type: "icon"; + /** + * Creates a deep clone of the symbol layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#clone) + * + * + */ clone(): IconSymbol3DLayer; } interface IconSymbol3DLayerConstructor { + /** + * IconSymbol3DLayer is used to render [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries using a flat 2D icon (e.g. a circle) with a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features may also be rendered with IconSymbol3DLayers, but the icon symbol layer must be contained within a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html), not a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in that scenario. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) + */ + new(properties?: IconSymbol3DLayerProperties): IconSymbol3DLayer; fromJSON(json: any): IconSymbol3DLayer; @@ -5218,30 +22069,139 @@ declare namespace __esri { export const IconSymbol3DLayer: IconSymbol3DLayerConstructor; interface IconSymbol3DLayerProperties extends Symbol3DLayerProperties { + /** + * The positioning of the icon relative to the geometry. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) + * + * @default center + */ anchor?: string; - outline?: IconSymbol3DLayerOutline; + /** + * The outline of the icon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) + */ + outline?: IconSymbol3DLayerOutlineProperties; + /** + * The shape (`primitive`) or image URL (`href`) used to visualize the features. If both properties are present, `href` takes precedence and `primitive` is ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) + * + * @default { primitive: "circle" } + */ resource?: IconSymbol3DLayerResource; - size?: number; + /** + * The size of the icon in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#size) + * + * @default 12 + */ + size?: number | string; } - export interface IconSymbol3DLayerOutline { + + export interface IconSymbol3DLayerOutlineProperties extends Object { + /** + * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) + * + * @default black + */ + color?: Color | number[] | string; + /** + * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) + * + * @default 1.125 + */ + size?: number | string; + } + + export interface IconSymbol3DLayerOutline extends AnonymousAccessor { + /** + * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) + * + * @default black + */ color?: Color; + /** + * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) + * + * @default 1.125 + */ size?: number; } - export interface IconSymbol3DLayerResource { + + export interface IconSymbol3DLayerResource extends Object { + /** + * Uses a built-in shape. See the table below for list of possible values. + * + * Value | Description + * ------|------------ + * circle | ![s3d-icon-circle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-circle.png) + * square | ![s3d-icon-square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-square.png) + * cross | ![s3d-icon-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-cross.png) + * x | ![s3d-icon-x](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-x.png) + * kite | ![s3d-icon-kite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-kite.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) + */ primitive?: string; + /** + * The URL or data URI for the image. If the external resource is an SVG then the SVG root node must have a set width and height, otherwise it will not render at the correct size. SVG is not supported in IE11. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) + */ href?: string; } interface LabelSymbol3D extends Symbol3D { + /** + * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type `line` are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) + */ callout: Callout3D; + /** + * For LabelSymbol3D the type is always `label-3d`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#type) + */ + readonly type: "label-3d"; + /** + * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) `verticalOffset` should be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) + */ verticalOffset: LabelSymbol3DVerticalOffset; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#clone) + * + * + */ clone(): LabelSymbol3D; } interface LabelSymbol3DConstructor { + /** + * LabelSymbol3D is used to render labels for features from a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) + */ + new(properties?: LabelSymbol3DProperties): LabelSymbol3D; fromJSON(json: any): LabelSymbol3D; @@ -5250,27 +22210,89 @@ declare namespace __esri { export const LabelSymbol3D: LabelSymbol3DConstructor; interface LabelSymbol3DProperties extends Symbol3DProperties { + /** + * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type `line` are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) + */ callout?: Callout3DProperties; + /** + * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) `verticalOffset` should be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) + */ verticalOffset?: LabelSymbol3DVerticalOffsetProperties; } - export interface LabelSymbol3DVerticalOffsetProperties { + + export interface LabelSymbol3DVerticalOffsetProperties extends Object { + /** + * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) + */ screenLength?: number; + /** + * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid the vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) + */ minWorldLength?: number; + /** + * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) + */ maxWorldLength?: number; } - export interface LabelSymbol3DVerticalOffset extends Accessor { + + export interface LabelSymbol3DVerticalOffset extends AnonymousAccessor { + /** + * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) + */ screenLength: number; + /** + * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid the vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) + */ minWorldLength?: number; + /** + * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) + */ maxWorldLength?: number; } interface LineSymbol extends Symbol { + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#color) + * + * @default "black" + */ color: Color; + /** + * The width of the symbol in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#width) + * + * @default 0.75 + */ width: number; } interface LineSymbolConstructor { + /** + * Line symbols are used to draw [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html) + */ + new(properties?: LineSymbolProperties): LineSymbol; fromJSON(json: any): LineSymbol; @@ -5279,15 +22301,49 @@ declare namespace __esri { export const LineSymbol: LineSymbolConstructor; interface LineSymbolProperties extends SymbolProperties { - color?: Color; - width?: number; + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#color) + * + * @default "black" + */ + color?: Color | number[] | string; + /** + * The width of the symbol in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#width) + * + * @default 0.75 + */ + width?: number | string; } interface LineSymbol3D extends Symbol3D { + /** + * For LineSymbol3D the type is always `line-3d`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html#type) + */ + readonly type: "line-3d"; + + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html#clone) + * + * + */ clone(): LineSymbol3D; } interface LineSymbol3DConstructor { + /** + * LineSymbol3D is used to render features with [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) + */ + new(properties?: LineSymbol3DProperties): LineSymbol3D; fromJSON(json: any): LineSymbol3D; @@ -5300,12 +22356,38 @@ declare namespace __esri { } interface LineSymbol3DLayer extends Symbol3DLayer { + /** + * The width of the line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#size) + * + * @default 0.75 + */ size: number; + /** + * For LineSymbol3DLayer the type is always `line`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#type) + */ + readonly type: "line"; + /** + * Creates a deep clone of the symbol layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#clone) + * + * + */ clone(): LineSymbol3DLayer; } interface LineSymbol3DLayerConstructor { + /** + * LineSymbol3DLayer renders [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries using a flat 2D line with a [LineSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html) + */ + new(properties?: LineSymbol3DLayerProperties): LineSymbol3DLayer; fromJSON(json: any): LineSymbol3DLayer; @@ -5314,16 +22396,53 @@ declare namespace __esri { export const LineSymbol3DLayer: LineSymbol3DLayerConstructor; interface LineSymbol3DLayerProperties extends Symbol3DLayerProperties { - size?: number; + /** + * The width of the line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#size) + * + * @default 0.75 + */ + size?: number | string; } interface MarkerSymbol extends Symbol { + /** + * The angle of the marker in degrees. + * > **Known Limitations** This property 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-symbols-MarkerSymbol.html#angle) + * + * @default 0 + */ angle: number; + /** + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * > **Known Limitations** This property 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-symbols-MarkerSymbol.html#xoffset) + * + * @default 0 + */ xoffset: number; + /** + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * > **Known Limitations** This property 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-symbols-MarkerSymbol.html#yoffset) + * + * @default 0 + */ yoffset: number; } interface MarkerSymbolConstructor { + /** + * Marker symbols are used to draw [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) graphics in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). To create new marker symbols, use either [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) or [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) + */ + new(properties?: MarkerSymbolProperties): MarkerSymbol; fromJSON(json: any): MarkerSymbol; @@ -5332,16 +22451,60 @@ declare namespace __esri { export const MarkerSymbol: MarkerSymbolConstructor; interface MarkerSymbolProperties extends SymbolProperties { + /** + * The angle of the marker in degrees. + * > **Known Limitations** This property 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-symbols-MarkerSymbol.html#angle) + * + * @default 0 + */ angle?: number; - xoffset?: number; - yoffset?: 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 not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#xoffset) + * + * @default 0 + */ + xoffset?: number | string; + /** + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * > **Known Limitations** This property 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-symbols-MarkerSymbol.html#yoffset) + * + * @default 0 + */ + yoffset?: number | string; } interface MeshSymbol3D extends Symbol3D { + /** + * For MeshSymbol3D, the type is always `mesh-3d`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html#type) + */ + readonly type: "mesh-3d"; + + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html#clone) + * + * + */ clone(): MeshSymbol3D; } interface MeshSymbol3DConstructor { + /** + * MeshSymbol3D is used to render 3D mesh features in a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) + */ + new(properties?: MeshSymbol3DProperties): MeshSymbol3D; fromJSON(json: any): MeshSymbol3D; @@ -5354,19 +22517,88 @@ declare namespace __esri { } interface ObjectSymbol3DLayer extends Symbol3DLayer { + /** + * The positioning of the object relative to the geometry. `origin` is only valid when an `href` resource is specified and uses the pivot point defined by the 3D model. **Possible Values:** center | top | bottom | origin + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) + * + * @default center + */ anchor: string; + /** + * The depth, or diameter from north to south, of the object in meters. If `undefined`, the depth will be calculated to maintain the original proportions of the object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) + * + * @default 10 + */ depth: number; + /** + * The clockwise rotation of the symbol in the horizontal plane (i.e., around the z axis). The rotation is specified in degrees and is relative to the y-axis. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the heading of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#heading) + */ heading: number; + /** + * The height of the object in meters. If `undefined`, the height will be calculated to maintain the original proportions of the object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height) + * + * @default 10 + */ height: number; + /** + * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the points. If both properties are present, `primitive` takes precedence and `href` is ignored. When using the `href` property, external 3D models must be present in a specific format, which can be generated using the ArcGIS Pro SDK. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to generate a custom 3D model for use in this property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) + * + * @default { primitive: "sphere" } + */ resource: ObjectSymbol3DLayerResource; + /** + * The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). The rotation is specified in degrees and is relative to the x-axis. At 0 degrees, the model is level. A positive value lifts the left part and lowers the right part of the model. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the roll of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#roll) + */ roll: number; + /** + * The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). The rotation is specified in degrees and is relative to the y-axis. At 0 degrees, the model is level. A positive value points lifts the front and lowers the back of the model. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the tilt of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#tilt) + */ tilt: number; + /** + * For ObjectSymbol3DLayer the type is always `object`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#type) + */ + readonly type: "object"; + /** + * The width, or diameter from east to west, of the object in meters. If `undefined`, the width will be calculated to maintain the original proportions of the object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width) + * + * @default 10 + */ width: number; + /** + * Creates a deep clone of the symbol layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#clone) + * + * + */ clone(): ObjectSymbol3DLayer; } interface ObjectSymbol3DLayerConstructor { + /** + * ObjectSymbol3DLayer is used to render [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries using a volumetric 3D shape (e.g., a sphere or cylinder) with a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features may also be rendered with ObjectSymbol3DLayers, but the object symbol layer must be contained in a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html), not a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in this scenario. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) + */ + new(properties?: ObjectSymbol3DLayerProperties): ObjectSymbol3DLayer; fromJSON(json: any): ObjectSymbol3DLayer; @@ -5375,28 +22607,126 @@ declare namespace __esri { export const ObjectSymbol3DLayer: ObjectSymbol3DLayerConstructor; interface ObjectSymbol3DLayerProperties extends Symbol3DLayerProperties { + /** + * The positioning of the object relative to the geometry. `origin` is only valid when an `href` resource is specified and uses the pivot point defined by the 3D model. **Possible Values:** center | top | bottom | origin + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) + * + * @default center + */ anchor?: string; + /** + * The depth, or diameter from north to south, of the object in meters. If `undefined`, the depth will be calculated to maintain the original proportions of the object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) + * + * @default 10 + */ depth?: number; + /** + * The clockwise rotation of the symbol in the horizontal plane (i.e., around the z axis). The rotation is specified in degrees and is relative to the y-axis. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the heading of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#heading) + */ heading?: number; + /** + * The height of the object in meters. If `undefined`, the height will be calculated to maintain the original proportions of the object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height) + * + * @default 10 + */ height?: number; + /** + * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the points. If both properties are present, `primitive` takes precedence and `href` is ignored. When using the `href` property, external 3D models must be present in a specific format, which can be generated using the ArcGIS Pro SDK. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to generate a custom 3D model for use in this property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) + * + * @default { primitive: "sphere" } + */ resource?: ObjectSymbol3DLayerResource; + /** + * The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). The rotation is specified in degrees and is relative to the x-axis. At 0 degrees, the model is level. A positive value lifts the left part and lowers the right part of the model. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the roll of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#roll) + */ roll?: number; + /** + * The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). The rotation is specified in degrees and is relative to the y-axis. At 0 degrees, the model is level. A positive value points lifts the front and lowers the back of the model. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the tilt of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#tilt) + */ tilt?: number; + /** + * The width, or diameter from east to west, of the object in meters. If `undefined`, the width will be calculated to maintain the original proportions of the object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width) + * + * @default 10 + */ width?: number; } - export interface ObjectSymbol3DLayerResource { + + export interface ObjectSymbol3DLayerResource extends Object { + /** + * Uses a built-in shape. See the table below for possible values. + * + * Value | Description + * ------|------------ + * sphere | ![s3d-object-sphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-sphere.png) + * cylinder | ![s3d-object-cylinder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-cylinder.png) + * cube | ![s3d-object-cube](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-cube.png) + * cone | ![s3d-object-cone](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-cone.png) + * inverted-cone | ![s3d-object-inverted-cone](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-inverted-cone.png) + * diamond | ![s3d-object-diamond](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-diamond.png) + * tetrahedron | ![s3d-object-tetrahedron](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-tetrahedron.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) + */ primitive?: string; + /** + * The URL to the 3D model. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to create a custom 3D model. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) + */ href?: string; } interface PathSymbol3DLayer extends Symbol3DLayer { + /** + * The diameter of the tube in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#size) + * + * @default 1 + */ size: number; + /** + * For PathSymbol3DLayer, the type is always `path`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#type) + */ + readonly type: "path"; + /** + * Creates a deep clone of the symbol layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#clone) + * + * + */ clone(): PathSymbol3DLayer; } interface PathSymbol3DLayerConstructor { + /** + * PathSymbol3DLayer renders [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries using a volumetric 3D tube with a [LineSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html) + */ + new(properties?: PathSymbol3DLayerProperties): PathSymbol3DLayer; fromJSON(json: any): PathSymbol3DLayer; @@ -5405,22 +22735,95 @@ declare namespace __esri { export const PathSymbol3DLayer: PathSymbol3DLayerConstructor; interface PathSymbol3DLayerProperties extends Symbol3DLayerProperties { + /** + * The diameter of the tube in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#size) + * + * @default 1 + */ size?: number; } interface PictureFillSymbol extends FillSymbol { + /** + * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#height) + * + * @default 12 + */ height: number; + /** + * For PictureFillSymbol the type is always `picture-fill`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#type) + */ + readonly type: "picture-fill"; + /** + * The URL to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) + */ url: string; + /** + * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#width) + * + * @default 12 + */ width: number; + /** + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xoffset) + * + * @default 0 + */ xoffset: number; + /** + * The scale factor on the x axis of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xscale) + * + * @default 1 + */ xscale: number; + /** + * The offset on the y-axis in pixels or points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yoffset) + * + * @default 0 + */ yoffset: number; + /** + * The scale factor on the y axis of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yscale) + * + * @default 1 + */ yscale: number; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#clone) + * + * + */ clone(): PictureFillSymbol; } interface PictureFillSymbolConstructor { + /** + * PictureFillSymbol uses an image in a repeating pattern to symbolize polygon features in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). A [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) must point to a valid image. In addition, the symbol can have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#outline), which is defined by a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). PictureFillSymbols may be applied to polygon features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or an individual [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html) + */ + new(properties?: PictureFillSymbolProperties): PictureFillSymbol; fromJSON(json: any): PictureFillSymbol; @@ -5429,24 +22832,112 @@ declare namespace __esri { export const PictureFillSymbol: PictureFillSymbolConstructor; interface PictureFillSymbolProperties extends FillSymbolProperties { - height?: number; + /** + * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#height) + * + * @default 12 + */ + height?: number | string; + /** + * The URL to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) + */ url?: string; - width?: number; - xoffset?: number; + /** + * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#width) + * + * @default 12 + */ + width?: number | string; + /** + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xoffset) + * + * @default 0 + */ + xoffset?: number | string; + /** + * The scale factor on the x axis of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xscale) + * + * @default 1 + */ xscale?: number; - yoffset?: number; + /** + * The offset on the y-axis in pixels or points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yoffset) + * + * @default 0 + */ + yoffset?: number | string; + /** + * The scale factor on the y axis of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yscale) + * + * @default 1 + */ yscale?: number; } interface PictureMarkerSymbol extends MarkerSymbol { + /** + * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#height) + * + * @default 12 + */ height: number; + /** + * For PictureMarkerSymbol the type is always `picture-marker`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#type) + */ + readonly type: "picture-marker"; + /** + * The URL to the image. To avoid CORS issues with this symbol, do one of the following: + * * Use an image hosted on the same domain as the application. + * * If the image is on a different domain and that server is CORS enabled, add the domain to the [corsEnabledServers](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) array. + * * Install a proxy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) + */ url: string; + /** + * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#width) + * + * @default 12 + */ width: number; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#clone) + * + * + */ clone(): PictureMarkerSymbol; } interface PictureMarkerSymbolConstructor { + /** + * PictureMarkerSymbol renders [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) graphics in either a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) using an image. A [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) must point to a valid image. PictureMarkerSymbols may be applied to point features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). The image below depicts a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) whose point features are styled with a [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html) + */ + new(properties?: PictureMarkerSymbolProperties): PictureMarkerSymbol; fromJSON(json: any): PictureMarkerSymbol; @@ -5455,19 +22946,70 @@ declare namespace __esri { export const PictureMarkerSymbol: PictureMarkerSymbolConstructor; interface PictureMarkerSymbolProperties extends MarkerSymbolProperties { - height?: number; + /** + * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#height) + * + * @default 12 + */ + height?: number | string; + /** + * The URL to the image. To avoid CORS issues with this symbol, do one of the following: + * * Use an image hosted on the same domain as the application. + * * If the image is on a different domain and that server is CORS enabled, add the domain to the [corsEnabledServers](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) array. + * * Install a proxy. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) + */ url?: string; - width?: number; + /** + * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#width) + * + * @default 12 + */ + width?: number | string; } interface PointSymbol3D extends Symbol3D { + /** + * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type line are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) + */ callout: Callout3D; + /** + * For PointSymbol3D the type is always `point-3d`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#type) + */ + readonly type: "point-3d"; + /** + * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) `verticalOffset` should be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) + */ verticalOffset: PointSymbol3DVerticalOffset; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#clone) + * + * + */ clone(): PointSymbol3D; } interface PointSymbol3DConstructor { + /** + * PointSymbol3D is used to render features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) + */ + new(properties?: PointSymbol3DProperties): PointSymbol3D; fromJSON(json: any): PointSymbol3D; @@ -5476,26 +23018,88 @@ declare namespace __esri { export const PointSymbol3D: PointSymbol3DConstructor; interface PointSymbol3DProperties extends Symbol3DProperties { + /** + * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type line are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) + */ callout?: Callout3DProperties; + /** + * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) `verticalOffset` should be set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) + */ verticalOffset?: PointSymbol3DVerticalOffsetProperties; } - export interface PointSymbol3DVerticalOffsetProperties { + + export interface PointSymbol3DVerticalOffsetProperties extends Object { + /** + * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) + */ screenLength?: number; + /** + * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) + */ minWorldLength?: number; + /** + * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) + */ maxWorldLength?: number; } - export interface PointSymbol3DVerticalOffset extends Accessor { + + export interface PointSymbol3DVerticalOffset extends AnonymousAccessor { + /** + * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) + */ screenLength: number; + /** + * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) + */ minWorldLength?: number; + /** + * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) + */ maxWorldLength?: number; } interface PolygonSymbol3D extends Symbol3D { + /** + * For PolygonSymbol3D the type is always `polygon-3d`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html#type) + */ + readonly type: "polygon-3d"; + + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html#clone) + * + * + */ clone(): PolygonSymbol3D; } interface PolygonSymbol3DConstructor { + /** + * PolygonSymbol3D is used to render features with [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. Polygon features may also be rendered as points with icons or objects at the centroid of each polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) + */ + new(properties?: PolygonSymbol3DProperties): PolygonSymbol3D; fromJSON(json: any): PolygonSymbol3D; @@ -5508,13 +23112,59 @@ declare namespace __esri { } interface SimpleFillSymbol extends FillSymbol { + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color) + * + * @default [0, 0, 0, 0.25] - black, semitransparent + */ color: Color; + /** + * The fill style. Valid values are listed in the table below: + * + * Value | Description + * ------|------------- + * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) + * cross | ![sfs-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-cross.png) + * diagonal-cross | ![sfs-diagonal-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-diagonal-cross.png) + * forward-diagonal | ![sfs-forward-diagonal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-forward-diagonal.png) + * horizontal | ![sfs-horizontal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-horizontal.png) + * none | The polygon has no fill. + * solid | ![sfs-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-solid.png) + * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-vertical.png) + * + * > **Known Limitations** This property 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-symbols-SimpleFillSymbol.html#style) + * + * @default solid + */ style: string; + /** + * For SimpleFillSymbol the type is always `simple-fill`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#type) + */ + readonly type: "simple-fill"; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#clone) + * + * + */ clone(): SimpleFillSymbol; } interface SimpleFillSymbolConstructor { + /** + * SimpleFillSymbol is used for rendering 2D polygons in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It can be filled with a solid [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color), or a [pattern](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style). In addition, the symbol can have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#outline), which is defined by a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html) + */ + new(properties?: SimpleFillSymbolProperties): SimpleFillSymbol; fromJSON(json: any): SimpleFillSymbol; @@ -5523,20 +23173,116 @@ declare namespace __esri { export const SimpleFillSymbol: SimpleFillSymbolConstructor; interface SimpleFillSymbolProperties extends FillSymbolProperties { - color?: Color; + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color) + * + * @default [0, 0, 0, 0.25] - black, semitransparent + */ + color?: Color | number[] | string; + /** + * The fill style. Valid values are listed in the table below: + * + * Value | Description + * ------|------------- + * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) + * cross | ![sfs-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-cross.png) + * diagonal-cross | ![sfs-diagonal-cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-diagonal-cross.png) + * forward-diagonal | ![sfs-forward-diagonal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-forward-diagonal.png) + * horizontal | ![sfs-horizontal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-horizontal.png) + * none | The polygon has no fill. + * solid | ![sfs-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-solid.png) + * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sfs-vertical.png) + * + * > **Known Limitations** This property 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-symbols-SimpleFillSymbol.html#style) + * + * @default solid + */ style?: string; } interface SimpleLineSymbol extends LineSymbol { + /** + * Specifies the cap style. The cap is the end of a line segment. **Known Values:** butt | round | square + * > **Known Limitations** + * * This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * This property does not persist when applied to a symbol used in a layer saved to a web map or portal item. See the [web map specification](https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/) for more details about properties that persist when a SimpleLineSymbol is saved to an ArcGIS Online or Portal item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#cap) + * + * @default butt + */ cap: string; + /** + * Specifies the join style. **Known Values:** miter | round | bevel + * > **Known Limitations** This property 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-symbols-SimpleLineSymbol.html#join) + * + * @default miter + */ join: string; + /** + * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#miterLimit) + * + * @default 0.75 + */ miterLimit: number; + /** + * Specifies the line style. Valid values are listed in the table below: + * + * Value | Description + * ------|------------- + * dash | ![sls-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash.png) + * dash-dot | ![sls-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash-dot.png) + * dot | ![sls-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dot.png) + * long-dash | ![sls-long-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-long-dash.png) + * long-dash-dot | ![sls-long-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-long-dash-dot.png) + * long-dash-dot-dot | ![sls-dash-dot-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash-dot-dot.png) + * none | The line has no symbol. + * short-dash | ![sls-short-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash.png) + * short-dash-dot | ![sls-short-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash-dot.png) + * short-dash-dot-dot | ![sls-short-dash-dot-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash-dot-dot.png) + * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dot.png) + * solid | ![sls-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-solid.png) + * + * > **Known Limitations** This property 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-symbols-SimpleLineSymbol.html#style) + * + * @default solid + */ style: string; + /** + * For SimpleLineSymbol, the type is always `simple-line`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#type) + */ + readonly type: "simple-line"; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#clone) + * + * + */ clone(): SimpleLineSymbol; } interface SimpleLineSymbolConstructor { + /** + * SimpleLineSymbol is used for rendering 2D [polyline geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). SimpleLineSymbol is also used for rendering outlines for [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) and [fill symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html) + */ + new(properties?: SimpleLineSymbolProperties): SimpleLineSymbol; fromJSON(json: any): SimpleLineSymbol; @@ -5545,23 +23291,134 @@ declare namespace __esri { export const SimpleLineSymbol: SimpleLineSymbolConstructor; interface SimpleLineSymbolProperties extends LineSymbolProperties { + /** + * Specifies the cap style. The cap is the end of a line segment. **Known Values:** butt | round | square + * > **Known Limitations** + * * This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * This property does not persist when applied to a symbol used in a layer saved to a web map or portal item. See the [web map specification](https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/) for more details about properties that persist when a SimpleLineSymbol is saved to an ArcGIS Online or Portal item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#cap) + * + * @default butt + */ cap?: string; + /** + * Specifies the join style. **Known Values:** miter | round | bevel + * > **Known Limitations** This property 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-symbols-SimpleLineSymbol.html#join) + * + * @default miter + */ join?: string; - miterLimit?: number; + /** + * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * > **Known Limitations** This property is not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#miterLimit) + * + * @default 0.75 + */ + miterLimit?: number | string; + /** + * Specifies the line style. Valid values are listed in the table below: + * + * Value | Description + * ------|------------- + * dash | ![sls-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash.png) + * dash-dot | ![sls-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash-dot.png) + * dot | ![sls-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dot.png) + * long-dash | ![sls-long-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-long-dash.png) + * long-dash-dot | ![sls-long-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-long-dash-dot.png) + * long-dash-dot-dot | ![sls-dash-dot-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-dash-dot-dot.png) + * none | The line has no symbol. + * short-dash | ![sls-short-dash](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash.png) + * short-dash-dot | ![sls-short-dash-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash-dot.png) + * short-dash-dot-dot | ![sls-short-dash-dot-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dash-dot-dot.png) + * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-short-dot.png) + * solid | ![sls-solid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sls-solid.png) + * + * > **Known Limitations** This property 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-symbols-SimpleLineSymbol.html#style) + * + * @default solid + */ style?: string; } interface SimpleMarkerSymbol extends MarkerSymbol { + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * > The `color` property does not apply to marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). Since these styles are wholly comprised of outlines, you must modify the [outline.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) property to set the color of symbols with those styles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) + * + * @default [255, 255, 255, 0.25] - white, semitransparent + */ color: Color; + /** + * The outline of the marker symbol. The `color` property of this object directly modifies the overall color of marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) + */ outline: SimpleLineSymbol; + /** + * The SVG path of the icon. + * > **Known Limitations** This property 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-symbols-SimpleMarkerSymbol.html#path) + */ path: string; + /** + * The size of the marker in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#size) + * + * @default 12 + */ size: number; + /** + * The marker style. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * circle | ![sms_circle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-circle.png) + * cross | ![sms_cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-cross.png) + * diamond | ![sms_diamond](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-diamond.png) + * square | ![sms_square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-square.png) + * x | ![sms_x](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-x.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style) + * + * @default circle + */ style: string; + /** + * For SimpleMarkerSymbol the type is always `simple-marker`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#type) + */ + readonly type: "simple-marker"; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#clone) + * + * + */ clone(): SimpleMarkerSymbol; } interface SimpleMarkerSymbolConstructor { + /** + * SimpleMarkerSymbol is used for rendering 2D [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries with a simple shape and [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It may be filled with a solid [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) and have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline), which is defined with a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) + */ + new(properties?: SimpleMarkerSymbolProperties): SimpleMarkerSymbol; fromJSON(json: any): SimpleMarkerSymbol; @@ -5570,24 +23427,155 @@ declare namespace __esri { export const SimpleMarkerSymbol: SimpleMarkerSymbolConstructor; interface SimpleMarkerSymbolProperties extends MarkerSymbolProperties { - color?: Color; + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * > The `color` property does not apply to marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). Since these styles are wholly comprised of outlines, you must modify the [outline.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) property to set the color of symbols with those styles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) + * + * @default [255, 255, 255, 0.25] - white, semitransparent + */ + color?: Color | number[] | string; + /** + * The outline of the marker symbol. The `color` property of this object directly modifies the overall color of marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) + */ outline?: SimpleLineSymbolProperties; + /** + * The SVG path of the icon. + * > **Known Limitations** This property 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-symbols-SimpleMarkerSymbol.html#path) + */ path?: string; - size?: number; + /** + * The size of the marker in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#size) + * + * @default 12 + */ + size?: number | string; + /** + * The marker style. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * circle | ![sms_circle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-circle.png) + * cross | ![sms_cross](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-cross.png) + * diamond | ![sms_diamond](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-diamond.png) + * square | ![sms_square](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-square.png) + * x | ![sms_x](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols-sms-x.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style) + * + * @default circle + */ style?: string; } + interface symbolsSupportJsonUtils { + /** + * Creates a new instance of an appropriate [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. When you create a [MarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) or [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html) from a JSON object, you may specify a property angle to rotate the symbol. Be aware that the angle in the JSON is different from [MarkerSymbol.angle](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#angle). The angle in the JSON follows the traditional ArcGIS specification and is rotated counter-clockwise, whereas the angle in the symbol is rotated clockwise. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-jsonUtils.html#fromJSON) + * + * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Symbol_Objects/02r3000000n5000000/) for examples of the structure of various input JSON objects. + * + */ fromJSON(json: any): Symbol; } export const symbolsSupportJsonUtils: symbolsSupportJsonUtils; + + interface symbolPreview { + /** + * Generates a preview image of a given symbol that can be displayed in a custom widget or other DOM element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) + * + * @param symbol The symbol for which to generate a preview image. + * @param options Formatting options for the symbol preview image. + * @param options.node The parent node to append to the symbol. + * @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. + * + */ + renderPreviewHTML(symbol: Symbol, options?: symbolPreviewRenderPreviewHTMLOptions): IPromise; + } + + export const symbolPreview: symbolPreview; + + + export interface symbolPreviewRenderPreviewHTMLOptions extends Object { + /** + * The parent node to append to the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) + */ + node?: HTMLElement; + /** + * The size of the symbol preview in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) + */ + size?: number; + /** + * The maximum size of the symbol preview in points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) + */ + maxSize?: number; + /** + * The opacity of the layer represented by the `symbol`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) + */ + opacity?: number; + /** + * Indicates whether to scale the symbol preview. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) + */ + scale?: boolean; + /** + * Indicates whether to disable upsampling for raster images. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) + */ + disableUpsampling?: boolean; + /** + * For "tall" symbols in portrait view, then the `tall` value should be used here. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) + */ + symbolConfig?: string; + } + interface Symbol extends Accessor, JSONSupport { - type: string; + /** + * The symbol type. **Possible values:** simple-marker | picture-marker | simple-line | cartographic-line-symbol | simple-fill | picture-fill | text | shield-label-symbol | point-3d | line-3d | polygon-3d | mesh-3d | label-3d + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#type) + */ + readonly type: string; } interface SymbolConstructor { + /** + * Symbol is the base class for all symbols. Symbols represent point, line, polygon, and mesh geometries as vector graphics within a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). They can be set on individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) or in a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that is applied to a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) + */ + new(properties?: SymbolProperties): Symbol; fromJSON(json: any): Symbol; @@ -5596,15 +23584,31 @@ declare namespace __esri { export const Symbol: SymbolConstructor; interface SymbolProperties { - type?: string; + } interface Symbol3D extends Symbol { - styleOrigin: Symbol3DStyleOrigin; + /** + * The origin of the style from which the symbol was originally referenced. A reference to the style origin can be either by styleName or by styleUrl (but not both). This information is part of the WebScene persistence model and may be used to understand where a symbol was originally sourced from. It does not affect actual appearance or rendering of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) + */ + readonly styleOrigin: Symbol3DStyleOrigin; + /** + * A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) objects used to visualize the graphic or feature. Individual symbol layers may be autocast as objects and specified using the `type` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#symbolLayers) + */ symbolLayers: Collection; } interface Symbol3DConstructor { + /** + * Symbol3D is the base class for all 3D symbols. It is used to render 2D [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and 3D mesh features in a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html). All 3D symbols must be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance; there is no support for 3D rendering in [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) + */ + new(properties?: Symbol3DProperties): Symbol3D; fromJSON(json: any): Symbol3D; @@ -5613,22 +23617,69 @@ declare namespace __esri { export const Symbol3D: Symbol3DConstructor; interface Symbol3DProperties extends SymbolProperties { - styleOrigin?: Symbol3DStyleOrigin; + /** + * A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) objects used to visualize the graphic or feature. Individual symbol layers may be autocast as objects and specified using the `type` property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#symbolLayers) + */ symbolLayers?: CollectionProperties; } - export interface Symbol3DStyleOrigin { + + export interface Symbol3DStyleOrigin extends Object { + /** + * a well-known esri-provided style, such as `EsriThematicShapesStyle` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) + */ styleName?: string; + /** + * url to a style definition + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) + */ styleUrl?: string; + /** + * name of the symbol in the style referenced by styleName or styleUrl + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) + */ name: string; } interface Symbol3DLayer extends Accessor, JSONSupport { + /** + * The material used to shade the geometry. For `material` properties, see the documentation of the individual symbol layer classes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#material) + */ material: any; - type: string; + /** + * The 3D symbol layer type. See the table below for a list of possible values. + * + * Value | Description + * ------|------------ + * icon | ![s3d-icon](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-icon-circle.png) + * object | ![s3d-object](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-object-sphere.png) + * line | ![s3d-line](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-line-line.png) + * path | ![s3d-path](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-path-tube.png) + * fill | ![s3d-fill](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-fill-solid.png) + * extrusion | ![s3d-extrusion](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-extrude-solid.png) + * text | ![s3d-text](https://developers.arcgis.com/javascript/latest/assets/img/apiref/symbols/symbols3d-label-text.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#type) + */ + readonly type: string; } interface Symbol3DLayerConstructor { + /** + * Symbol layers are used to define the visualization of [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), and mesh geometries rendered with [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html). [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) may only be used to render features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), or standalone [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). There is no support for 3D symbols in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) + */ + new(properties?: Symbol3DLayerProperties): Symbol3DLayer; fromJSON(json: any): Symbol3DLayer; @@ -5637,31 +23688,158 @@ declare namespace __esri { export const Symbol3DLayer: Symbol3DLayerConstructor; interface Symbol3DLayerProperties { + /** + * The material used to shade the geometry. For `material` properties, see the documentation of the individual symbol layer classes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#material) + */ material?: any; - type?: string; } interface TextSymbol extends Symbol { + /** + * The angle of the text. `0` is horizontal and the angle moves clockwise. + * > **Known Limitations** This property 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-symbols-TextSymbol.html#angle) + * + * @default 0 + */ angle: number; + /** + * The background color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#backgroundColor) + */ backgroundColor: Color; + /** + * The border color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineColor) + */ borderLineColor: Color; + /** + * The border size or width of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineSize) + */ borderLineSize: number; + /** + * The color of the text. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color) + */ color: Color; + /** + * The font used to style the text. + * > **Known Limitations** This property is not fully supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font) + */ font: Font; + /** + * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). + * > **Known Limitations** + * * Not supported in IE 9 or below. + * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. + * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) + */ haloColor: Color; + /** + * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). + * > **Known Limitations** + * * Not supported in IE 9 or below. + * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. + * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) + */ haloSize: number; + /** + * The horizontal alignment of the text with respect to the graphic. **Possible Values:** left | right | center | justify + * > **Known Limitations** This property 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-symbols-TextSymbol.html#horizontalAlignment) + * + * @default center + */ horizontalAlignment: string; + /** + * Determines whether to adjust the spacing between characters in the text string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#kerning) + * + * @default true + */ kerning: boolean; + /** + * Determines whether every character in the text string is rotated. + * > **Known Limitations** This property 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-symbols-TextSymbol.html#rotated) + * + * @default false + */ rotated: boolean; + /** + * The text string to display in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#text) + */ text: string; + /** + * For TextSymbol, the type is always `text`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#type) + */ + readonly type: "text"; + /** + * The vertical alignment of the text with respect to the graphic. **Possible Values:** baseline | top | middle | bottom + * > **Known Limitations** This property 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-symbols-TextSymbol.html#verticalAlignment) + * + * @default baseline + */ verticalAlignment: string; + /** + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * > **Known Limitations** This property 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-symbols-TextSymbol.html#xoffset) + * + * @default 0 + */ xoffset: number; + /** + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * > **Known Limitations** This property 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-symbols-TextSymbol.html#yoffset) + * + * @default 0 + */ yoffset: number; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#clone) + * + * + */ clone(): TextSymbol; } interface TextSymbolConstructor { + /** + * Text symbols are used to define the graphic for displaying labels on a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). With this class, you may alter the [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color), [font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font), [halo](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize), and other properties of the label graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) + */ + new(properties?: TextSymbolProperties): TextSymbol; fromJSON(json: any): TextSymbol; @@ -5670,33 +23848,178 @@ declare namespace __esri { export const TextSymbol: TextSymbolConstructor; interface TextSymbolProperties extends SymbolProperties { + /** + * The angle of the text. `0` is horizontal and the angle moves clockwise. + * > **Known Limitations** This property 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-symbols-TextSymbol.html#angle) + * + * @default 0 + */ angle?: number; - backgroundColor?: Color; - borderLineColor?: Color; + /** + * The background color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#backgroundColor) + */ + backgroundColor?: Color | number[] | string; + /** + * The border color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineColor) + */ + borderLineColor?: Color | number[] | string; + /** + * The border size or width of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineSize) + */ borderLineSize?: number; - color?: Color; + /** + * The color of the text. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color) + */ + color?: Color | number[] | string; + /** + * The font used to style the text. + * > **Known Limitations** This property is not fully supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font) + */ font?: FontProperties; + /** + * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). + * > **Known Limitations** + * * Not supported in IE 9 or below. + * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. + * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) + */ haloColor?: Color; - haloSize?: number; + /** + * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). + * > **Known Limitations** + * * Not supported in IE 9 or below. + * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. + * * Not supported in [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), but will be in a future release. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) + */ + haloSize?: number | string; + /** + * The horizontal alignment of the text with respect to the graphic. **Possible Values:** left | right | center | justify + * > **Known Limitations** This property 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-symbols-TextSymbol.html#horizontalAlignment) + * + * @default center + */ horizontalAlignment?: string; + /** + * Determines whether to adjust the spacing between characters in the text string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#kerning) + * + * @default true + */ kerning?: boolean; + /** + * Determines whether every character in the text string is rotated. + * > **Known Limitations** This property 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-symbols-TextSymbol.html#rotated) + * + * @default false + */ rotated?: boolean; + /** + * The text string to display in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#text) + */ text?: string; + /** + * The vertical alignment of the text with respect to the graphic. **Possible Values:** baseline | top | middle | bottom + * > **Known Limitations** This property 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-symbols-TextSymbol.html#verticalAlignment) + * + * @default baseline + */ verticalAlignment?: string; - xoffset?: number; - yoffset?: 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 not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#xoffset) + * + * @default 0 + */ + xoffset?: number | string; + /** + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * > **Known Limitations** This property 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-symbols-TextSymbol.html#yoffset) + * + * @default 0 + */ + yoffset?: number | string; } interface TextSymbol3DLayer extends Symbol3DLayer { + /** + * The font of the text label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) + */ font: TextSymbol3DLayerFont; + /** + * The halo surrounding the text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) + */ halo: TextSymbol3DLayerHalo; + /** + * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) + * + * @default 9 + */ size: number; + /** + * The text to be displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#text) + */ text: string; + /** + * For TextSymbol3DLayer the type is always `text`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#type) + */ + readonly type: "text"; + /** + * Creates a deep clone of the symbol layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#clone) + * + * + */ clone(): TextSymbol3DLayer; } interface TextSymbol3DLayerConstructor { + /** + * TextSymbol3DLayer is used to draw text labels for features of any geometry type. This is typically done by adding it to a [LabelSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) + */ + new(properties?: TextSymbol3DLayerProperties): TextSymbol3DLayer; fromJSON(json: any): TextSymbol3DLayer; @@ -5705,34 +24028,158 @@ declare namespace __esri { export const TextSymbol3DLayer: TextSymbol3DLayerConstructor; interface TextSymbol3DLayerProperties extends Symbol3DLayerProperties { + /** + * The font of the text label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) + */ font?: TextSymbol3DLayerFont; - halo?: TextSymbol3DLayerHalo; - size?: number; + /** + * The halo surrounding the text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) + */ + halo?: TextSymbol3DLayerHaloProperties; + /** + * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) + * + * @default 9 + */ + size?: number | string; + /** + * The text to be displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#text) + */ text?: string; } - export interface TextSymbol3DLayerFont { + + export interface TextSymbol3DLayerFont extends Object { + /** + * The font family. See [MDN: font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) + * + * @default Arial + */ family?: string; + /** + * The font weight. **Known Values:** normal | bold + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) + * + * @default normal + */ weight?: string; + /** + * The font style. **Known Values:** normal | italic + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) + * + * @default normal + */ style?: string; } - export interface TextSymbol3DLayerHalo { + + export interface TextSymbol3DLayerHaloProperties extends Object { + /** + * The color of the halo. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) + * + * @default black + */ + color?: Color | number[] | string; + /** + * The size of the halo in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) + * + * @default 0 + */ + size?: number | string; + } + + export interface TextSymbol3DLayerHalo extends AnonymousAccessor { + /** + * The color of the halo. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) + * + * @default black + */ color?: Color; + /** + * The size of the halo in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) + * + * @default 0 + */ size?: number; } interface WebStyleSymbol extends Symbol { + /** + * The name of the symbol within the web style. Each symbol in a web style is identified by a unique name. Only [Esri-provided web style symbol names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#name) + */ name: string; + /** + * The portal that contains the web style this symbol refers to. Only required when [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) is set. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) + */ portal: Portal; + /** + * A registered web style name. Only [Esri-provided web style names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. Requires [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) property to be set. Can not be used in conjunction with [styleUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl). See class description for example. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) + */ styleName: string; + /** + * URL that points to the web style definition. Cannot be used in conjunction with [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) and [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal). See class description for example. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl) + */ styleUrl: string; + /** + * For WebStyleSymbol the type is always `web-style`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#type) + */ + readonly type: "web-style"; + /** + * Creates a deep clone of the symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#clone) + * + * + */ clone(): WebStyleSymbol; + /** + * Downloads and returns the [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) instance the WebStyleSymbol refers to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#fetchSymbol) + * + * + */ fetchSymbol(): IPromise; } interface WebStyleSymbolConstructor { + /** + * WebStyleSymbol is a class used to conveniently create realistic and thematic 3D symbols. It is a wrapper for creating [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) objects that point to a web style resource available in the API. This symbol type is not supported in 2D MapViews. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html) + */ + new(properties?: WebStyleSymbolProperties): WebStyleSymbol; fromJSON(json: any): WebStyleSymbol; @@ -5741,17 +24188,52 @@ declare namespace __esri { export const WebStyleSymbol: WebStyleSymbolConstructor; interface WebStyleSymbolProperties extends SymbolProperties { + /** + * The name of the symbol within the web style. Each symbol in a web style is identified by a unique name. Only [Esri-provided web style symbol names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#name) + */ name?: string; + /** + * The portal that contains the web style this symbol refers to. Only required when [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) is set. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) + */ portal?: PortalProperties; + /** + * A registered web style name. Only [Esri-provided web style names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. Requires [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) property to be set. Can not be used in conjunction with [styleUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl). See class description for example. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) + */ styleName?: string; + /** + * URL that points to the web style definition. Cannot be used in conjunction with [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) and [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal). See class description for example. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl) + */ styleUrl?: string; } interface ClosestFacilityTask extends Task { + /** + * Solves the closest facility. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html#solve) + * + * @param params Defines the parameters of the closest facility analysis. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ solve(params: ClosestFacilityParameters, requestOptions?: any): IPromise; } interface ClosestFacilityTaskConstructor { + /** + * Helps you find closest facilities around any location (incident) on a network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html) + */ + new(properties?: ClosestFacilityTaskProperties): ClosestFacilityTask; } @@ -5762,46 +24244,282 @@ declare namespace __esri { } interface FindTask extends Task { + /** + * The geodatabase version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#gdbVersion) + */ gdbVersion: string; + /** + * Sends a request to the ArcGIS REST map service resource to perform a search based on the input [params](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#execute) + * + * @param params Specifies the layers and fields that are used for the search. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ execute(params: FindParameters, requestOptions?: any): IPromise; } interface FindTaskConstructor { + /** + * Search a map service exposed by the ArcGIS Server REST API based on a string value. The search can be conducted on a single field of a single layer, on many fields of a layer, or on many fields of many layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html) + */ + new(properties?: FindTaskProperties): FindTask; } export const FindTask: FindTaskConstructor; interface FindTaskProperties extends TaskProperties { + /** + * The geodatabase version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#gdbVersion) + */ gdbVersion?: string; } interface GeometryService extends Task { + /** + * Computes the area and length for the input [polygons](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#areasAndLengths) + * + * @param areasAndLengthsParameters Specify the input polygons and optionally the linear and area units. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ areasAndLengths(areasAndLengthsParameters: AreasAndLengthsParameters, requestOptions?: any): IPromise; + /** + * The Auto Complete operation is performed on a geometry service resource. The AutoComplete operation simplifies the process of constructing new polygons that are adjacent to other polygons. It constructs polygons that fill in the gaps between existing polygons and a set of polylines. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#autoComplete) + * + * @param polygons The array of polygons that will provide boundaries for new polygons. + * @param polylines An array of polylines that will provide the remaining boundaries for new polygons. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ autoComplete(polygons: Polygon[], polylines: Polyline[], requestOptions?: any): IPromise; + /** + * Creates buffer polygons at a specified distance around the given geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer) + * + * @param bufferParameters Specifies the input geometries, buffer distances, and other options. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ buffer(bufferParameters: BufferParameters, requestOptions?: any): IPromise; + /** + * The convexHull operation is performed on a geometry service resource. It returns the convex hull of the input geometry. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#convexHull) + * + * @param geometries The geometries whose convex hull is to be created. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ convexHull(geometries: Geometry[], requestOptions?: any): IPromise; + /** + * The cut operation is performed on a geometry service resource. This operation splits the input polyline or polygon where it crosses a cutting polyline. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#cut) + * + * @param geometries The polylines or polygons to be cut. + * @param cutter The polyline that will be used to divide the target into pieces where it crosses the target. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ cut(geometries: Geometry[], cutter: Polyline, requestOptions?: any): IPromise; + /** + * The densify operation is performed on a geometry service resource. This operation densifies geometries by plotting points between existing vertices. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#densify) + * + * @param densifyParameters The DensifyParameters objects contains `geometries`, `geodesic`, `lengthUnit`, and `maxSegmentLength` properties. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ densify(densifyParameters: DensifyParameters, requestOptions?: any): IPromise; + /** + * The difference operation is performed on a geometry service resource. This operation constructs the set-theoretic difference between an array of geometries and another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#difference) + * + * @param geometries An array of points, multipoints, polylines or polygons. + * @param geometry A single geometry of any type, with a dimension equal to or greater than the items in geometries. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ difference(geometries: Geometry[], geometry: Geometry, requestOptions?: any): IPromise; + /** + * Measures the planar or geodesic distance between geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#distance) + * + * @param params Sets the input geometries to measure, distance units, and other parameters. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ distance(params: DistanceParameters, requestOptions?: any): IPromise; + /** + * Converts an array of well-known strings into xy-coordinates based on the conversion type and spatial reference supplied by the user. Only available with ArcGIS Server 10.3 or above. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) + * + * @param params See the object specifications table below for the structure of the `params` object. + * @param params.strings An array of formatted strings as specified by `conversionType`. Example: `["01N AA 66021 00000" , "11S NT 00000 62155" , "31U BT 94071 65288"]` + * @param params.sr The spatial reference or well-known ID to convert the input string coordinates to. + * @param params.conversionType The converstion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd + * @param params.conversionMode Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000026z000000) for valid values and their descriptions. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ fromGeoCoordinateString(params: GeometryServiceFromGeoCoordinateStringParams, requestOptions?: any): IPromise; + /** + * Generalizes the input geometries using the Douglas-Peucker algorithm. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#generalize) + * + * @param params An array of geometries to generalize and a maximum deviation. Optionally set the deviation units. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ generalize(params: GeneralizeParameters, requestOptions?: any): IPromise; + /** + * The intersect operation is performed on a geometry service resource. This operation constructs the set-theoretic intersection between an array of geometries and another geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#intersect) + * + * @param geometries An array of points, multipoints, polylines, or polygons. + * @param intersector A single geometry of any type, of dimension equal to or greater than the dimension of the items in `geometries`. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ intersect(geometries: Geometry[], intersector: Geometry, requestOptions?: any): IPromise; + /** + * Calculates an interior point for each polygon specified. These interior points can be used by clients for labeling the polygons. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#labelPoints) + * + * @param polygons The polygon graphics to process. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ labelPoints(polygons: Polygon[], requestOptions?: any): IPromise; + /** + * Gets the lengths for a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) when the geometry type is [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#lengths) + * + * @param params Specify the polylines and optionally the length unit and the geodesic length option. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ lengths(params: LengthsParameters, requestOptions?: any): IPromise; + /** + * Constructs the offset of the input geometries based on a planar distance. If the offsetDistance is positive the constructed offset will be on the right side of the geometry. Left side offsets are constructed with negative values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#offset) + * + * @param params Set the geometries to offset, distance, and units. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ offset(params: OffsetParameters, requestOptions?: any): IPromise; + /** + * Projects a set of geometries to a new spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#project) + * + * @param params The input projection parameters. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ project(params: ProjectParameters, requestOptions?: any): IPromise; + /** + * Computes the set of pairs of geometries from the input geometry arrays that belong to the specified relation. Both arrays are assumed to be in the same spatial reference. The relations are evaluated in 2D. Z-coordinates are not used. Geometry types cannot be mixed within an array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#relation) + * + * @param params The set of parameters required to perform the comparison. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ relation(params: RelationParameters, requestOptions?: any): IPromise; + /** + * The reshape operation is performed on a geometry service resource. It reshapes a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or a part of a [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) using a reshaping line. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#reshape) + * + * @param targetGeometry The Polyline or Polygon to be reshaped. + * @param reshaper The single-part polyline that performs the reshaping. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ reshape(targetGeometry: Geometry, reshaper: Geometry, requestOptions?: any): IPromise; + /** + * Alters the given geometries to make their definitions topologically legal with respect to their geometry type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#simplify) + * + * @param geometries The geometries to simplify. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ simplify(geometries: Geometry[], requestOptions?: any): IPromise; + /** + * Converts an array of XY-coordinates into well-known strings based on the conversion type and spatial reference supplied by the user. Only available with ArcGIS Server 10.3 or above. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) + * + * @param params See the object specifications table below for the structure of the `params` object. + * @param params.sr The spatial reference (or WKID of the spatial reference) of the XY-coordinates to be converted. + * @param params.coordinates An array of XY-coordinates (in JSON format) to be converted. + * @param params.conversionType The conversion type of the input strings. **Possible values:** mgrs | usng | utm | geo-ref | gars | dms | ddm | dd + * @param params.conversionMode Conversion options for mgrs and utm conversion types. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000026w000000) for valid conversion modes and their descriptions. + * @param params.numOfDigits The number of digits to output for each of the numerical portions in the string. The default value depends of `conversionType`. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000026z000000) for default values. + * @param params.rounding If `true`, then numeric portions of the string are rounded to the nearest whole magnitude as specified by `numOfDigits`. Otherwise, numeric portions of the string are truncated. The rounding parameter applies only to conversion types `mgrs`, `usng` and `geo-ref`. + * @param params.addSpaces If `true`, then spaces are added between components of the string. The `addSpaces` parameter applies only to conversion types `mgrs`, `usng` and `utm`. The default value for `mgrs` is `false` , while the default value for both `usng` and `utm` is `true`. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ toGeoCoordinateString(params: GeometryServiceToGeoCoordinateStringParams, requestOptions?: any): IPromise; + /** + * Trims or extends the input polylines using the user specified guide polyline. When trimming features, the portion to the left of the cutting line is preserved in the output and the rest is discarded. If the input polyline is not cut or extended then an empty polyline is added to the output array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#trimExtend) + * + * @param params Input parameters for the `trimExtend` operation. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ trimExtend(params: TrimExtendParameters, requestOptions?: any): IPromise; + /** + * The union operation is performed on a geometry service resource. This operation constructs the set-theoretic union of the geometries in the input array. All inputs must be of the same type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#union) + * + * @param geometries An array of the geometries to be unioned. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ union(geometries: Geometry[], requestOptions?: any): IPromise; } interface GeometryServiceConstructor { + /** + * Represents a geometry service resource exposed by the ArcGIS REST API. It is used to perform various operations on geometries such as project, simplify, buffer, and relationships. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html) + */ + new(properties?: GeometryServiceProperties): GeometryService; } @@ -5811,71 +24529,301 @@ declare namespace __esri { } - export interface GeometryServiceFromGeoCoordinateStringParams { + + export interface GeometryServiceFromGeoCoordinateStringParams extends Object { + /** + * An array of formatted strings as specified by `conversionType`. Example: `["01N AA 66021 00000" , "11S NT 00000 62155" , "31U BT 94071 65288"]` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) + */ strings: string[]; + /** + * The spatial reference or well-known ID to convert the input string coordinates to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) + */ sr: SpatialReference | string; - conversionType: string; + /** + * The converstion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) + * + * @default mrgs + */ + conversionType?: string; + /** + * Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000026z000000) for valid values and their descriptions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) + */ conversionMode?: string; } - export interface GeometryServiceToGeoCoordinateStringParams { + + export interface GeometryServiceToGeoCoordinateStringParams extends Object { + /** + * The spatial reference (or WKID of the spatial reference) of the XY-coordinates to be converted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) + */ sr: SpatialReference | string; + /** + * An array of XY-coordinates (in JSON format) to be converted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) + */ coordinates: number[][]; + /** + * The conversion type of the input strings. **Possible values:** mgrs | usng | utm | geo-ref | gars | dms | ddm | dd + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) + */ conversionType: string; + /** + * Conversion options for mgrs and utm conversion types. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000026w000000) for valid conversion modes and their descriptions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) + */ conversionMode?: string; + /** + * The number of digits to output for each of the numerical portions in the string. The default value depends of `conversionType`. See the [ArcGIS REST API documentation](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000026z000000) for default values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) + */ numOfDigits?: number; + /** + * If `true`, then numeric portions of the string are rounded to the nearest whole magnitude as specified by `numOfDigits`. Otherwise, numeric portions of the string are truncated. The rounding parameter applies only to conversion types `mgrs`, `usng` and `geo-ref`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) + * + * @default true + */ rounding?: boolean; + /** + * If `true`, then spaces are added between components of the string. The `addSpaces` parameter applies only to conversion types `mgrs`, `usng` and `utm`. The default value for `mgrs` is `false` , while the default value for both `usng` and `utm` is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) + */ addSpaces?: boolean; } interface Geoprocessor extends Task { + /** + * The spatial reference of the output geometries. If not specified, the output geometries will be in the spatial reference of the input geometries. If [processSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) is specified and `outSpatialReference` is not specified, the output geometries will be in the spatial reference of the process spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * The spatial reference that the model will use to perform geometry operations. If `processSpatialReference` is specified and [outputSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outputSpatialReference) is not specified, the output geometries will be in the spatial reference of the process spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) + */ processSpatialReference: SpatialReference; + /** + * The time interval in milliseconds between each job status request sent to an asynchronous GP task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#updateDelay) + * + * @default 1000 + */ updateDelay: number; + /** + * Cancels an asynchronous geoprocessing job. Requires an ArcGIS Server 10.1 service or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#cancelJob) + * + * @param jobId A string that uniquely identifies a job on the server. It is created when a job is submitted for execution and later used to check its status and retrieve the results. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ cancelJob(jobId: string, requestOptions?: any): IPromise; + /** + * Cancels the periodic job status updates automatically initiated when [submitJob()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#submitJob) is invoked for the job identified by `jobId`. You can still obtain the status of this job by calling the [checkJobStatus()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#checkJobStatus) method at your own discretion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#cancelJobStatusUpdates) + * + * @param jobId A string that uniquely identifies the job for which the job updates are cancelled. + * + */ cancelJobStatusUpdates(jobId: string): void; + /** + * Sends a request to the GP Task for the current state of the job identified by `jobId`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#checkJobStatus) + * + * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ checkJobStatus(jobId: string, requestOptions?: any): IPromise; + /** + * Sends a request to the server to execute a synchronous GP task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#execute) + * + * @param params ``` + * Specifies the input parameters accepted by the task and their corresponding values. These input parameters are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task resource has the following input parameters: + * * `` Input_Points + * * `` Distance + * + * + * The `params` argument would then be an Object of the form: + * ``` + * { + * Input_Points: , + * Distance: + * } + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ execute(params: any, requestOptions?: any): IPromise; + /** + * Sends a request to the GP Task to get the task result identified by `jobId` and `resultName`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultData) + * + * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). + * @param resultName The name of the result parameter as defined in Services Directory. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getResultData(jobId: string, resultName: string, requestOptions?: any): IPromise; + /** + * Sends a request to the GP Task to get the task result identified by `jobId` and `resultName` as an image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultImage) + * + * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). + * @param resultName The name of the result parameter as defined in the Services Directory. + * @param imageParams Specifies the properties of the result image. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getResultImage(jobId: string, resultName: string, imageParams: ImageParameters, requestOptions?: any): IPromise; + /** + * Get the task result identified by `jobId` as an [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). This method supports MapImageLayer 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultMapImageLayer) + * + * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). + * + */ getResultMapImageLayer(jobId: string): MapImageLayer; + /** + * Submits a job to the server for asynchronous processing by the GP task. The task execution results can be retrieved using the [getResultData()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultData), [getResultImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultImage), or [getResultMapImageLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultMapImageLayer) methods. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#submitJob) + * + * @param params ``` + * specifies the input parameters accepted by the task and their corresponding values. These input parameters are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task resource has the following input parameters: + * * `` Input_Points + * * `` Distance + * + * + * The `params` argument would then be an Object of the form: + * ``` + * { + * Input_Points: , + * Distance: + * } + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ submitJob(params: any, requestOptions?: any): IPromise; } interface GeoprocessorConstructor { + + new(properties?: GeoprocessorProperties): Geoprocessor; } export const Geoprocessor: GeoprocessorConstructor; interface GeoprocessorProperties extends TaskProperties { + /** + * The spatial reference of the output geometries. If not specified, the output geometries will be in the spatial reference of the input geometries. If [processSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) is specified and `outSpatialReference` is not specified, the output geometries will be in the spatial reference of the process spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * The spatial reference that the model will use to perform geometry operations. If `processSpatialReference` is specified and [outputSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outputSpatialReference) is not specified, the output geometries will be in the spatial reference of the process spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) + */ processSpatialReference?: SpatialReferenceProperties; + /** + * The time interval in milliseconds between each job status request sent to an asynchronous GP task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#updateDelay) + * + * @default 1000 + */ updateDelay?: number; } interface IdentifyTask extends Task { + /** + * Specifies the geodatabase version to display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#gdbVersion) + */ gdbVersion: string; + /** + * Sends a request to the ArcGIS REST map service resource to identify features based on the [IdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html) specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#execute) + * + * @param params Specifies the criteria used to identify the features. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ execute(params: IdentifyParameters, requestOptions?: any): IPromise; } interface IdentifyTaskConstructor { + /** + * Performs an identify operation on the layers of a map service exposed by the ArcGIS Server REST API. Use [IdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html) to set the parameters for the identify operation and [IdentifyResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html) to work with the results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html) + */ + new(properties?: IdentifyTaskProperties): IdentifyTask; } export const IdentifyTask: IdentifyTaskConstructor; interface IdentifyTaskProperties extends TaskProperties { + /** + * Specifies the geodatabase version to display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#gdbVersion) + */ gdbVersion?: string; } interface ImageServiceIdentifyTask extends Task { + /** + * Sends a request to the ArcGIS REST image service resource to identify content based on the [ImageServiceIdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html) specified in the `params` argument. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ImageServiceIdentifyTask.html#execute) + * + * @param params Specifies the criteria used to identify the features. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ execute(params: ImageServiceIdentifyParameters, requestOptions?: any): IPromise; } interface ImageServiceIdentifyTaskConstructor { + + new(properties?: ImageServiceIdentifyTaskProperties): ImageServiceIdentifyTask; } @@ -5886,103 +24834,462 @@ declare namespace __esri { } interface Locator extends Task { + /** + * Limit the results to one or more categories. For example "Populated Place" or "airport". Only applicable when using the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#categories) + */ categories: string[]; + /** + * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#countryCode) + */ countryCode: string; + /** + * The spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of the input geometries when performing a reverse geocode and in the default spatial reference returned by the service if finding locations by address. If `processSpatialReference` is specified and `outSpatialReference` is not specified, the output geometries are in the spatial reference of the process spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * Find address candidates for multiple input addresses. This method requires an ArcGIS Server 10.1 or greater geocode service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) + * + * @param params See specifications below. + * @param params.addresses ``` + * The input addresses in the format supported by the geocode service. If the service supports 'Single Line Input' the input addresses will be in the following format: + * ```js + * { + * "OBJECTID": 0, + * "Single Line Input":"440 Arguello Blvd, 94118" + * } + * @param params.countryCode Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * @param params.categories Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ addressesToLocations(params: LocatorAddressesToLocationsParams, requestOptions?: any): IPromise; + /** + * Sends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + * + * @param params Specify at least the address and optionally other properties. See the object specifications table below. + * @param params.address visit the ArcGIS Online Geocoding Service help for more details on the World Geocoder. + * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: + * ```js + * { + * Street: "1234 W Main St", + * City: "Small Town", + * State: "WA", + * Zone: "99027" + * } + * ``` + * + * Locators published using ArcGIS 10 or later support a single line address field, which + * can be specified using the following syntax where field_name is the name of the single + * line address field. You can find this name by viewing the help or services directory for + * your locator services. Common values are *SingleLine* and *SingleLineFieldName*: + * ```js + * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; + * ``` + * The Services Directory can be used to find out the required and optional address fields + * and the correct names for the input name fields. If you are using the World Geocoding Service + * @param params.categories Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. + * @param params.countryCode Limit result to a specific country. For example, "US" for United States or "SE" for Sweden. Only applies to the World Geocode Service. See Geocode coverage (World Geocoding Service) for more information. + * @param params.distance Used in combination with `location` option to weight returned results within this distance (meters). + * @param params.forStorage Allows the results of single geocode transactions to be persisted. + * @param params.location Used in combination with `distance` option to weight returned results for a specified area. + * @param params.magicKey A `suggestLocations` result ID (magicKey). Used to query for a specific results information. + * @param params.maxLocations Maximum results to return from the query. + * @param params.outFields The list of fields included in the returned result set. This list is a comma delimited list of field names. If you specify the shape field in the list of return fields, it is ignored. For non-intersection addresses you can specify the candidate fields as defined in the geocode service. For intersection addresses you can specify the intersection candidate fields. + * @param params.searchExtent Defines the extent within which the geocode server will search. Requires ArcGIS Server version 10.1 or greater. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ addressToLocations(params: LocatorAddressToLocationsParams, requestOptions?: any): IPromise; + /** + * Locates an address based on a given point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#locationToAddress) + * + * @param location The point at which to search for the closest address. The location should be in the same spatial reference as that of the geocode service. + * @param distance The distance in meters from the given location within which a matching address should be searched. If this parameter is not provided or an invalid value is provided, a default value of 0 meters is used. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ locationToAddress(location: Point, distance?: number, requestOptions?: any): IPromise; - suggestLocations(params: LocatorSuggestLocationsParams, requestOptions?: any): IPromise; + /** + * Get character by character auto complete suggestions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) + * + * @param params An object that defines suggest parameters. See specifications below. + * @param params.categories A place or address type which can be used to filter suggest results. The parameter supports input of single category values or multiple comma-separated values. + * @param params.distance Used with the `location` property. The `distance` property specifies the radial distance from the location. + * @param params.location Defines a normalized location point that is used with the distance parameter to sort geocoding candidates based upon their proximity to the given location. + * @param params.text The input text entered by a user which is used by the suggest operation to generate a list of possible matches. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ + suggestLocations(params: LocatorSuggestLocationsParams, requestOptions?: any): IPromise; } interface LocatorConstructor { + /** + * Represents a geocode service resource exposed by the ArcGIS Server REST API. It is used to generate candidates for an address. It is also used to generate batch results for a set of addresses. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) + */ + new(properties?: LocatorProperties): Locator; } export const Locator: LocatorConstructor; interface LocatorProperties extends TaskProperties { + /** + * Limit the results to one or more categories. For example "Populated Place" or "airport". Only applicable when using the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#categories) + */ categories?: string[]; + /** + * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#countryCode) + */ countryCode?: string; + /** + * The spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of the input geometries when performing a reverse geocode and in the default spatial reference returned by the service if finding locations by address. If `processSpatialReference` is specified and `outSpatialReference` is not specified, the output geometries are in the spatial reference of the process spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; } - export interface LocatorAddressesToLocationsParams { + + export interface LocatorAddressesToLocationsParams extends Object { + /** + * The input addresses in the format supported by the geocode service. If the service supports 'Single Line Input' the input addresses will be in the following format: + * ```js + * { + * "OBJECTID": 0, + * "Single Line Input":"440 Arguello Blvd, 94118" + * } + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) + */ addresses: any[]; + /** + * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) + */ countryCode: string; + /** + * Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) + */ categories: string[]; } - export interface LocatorAddressToLocationsParams { + + export interface LocatorAddressToLocationsParams extends Object { + /** + * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: + * ```js + * { + * Street: "1234 W Main St", + * City: "Small Town", + * State: "WA", + * Zone: "99027" + * } + * ``` + * + * Locators published using ArcGIS 10 or later support a single line address field, which + * can be specified using the following syntax where field_name is the name of the single + * line address field. You can find this name by viewing the help or services directory for + * your locator services. Common values are *SingleLine* and *SingleLineFieldName*: + * ```js + * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; + * ``` + * The Services Directory can be used to find out the required and optional address fields + * and the correct names for the input name fields. If you are using the World Geocoding Service + * visit the ArcGIS Online Geocoding Service help for more details on the World Geocoder. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ address: any; + /** + * Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ categories: string[]; + /** + * Limit result to a specific country. For example, "US" for United States or "SE" for Sweden. Only applies to the World Geocode Service. See Geocode coverage (World Geocoding Service) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ countryCode: string; + /** + * Used in combination with `location` option to weight returned results within this distance (meters). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ distance: number; + /** + * Allows the results of single geocode transactions to be persisted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ forStorage: boolean; + /** + * Used in combination with `distance` option to weight returned results for a specified area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ location: Point; + /** + * A `suggestLocations` result ID (magicKey). Used to query for a specific results information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ magicKey: string; + /** + * Maximum results to return from the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ maxLocations: number; + /** + * The list of fields included in the returned result set. This list is a comma delimited list of field names. If you specify the shape field in the list of return fields, it is ignored. For non-intersection addresses you can specify the candidate fields as defined in the geocode service. For intersection addresses you can specify the intersection candidate fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ outFields: string[]; + /** + * Defines the extent within which the geocode server will search. Requires ArcGIS Server version 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) + */ searchExtent: Extent; } - export interface LocatorSuggestLocationsParams { + + export interface LocatorSuggestLocationsParams extends Object { + /** + * A place or address type which can be used to filter suggest results. The parameter supports input of single category values or multiple comma-separated values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) + */ categories: string[]; + /** + * Used with the `location` property. The `distance` property specifies the radial distance from the location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) + */ distance: number; + /** + * Defines a normalized location point that is used with the distance parameter to sort geocoding candidates based upon their proximity to the given location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) + */ location: Point; + /** + * The input text entered by a user which is used by the suggest operation to generate a list of possible matches. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) + */ text: string; } - export interface SuggestionResult { + /** + * Describes the object representing the result of the [suggestLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) + */ + export interface SuggestionResult extends Object { + /** + * Indicates if the result is a Collection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) + */ isCollection: boolean; + /** + * ID used in combination with the `text` property to uniquely identify a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) + */ magicKey: string; + /** + * The string name of the suggested location to geocode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) + */ text: string; } interface PrintTask extends Task { - mode: string; + /** + * The mode for the print task execution. **Known Values:** async | sync + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#mode) + * + * @default sync + */ + readonly mode: string; + /** + * The time interval in milliseconds between each job status request sent to an asynchronous GP task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#updateDelay) + * + * @default 1000 + */ updateDelay: number; + /** + * Sends a request to the print service to create a print page using the options specified in the [PrintParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#execute) + * + * @param params Defines the printing options. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ execute(params: PrintParameters, requestOptions?: any): IPromise; } interface PrintTaskConstructor { + /** + * The PrintTask generates a printer-ready version of the map using an [Export Web Map Task](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Export_Web_Map_Task/02r3000001m3000000/) available with ArGIS Server 10.1 and later. This class is used when you want to have more granular control over the user interface, for example, if you want to provide users the ability to define what appears on the printed page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html) + */ + new(properties?: PrintTaskProperties): PrintTask; } export const PrintTask: PrintTaskConstructor; interface PrintTaskProperties extends TaskProperties { - mode?: string; + /** + * The time interval in milliseconds between each job status request sent to an asynchronous GP task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#updateDelay) + * + * @default 1000 + */ updateDelay?: number; } interface QueryTask extends Task { + /** + * Specify the geodatabase version to display. Requires ArcGIS Server service 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#gdbVersion) + */ gdbVersion: string; - execute(params: Query, requestOptions?: any): IPromise; - executeForCount(params: Query, requestOptions?: any): IPromise; - executeForExtent(params: Query, requestOptions?: any): IPromise; - executeForIds(params: Query, requestOptions?: any): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against an ArcGIS Server map layer. The result is returned as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the map. This array will not be populated if no results are found. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#execute) + * + * @param params Specifies the attributes and spatial filter of the query. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ + execute(params: Query | QueryProperties, requestOptions?: any): IPromise; + /** + * Gets a count of the number of features that satisfy the input query. Valid only for layers published using ArcGIS Server 10 SP1 or greater. Layers published with earlier versions of ArcGIS Server return an error to the `errback` param of `.then()`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForCount) + * + * @param params Specifies the attributes and spatial filter of the query. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ + executeForCount(params: Query | QueryProperties, requestOptions?: any): IPromise; + /** + * Gets the extent of the features that satisfy the input query. The count of features that satisfy the input query is returned upon resolution as well. Valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForExtent) + * + * @param params Specifies the attributes and spatial filter of the query. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ + executeForExtent(params: Query | QueryProperties, requestOptions?: any): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against an ArcGIS Server map layer. The result is an array of the object IDs of features that satisfy the input query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForIds) + * + * @param params Specifies the attributes and spatial filter of the query. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ + executeForIds(params: Query | QueryProperties, requestOptions?: any): IPromise; + /** + * Executes a [RelationshipQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html) against an ArcGIS Server map layer (or table). If the query is successful, the result is returned as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeRelationshipQuery) + * + * @param params Specifies the attributes and spatial filter of the query. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ executeRelationshipQuery(params: RelationshipQuery, requestOptions?: any): IPromise; } interface QueryTaskConstructor { + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) operation on a layer. The most common method used in this class is [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#execute), which executes the query as defined in the [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) object that is passed as a parameter to the function. `QueryTask.execute()` returns a Promise that resolves to a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which contains the features in the layer that satisfy the [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) + */ + new(properties?: QueryTaskProperties): QueryTask; } export const QueryTask: QueryTaskConstructor; interface QueryTaskProperties extends TaskProperties { + /** + * Specify the geodatabase version to display. Requires ArcGIS Server service 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#gdbVersion) + */ gdbVersion?: string; } interface RouteTask extends Task { + /** + * Solves the route against the route layer with the route parameters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html#solve) + * + * @param params Route parameters used as input to generate the route. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ solve(params: RouteParameters, requestOptions?: any): IPromise; } interface RouteTaskConstructor { + /** + * Find routes between two or more locations and optionally get driving directions. The RouteTask uses ArcGIS Server network analysis services to calculate routes. Network analysis services allow you to solve simple routing problems as well as complex ones that take into account multiple stops, barriers, and time windows. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) + */ + new(properties?: RouteTaskProperties): RouteTask; } @@ -5993,10 +25300,25 @@ declare namespace __esri { } interface ServiceAreaTask extends Task { + /** + * Determines the service area based on a set of parameters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html#solve) + * + * @param params The parameters needed to define the service area. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ solve(params: ServiceAreaParameters, requestOptions?: any): IPromise; } interface ServiceAreaTaskConstructor { + /** + * ServiceAreaTask helps you find service areas around any location on a network. A network service area is a region that encompasses all accessible streets (streets that are within a specified impedance). For instance, the 5-minute service area for a point includes all the streets that can be reached within five minutes from that point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html) + */ + new(properties?: ServiceAreaTaskProperties): ServiceAreaTask; } @@ -6007,14 +25329,41 @@ declare namespace __esri { } interface AddressCandidate extends Accessor, JSONSupport { + /** + * Address of the candidate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address) + */ address: string; + /** + * Name value pairs of field name and field value as defined in `outFields` in [Locator.addressToLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#attributes) + */ attributes: any; + /** + * The minimum and maximum X and Y coordinates of a bounding box of the address candidate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#extent) + */ extent: Extent; + /** + * The [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object representing the location of the [address](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#location) + */ location: Point; + /** + * Numeric score between `0` and `100` for geocode candidates. A candidate with a score of `100` means a perfect match, and `0` means no match. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#score) + */ score: number; } interface AddressCandidateConstructor { + + new(properties?: AddressCandidateProperties): AddressCandidate; fromJSON(json: any): AddressCandidate; @@ -6023,161 +25372,769 @@ declare namespace __esri { export const AddressCandidate: AddressCandidateConstructor; interface AddressCandidateProperties { + /** + * Address of the candidate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address) + */ address?: string; + /** + * Name value pairs of field name and field value as defined in `outFields` in [Locator.addressToLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#attributes) + */ attributes?: any; + /** + * The minimum and maximum X and Y coordinates of a bounding box of the address candidate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#extent) + */ extent?: ExtentProperties; + /** + * The [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object representing the location of the [address](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#location) + */ location?: PointProperties; + /** + * Numeric score between `0` and `100` for geocode candidates. A candidate with a score of `100` means a perfect match, and `0` means no match. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#score) + */ score?: number; } interface AreasAndLengthsParameters extends Accessor { + /** + * The area unit in which areas of polygons will be calculated. Use the strings listed below or [any other valid area unit](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | hectares | square-miles | square-kilometers | square-meters | square-feet | square-yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#areaUnit) + */ areaUnit: string; + /** + * Defines the type of calculation for the geometry. The type can be one of the following: + * + * Value | Description + * ------|------------ + * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference. Otherwise use `preserveShape`. + * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. + * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid (for geometries defined in a projected or geographic coordinate system). This method preserves the shape of the geometry in its coordinate system, which means the true area or length will be calculated for the geometry that is displayed on the map. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#calculationType) + */ calculationType: string; + /** + * The length unit in which perimeters of polygons will be calculated. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#lengthUnit) + */ lengthUnit: string; + /** + * Polygon geometries for which to compute areas and lengths. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#polygons) + */ polygons: Polygon[]; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#toJSON) + * + * + */ toJSON(): any; } interface AreasAndLengthsParametersConstructor { + + new(properties?: AreasAndLengthsParametersProperties): AreasAndLengthsParameters; } export const AreasAndLengthsParameters: AreasAndLengthsParametersConstructor; interface AreasAndLengthsParametersProperties { + /** + * The area unit in which areas of polygons will be calculated. Use the strings listed below or [any other valid area unit](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | hectares | square-miles | square-kilometers | square-meters | square-feet | square-yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#areaUnit) + */ areaUnit?: string; + /** + * Defines the type of calculation for the geometry. The type can be one of the following: + * + * Value | Description + * ------|------------ + * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference. Otherwise use `preserveShape`. + * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. + * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid (for geometries defined in a projected or geographic coordinate system). This method preserves the shape of the geometry in its coordinate system, which means the true area or length will be calculated for the geometry that is displayed on the map. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#calculationType) + */ calculationType?: string; + /** + * The length unit in which perimeters of polygons will be calculated. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#lengthUnit) + */ lengthUnit?: string; + /** + * Polygon geometries for which to compute areas and lengths. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#polygons) + */ polygons?: PolygonProperties[]; } interface BufferParameters extends Accessor { + /** + * The spatial reference in which the geometries are buffered. If `bufferSpatialReference` is not specified, the geometries are buffered in the spatial reference specified by `outSpatialReference`. If `outSpatialReference` is also not specified, they are buffered in the spatial reference of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#bufferSpatialReference) + */ bufferSpatialReference: SpatialReference; + /** + * The distances the input features are buffered. The distance units are specified by `unit`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#distances) + */ distances: number[]; + /** + * If the input geometries are in a geographic coordinate system, set geodesic to `true` to generate a buffer polygon using a geodesic distance. The `bufferSpatialReference` property is ignored when geodesic is set to `true`. Requires ArcGIS Server 10.1 or greater geometry service. For more information, see the ArcGIS REST API documentation on the GeometryService buffer operation and the geodesic property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geodesic) + */ geodesic: boolean; + /** + * The input geometries to buffer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geometries) + */ geometries: Geometry[]; + /** + * The spatial reference for the returned geometries. If `outSpatialReference` is not specified, the output geometries are in the spatial reference specified by `bufferSpatialReference`. If `bufferSpatialReference` also is not specified, they are in the spatial reference of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * If `true`, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unionResults) + */ unionResults: boolean; + /** + * The units for calculating each buffer distance. If `unit` is not specified, the units are derived from `bufferSpatialReference`. If `bufferSpatialReference` is not specified, the units are derived from the features. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unit) + */ unit: string; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#toJSON) + * + * + */ toJSON(): any; } interface BufferParametersConstructor { + + new(properties?: BufferParametersProperties): BufferParameters; } export const BufferParameters: BufferParametersConstructor; interface BufferParametersProperties { + /** + * The spatial reference in which the geometries are buffered. If `bufferSpatialReference` is not specified, the geometries are buffered in the spatial reference specified by `outSpatialReference`. If `outSpatialReference` is also not specified, they are buffered in the spatial reference of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#bufferSpatialReference) + */ bufferSpatialReference?: SpatialReferenceProperties; + /** + * The distances the input features are buffered. The distance units are specified by `unit`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#distances) + */ distances?: number[]; + /** + * If the input geometries are in a geographic coordinate system, set geodesic to `true` to generate a buffer polygon using a geodesic distance. The `bufferSpatialReference` property is ignored when geodesic is set to `true`. Requires ArcGIS Server 10.1 or greater geometry service. For more information, see the ArcGIS REST API documentation on the GeometryService buffer operation and the geodesic property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geodesic) + */ geodesic?: boolean; + /** + * The input geometries to buffer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geometries) + */ geometries?: GeometryProperties[]; + /** + * The spatial reference for the returned geometries. If `outSpatialReference` is not specified, the output geometries are in the spatial reference specified by `bufferSpatialReference`. If `bufferSpatialReference` also is not specified, they are in the spatial reference of the features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * If `true`, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unionResults) + */ unionResults?: boolean; + /** + * The units for calculating each buffer distance. If `unit` is not specified, the units are derived from `bufferSpatialReference`. If `bufferSpatialReference` is not specified, the units are derived from the features. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unit) + */ unit?: string; } interface ClosestFacilityParameters extends Accessor { + /** + * The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#accumulateAttributes) + */ accumulateAttributes: string[]; + /** + * An array of attribute parameter values that determine which network elements can be used by a vehicle. View the object specifications below for properties of the individual objects in this array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) + */ attributeParameterValues: ClosestFacilityParametersAttributeParameterValues[]; + /** + * The cutoff value used to determine when to stop traversing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultCutoff) + */ defaultCutoff: number; + /** + * The number of facilities to find. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultTargetFacilityCount) + */ defaultTargetFacilityCount: number; + /** + * The language used when generating driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If an unsupported language code is specified, the service returns the directions using the default language, English. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLanguage) + */ directionsLanguage: string; + /** + * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) + */ directionsLengthUnits: string; + /** + * Defines the amount of direction information returned. The default value is standard. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsOutputType) + */ directionsOutputType: string; + /** + * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsStyleName) + */ directionsStyleName: string; + /** + * The name of the attribute field that contains the drive time values. If not specified, the task will use the attribute field defined by the routing network layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsTimeAttribute) + */ directionsTimeAttribute: string; + /** + * When `true`, restricted network elements should be considered when finding network locations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#doNotLocateOnRestrictedElements) + * + * @default true + */ doNotLocateOnRestrictedElements: boolean; + /** + * The set of facilities loaded as network locations during analysis. These can be specified as either a [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#facilities) + */ facilities: DataLayer | FeatureSet; + /** + * The network attribute field name used as the impedance attribute during analysis. If not specified the default value defined by the routing network layer. Valid values include any attribute name listed in the Service Directory under Network Dataset > Network Attributes with a Usage Type of `esriNauTCost`. Specify none to indicate that no network attributes should be used for impedance. If you specify an empty string the default value defined by the service will be used. See the [Understanding the network attribute](https://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000) help topic for more details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#impedanceAttribute) + */ impedanceAttribute: string; + /** + * The set of incidents loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#incidents) + */ incidents: DataLayer | FeatureSet; + /** + * The output geometry precision. When `0`, no generalization of the output geometry is performed. Positive values represent the `MaximumAllowableOffset` parameter used by generalize. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecision) + */ outputGeometryPrecision: number; + /** + * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) + */ outputGeometryPrecisionUnits: string; + /** + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. See NAOutputLine for a list of valid values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) + */ outputLines: string; + /** + * The well-known id of the spatial reference or the spatial reference object for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outSpatialReference) + */ outSpatialReference: SpatialReference | string; + /** + * The set of point barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#pointBarriers) + */ pointBarriers: DataLayer | FeatureSet; + /** + * The set of polygon barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polygonBarriers) + */ polygonBarriers: DataLayer | FeatureSet; + /** + * The set of polyline barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polylineBarriers) + */ polylineBarriers: DataLayer | FeatureSet; + /** + * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are listed in the Service Directory under Network Dataset > Network Attributes. You can also specify a value of none to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. Use `["none"]` to override the service defaults and specify that no restrictions should be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictionAttributes) + */ restrictionAttributes: string[]; + /** + * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) + */ restrictUTurns: string; + /** + * Indicates whether the service should generate driving directions for each route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) + * + * @default false + */ returnDirections: boolean; + /** + * If `true`, facilities will be returned with the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnFacilities) + * + * @default false + */ returnFacilities: boolean; + /** + * If `true`, incidents will be returned with the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnIncidents) + * + * @default false + */ returnIncidents: boolean; + /** + * If `true`, point barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPointBarriers) + * + * @default false + */ returnPointBarriers: boolean; + /** + * If `true`, polygon barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolygonBarriers) + * + * @default false + */ returnPolygonBarriers: boolean; + /** + * If `true`, polyline barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolylineBarriers) + * + * @default false + */ returnPolylineBarriers: boolean; + /** + * When `true`, closest facility routes will be generated and returned in the route property of each [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnRoutes) + * + * @default true + */ returnRoutes: boolean; + /** + * The arrival or departure date and time. For example, if the travelDirection is set to `TO_FACILITY` and `timeOfDayUsage` is set to "end" and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) + */ timeOfDay: Date; + /** + * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Known Values:** start | end + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) + */ timeOfDayUsage: string; + /** + * Options for traveling to or from the facility. Default values are defined by the newtork layer. See NATravelDirection for a list of valid values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) + */ travelDirection: 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). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#useHierarchy) + * + * @default false + */ useHierarchy: boolean; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#toJSON) + * + * + */ toJSON(): any; } interface ClosestFacilityParametersConstructor { + /** + * Input parameters for [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html) + */ + new(properties?: ClosestFacilityParametersProperties): ClosestFacilityParameters; } export const ClosestFacilityParameters: ClosestFacilityParametersConstructor; interface ClosestFacilityParametersProperties { + /** + * The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#accumulateAttributes) + */ accumulateAttributes?: string[]; + /** + * An array of attribute parameter values that determine which network elements can be used by a vehicle. View the object specifications below for properties of the individual objects in this array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) + */ attributeParameterValues?: ClosestFacilityParametersAttributeParameterValues[]; + /** + * The cutoff value used to determine when to stop traversing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultCutoff) + */ defaultCutoff?: number; + /** + * The number of facilities to find. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultTargetFacilityCount) + */ defaultTargetFacilityCount?: number; + /** + * The language used when generating driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If an unsupported language code is specified, the service returns the directions using the default language, English. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLanguage) + */ directionsLanguage?: string; + /** + * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) + */ directionsLengthUnits?: string; + /** + * Defines the amount of direction information returned. The default value is standard. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsOutputType) + */ directionsOutputType?: string; + /** + * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsStyleName) + */ directionsStyleName?: string; + /** + * The name of the attribute field that contains the drive time values. If not specified, the task will use the attribute field defined by the routing network layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsTimeAttribute) + */ directionsTimeAttribute?: string; + /** + * When `true`, restricted network elements should be considered when finding network locations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#doNotLocateOnRestrictedElements) + * + * @default true + */ doNotLocateOnRestrictedElements?: boolean; + /** + * The set of facilities loaded as network locations during analysis. These can be specified as either a [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#facilities) + */ facilities?: DataLayerProperties | FeatureSetProperties; + /** + * The network attribute field name used as the impedance attribute during analysis. If not specified the default value defined by the routing network layer. Valid values include any attribute name listed in the Service Directory under Network Dataset > Network Attributes with a Usage Type of `esriNauTCost`. Specify none to indicate that no network attributes should be used for impedance. If you specify an empty string the default value defined by the service will be used. See the [Understanding the network attribute](https://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000) help topic for more details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#impedanceAttribute) + */ impedanceAttribute?: string; + /** + * The set of incidents loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#incidents) + */ incidents?: DataLayerProperties | FeatureSetProperties; + /** + * The output geometry precision. When `0`, no generalization of the output geometry is performed. Positive values represent the `MaximumAllowableOffset` parameter used by generalize. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecision) + */ outputGeometryPrecision?: number; + /** + * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) + */ outputGeometryPrecisionUnits?: string; + /** + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. See NAOutputLine for a list of valid values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) + */ outputLines?: string; + /** + * The well-known id of the spatial reference or the spatial reference object for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties | string; + /** + * The set of point barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#pointBarriers) + */ pointBarriers?: DataLayerProperties | FeatureSetProperties; + /** + * The set of polygon barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polygonBarriers) + */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; + /** + * The set of polyline barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polylineBarriers) + */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; + /** + * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are listed in the Service Directory under Network Dataset > Network Attributes. You can also specify a value of none to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. Use `["none"]` to override the service defaults and specify that no restrictions should be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictionAttributes) + */ restrictionAttributes?: string[]; + /** + * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) + */ restrictUTurns?: string; + /** + * Indicates whether the service should generate driving directions for each route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) + * + * @default false + */ returnDirections?: boolean; + /** + * If `true`, facilities will be returned with the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnFacilities) + * + * @default false + */ returnFacilities?: boolean; + /** + * If `true`, incidents will be returned with the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnIncidents) + * + * @default false + */ returnIncidents?: boolean; + /** + * If `true`, point barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPointBarriers) + * + * @default false + */ returnPointBarriers?: boolean; + /** + * If `true`, polygon barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolygonBarriers) + * + * @default false + */ returnPolygonBarriers?: boolean; + /** + * If `true`, polyline barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolylineBarriers) + * + * @default false + */ returnPolylineBarriers?: boolean; + /** + * When `true`, closest facility routes will be generated and returned in the route property of each [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnRoutes) + * + * @default true + */ returnRoutes?: boolean; + /** + * The arrival or departure date and time. For example, if the travelDirection is set to `TO_FACILITY` and `timeOfDayUsage` is set to "end" and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) + */ timeOfDay?: DateProperties; + /** + * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Known Values:** start | end + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) + */ timeOfDayUsage?: string; + /** + * Options for traveling to or from the facility. Default values are defined by the newtork layer. See NATravelDirection for a list of valid values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) + */ travelDirection?: 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). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#useHierarchy) + * + * @default false + */ useHierarchy?: boolean; } - export interface ClosestFacilityParametersAttributeParameterValues { + + export interface ClosestFacilityParametersAttributeParameterValues extends Object { + /** + * The name of the attribute. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) + */ attributeName: string; + /** + * The parameter name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) + */ parameterName: string; + /** + * The parameter value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) + */ value: string; } interface ClosestFacilitySolveResult extends Accessor, JSONSupport { + /** + * An array of directions. A direction is an instance of [DirectionsFeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html). Route directions are returned if `returnDirections = true` (default is false). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#directions) + */ directions: DirectionsFeatureSet; + /** + * An array of points representing facilities. Only returned when `ClosestFacilityParameters.returnFacilities = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#facilities) + */ facilities: Point[]; + /** + * An array of points representing incidents. Only returned when `ClosestFacilityParameters.returnIncidents = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#incidents) + */ incidents: Point[]; + /** + * Message received when the solve is complete. If a closest facility cannot be solved, the message returned by the server identifies the incident that could not be solved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#messages) + */ messages: NAMessage[]; + /** + * The point barriers are an array of points. They are returned only if `ClosestFacilityParameters.returnPointBarriers` was set to `true` (which is not the default). If you send in the point barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#pointBarriers) + */ pointBarriers: Point[]; + /** + * The polygon barriers are an array of polygons. They are returned only if `ClosestFacilityParameters.returnPolygonBarriers` was set to `true` (which is not the default). If you send in the polygon barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polygonBarriers) + */ polygonBarriers: Polygon[]; + /** + * The polyline barriers are an array of polylines. They are returned only if `ClosestFacilityParameters.returnPolylineBarriers` was set to `true` (which is not the default). If you send in the polyline barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polylineBarriers) + */ polylineBarriers: Polyline[]; + /** + * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `esriNAOutputLineNone`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#routes) + */ routes: Graphic[]; } interface ClosestFacilitySolveResultConstructor { + /** + * The result from [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html) + */ + new(properties?: ClosestFacilitySolveResultProperties): ClosestFacilitySolveResult; fromJSON(json: any): ClosestFacilitySolveResult; @@ -6186,22 +26143,74 @@ declare namespace __esri { export const ClosestFacilitySolveResult: ClosestFacilitySolveResultConstructor; interface ClosestFacilitySolveResultProperties { + /** + * An array of directions. A direction is an instance of [DirectionsFeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html). Route directions are returned if `returnDirections = true` (default is false). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#directions) + */ directions?: DirectionsFeatureSetProperties; + /** + * An array of points representing facilities. Only returned when `ClosestFacilityParameters.returnFacilities = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#facilities) + */ facilities?: PointProperties[]; + /** + * An array of points representing incidents. Only returned when `ClosestFacilityParameters.returnIncidents = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#incidents) + */ incidents?: PointProperties[]; + /** + * Message received when the solve is complete. If a closest facility cannot be solved, the message returned by the server identifies the incident that could not be solved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#messages) + */ messages?: NAMessageProperties[]; + /** + * The point barriers are an array of points. They are returned only if `ClosestFacilityParameters.returnPointBarriers` was set to `true` (which is not the default). If you send in the point barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#pointBarriers) + */ pointBarriers?: PointProperties[]; + /** + * The polygon barriers are an array of polygons. They are returned only if `ClosestFacilityParameters.returnPolygonBarriers` was set to `true` (which is not the default). If you send in the polygon barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polygonBarriers) + */ polygonBarriers?: PolygonProperties[]; + /** + * The polyline barriers are an array of polylines. They are returned only if `ClosestFacilityParameters.returnPolylineBarriers` was set to `true` (which is not the default). If you send in the polyline barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polylineBarriers) + */ polylineBarriers?: PolylineProperties[]; + /** + * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `esriNAOutputLineNone`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#routes) + */ routes?: GraphicProperties[]; } interface DataFile extends Accessor, JSONSupport { + /** + * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater services that support uploads, this class can be used to specify an uploaded item as input by specifying the ItemID. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#itemId) + */ itemId: string; + /** + * URL to the location of the data file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#url) + */ url: string; } interface DataFileConstructor { + + new(properties?: DataFileProperties): DataFile; fromJSON(json: any): DataFile; @@ -6210,38 +26219,141 @@ declare namespace __esri { export const DataFile: DataFileConstructor; interface DataFileProperties { + /** + * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater services that support uploads, this class can be used to specify an uploaded item as input by specifying the ItemID. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#itemId) + */ itemId?: string; + /** + * URL to the location of the data file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#url) + */ url?: string; } interface DataLayer extends Accessor { + /** + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) is applied to this geometry while performing the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#geometry) + */ geometry: Geometry; + /** + * The name of the data layer in the map service that is being referenced. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#name) + */ name: string; + /** + * The spatial relationship to be applied on the input geometry while performing the query. + * + * Possible Value | Description + * ---------------|------------ + * intersects | Part of a feature from feature class 1 is contained in a feature from feature class 2. + * contains | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. + * crosses | The feature from feature class 1 crosses a feature from feature class 2. + * envelope-intersects | The envelope of feature class 1 intersects with the envelope of feature class 2. + * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. + * overlaps | Features from feature class 1 overlap features in feature class 2. + * touches | The feature from feature class 1 touches the border of a feature from feature class 2. + * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. + * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) + */ spatialRelationship: string; + /** + * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#where) + */ where: string; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#toJSON) + * + * + */ toJSON(): any; } interface DataLayerConstructor { + /** + * Input for properties of ClosestFacilityParameters,RouteParameters or ServiceAreaParameters. The DataLayer can be used to define the following for each paramater type: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) + */ + new(properties?: DataLayerProperties): DataLayer; } export const DataLayer: DataLayerConstructor; interface DataLayerProperties { + /** + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) is applied to this geometry while performing the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#geometry) + */ geometry?: GeometryProperties; + /** + * The name of the data layer in the map service that is being referenced. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#name) + */ name?: string; + /** + * The spatial relationship to be applied on the input geometry while performing the query. + * + * Possible Value | Description + * ---------------|------------ + * intersects | Part of a feature from feature class 1 is contained in a feature from feature class 2. + * contains | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. + * crosses | The feature from feature class 1 crosses a feature from feature class 2. + * envelope-intersects | The envelope of feature class 1 intersects with the envelope of feature class 2. + * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. + * overlaps | Features from feature class 1 overlap features in feature class 2. + * touches | The feature from feature class 1 touches the border of a feature from feature class 2. + * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. + * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) + */ spatialRelationship?: string; + /** + * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#where) + */ where?: string; } interface supportDate extends Accessor, JSONSupport { + /** + * Date value returned from server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#date) + */ date: Date; + /** + * The format of the date used in the date property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#format) + * + * @default EEE MMM dd HH:mm:ss zzz yyyy + */ format: string; } interface supportDateConstructor { + + new(properties?: supportDateProperties): supportDate; fromJSON(json: any): supportDate; @@ -6250,44 +26362,151 @@ declare namespace __esri { export const supportDate: supportDateConstructor; interface supportDateProperties { + /** + * Date value returned from server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#date) + */ date?: DateProperties; + /** + * The format of the date used in the date property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#format) + * + * @default EEE MMM dd HH:mm:ss zzz yyyy + */ format?: string; } interface DensifyParameters extends Accessor { + /** + * If `true`, Geographic Coordinate System spatial references are used or densify geodesic will be performed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geodesic) + */ geodesic: boolean; + /** + * The array of geometries to be densified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geometries) + */ geometries: Geometry[]; + /** + * The length unit of `maxSegmentLength`. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#lengthUnit) + */ lengthUnit: string; + /** + * All segments longer than `maxSegmentLength` are replaced with sequences of lines no longer than `maxSegmentLength.` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#maxSegmentLength) + */ maxSegmentLength: number; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#toJSON) + * + * + */ toJSON(): any; } interface DensifyParametersConstructor { + + new(properties?: DensifyParametersProperties): DensifyParameters; } export const DensifyParameters: DensifyParametersConstructor; interface DensifyParametersProperties { + /** + * If `true`, Geographic Coordinate System spatial references are used or densify geodesic will be performed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geodesic) + */ geodesic?: boolean; + /** + * The array of geometries to be densified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geometries) + */ geometries?: GeometryProperties[]; + /** + * The length unit of `maxSegmentLength`. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#lengthUnit) + */ lengthUnit?: string; + /** + * All segments longer than `maxSegmentLength` are replaced with sequences of lines no longer than `maxSegmentLength.` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#maxSegmentLength) + */ maxSegmentLength?: number; } interface DirectionsFeatureSet extends FeatureSet, Accessor { + /** + * The extent of the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#extent) + */ extent: Extent; + /** + * A single polyline representing the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#mergedGeometry) + */ mergedGeometry: Polyline; + /** + * The ID of the route returned from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeId) + */ routeId: string; + /** + * Name specified in [RouteParameters.stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeName) + */ routeName: string; + /** + * Lists additional information about the directions depending on the value of [RouteParameters.directionsOutputType](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#strings) + */ strings: any[]; + /** + * Actual drive time calculated for the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalDriveTime) + */ totalDriveTime: number; + /** + * The length of the route as specified in the units set in [RouteParameters.directionsLengthUnits](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalLength) + */ totalLength: number; + /** + * The total time calculated for the route as specified in the units set in [RouteParameters.directionsTimeAttribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalTime) + */ totalTime: number; } interface DirectionsFeatureSetConstructor { + /** + * A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) that has properties specific to routing. The [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#features) property contains the turn by turn directions text and geometry of the route. The attributes for each feature provide information associated with the corresponding route segment. The following attributes are returned: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html) + */ + new(properties?: DirectionsFeatureSetProperties): DirectionsFeatureSet; fromJSON(json: any): DirectionsFeatureSet; @@ -6296,48 +26515,169 @@ declare namespace __esri { export const DirectionsFeatureSet: DirectionsFeatureSetConstructor; interface DirectionsFeatureSetProperties extends FeatureSetProperties { + /** + * The extent of the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#extent) + */ extent?: ExtentProperties; + /** + * A single polyline representing the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#mergedGeometry) + */ mergedGeometry?: PolylineProperties; + /** + * The ID of the route returned from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeId) + */ routeId?: string; + /** + * Name specified in [RouteParameters.stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeName) + */ routeName?: string; + /** + * Lists additional information about the directions depending on the value of [RouteParameters.directionsOutputType](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#strings) + */ strings?: any[]; + /** + * Actual drive time calculated for the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalDriveTime) + */ totalDriveTime?: number; + /** + * The length of the route as specified in the units set in [RouteParameters.directionsLengthUnits](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalLength) + */ totalLength?: number; + /** + * The total time calculated for the route as specified in the units set in [RouteParameters.directionsTimeAttribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalTime) + */ totalTime?: number; } interface DistanceParameters extends Accessor { + /** + * Specifies the units for measuring distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2). If the unit is not specified the units are derived from the spatial reference. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#distanceUnit) + */ distanceUnit: string; + /** + * When `true`, the geodesic distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) is measured. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geodesic) + */ geodesic: boolean; + /** + * The geometry from which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) + */ geometry1: Geometry[]; + /** + * The geometry to which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) + */ geometry2: Geometry[]; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#toJSON) + * + * + */ toJSON(): any; } interface DistanceParametersConstructor { + + new(properties?: DistanceParametersProperties): DistanceParameters; } export const DistanceParameters: DistanceParametersConstructor; interface DistanceParametersProperties { + /** + * Specifies the units for measuring distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2). If the unit is not specified the units are derived from the spatial reference. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#distanceUnit) + */ distanceUnit?: string; + /** + * When `true`, the geodesic distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) is measured. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geodesic) + */ geodesic?: boolean; + /** + * The geometry from which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) + */ geometry1?: GeometryProperties[]; + /** + * The geometry to which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) + */ geometry2?: GeometryProperties[]; } interface FeatureSet extends Accessor, JSONSupport { + /** + * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. This is only applicable when the FeatureSet is returned from a task. It is ignored when the FeatureSet is used as input to a geoprocessing task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#displayFieldName) + */ displayFieldName: string; + /** + * Typically, a layer has a limit on the number of features (i.e., records) returned by the query operation. If `maxRecordCount` is configured for a layer, `exceededTransferLimit` will be `true` if a query matches more than the `maxRecordCount` features. It will be `false` otherwise. Supported by ArcGIS Server version 10.1 and later. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#exceededTransferLimit) + */ exceededTransferLimit: boolean; + /** + * The array of graphics returned from a task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#features) + */ features: Graphic[]; + /** + * Information about each field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#fields) + */ fields: Field[]; + /** + * The geometry type of the FeatureSet. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#geometryType) + */ geometryType: string; + /** + * When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. This value can be changed. When a FeatureSet is returned from a task, the value is the result as returned from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#spatialReference) + */ spatialReference: SpatialReference; } interface FeatureSetConstructor { + + new(properties?: FeatureSetProperties): FeatureSet; fromJSON(json: any): FeatureSet; @@ -6346,54 +26686,213 @@ declare namespace __esri { export const FeatureSet: FeatureSetConstructor; interface FeatureSetProperties { + /** + * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. This is only applicable when the FeatureSet is returned from a task. It is ignored when the FeatureSet is used as input to a geoprocessing task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#displayFieldName) + */ displayFieldName?: string; + /** + * Typically, a layer has a limit on the number of features (i.e., records) returned by the query operation. If `maxRecordCount` is configured for a layer, `exceededTransferLimit` will be `true` if a query matches more than the `maxRecordCount` features. It will be `false` otherwise. Supported by ArcGIS Server version 10.1 and later. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#exceededTransferLimit) + */ exceededTransferLimit?: boolean; + /** + * The array of graphics returned from a task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#features) + */ features?: GraphicProperties[]; + /** + * Information about each field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#fields) + */ fields?: FieldProperties[]; + /** + * The geometry type of the FeatureSet. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#geometryType) + */ geometryType?: string; + /** + * When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. This value can be changed. When a FeatureSet is returned from a task, the value is the result as returned from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; } interface FindParameters extends Accessor { + /** + * Determines whether to look for an exact match of the search text or not. If `true`, searches for a value that contains the provided [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText). This is a case-insensitive search. If `false`, searches for an exact match of the [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) string. The exact match is case-sensitive. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#contains) + * + * @default true + */ contains: boolean; + /** + * Specify the number of decimal places for the geometries returned by the task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#geometryPrecision) + */ geometryPrecision: number; + /** + * The layers to perform the find operation on. The layers are specified as a comma-separated list of layer ids. The list of ids is returned in [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) layerInfos. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#layerIds) + */ layerIds: number[]; + /** + * The maximum allowable offset used for generalizing geometries returned by the find operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference). If [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) is not defined, the spatial reference of the map is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#maxAllowableOffset) + */ maxAllowableOffset: number; + /** + * The spatial reference of the output geometries. If this is not specified, the output geometries are returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * If `true`, the output will include the geometry associated with each result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#returnGeometry) + * + * @default false + */ returnGeometry: boolean; + /** + * The names of the fields of a layer to search. The fields are specified as a comma-separated list of field names. If this parameter is not specified, all fields are searched by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) + */ searchFields: string[]; + /** + * The text that is searched across the layers and the fields as specified in the `layers` and [searchFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) + */ searchText: string; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#toJSON) + * + * + */ toJSON(): any; } interface FindParametersConstructor { + + new(properties?: FindParametersProperties): FindParameters; } export const FindParameters: FindParametersConstructor; interface FindParametersProperties { + /** + * Determines whether to look for an exact match of the search text or not. If `true`, searches for a value that contains the provided [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText). This is a case-insensitive search. If `false`, searches for an exact match of the [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) string. The exact match is case-sensitive. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#contains) + * + * @default true + */ contains?: boolean; + /** + * Specify the number of decimal places for the geometries returned by the task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#geometryPrecision) + */ geometryPrecision?: number; + /** + * The layers to perform the find operation on. The layers are specified as a comma-separated list of layer ids. The list of ids is returned in [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) layerInfos. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#layerIds) + */ layerIds?: number[]; + /** + * The maximum allowable offset used for generalizing geometries returned by the find operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference). If [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) is not defined, the spatial reference of the map is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#maxAllowableOffset) + */ maxAllowableOffset?: number; + /** + * The spatial reference of the output geometries. If this is not specified, the output geometries are returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * If `true`, the output will include the geometry associated with each result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#returnGeometry) + * + * @default false + */ returnGeometry?: boolean; + /** + * The names of the fields of a layer to search. The fields are specified as a comma-separated list of field names. If this parameter is not specified, all fields are searched by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) + */ searchFields?: string[]; + /** + * The text that is searched across the layers and the fields as specified in the `layers` and [searchFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) + */ searchText?: string; } interface FindResult extends Accessor, JSONSupport { + /** + * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#displayFieldName) + */ displayFieldName: string; + /** + * The found feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#feature) + */ feature: Graphic; + /** + * The name of the field that contains the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#foundFieldName) + */ foundFieldName: string; + /** + * Unique ID of the layer that contains the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerId) + */ layerId: number; + /** + * The layer name that contains the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerName) + */ layerName: string; + /** + * The value of the `foundFieldName` in the feature's attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#value) + */ value: void; } interface FindResultConstructor { + + new(properties?: FindResultProperties): FindResult; fromJSON(json: any): FindResult; @@ -6402,40 +26901,121 @@ declare namespace __esri { export const FindResult: FindResultConstructor; interface FindResultProperties { + /** + * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#displayFieldName) + */ displayFieldName?: string; + /** + * The found feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#feature) + */ feature?: GraphicProperties; + /** + * The name of the field that contains the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#foundFieldName) + */ foundFieldName?: string; + /** + * Unique ID of the layer that contains the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerId) + */ layerId?: number; + /** + * The layer name that contains the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerName) + */ layerName?: string; + /** + * The value of the `foundFieldName` in the feature's attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#value) + */ value?: void; } interface GeneralizeParameters extends Accessor { + /** + * The maximum deviation unit. If the unit is not specified, units are derived from the spatial reference. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#deviationUnit) + */ deviationUnit: string; + /** + * The array of input geometries to generalize. All geometries in this array must be of the same geometry type (e.g. `esriGeometryPolyline` or `esriGeometryPolygon`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#geometries) + */ geometries: Geometry[]; + /** + * The maximum deviation for constructing a generalized geometry based on the input geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#maxDeviation) + */ maxDeviation: number; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#toJSON) + * + * + */ toJSON(): any; } interface GeneralizeParametersConstructor { + + new(properties?: GeneralizeParametersProperties): GeneralizeParameters; } export const GeneralizeParameters: GeneralizeParametersConstructor; interface GeneralizeParametersProperties { + /** + * The maximum deviation unit. If the unit is not specified, units are derived from the spatial reference. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#deviationUnit) + */ deviationUnit?: string; + /** + * The array of input geometries to generalize. All geometries in this array must be of the same geometry type (e.g. `esriGeometryPolyline` or `esriGeometryPolygon`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#geometries) + */ geometries?: GeometryProperties[]; + /** + * The maximum deviation for constructing a generalized geometry based on the input geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#maxDeviation) + */ maxDeviation?: number; } interface GPMessage extends Accessor, JSONSupport { + /** + * The geoprocessing message. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#description) + */ description: string; + /** + * The geoprocessing message type. **Known Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#type) + */ type: string; } interface GPMessageConstructor { + + new(properties?: GPMessageProperties): GPMessage; fromJSON(json: any): GPMessage; @@ -6444,56 +27024,251 @@ declare namespace __esri { export const GPMessage: GPMessageConstructor; interface GPMessageProperties { + /** + * The geoprocessing message. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#description) + */ description?: string; + /** + * The geoprocessing message type. **Known Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#type) + */ type?: string; } interface IdentifyParameters extends Accessor { + /** + * Resolution of the current map view in dots per inch. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) + * + * @default 96 + */ dpi: number; + /** + * The geometry used to select features during the Identify operation. The type of the geometry is specified by [Geometry.type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type). The most common geometry used with Identify is a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometry) + */ geometry: Geometry; + /** + * Specify the number of decimal places for the geometries returned by the task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometryPrecision) + */ geometryPrecision: number; + /** + * Height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height) + * + * @default 400 + */ height: number; + /** + * The layers on which to perform the identify operation. The layers are specified as a comma-separated list of layer IDs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerIds) + */ layerIds: number[]; + /** + * Specifies which layers to use when using Identify. + * + * Possible values | Description + * --------------- | ----------- + * top | Only the top-most visible layer is identified. + * visible | All visible layers are identified. + * all | All layers are identified, even if they are not visible. If your service has many layers, a request using this option will not perform well. A visible layer means you can see it in the map at the current extent. If a layer is turned off or not in range based on its scale dependency settings, it cannot be identified. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerOption) + * + * @default top + */ layerOption: string; + /** + * The Extent or bounding box of the current map view. The `mapExtent` property is assumed to be in the spatial reference of the map unless [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) has been specified. The values for [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent), [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width), and [dpi](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) are used to determine the current map scale. Once the scale is known, the map service can exclude layers based on their scale dependency settings. The map service is not performing a spatial intersection based on the provided extent. These properties are also used to calculate the search distance on the map based on the tolerance in screen pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent) + */ mapExtent: Extent; + /** + * The maximum allowable offset used for generalizing geometries returned by the identify operation. The offset is in the units of the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference). If a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) is not defined the spatial reference of the view is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#maxAllowableOffset) + */ maxAllowableOffset: number; + /** + * If `true`, the result set includes the geometry associated with each result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnGeometry) + * + * @default false + */ returnGeometry: boolean; + /** + * The spatial reference of the input and output geometries as well as of the [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent). If the spatial reference is not specified, the geometry and the extent are assumed to be in the spatial reference of the view, and the output geometries will also be in the spatial reference of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) + */ spatialReference: SpatialReference; + /** + * The distance in screen pixels from the specified geometry within which the identify should be performed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#tolerance) + */ tolerance: number; + /** + * Width of the current map view in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width) + * + * @default 400 + */ width: number; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#toJSON) + * + * + */ toJSON(): any; } interface IdentifyParametersConstructor { + + new(properties?: IdentifyParametersProperties): IdentifyParameters; } export const IdentifyParameters: IdentifyParametersConstructor; interface IdentifyParametersProperties { + /** + * Resolution of the current map view in dots per inch. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) + * + * @default 96 + */ dpi?: number; + /** + * The geometry used to select features during the Identify operation. The type of the geometry is specified by [Geometry.type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type). The most common geometry used with Identify is a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometry) + */ geometry?: GeometryProperties; + /** + * Specify the number of decimal places for the geometries returned by the task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometryPrecision) + */ geometryPrecision?: number; + /** + * Height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height) + * + * @default 400 + */ height?: number; + /** + * The layers on which to perform the identify operation. The layers are specified as a comma-separated list of layer IDs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerIds) + */ layerIds?: number[]; + /** + * Specifies which layers to use when using Identify. + * + * Possible values | Description + * --------------- | ----------- + * top | Only the top-most visible layer is identified. + * visible | All visible layers are identified. + * all | All layers are identified, even if they are not visible. If your service has many layers, a request using this option will not perform well. A visible layer means you can see it in the map at the current extent. If a layer is turned off or not in range based on its scale dependency settings, it cannot be identified. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerOption) + * + * @default top + */ layerOption?: string; + /** + * The Extent or bounding box of the current map view. The `mapExtent` property is assumed to be in the spatial reference of the map unless [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) has been specified. The values for [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent), [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width), and [dpi](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) are used to determine the current map scale. Once the scale is known, the map service can exclude layers based on their scale dependency settings. The map service is not performing a spatial intersection based on the provided extent. These properties are also used to calculate the search distance on the map based on the tolerance in screen pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent) + */ mapExtent?: ExtentProperties; + /** + * The maximum allowable offset used for generalizing geometries returned by the identify operation. The offset is in the units of the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference). If a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) is not defined the spatial reference of the view is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#maxAllowableOffset) + */ maxAllowableOffset?: number; + /** + * If `true`, the result set includes the geometry associated with each result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnGeometry) + * + * @default false + */ returnGeometry?: boolean; + /** + * The spatial reference of the input and output geometries as well as of the [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent). If the spatial reference is not specified, the geometry and the extent are assumed to be in the spatial reference of the view, and the output geometries will also be in the spatial reference of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; + /** + * The distance in screen pixels from the specified geometry within which the identify should be performed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#tolerance) + */ tolerance?: number; + /** + * Width of the current map view in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width) + * + * @default 400 + */ width?: number; } interface IdentifyResult extends Accessor, JSONSupport { + /** + * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#displayFieldName) + */ displayFieldName: string; + /** + * An identified feature from the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#feature) + */ feature: Graphic; + /** + * Unique ID of the layer that contains the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerId) + */ layerId: number; + /** + * The layer name that contains the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerName) + */ layerName: string; } interface IdentifyResultConstructor { + + new(properties?: IdentifyResultProperties): IdentifyResult; fromJSON(json: any): IdentifyResult; @@ -6502,55 +27277,219 @@ declare namespace __esri { export const IdentifyResult: IdentifyResultConstructor; interface IdentifyResultProperties { + /** + * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#displayFieldName) + */ displayFieldName?: string; + /** + * An identified feature from the map service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#feature) + */ feature?: GraphicProperties; + /** + * Unique ID of the layer that contains the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerId) + */ layerId?: number; + /** + * The layer name that contains the feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerName) + */ layerName?: string; } interface ImageServiceIdentifyParameters extends Accessor { + /** + * Input geometry that defines the location to be identified. The location can be a point or a polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#geometry) + */ geometry: Point | Polygon; + /** + * Specifies the mosaic rules defining the image sorting order. When a mosaic rule is not specified, `center` is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#mosaicRule) + */ mosaicRule: MosaicRule; + /** + * The pixel or RGB color value representing no information. It can be defined as a number `noData = 0` representing a pixel value or as a string `noData = "58,128,187"` representing an RGB color value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#noData) + */ noData: string | number; + /** + * Specifies the pixel level being identified on the x and y axis. Defaults to the base resolution of the dataset when not specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSize) + */ pixelSize: Symbol; + /** + * The pixel level being identified (or the resolution being looked at) on the x-axis. If not specified, it will default to the base resolution of the dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeX) + */ pixelSizeX: number; + /** + * The pixel level being identified (or the resolution being looked at) on the y-axis. If not specified, it will default to the base resolution of the dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeY) + */ pixelSizeY: number; + /** + * Specifies the rendering rule for how the requested image should be rendered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#renderingRule) + */ renderingRule: RasterFunction; + /** + * If `true`, returns both geometry and attributes of the catalog items. Set to `false` when catalog items are not needed to significantly improve identify operation's performance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnCatalogItems) + * + * @default true + */ returnCatalogItems: boolean; + /** + * When `true`, each feature in the catalog items includes the geometry. Set to `false` to not display the features on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnGeometry) + * + * @default false + */ returnGeometry: boolean; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#toJSON) + * + * + */ toJSON(): any; } interface ImageServiceIdentifyParametersConstructor { + + new(properties?: ImageServiceIdentifyParametersProperties): ImageServiceIdentifyParameters; } export const ImageServiceIdentifyParameters: ImageServiceIdentifyParametersConstructor; interface ImageServiceIdentifyParametersProperties { + /** + * Input geometry that defines the location to be identified. The location can be a point or a polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#geometry) + */ geometry?: PointProperties | PolygonProperties; + /** + * Specifies the mosaic rules defining the image sorting order. When a mosaic rule is not specified, `center` is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#mosaicRule) + */ mosaicRule?: MosaicRuleProperties; + /** + * The pixel or RGB color value representing no information. It can be defined as a number `noData = 0` representing a pixel value or as a string `noData = "58,128,187"` representing an RGB color value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#noData) + */ noData?: string | number; + /** + * Specifies the pixel level being identified on the x and y axis. Defaults to the base resolution of the dataset when not specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSize) + */ pixelSize?: SymbolProperties; + /** + * The pixel level being identified (or the resolution being looked at) on the x-axis. If not specified, it will default to the base resolution of the dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeX) + */ pixelSizeX?: number; + /** + * The pixel level being identified (or the resolution being looked at) on the y-axis. If not specified, it will default to the base resolution of the dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeY) + */ pixelSizeY?: number; + /** + * Specifies the rendering rule for how the requested image should be rendered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#renderingRule) + */ renderingRule?: RasterFunctionProperties; + /** + * If `true`, returns both geometry and attributes of the catalog items. Set to `false` when catalog items are not needed to significantly improve identify operation's performance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnCatalogItems) + * + * @default true + */ returnCatalogItems?: boolean; + /** + * When `true`, each feature in the catalog items includes the geometry. Set to `false` to not display the features on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnGeometry) + * + * @default false + */ returnGeometry?: boolean; } interface ImageServiceIdentifyResult extends Accessor, JSONSupport { + /** + * The set of catalog items that overlap the input geometry. Catalog Items are returned only when the image service source is a mosaic dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItems) + */ catalogItems: FeatureSet; + /** + * The set of visible areas for the identified catalog items. `CatalogItemVisibilities` are returned only when the image service source is a mosaic dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItemVisibilities) + */ catalogItemVisibilities: number[]; + /** + * The identified location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#location) + */ location: Point; + /** + * The identify property name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#name) + */ name: string; + /** + * The identify property id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#objectId) + */ objectId: number; + /** + * The attributes of the identified object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#properties) + */ properties: any; + /** + * The identify property pixel value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#value) + */ value: string; } interface ImageServiceIdentifyResultConstructor { + + new(properties?: ImageServiceIdentifyResultProperties): ImageServiceIdentifyResult; fromJSON(json: any): ImageServiceIdentifyResult; @@ -6559,22 +27498,74 @@ declare namespace __esri { export const ImageServiceIdentifyResult: ImageServiceIdentifyResultConstructor; interface ImageServiceIdentifyResultProperties { + /** + * The set of catalog items that overlap the input geometry. Catalog Items are returned only when the image service source is a mosaic dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItems) + */ catalogItems?: FeatureSetProperties; + /** + * The set of visible areas for the identified catalog items. `CatalogItemVisibilities` are returned only when the image service source is a mosaic dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItemVisibilities) + */ catalogItemVisibilities?: number[]; + /** + * The identified location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#location) + */ location?: PointProperties; + /** + * The identify property name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#name) + */ name?: string; + /** + * The identify property id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#objectId) + */ objectId?: number; + /** + * The attributes of the identified object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#properties) + */ properties?: any; + /** + * The identify property pixel value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#value) + */ value?: string; } interface JobInfo extends Accessor, JSONSupport { + /** + * The unique job ID assigned by ArcGIS Server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobId) + */ jobId: string; + /** + * The job status. **Known Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobStatus) + */ jobStatus: string; + /** + * An array of messages that include the message type and a description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#messages) + */ messages: GPMessage[]; } interface JobInfoConstructor { + + new(properties?: JobInfoProperties): JobInfo; fromJSON(json: any): JobInfo; @@ -6583,57 +27574,181 @@ declare namespace __esri { export const JobInfo: JobInfoConstructor; interface JobInfoProperties { + /** + * The unique job ID assigned by ArcGIS Server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobId) + */ jobId?: string; + /** + * The job status. **Known Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobStatus) + */ jobStatus?: string; + /** + * An array of messages that include the message type and a description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#messages) + */ messages?: GPMessageProperties[]; } interface LegendLayer extends Accessor { + /** + * The id of the operational layer to include in the printout's legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#layerId) + */ layerId: string; + /** + * The ids of the sublayers to include in the printout's legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#subLayerIds) + */ subLayerIds: string[]; + /** + * The title of the feature layer. Use this property to modify feature layer name in the legend for the printout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#title) + */ title: string; } interface LegendLayerConstructor { + + new(properties?: LegendLayerProperties): LegendLayer; } export const LegendLayer: LegendLayerConstructor; interface LegendLayerProperties { + /** + * The id of the operational layer to include in the printout's legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#layerId) + */ layerId?: string; + /** + * The ids of the sublayers to include in the printout's legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#subLayerIds) + */ subLayerIds?: string[]; + /** + * The title of the feature layer. Use this property to modify feature layer name in the legend for the printout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#title) + */ title?: string; } interface LengthsParameters extends Accessor { + /** + * Defines the type of calculation for the geometry. The type can be one of the following: + * + * Value | Description + * ---------------|--------------- + * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference otherwise use `preserve-shape`. + * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. + * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid, for geometries defined in a projected or geographic coordinate system. This method preserves the shape of the geometry in its coordinate system which means the true area or length will be calculated for the geometry that is displayed on the map. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#calculationType) + */ calculationType: string; + /** + * If polylines are in a geographic coordinate system, then geodesic needs to be set to `true` in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. If `lengthUnit` is not specified, the output is returned in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#geodesic) + */ geodesic: boolean; + /** + * The length unit in which perimeters of polygons will be calculated. For a list of valid units, see [linear unit codes](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#lengthUnit) + */ lengthUnit: number | string; + /** + * The array of polylines whose lengths are to be computed. The structure of each polyline in the array is same as the structure of the JSON polyline objects returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#polylines) + */ polylines: Polyline[]; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#toJSON) + * + * + */ toJSON(): any; } interface LengthsParametersConstructor { + + new(properties?: LengthsParametersProperties): LengthsParameters; } export const LengthsParameters: LengthsParametersConstructor; interface LengthsParametersProperties { + /** + * Defines the type of calculation for the geometry. The type can be one of the following: + * + * Value | Description + * ---------------|--------------- + * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference otherwise use `preserve-shape`. + * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. + * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid, for geometries defined in a projected or geographic coordinate system. This method preserves the shape of the geometry in its coordinate system which means the true area or length will be calculated for the geometry that is displayed on the map. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#calculationType) + */ calculationType?: string; + /** + * If polylines are in a geographic coordinate system, then geodesic needs to be set to `true` in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. If `lengthUnit` is not specified, the output is returned in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#geodesic) + */ geodesic?: boolean; + /** + * The length unit in which perimeters of polygons will be calculated. For a list of valid units, see [linear unit codes](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#lengthUnit) + */ lengthUnit?: number | string; + /** + * The array of polylines whose lengths are to be computed. The structure of each polyline in the array is same as the structure of the JSON polyline objects returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#polylines) + */ polylines?: PolylineProperties[]; } interface LinearUnit extends Accessor, JSONSupport { + /** + * Specifies the value of the linear distance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#distance) + * + * @default 0 + */ distance: number; + /** + * Specifies the unit type of the linear distance. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#units) + */ units: string; } interface LinearUnitConstructor { + + new(properties?: LinearUnitProperties): LinearUnit; fromJSON(json: any): LinearUnit; @@ -6642,16 +27757,40 @@ declare namespace __esri { export const LinearUnit: LinearUnitConstructor; interface LinearUnitProperties { + /** + * Specifies the value of the linear distance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#distance) + * + * @default 0 + */ distance?: number; + /** + * Specifies the unit type of the linear distance. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#units) + */ units?: string; } interface NAMessage extends Accessor, JSONSupport { + /** + * A description of the network analyst message. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#description) + */ description: string; + /** + * The network analyst message type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#type) + */ type: any; } interface NAMessageConstructor { + + new(properties?: NAMessageProperties): NAMessage; fromJSON(json: any): NAMessage; @@ -6660,40 +27799,151 @@ declare namespace __esri { export const NAMessage: NAMessageConstructor; interface NAMessageProperties { + /** + * A description of the network analyst message. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#description) + */ description?: string; + /** + * The network analyst message type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#type) + */ type?: any; } interface OffsetParameters extends Accessor { + /** + * The `bevelRatio` is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. When mitered is specified, the value set for `bevelRatio` is ignored and `10` is used internally. If beveled is specified, `1.1` will be used if no value is set for bevelRatio. The bevelRatio is ignored when `rounded` is specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#bevelRatio) + */ bevelRatio: number; + /** + * The array of geometries to be offset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#geometries) + */ geometries: Geometry[]; + /** + * Specifies the planar distance for constructing an offset based on the input geometries. If the `offsetDistance` parameter is positive, the constructed offset will be on the right side of the curve. Left side offsets are constructed with negative values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetDistance) + */ offsetDistance: number; + /** + * Options that determine how the ends intersect. Set to one of the following options: + * + * Possible Value | Description + * ---------------|------------- + * bevelled | Squares off the corner after a given ratio distance. + * mitered | Attempts to allow extended offsets to naturally intersect. If the intersection occurs too far from a corner, the corner will be beveled off at a fixed distance. + * rounded | Rounds the corner between extended offsets. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetHow) + */ offsetHow: string; + /** + * The offset distance unit. For a list of valid units see [esriSRUnitType constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnitType.htm) or [esriSRUnit2Type constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnit2Type.htm). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetUnit) + */ offsetUnit: string; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#toJSON) + * + * + */ toJSON(): any; } interface OffsetParametersConstructor { + + new(properties?: OffsetParametersProperties): OffsetParameters; } export const OffsetParameters: OffsetParametersConstructor; interface OffsetParametersProperties { + /** + * The `bevelRatio` is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. When mitered is specified, the value set for `bevelRatio` is ignored and `10` is used internally. If beveled is specified, `1.1` will be used if no value is set for bevelRatio. The bevelRatio is ignored when `rounded` is specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#bevelRatio) + */ bevelRatio?: number; + /** + * The array of geometries to be offset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#geometries) + */ geometries?: GeometryProperties[]; + /** + * Specifies the planar distance for constructing an offset based on the input geometries. If the `offsetDistance` parameter is positive, the constructed offset will be on the right side of the curve. Left side offsets are constructed with negative values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetDistance) + */ offsetDistance?: number; + /** + * Options that determine how the ends intersect. Set to one of the following options: + * + * Possible Value | Description + * ---------------|------------- + * bevelled | Squares off the corner after a given ratio distance. + * mitered | Attempts to allow extended offsets to naturally intersect. If the intersection occurs too far from a corner, the corner will be beveled off at a fixed distance. + * rounded | Rounds the corner between extended offsets. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetHow) + */ offsetHow?: string; + /** + * The offset distance unit. For a list of valid units see [esriSRUnitType constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnitType.htm) or [esriSRUnit2Type constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnit2Type.htm). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetUnit) + */ offsetUnit?: string; } interface ParameterValue extends Accessor, JSONSupport { + /** + * Specifies the parameter's data type. **Possible Values:** string | double | long | boolean | date | linear-unit | data-file | raster-data | record-set | raster-data-layer | feature-record-set-layer | multi-value + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#dataType) + */ dataType: string; + /** + * The value of the parameter. The data structure of this value depends on the `dataType`. + * + * Data Type | JavaScript Type + * ----------|---------------- + * string | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + * double | [Number (float)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) + * long | [Number (int)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) + * boolean | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) + * date | [Date](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html) + * linear-unit | [LinearUnit](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html) + * data-file | [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html) + * raster-data | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html) + * record-set | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) + * raster-data-layer | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html) + * feature-record-set-layer | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) + * multi-value | [String[]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#value) + */ value: any; } interface ParameterValueConstructor { + + new(properties?: ParameterValueProperties): ParameterValue; fromJSON(json: any): ParameterValue; @@ -6702,176 +27952,874 @@ declare namespace __esri { export const ParameterValue: ParameterValueConstructor; interface ParameterValueProperties { + /** + * Specifies the parameter's data type. **Possible Values:** string | double | long | boolean | date | linear-unit | data-file | raster-data | record-set | raster-data-layer | feature-record-set-layer | multi-value + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#dataType) + */ dataType?: string; + /** + * The value of the parameter. The data structure of this value depends on the `dataType`. + * + * Data Type | JavaScript Type + * ----------|---------------- + * string | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + * double | [Number (float)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) + * long | [Number (int)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) + * boolean | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) + * date | [Date](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html) + * linear-unit | [LinearUnit](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html) + * data-file | [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html) + * raster-data | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html) + * record-set | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) + * raster-data-layer | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html) + * feature-record-set-layer | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) + * multi-value | [String[]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#value) + */ value?: any; } interface PrintParameters extends Accessor { + /** + * Additional parameters for the print service. When an arcpy script is published as a custom print service there may be additional parameters associated with the print service. To determine the extra parameters visit the ArcGIS REST Services Directory page for the print service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#extraParameters) + */ extraParameters: any; + /** + * Specify the output spatial reference for the printout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * Defines the layout template used for the printed map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#template) + */ template: PrintTemplate; + /** + * The view to print. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#view) + */ view: MapView; } interface PrintParametersConstructor { + + new(properties?: PrintParametersProperties): PrintParameters; } export const PrintParameters: PrintParametersConstructor; interface PrintParametersProperties { + /** + * Additional parameters for the print service. When an arcpy script is published as a custom print service there may be additional parameters associated with the print service. To determine the extra parameters visit the ArcGIS REST Services Directory page for the print service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#extraParameters) + */ extraParameters?: any; + /** + * Specify the output spatial reference for the printout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * Defines the layout template used for the printed map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#template) + */ template?: PrintTemplateProperties; + /** + * The view to print. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#view) + */ view?: MapViewProperties; } interface PrintTemplate extends Accessor { + /** + * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#attributionVisible) + * + * @default true + */ attributionVisible: boolean; + /** + * Define the map width, height and dpi. Required when `layout = 'map-only'`. See the object specification table below for available options to set for exportOptions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) + */ exportOptions: PrintTemplateExportOptions; + /** + * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#format) + * + * @default png32 + */ format: string; + /** + * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: + * + * Value | Description + * | --- | --- + * map-only | Map does not contain any layout elements. Only map image is printed. + * a3-landscape | 16.54 x 11.69 in + * a3-portrait | 11.69 x 16.54 in + * a4-landscape | 11.69 x 8.27 in + * a4-portrait | 8.27 × 11.69 in + * letter-ansi-a-landscape | 11.0 x 8.5 in + * letter-ansi-a-portrait | 8.5 x 11.0 in + * tabloid-ansi-b-landscape| 17.0 x 11.0 in + * tabloid-ansi-b-portrait | 11.0 x 17.0 in + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) + * + * @default map-only + */ layout: string; + /** + * Defines the layout elements. It's an object with the following properties: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) + */ layoutOptions: PrintTemplateLayoutOptions; + /** + * The optional map scale of the printed map. Only applies when `preserveScale = true`. If `outScale` is less than 1, then the printed map will use the scale of the input map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#outScale) + * + * @default 0 + */ outScale: number; + /** + * Define whether the printed map should preserve map scale or map extent. If `true`, the printed map will use the `outScale` property or default to the scale of the input map. If `false`, the printed map will use the same extent as the input map and thus scale might change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#preserveScale) + * + * @default true + */ preserveScale: boolean; + /** + * When `true`, labels will be shown on the layout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#showLabels) + * + * @default true + */ showLabels: boolean; } interface PrintTemplateConstructor { + + new(properties?: PrintTemplateProperties): PrintTemplate; } export const PrintTemplate: PrintTemplateConstructor; interface PrintTemplateProperties { + /** + * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#attributionVisible) + * + * @default true + */ attributionVisible?: boolean; + /** + * Define the map width, height and dpi. Required when `layout = 'map-only'`. See the object specification table below for available options to set for exportOptions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) + */ exportOptions?: PrintTemplateExportOptions; + /** + * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#format) + * + * @default png32 + */ format?: string; + /** + * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: + * + * Value | Description + * | --- | --- + * map-only | Map does not contain any layout elements. Only map image is printed. + * a3-landscape | 16.54 x 11.69 in + * a3-portrait | 11.69 x 16.54 in + * a4-landscape | 11.69 x 8.27 in + * a4-portrait | 8.27 × 11.69 in + * letter-ansi-a-landscape | 11.0 x 8.5 in + * letter-ansi-a-portrait | 8.5 x 11.0 in + * tabloid-ansi-b-landscape| 17.0 x 11.0 in + * tabloid-ansi-b-portrait | 11.0 x 17.0 in + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) + * + * @default map-only + */ layout?: string; + /** + * Defines the layout elements. It's an object with the following properties: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) + */ layoutOptions?: PrintTemplateLayoutOptions; + /** + * The optional map scale of the printed map. Only applies when `preserveScale = true`. If `outScale` is less than 1, then the printed map will use the scale of the input map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#outScale) + * + * @default 0 + */ outScale?: number; + /** + * Define whether the printed map should preserve map scale or map extent. If `true`, the printed map will use the `outScale` property or default to the scale of the input map. If `false`, the printed map will use the same extent as the input map and thus scale might change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#preserveScale) + * + * @default true + */ preserveScale?: boolean; + /** + * When `true`, labels will be shown on the layout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#showLabels) + * + * @default true + */ showLabels?: boolean; } - export interface PrintTemplateExportOptions { + + export interface PrintTemplateExportOptions extends Object { + /** + * Map width. Default value is 800. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) + */ width?: number; + /** + * Map height. Default value is 1100. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) + */ height?: number; + /** + * Resolution in dots per inch. Default value is 96. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) + */ dpi?: number; } - export interface PrintTemplateLayoutOptions { + + export interface PrintTemplateLayoutOptions extends Object { + /** + * The text used for the map title if the specified layout contains a title text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) + */ titleText: string; + /** + * The text used for the author if the specified layout contains an author text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) + */ authorText: string; + /** + * The text used for the copyright if the specified layout contains an copyright text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) + */ copyrightText: string; - scalebarUnit: string; + /** + * The unit used for the scalebar. **Known Values:** `Miles` | `Kilometers` | `Meters` | `Feet` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) + * + * @default Miles + */ + scalebarUnit?: string; + /** + * An array of [LegendLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html) containing the id's of the layers that will be included in the legend. If `legendLayers` is not specified, all operational layers will be present in the legend. To specify that no layers will be included in the legend set `legendLayer = []`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) + */ legendLayers: LegendLayer[]; + /** + * An array of name-value pairs. Use this property to update the text for custom text elements on the page layout. Values must be strings. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) + */ customTextElements: any[]; } interface ProjectParameters extends Accessor { + /** + * The input geometries to project. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#geometries) + */ geometries: Geometry[]; + /** + * The spatial reference to which you are projecting the geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * The spatial reference to which you are projecting the geometries. Use [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSR) + */ outSR: SpatialReference; + /** + * The well-known id {wkid:number} or well-known text {wkt:string} of the datum transformation to be applied to the projected geometries. See [Datum transformations](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000r8000000) for a list of valid datum transformations that may be used here. If a transformation is specified, a value must also be specified in the [transformForward](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) + */ transformation: ProjectParametersTransformation; + /** + * Indicates whether to transform forward or not. The forward or reverse direction of transformation is implied in the name of the transformation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) + */ transformForward: boolean; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#toJSON) + * + * + */ toJSON(): any; } interface ProjectParametersConstructor { + + new(properties?: ProjectParametersProperties): ProjectParameters; } export const ProjectParameters: ProjectParametersConstructor; interface ProjectParametersProperties { + /** + * The input geometries to project. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#geometries) + */ geometries?: GeometryProperties[]; + /** + * The spatial reference to which you are projecting the geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * The spatial reference to which you are projecting the geometries. Use [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSR) + */ outSR?: SpatialReferenceProperties; + /** + * The well-known id {wkid:number} or well-known text {wkt:string} of the datum transformation to be applied to the projected geometries. See [Datum transformations](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000r8000000) for a list of valid datum transformations that may be used here. If a transformation is specified, a value must also be specified in the [transformForward](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) + */ transformation?: ProjectParametersTransformation; + /** + * Indicates whether to transform forward or not. The forward or reverse direction of transformation is implied in the name of the transformation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) + */ transformForward?: boolean; } - export interface ProjectParametersTransformation { + + export interface ProjectParametersTransformation extends Object { + /** + * The well-known ID of the datum transformation to apply to the projection. [List of valid IDs for Datum transformations](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000r8000000). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) + */ wkid?: number; + /** + * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to [setup and use a proxy page](https://developers.arcgis.com/javascript/latest/guide/proxies/index.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) + */ wkt?: string; } - interface Query extends Accessor { + interface Query extends Accessor, JSONSupport { + /** + * Buffer distance for input geometries. The distance unit is specified by [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units). Query results will include features within the distance specified of the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) of the query. This parameter only applies if [supportsQueryWithDistance](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Feature_Service_Layer/02r3000000r1000000/) is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) + */ distance: number; + /** + * The geometry to apply to the spatial filter. The spatial relationship as specified by `spatialRelationship` is applied to this geometry while performing the query. The valid geometry types are [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html), [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), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) + */ geometry: Geometry; + /** + * Specify the number of decimal places for the geometries returned by the query operation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometryPrecision) + */ geometryPrecision: number; + /** + * One or more field names that will be used to group the statistics. This is only valid when `outStatistics` has been defined. Requires ArcGIS Server service version 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) + */ groupByFieldsForStatistics: string[]; + /** + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) + */ maxAllowableOffset: number; + /** + * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint` and the xy footprint of each multipatch geometry will be returned in the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#multipatchOption) + */ multipatchOption: string; + /** + * Number of features to retrieve. Should be used in conjunction with [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging and retrieve "pages" of results when querying. If not provided, but an instance of Query has a start property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) + */ num: number; + /** + * A comma delimited list of ObjectIds for the features in the layer/table being queried. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) + */ objectIds: number[]; + /** + * One or more field names that will be used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. `orderByFields` is only supported on [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) and tables where `supportsAdvancedQueries = true`. *Requires ArcGIS Server service version 10.1 or greater.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields) + */ orderByFields: string[]; + /** + * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. You can set field alias names in the map document. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) + */ outFields: string[]; + /** + * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * The definitions for one or more field-based statistics to be calculated. `outStatistics` is only supported on layers/tables where `supportsStatistics = true`. If `outStatistics` is specified the only other query parameters that will be used are `groupByFieldsForStatistics`, `orderByFields`, `text` and `where`. *Requires ArcGIS Server service version 10.1 or greater.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) + */ outStatistics: StatisticDefinition[]; + /** + * Specify the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#pixelSize) + */ pixelSize: Symbol; + /** + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. *Only works with ArcGIS Online hosted services.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) + */ quantizationParameters: QueryQuantizationParameters; - relationParam: string; + /** + * The string describes the spatial relationship to be tested when the spatial relationship is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) + */ + relationParameter: string; + /** + * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) each polygon geometry will be returned with a centroid. This operation is only supported in ArcGIS Online hosted feature services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnCentroid) + * + * @default false + */ + returnCentroid: boolean; + /** + * If `true` then the query returns distinct values based on the fields specified in `outFields`. This parameter applies only if `supportsAdvancedQueries` property of the layer is `true`. *Requires ArcGIS Server 10.1 Service Pack 1 or later.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnDistinctValues) + * + * @default false + */ returnDistinctValues: boolean; + /** + * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. **Support is limited to feature services hosted on ArcGIS Online.** + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnExceededLimitFeatures) + * + * @default true + */ + returnExceededLimitFeatures: boolean; + /** + * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry takes up a significant portion of the response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) + * + * @default false + */ returnGeometry: boolean; + /** + * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are returned in the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) + * + * @default false + */ + returnM: boolean; + /** + * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are returned in the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnZ) + * + * @default false + */ returnZ: boolean; + /** + * The spatial relationship to be applied to the input geometry while performing the query. The valid values are listed in the table below: + * + * Value | Description + * ------|------------- + * intersects | Part of a feature from feature class 1 intersects a feature from feature class 2. + * contains | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. + * crosses | The feature from feature class 1 crosses a feature from feature class 2. + * envelope-intersects | The envelope of feature class 1 intersects with the envelope of feature class 2. + * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. + * overlaps | Features from feature class 1 overlap features in feature class 2. + * touches | The feature from feature class 1 touches the border of a feature from feature class 2. + * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. + * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) + * + * @default intersects + */ spatialRelationship: string; + /** + * Zero-based index indicating where to begin retrieving features. Should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) + */ start: number; + /** + * Shorthand for a where clause using "like". The field used is the display field defined in the map document. You can determine what the display field is for a layer in the Services Directory. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text) + * + * @default null + */ text: string; + /** + * The unit for calculating the buffer distance. if unit 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 spatial reference. This parameter only applies if [supportsQueryWithDistance](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Feature_Service_Layer/02r3000000r1000000/) is `true`. **Known Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) + */ units: string; + /** + * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. Be sure to have the correct sequence of single and double quotes when writing the where clause in JavaScript. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) + */ where: string; - toJSON(): any; + /** + * Creates a deep clone of Query object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#clone) + * + * + */ + clone(): Query; } interface QueryConstructor { + /** + * Query is used to define parameters to filter a layer's features, either by its attributes or its geometry. Once a Query object is created, you can set its properties to conform to the filtering requirements of the application. Once a Query object is created and its properties are set, it is then ready to be passed into an executable function in [QueryTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) (e.g. `QueryTask.execute(Query)`). The returned result is often a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) + */ + new(properties?: QueryProperties): Query; + + fromJSON(json: any): Query; } export const Query: QueryConstructor; interface QueryProperties { + /** + * Buffer distance for input geometries. The distance unit is specified by [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units). Query results will include features within the distance specified of the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) of the query. This parameter only applies if [supportsQueryWithDistance](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Feature_Service_Layer/02r3000000r1000000/) is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) + */ distance?: number; + /** + * The geometry to apply to the spatial filter. The spatial relationship as specified by `spatialRelationship` is applied to this geometry while performing the query. The valid geometry types are [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html), [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), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) + */ geometry?: GeometryProperties; + /** + * Specify the number of decimal places for the geometries returned by the query operation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometryPrecision) + */ geometryPrecision?: number; + /** + * One or more field names that will be used to group the statistics. This is only valid when `outStatistics` has been defined. Requires ArcGIS Server service version 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) + */ groupByFieldsForStatistics?: string[]; + /** + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) + */ maxAllowableOffset?: number; + /** + * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint` and the xy footprint of each multipatch geometry will be returned in the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#multipatchOption) + */ multipatchOption?: string; + /** + * Number of features to retrieve. Should be used in conjunction with [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging and retrieve "pages" of results when querying. If not provided, but an instance of Query has a start property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) + */ num?: number; + /** + * A comma delimited list of ObjectIds for the features in the layer/table being queried. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) + */ objectIds?: number[]; + /** + * One or more field names that will be used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. `orderByFields` is only supported on [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) and tables where `supportsAdvancedQueries = true`. *Requires ArcGIS Server service version 10.1 or greater.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields) + */ orderByFields?: string[]; + /** + * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. You can set field alias names in the map document. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) + */ outFields?: string[]; + /** + * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * The definitions for one or more field-based statistics to be calculated. `outStatistics` is only supported on layers/tables where `supportsStatistics = true`. If `outStatistics` is specified the only other query parameters that will be used are `groupByFieldsForStatistics`, `orderByFields`, `text` and `where`. *Requires ArcGIS Server service version 10.1 or greater.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) + */ outStatistics?: StatisticDefinitionProperties[]; + /** + * Specify the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#pixelSize) + */ pixelSize?: SymbolProperties; + /** + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. *Only works with ArcGIS Online hosted services.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) + */ quantizationParameters?: QueryQuantizationParameters; - relationParam?: string; + /** + * The string describes the spatial relationship to be tested when the spatial relationship is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) + */ + relationParameter?: string; + /** + * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) each polygon geometry will be returned with a centroid. This operation is only supported in ArcGIS Online hosted feature services. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnCentroid) + * + * @default false + */ + returnCentroid?: boolean; + /** + * If `true` then the query returns distinct values based on the fields specified in `outFields`. This parameter applies only if `supportsAdvancedQueries` property of the layer is `true`. *Requires ArcGIS Server 10.1 Service Pack 1 or later.* + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnDistinctValues) + * + * @default false + */ returnDistinctValues?: boolean; + /** + * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. **Support is limited to feature services hosted on ArcGIS Online.** + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnExceededLimitFeatures) + * + * @default true + */ + returnExceededLimitFeatures?: boolean; + /** + * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry takes up a significant portion of the response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) + * + * @default false + */ returnGeometry?: boolean; + /** + * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are returned in the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) + * + * @default false + */ + returnM?: boolean; + /** + * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are returned in the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnZ) + * + * @default false + */ returnZ?: boolean; + /** + * The spatial relationship to be applied to the input geometry while performing the query. The valid values are listed in the table below: + * + * Value | Description + * ------|------------- + * intersects | Part of a feature from feature class 1 intersects a feature from feature class 2. + * contains | Part or all of a feature from feature class 1 is contained within a feature from feature class 2. + * crosses | The feature from feature class 1 crosses a feature from feature class 2. + * envelope-intersects | The envelope of feature class 1 intersects with the envelope of feature class 2. + * index-intersects | The envelope of the query feature class intersects the index entry for the target feature class. + * overlaps | Features from feature class 1 overlap features in feature class 2. + * touches | The feature from feature class 1 touches the border of a feature from feature class 2. + * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. + * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) + * + * @default intersects + */ spatialRelationship?: string; + /** + * Zero-based index indicating where to begin retrieving features. Should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) + */ start?: number; + /** + * Shorthand for a where clause using "like". The field used is the display field defined in the map document. You can determine what the display field is for a layer in the Services Directory. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text) + * + * @default null + */ text?: string; + /** + * The unit for calculating the buffer distance. if unit 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 spatial reference. This parameter only applies if [supportsQueryWithDistance](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Feature_Service_Layer/02r3000000r1000000/) is `true`. **Known Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) + */ units?: string; + /** + * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. Be sure to have the correct sequence of single and double quotes when writing the where clause in JavaScript. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) + */ where?: string; } - export interface QueryQuantizationParameters { + + export interface QueryQuantizationParameters extends Object { + /** + * An extent defining the quantization grid bounds. Its [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) matches the input geometry spatial reference if one is specified for the query. Otherwise, the extent will be in the layer's spatial reference. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) + */ extent?: Extent; + /** + * Geometry coordinates are optimized for viewing and displaying of data. **Known Values:** view + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) + */ mode?: string; + /** + * The integer's coordinates will be returned relative to the origin position defined by this property value. **Known Values:** upper-left | lower-left + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) + * + * @default upper-left + */ originPosition?: string; + /** + * The size of one pixel in the units of outSpatialReference. This number is used to convert coordinates to integers by building a grid with a resolution matching the tolerance. Each coordinate is then snapped to one pixel on the grid. Consecutive coordinates snapped to the same pixel are removed for reducing the overall response size. The units of tolerance will match the units of outSpatialReference. If outSpatialReference is not specified, then tolerance is assumed to be in the units of the spatial reference of the layer. If tolerance is not specified, the maxAllowableOffset is used. If tolerance and maxAllowableOffset are not specified, a grid of 10,000 * 10,000 grid is used by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) + */ tolerance?: number; } interface RasterData extends Accessor, JSONSupport { + /** + * Specifies the format of the raster data, such as "jpg", "tif", etc. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#format) + */ format: string; + /** + * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater, this class can be used to specify an uploaded item as input by specifying the ItemID. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#itemId) + */ itemId: string; + /** + * URL to the location of the raster data file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#url) + */ url: string; } interface RasterDataConstructor { + + new(properties?: RasterDataProperties): RasterData; fromJSON(json: any): RasterData; @@ -6880,159 +28828,791 @@ declare namespace __esri { export const RasterData: RasterDataConstructor; interface RasterDataProperties { + /** + * Specifies the format of the raster data, such as "jpg", "tif", etc. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#format) + */ format?: string; + /** + * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater, this class can be used to specify an uploaded item as input by specifying the ItemID. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#itemId) + */ itemId?: string; + /** + * URL to the location of the raster data file. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#url) + */ url?: string; } interface RelationParameters extends Accessor { + /** + * The first array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries1) + */ geometries1: Geometry[]; + /** + * The second array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries2) + */ geometries2: Geometry[]; + /** + * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. + * + * Value | Description + * ------|------------ + * cross | Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline in common on the interior of the polygon which is not equivalent to the entire polyline. Cross is a Clementini operator. If either one of the geometries is empty, the geometries do not cross. + * disjoint | Two geometries are disjoint if their intersection is empty. Two geometries intersect if disjoint is "false". + * in | The base geometry is within the comparison geometry if the base geometry is the intersection of the geometries and the intersection of their interiors is not empty. An empty geometry is within another geometry, unless the other geometry is empty. + * interior-intersection | Geometries intersect excluding boundary touch. + * intersection | Geometry interiors intersect or boundaries touch, same as 'not disjoint'. + * line-coincidence | The boundaries of the geometries must share an intersection, but the relationship between the interiors of the shapes is not considered (they could overlap, one could be contained in the other, or their interiors could be disjoint). This relation applies to polylines and polygons. + * line-touch | Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. This evaluates if the touch occurs along a boundary (not a point). Valid for polygons. + * overlap | Two polylines share a common sub-line, or two polygons share a common sub-area. Two geometries do not overlap if either one is empty. + * point-touch | Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. This evaluates if the touch occurs at a point (not a boundary). + * relation | Allows specification of any relationship defined using the Shape Comparison Language. If this value is used, a value for `relationParameter` must be specified. + * touch | The union of point touch and line touch. Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. For example, a point touches a polyline only if the point is coincident with one of the polyline end points. If either one of the two geometries is empty, the geometries are not touched. + * within | Same as `in` but also allows polylines that are strictly on the boundaries of polygons to be considered in the polygon. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relation) + */ relation: string; - relationParam: string; + /** + * The string describes the spatial relationship to be tested when `RelationParameters.relation = 'relation'`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. An example of a valid string is: `FFFTTT**`. Also see the description of [geometryEngine.relate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) for additional examples of valid strings. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relationParameter) + */ + relationParameter: string; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#toJSON) + * + * + */ toJSON(): any; } interface RelationParametersConstructor { + + new(properties?: RelationParametersProperties): RelationParameters; } export const RelationParameters: RelationParametersConstructor; interface RelationParametersProperties { + /** + * The first array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries1) + */ geometries1?: GeometryProperties[]; + /** + * The second array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries2) + */ geometries2?: GeometryProperties[]; + /** + * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. + * + * Value | Description + * ------|------------ + * cross | Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline in common on the interior of the polygon which is not equivalent to the entire polyline. Cross is a Clementini operator. If either one of the geometries is empty, the geometries do not cross. + * disjoint | Two geometries are disjoint if their intersection is empty. Two geometries intersect if disjoint is "false". + * in | The base geometry is within the comparison geometry if the base geometry is the intersection of the geometries and the intersection of their interiors is not empty. An empty geometry is within another geometry, unless the other geometry is empty. + * interior-intersection | Geometries intersect excluding boundary touch. + * intersection | Geometry interiors intersect or boundaries touch, same as 'not disjoint'. + * line-coincidence | The boundaries of the geometries must share an intersection, but the relationship between the interiors of the shapes is not considered (they could overlap, one could be contained in the other, or their interiors could be disjoint). This relation applies to polylines and polygons. + * line-touch | Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. This evaluates if the touch occurs along a boundary (not a point). Valid for polygons. + * overlap | Two polylines share a common sub-line, or two polygons share a common sub-area. Two geometries do not overlap if either one is empty. + * point-touch | Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. This evaluates if the touch occurs at a point (not a boundary). + * relation | Allows specification of any relationship defined using the Shape Comparison Language. If this value is used, a value for `relationParameter` must be specified. + * touch | The union of point touch and line touch. Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. For example, a point touches a polyline only if the point is coincident with one of the polyline end points. If either one of the two geometries is empty, the geometries are not touched. + * within | Same as `in` but also allows polylines that are strictly on the boundaries of polygons to be considered in the polygon. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relation) + */ relation?: string; - relationParam?: string; + /** + * The string describes the spatial relationship to be tested when `RelationParameters.relation = 'relation'`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. An example of a valid string is: `FFFTTT**`. Also see the description of [geometryEngine.relate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) for additional examples of valid strings. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relationParameter) + */ + relationParameter?: string; } interface RelationshipQuery extends Accessor { + /** + * The definition expression to be applied to the related table or layer. Only records that fit the definition expression and are in the list of `objectIds` will be returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#definitionExpression) + */ definitionExpression: string; + /** + * Specify the number of decimal places for the geometries returned by the query operation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#geometryPrecision) + */ geometryPrecision: number; + /** + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of the `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#maxAllowableOffset) + */ maxAllowableOffset: number; + /** + * A comma delimited list of `ObjectIds` for the features in the layer/table that you want to query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) + */ objectIds: number[]; + /** + * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the map layer. You must list the actual field names rather than the alias names. Returned fields are also the actual field names. However, you are able to use the alias names when you display the results. You can set field alias names in the map document. When you specify the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer, but your list of fields does not need to include these two fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outFields) + */ outFields: string[]; + /** + * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * The ID of the relationship to test. The ids for the relationships the table or layer participates in are listed in the ArcGIS Services directory. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#relationshipId) + */ relationshipId: number; + /** + * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry makes up a significant portion of the response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#returnGeometry) + */ returnGeometry: boolean; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#toJSON) + * + * + */ toJSON(): any; } interface RelationshipQueryConstructor { + + new(properties?: RelationshipQueryProperties): RelationshipQuery; } export const RelationshipQuery: RelationshipQueryConstructor; interface RelationshipQueryProperties { + /** + * The definition expression to be applied to the related table or layer. Only records that fit the definition expression and are in the list of `objectIds` will be returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#definitionExpression) + */ definitionExpression?: string; + /** + * Specify the number of decimal places for the geometries returned by the query operation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#geometryPrecision) + */ geometryPrecision?: number; + /** + * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of the `outSpatialReference`. If `outSpatialReference` is not defined, the spatial reference of the map is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#maxAllowableOffset) + */ maxAllowableOffset?: number; + /** + * A comma delimited list of `ObjectIds` for the features in the layer/table that you want to query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) + */ objectIds?: number[]; + /** + * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the map layer. You must list the actual field names rather than the alias names. Returned fields are also the actual field names. However, you are able to use the alias names when you display the results. You can set field alias names in the map document. When you specify the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer, but your list of fields does not need to include these two fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outFields) + */ outFields?: string[]; + /** + * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * The ID of the relationship to test. The ids for the relationships the table or layer participates in are listed in the ArcGIS Services directory. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#relationshipId) + */ relationshipId?: number; + /** + * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry makes up a significant portion of the response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#returnGeometry) + */ returnGeometry?: boolean; } interface RouteParameters extends Accessor { + /** + * The list of network attribute names to be accumulated with the analysis. For example, which attributes should be returned as part of the response. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. See also [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#accumulateAttributes) + */ accumulateAttributes: string[]; + /** + * Each element in the array is an object that describes the parameter values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) + */ attributeParameterValues: AttributeParamValue; + /** + * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1 an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#barriers) + */ barriers: DataLayer | FeatureSet; + /** + * The language used when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). By default, NAServer gets installed with `en_US` only - it is up to the server administrator to add additional languages. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLanguage) + */ directionsLanguage: string; + /** + * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) + */ directionsLengthUnits: string; + /** + * Defines the amount of direction information returned. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType) + * + * @default standard + */ directionsOutputType: string; + /** + * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsStyleName) + */ directionsStyleName: string; + /** + * The name of network attribute to use for the drive time when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute) + */ directionsTimeAttribute: string; + /** + * If `true`, avoids network elements restricted by barriers or restrictions specified in [restrictionAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#doNotLocateOnRestrictedElements) + * + * @default true + */ doNotLocateOnRestrictedElements: boolean; + /** + * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: + * ```js + * routeParams.findBestSequence = true; + * routeParams.preserveFirstStop = false; + * routeParams.preserveLastStop = false; + * routeParams.returnStops = true; + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#findBestSequence) + */ findBestSequence: boolean; + /** + * In routes where a stop is not located on a network or a stop could not be reached, the results will differ depending on the value of this property: + * * When `false`, the solve operation will fail if at least one of the stops specified cannot be located or reached. + * * When `true`, as long as there are at least two valid stops that have been connected by a route, a valid result is returned. If multiple routes are processed in a single request, as long as least one route is built, a valid result is returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#ignoreInvalidLocations) + */ ignoreInvalidLocations: boolean; + /** + * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#impedanceAttribute) + */ impedanceAttribute: string; + /** + * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to `IPolycurve.Generalize`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecision) + */ outputGeometryPrecision: number; + /** + * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) + */ outputGeometryPrecisionUnits: string; + /** + * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** none | straight | true-shape | true-shape-with-measure + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputLines) + * + * @default true-shape + */ outputLines: string; + /** + * The well-known ID of the spatial reference for the geometries returned with the analysis results. If not specified, the geometries are returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polygonBarriers) + */ polygonBarriers: DataLayer | FeatureSet; + /** + * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polylineBarriers) + */ polylineBarriers: DataLayer | FeatureSet; + /** + * If `true`, keeps the first stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveFirstStop) + */ preserveFirstStop: boolean; + /** + * If `true`, keeps the last stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveLastStop) + */ preserveLastStop: boolean; + /** + * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). Possible values are listed in the Service Directory under `Network Dataset -> Network Attributes`. You can also specify a value of `none` to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes) + */ restrictionAttributes: string[]; + /** + * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) + */ restrictUTurns: string; + /** + * If `true`, barriers are returned with the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnBarriers) + * + * @default false + */ returnBarriers: boolean; + /** + * If `true`, barriers are returned in the [directions property of each RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnDirections) + * + * @default false + */ returnDirections: boolean; + /** + * If `true`, polygon barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolygonBarriers) + * + * @default false + */ returnPolygonBarriers: boolean; + /** + * If `true`, polyline barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolylineBarriers) + * + * @default false + */ returnPolylineBarriers: boolean; + /** + * If `true`, routes are generated and returned in the route property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnRoutes) + * + * @default true + */ returnRoutes: boolean; + /** + * If `true`, stops are returned in the stops property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnStops) + * + * @default false + */ returnStops: boolean; + /** + * If `true`, `z` values are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnZ) + * + * @default true + */ returnZ: boolean; + /** + * The time the route begins. If not specified, the default is the time specified in the route service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTime) + */ startTime: Date; + /** + * If `true`, the start time will be in UTC format. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTimeIsUTC) + */ startTimeIsUTC: boolean; + /** + * The set of stops loaded as network locations during analysis. When `stops` takes a FeatureSet, each feature in the FeatureSet must have a defined spatial reference. If the feature contains `x` and `y` attributes, those values are used for the stop, even if the feature includes geometry. At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The `url` property can be specified using DataFile Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops) + */ stops: DataLayer | FeatureSet; + /** + * If `true`, the hierarchy attribute for the network should be used in analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useHierarchy) + */ useHierarchy: boolean; + /** + * A useful feature of the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) is the ability to constrain stop visits to certain times of day, or "time windows". If you were required to deliver orders to four homes and each customer was available during a limited time period during the day, the route task could help you find the most efficient path for making all the deliveries. Time windows are treated as a "soft" constraint. This means that although the solver attempts to honor time windows, if necessary, it will violate the time windows of some stops in order to reach them. Remember, the stops will be visited in the order they were added unless you set `RouteParameters.findBestSequence = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useTimeWindows) + */ useTimeWindows: boolean; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#toJSON) + * + * + */ toJSON(): any; } interface RouteParametersConstructor { + + new(properties?: RouteParametersProperties): RouteParameters; } export const RouteParameters: RouteParametersConstructor; interface RouteParametersProperties { + /** + * The list of network attribute names to be accumulated with the analysis. For example, which attributes should be returned as part of the response. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. See also [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#accumulateAttributes) + */ accumulateAttributes?: string[]; + /** + * Each element in the array is an object that describes the parameter values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) + */ attributeParameterValues?: AttributeParamValue; + /** + * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1 an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#barriers) + */ barriers?: DataLayerProperties | FeatureSetProperties; + /** + * The language used when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). By default, NAServer gets installed with `en_US` only - it is up to the server administrator to add additional languages. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLanguage) + */ directionsLanguage?: string; + /** + * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) + */ directionsLengthUnits?: string; + /** + * Defines the amount of direction information returned. **Known Values:** complete | complete-no-events | instructions-only | standard | summary-only + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType) + * + * @default standard + */ directionsOutputType?: string; + /** + * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsStyleName) + */ directionsStyleName?: string; + /** + * The name of network attribute to use for the drive time when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute) + */ directionsTimeAttribute?: string; + /** + * If `true`, avoids network elements restricted by barriers or restrictions specified in [restrictionAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#doNotLocateOnRestrictedElements) + * + * @default true + */ doNotLocateOnRestrictedElements?: boolean; + /** + * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: + * ```js + * routeParams.findBestSequence = true; + * routeParams.preserveFirstStop = false; + * routeParams.preserveLastStop = false; + * routeParams.returnStops = true; + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#findBestSequence) + */ findBestSequence?: boolean; + /** + * In routes where a stop is not located on a network or a stop could not be reached, the results will differ depending on the value of this property: + * * When `false`, the solve operation will fail if at least one of the stops specified cannot be located or reached. + * * When `true`, as long as there are at least two valid stops that have been connected by a route, a valid result is returned. If multiple routes are processed in a single request, as long as least one route is built, a valid result is returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#ignoreInvalidLocations) + */ ignoreInvalidLocations?: boolean; + /** + * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#impedanceAttribute) + */ impedanceAttribute?: string; + /** + * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to `IPolycurve.Generalize`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecision) + */ outputGeometryPrecision?: number; + /** + * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) + */ outputGeometryPrecisionUnits?: string; + /** + * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** none | straight | true-shape | true-shape-with-measure + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputLines) + * + * @default true-shape + */ outputLines?: string; + /** + * The well-known ID of the spatial reference for the geometries returned with the analysis results. If not specified, the geometries are returned in the spatial reference of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polygonBarriers) + */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; + /** + * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polylineBarriers) + */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; + /** + * If `true`, keeps the first stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveFirstStop) + */ preserveFirstStop?: boolean; + /** + * If `true`, keeps the last stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveLastStop) + */ preserveLastStop?: boolean; + /** + * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). Possible values are listed in the Service Directory under `Network Dataset -> Network Attributes`. You can also specify a value of `none` to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes) + */ restrictionAttributes?: string[]; + /** + * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Known Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) + */ restrictUTurns?: string; + /** + * If `true`, barriers are returned with the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnBarriers) + * + * @default false + */ returnBarriers?: boolean; + /** + * If `true`, barriers are returned in the [directions property of each RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnDirections) + * + * @default false + */ returnDirections?: boolean; + /** + * If `true`, polygon barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolygonBarriers) + * + * @default false + */ returnPolygonBarriers?: boolean; + /** + * If `true`, polyline barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolylineBarriers) + * + * @default false + */ returnPolylineBarriers?: boolean; + /** + * If `true`, routes are generated and returned in the route property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnRoutes) + * + * @default true + */ returnRoutes?: boolean; + /** + * If `true`, stops are returned in the stops property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnStops) + * + * @default false + */ returnStops?: boolean; + /** + * If `true`, `z` values are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnZ) + * + * @default true + */ returnZ?: boolean; + /** + * The time the route begins. If not specified, the default is the time specified in the route service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTime) + */ startTime?: DateProperties; + /** + * If `true`, the start time will be in UTC format. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTimeIsUTC) + */ startTimeIsUTC?: boolean; + /** + * The set of stops loaded as network locations during analysis. When `stops` takes a FeatureSet, each feature in the FeatureSet must have a defined spatial reference. If the feature contains `x` and `y` attributes, those values are used for the stop, even if the feature includes geometry. At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The `url` property can be specified using DataFile Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops) + */ stops?: DataLayerProperties | FeatureSetProperties; + /** + * If `true`, the hierarchy attribute for the network should be used in analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useHierarchy) + */ useHierarchy?: boolean; + /** + * A useful feature of the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) is the ability to constrain stop visits to certain times of day, or "time windows". If you were required to deliver orders to four homes and each customer was available during a limited time period during the day, the route task could help you find the most efficient path for making all the deliveries. Time windows are treated as a "soft" constraint. This means that although the solver attempts to honor time windows, if necessary, it will violate the time windows of some stops in order to reach them. Remember, the stops will be visited in the order they were added unless you set `RouteParameters.findBestSequence = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useTimeWindows) + */ useTimeWindows?: boolean; } - export interface AttributeParamValue { + /** + * An object describing the parameter values for the [attributeParameterValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) property of [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) + */ + export interface AttributeParamValue extends Object { + /** + * The name of the attribute. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) + */ attributeName: string; + /** + * The name of the parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) + */ parameterName: string; + /** + * The parameter's value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) + */ value: string; } interface RouteResult extends Accessor, JSONSupport { + /** + * Route directions are returned if `RouteParameters.returnDirections = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions) + */ directions: DirectionsFeatureSet; + /** + * The Route graphic that is returned if `RouteParameters.returnRoutes = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#route) + */ route: Graphic; + /** + * The name of the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#routeName) + */ routeName: string; + /** + * Array of stops. Returned only if `RouteParameters.returnStops = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#stops) + */ stops: Graphic[]; } interface RouteResultConstructor { + + new(properties?: RouteResultProperties): RouteResult; fromJSON(json: any): RouteResult; @@ -7041,101 +29621,583 @@ declare namespace __esri { export const RouteResult: RouteResultConstructor; interface RouteResultProperties { + /** + * Route directions are returned if `RouteParameters.returnDirections = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions) + */ directions?: DirectionsFeatureSetProperties; + /** + * The Route graphic that is returned if `RouteParameters.returnRoutes = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#route) + */ route?: GraphicProperties; + /** + * The name of the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#routeName) + */ routeName?: string; + /** + * Array of stops. Returned only if `RouteParameters.returnStops = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#stops) + */ stops?: GraphicProperties[]; } interface ServiceAreaParameters extends Accessor { + /** + * The list of network attribute names to be accumulated with the analysis (i.e. which attributes should be returned as part of the response). The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#accumulateAttributes) + */ accumulateAttributes: string[]; + /** + * A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle. The parameter holding a vehicle characteristic is compared to a value coming from a descriptor attribute to determine whether or not a network element is traversable. For example, a parameterized restriction attribute can compare the height of your vehicle with a descriptor attribute that holds the clearance under overpasses through tunnels. If the vehicle's height is greater than the clearance, the edge is restricted. Parameterized cost attributes that reference other cost attributes and scale them, can also be used. This is useful when inclement weather like ice, fog or heavy rain, descends on the study area and hinders normal flow of traffic. By having a parameter already outfitted on a cost attribute, travel-time expectations and traversable network paths can be adjusted with respect to changes in traffic speeds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#attributeParameterValues) + */ attributeParameterValues: any[]; + /** + * An array of numbers defining the breaks. The default value is defined in the network analysis layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#defaultBreaks) + */ defaultBreaks: number[]; + /** + * When `true`, restricted network elements should be considered when finding network locations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#doNotLocateOnRestrictedElements) + * + * @default true + */ doNotLocateOnRestrictedElements: boolean; + /** + * An array of network source names to NOT use when generating polygons. This property specifies if certain network sources should be excluded from the service area polygon generation. A service area on a multi-modal network where only one mode is being used to compute the service area would get a more appropriate shape if other modes are excluded from the polygons. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#excludeSourcesFromPolygons) + */ excludeSourcesFromPolygons: string[]; + /** + * The set of facilities loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using `DataFile`. Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#facilities) + */ facilities: DataLayer | FeatureSet; + /** + * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive. Assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000000M000000.htm) ArcGIS desktop help topic for more details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#impedanceAttribute) + */ impedanceAttribute: string; + /** + * If `true`, similar ranges will be merged in the resulting polygons. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#mergeSimilarPolygonRanges) + * + * @default false + */ mergeSimilarPolygonRanges: boolean; + /** + * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to IPolycurve.Generalize. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecision) + */ outputGeometryPrecision: number; + /** + * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) + */ outputGeometryPrecisionUnits: string; + /** + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * 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 measurments + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines) + */ outputLines: string; + /** + * The type of output polygons to be generated in the result. The default is as defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). **Possible Values:** none | simplified | detailed + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputPolygons) + */ outputPolygons: string; + /** + * The well-known ID of the spatial reference for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outSpatialReference) + */ outSpatialReference: SpatialReference; + /** + * Indicates if the lines should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapLines) + * + * @default false + */ overlapLines: boolean; + /** + * Indicates if the polygons should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapPolygons) + * + * @default false + */ overlapPolygons: boolean; + /** + * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#pointBarriers) + */ pointBarriers: DataLayer | FeatureSet; + /** + * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polygonBarriers) + */ polygonBarriers: DataLayer | FeatureSet; + /** + * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polylineBarriers) + */ polylineBarriers: DataLayer | FeatureSet; + /** + * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictionAttributes) + */ restrictionAttributes: string[]; + /** + * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. + * + * Possible Value | Description + * ---------------|------------ + * allow-backtrack | Allows U-turns on everywhere + * at-dead-ends-only | Only allows U-turns at dead ends + * no-backtrack | Restricts U-turns everywhere + * at-dead-ends-and-intersections | Only allows U-turns at dead ends and intersections + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictUTurns) + */ restrictUTurns: string; + /** + * If `true`, facilities will be returned with the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnFacilities) + * + * @default false + */ returnFacilities: boolean; + /** + * If `true`, point barriers will be returned in the [pointBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) property of the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPointBarriers) + * + * @default false + */ returnPointBarriers: boolean; + /** + * If `true`, polygon barriers will be returned in the [polygonBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) property of the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolygonBarriers) + * + * @default false + */ returnPolygonBarriers: boolean; + /** + * If `true`, polyline barriers will be returned in the [polylineBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) property of the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolylineBarriers) + * + * @default false + */ returnPolylineBarriers: boolean; + /** + * If `true`, lines will be split at breaks. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitLinesAtBreaks) + * + * @default false + */ splitLinesAtBreaks: boolean; + /** + * If `true`, polygons will be split at breaks. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitPolygonsAtBreaks) + * + * @default false + */ splitPolygonsAtBreaks: boolean; + /** + * Local date and time at the facility. if `travelDirection = "esriNATravelDirectionToFacility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "esriNATravelDirectionFromFacility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#timeOfDay) + */ timeOfDay: Date; + /** + * Options for traveling to or from the facility. Default values are defined by the network layer. + * + * Possible Value | Description + * ---------------|------------ + * from-facility | Sets travel direction from the facility + * to-facility | Sets travel direction to the facility + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelDirection) + */ travelDirection: string; + /** + * If `true`, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimOuterPolygon) + * + * @default false + */ trimOuterPolygon: boolean; + /** + * If polygons are being trimmed, provides the distance to trim. The default value is defined in the network analysis layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance) + */ trimPolygonDistance: number; + /** + * If polygons are being trimmed, specifies the units of [trimPolygonDistance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance). The default is defined in the network analysis layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistanceUnits) + */ trimPolygonDistanceUnits: string; + /** + * When `true`, the hierarchy attributes for the network will be used in the analysis. The default value is defined in the network layer. `useHierarchy` cannot be used in conjunction with [outputLines](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines). Requires an ArcGIS Server service version 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#useHierarchy) + */ useHierarchy: boolean; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#toJSON) + * + * + */ toJSON(): any; } interface ServiceAreaParametersConstructor { + /** + * Input parameters for [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html) + */ + new(properties?: ServiceAreaParametersProperties): ServiceAreaParameters; } export const ServiceAreaParameters: ServiceAreaParametersConstructor; interface ServiceAreaParametersProperties { + /** + * The list of network attribute names to be accumulated with the analysis (i.e. which attributes should be returned as part of the response). The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#accumulateAttributes) + */ accumulateAttributes?: string[]; + /** + * A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle. The parameter holding a vehicle characteristic is compared to a value coming from a descriptor attribute to determine whether or not a network element is traversable. For example, a parameterized restriction attribute can compare the height of your vehicle with a descriptor attribute that holds the clearance under overpasses through tunnels. If the vehicle's height is greater than the clearance, the edge is restricted. Parameterized cost attributes that reference other cost attributes and scale them, can also be used. This is useful when inclement weather like ice, fog or heavy rain, descends on the study area and hinders normal flow of traffic. By having a parameter already outfitted on a cost attribute, travel-time expectations and traversable network paths can be adjusted with respect to changes in traffic speeds. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#attributeParameterValues) + */ attributeParameterValues?: any[]; + /** + * An array of numbers defining the breaks. The default value is defined in the network analysis layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#defaultBreaks) + */ defaultBreaks?: number[]; + /** + * When `true`, restricted network elements should be considered when finding network locations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#doNotLocateOnRestrictedElements) + * + * @default true + */ doNotLocateOnRestrictedElements?: boolean; + /** + * An array of network source names to NOT use when generating polygons. This property specifies if certain network sources should be excluded from the service area polygon generation. A service area on a multi-modal network where only one mode is being used to compute the service area would get a more appropriate shape if other modes are excluded from the polygons. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#excludeSourcesFromPolygons) + */ excludeSourcesFromPolygons?: string[]; + /** + * The set of facilities loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using `DataFile`. Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#facilities) + */ facilities?: DataLayerProperties | FeatureSetProperties; + /** + * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive. Assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00470000000M000000.htm) ArcGIS desktop help topic for more details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#impedanceAttribute) + */ impedanceAttribute?: string; + /** + * If `true`, similar ranges will be merged in the resulting polygons. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#mergeSimilarPolygonRanges) + * + * @default false + */ mergeSimilarPolygonRanges?: boolean; + /** + * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to IPolycurve.Generalize. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecision) + */ outputGeometryPrecision?: number; + /** + * The units of the output geometry precision. **Known Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) + */ outputGeometryPrecisionUnits?: string; + /** + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * 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 measurments + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines) + */ outputLines?: string; + /** + * The type of output polygons to be generated in the result. The default is as defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). **Possible Values:** none | simplified | detailed + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputPolygons) + */ outputPolygons?: string; + /** + * The well-known ID of the spatial reference for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outSpatialReference) + */ outSpatialReference?: SpatialReferenceProperties; + /** + * Indicates if the lines should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapLines) + * + * @default false + */ overlapLines?: boolean; + /** + * Indicates if the polygons should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapPolygons) + * + * @default false + */ overlapPolygons?: boolean; + /** + * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#pointBarriers) + */ pointBarriers?: DataLayerProperties | FeatureSetProperties; + /** + * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polygonBarriers) + */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; + /** + * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polylineBarriers) + */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; + /** + * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictionAttributes) + */ restrictionAttributes?: string[]; + /** + * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. + * + * Possible Value | Description + * ---------------|------------ + * allow-backtrack | Allows U-turns on everywhere + * at-dead-ends-only | Only allows U-turns at dead ends + * no-backtrack | Restricts U-turns everywhere + * at-dead-ends-and-intersections | Only allows U-turns at dead ends and intersections + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictUTurns) + */ restrictUTurns?: string; + /** + * If `true`, facilities will be returned with the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnFacilities) + * + * @default false + */ returnFacilities?: boolean; + /** + * If `true`, point barriers will be returned in the [pointBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) property of the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPointBarriers) + * + * @default false + */ returnPointBarriers?: boolean; + /** + * If `true`, polygon barriers will be returned in the [polygonBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) property of the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolygonBarriers) + * + * @default false + */ returnPolygonBarriers?: boolean; + /** + * If `true`, polyline barriers will be returned in the [polylineBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) property of the analysis results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolylineBarriers) + * + * @default false + */ returnPolylineBarriers?: boolean; + /** + * If `true`, lines will be split at breaks. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitLinesAtBreaks) + * + * @default false + */ splitLinesAtBreaks?: boolean; + /** + * If `true`, polygons will be split at breaks. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitPolygonsAtBreaks) + * + * @default false + */ splitPolygonsAtBreaks?: boolean; + /** + * Local date and time at the facility. if `travelDirection = "esriNATravelDirectionToFacility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "esriNATravelDirectionFromFacility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#timeOfDay) + */ timeOfDay?: DateProperties; + /** + * Options for traveling to or from the facility. Default values are defined by the network layer. + * + * Possible Value | Description + * ---------------|------------ + * from-facility | Sets travel direction from the facility + * to-facility | Sets travel direction to the facility + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelDirection) + */ travelDirection?: string; + /** + * If `true`, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimOuterPolygon) + * + * @default false + */ trimOuterPolygon?: boolean; + /** + * If polygons are being trimmed, provides the distance to trim. The default value is defined in the network analysis layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance) + */ trimPolygonDistance?: number; + /** + * If polygons are being trimmed, specifies the units of [trimPolygonDistance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance). The default is defined in the network analysis layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistanceUnits) + */ trimPolygonDistanceUnits?: string; + /** + * When `true`, the hierarchy attributes for the network will be used in the analysis. The default value is defined in the network layer. `useHierarchy` cannot be used in conjunction with [outputLines](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines). Requires an ArcGIS Server service version 10.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#useHierarchy) + */ useHierarchy?: boolean; } interface ServiceAreaSolveResult extends Accessor, JSONSupport { + /** + * Array of points only returned if `ServiceAreaParameters.returnFacilities = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#facilities) + */ facilities: Point[]; + /** + * Message received when solve is completed. If a service area cannot be solved, the message returned by the server identifies the incident that could not be solved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#messages) + */ messages: NAMessage[]; + /** + * The point barriers are returned only if `ServiceAreaParameters.returnPointBarriers = true` (which is not the default). If you send in the point barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) + */ pointBarriers: Point[]; + /** + * The polygon barriers are returned only if `ServiceAreaParameters.returnPolygonBarriers = true` (which is not the default). If you send in the polygon barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) + */ polygonBarriers: Polygon[]; + /** + * The polyline barriers are returned only if `ServiceAreaParameters.returnPolylineBarriers = true` (which is not the default). If you send in the polyline barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) + */ polylineBarriers: Polyline[]; + /** + * An array of service area polygon graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolygons) + */ serviceAreaPolygons: Graphic[]; + /** + * An array of service area polyline graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolylines) + */ serviceAreaPolylines: Graphic[]; } interface ServiceAreaSolveResultConstructor { + /** + * The result from [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html) + */ + new(properties?: ServiceAreaSolveResultProperties): ServiceAreaSolveResult; fromJSON(json: any): ServiceAreaSolveResult; @@ -7144,842 +30206,4021 @@ declare namespace __esri { export const ServiceAreaSolveResult: ServiceAreaSolveResultConstructor; interface ServiceAreaSolveResultProperties { + /** + * Array of points only returned if `ServiceAreaParameters.returnFacilities = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#facilities) + */ facilities?: PointProperties[]; + /** + * Message received when solve is completed. If a service area cannot be solved, the message returned by the server identifies the incident that could not be solved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#messages) + */ messages?: NAMessageProperties[]; + /** + * The point barriers are returned only if `ServiceAreaParameters.returnPointBarriers = true` (which is not the default). If you send in the point barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) + */ pointBarriers?: PointProperties[]; + /** + * The polygon barriers are returned only if `ServiceAreaParameters.returnPolygonBarriers = true` (which is not the default). If you send in the polygon barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) + */ polygonBarriers?: PolygonProperties[]; + /** + * The polyline barriers are returned only if `ServiceAreaParameters.returnPolylineBarriers = true` (which is not the default). If you send in the polyline barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) + */ polylineBarriers?: PolylineProperties[]; + /** + * An array of service area polygon graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolygons) + */ serviceAreaPolygons?: GraphicProperties[]; + /** + * An array of service area polyline graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolylines) + */ serviceAreaPolylines?: GraphicProperties[]; } - interface StatisticDefinition extends Accessor { + interface StatisticDefinition extends Accessor, JSONSupport { + /** + * Defines the field for which statistics will be calculated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#onStatisticField) + */ onStatisticField: string; + /** + * Specifies the output field name. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the map server assigns a field name to the returned statistic field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#outStatisticFieldName) + */ outStatisticFieldName: string; + /** + * Defines the type of statistic. **Known Values:** count | sum | min | max | avg | stddev | var + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) + */ statisticType: string; - - toJSON(): any; } interface StatisticDefinitionConstructor { + + new(properties?: StatisticDefinitionProperties): StatisticDefinition; + + fromJSON(json: any): StatisticDefinition; } export const StatisticDefinition: StatisticDefinitionConstructor; interface StatisticDefinitionProperties { + /** + * Defines the field for which statistics will be calculated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#onStatisticField) + */ onStatisticField?: string; + /** + * Specifies the output field name. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the map server assigns a field name to the returned statistic field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#outStatisticFieldName) + */ outStatisticFieldName?: string; + /** + * Defines the type of statistic. **Known Values:** count | sum | min | max | avg | stddev | var + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) + */ statisticType?: string; } interface TrimExtendParameters extends Accessor { + /** + * A flag used with the `trimExtend` operation. + * + * Possible Value | Description + * ---------------|------------- + * default-curve-extension | The extension considers both ends of the path. The old ends remain and new points are added to the extended ends. The new points have attributes that are extrapolated from existing adjacent segments. + * relocate-ends | When an extension is performed at an end, relocate the end point to the new position. + * keep-end-attributes | When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. Instead, the attributes will be the same as the current end. + * no-end-attributes | When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. Instead the attributes will be empty. + * no-extend-at-from | Do not extend the 'from' end of any path. + * no-extend-at-to | Do not extend the 'to' end of any path. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#extendHow) + * + * @default default-curve-extension + */ extendHow: string; + /** + * The array of polylines to trim or extend. The structure of each geometry in the array is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#polylines) + */ polylines: Polyline[]; + /** + * A polyline used as a guide for trimming or extending input polylines. The structure of the polyline is the same as the structure of the JSON polyline object returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#trimExtendTo) + */ trimExtendTo: Polyline; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#toJSON) + * + * + */ toJSON(): any; } interface TrimExtendParametersConstructor { + + new(properties?: TrimExtendParametersProperties): TrimExtendParameters; } export const TrimExtendParameters: TrimExtendParametersConstructor; interface TrimExtendParametersProperties { + /** + * A flag used with the `trimExtend` operation. + * + * Possible Value | Description + * ---------------|------------- + * default-curve-extension | The extension considers both ends of the path. The old ends remain and new points are added to the extended ends. The new points have attributes that are extrapolated from existing adjacent segments. + * relocate-ends | When an extension is performed at an end, relocate the end point to the new position. + * keep-end-attributes | When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. Instead, the attributes will be the same as the current end. + * no-end-attributes | When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. Instead the attributes will be empty. + * no-extend-at-from | Do not extend the 'from' end of any path. + * no-extend-at-to | Do not extend the 'to' end of any path. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#extendHow) + * + * @default default-curve-extension + */ extendHow?: string; + /** + * The array of polylines to trim or extend. The structure of each geometry in the array is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#polylines) + */ polylines?: PolylineProperties[]; + /** + * A polyline used as a guide for trimming or extending input polylines. The structure of the polyline is the same as the structure of the JSON polyline object returned by the ArcGIS REST API. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#trimExtendTo) + */ trimExtendTo?: PolylineProperties; } interface Task extends Accessor { + /** + * The [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for data requests. These options can also be controlled through the `requestOptions` method parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#requestOptions) + */ requestOptions: any; + /** + * The ArcGIS Server REST service URL (usually of a Feature Service Layer or Map Service Layer) for use in a task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#url) + */ url: string; } interface TaskConstructor { + + new(properties?: TaskProperties): Task; } export const Task: TaskConstructor; interface TaskProperties { + /** + * The [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for data requests. These options can also be controlled through the `requestOptions` method parameter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#requestOptions) + */ requestOptions?: any; + /** + * The ArcGIS Server REST service URL (usually of a Feature Service Layer or Map Service Layer) for use in a task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#url) + */ url?: string; } interface ConfigurationTask extends Task { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#url) + */ url: string; + /** + * Gets an array of all the user groups that are configured in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getAllGroups) + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getAllGroups(requestOptions?: any): IPromise; + /** + * Gets an array of all the users that are configured in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getAllUsers) + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getAllUsers(requestOptions?: any): IPromise; + /** + * Gets the properties and an array of geodatabase versions for a data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.dataWorkspaceId The unique id of the data workspace, whose version will be returned. + * @param params.user The user name of the user who is requesting the information. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getDataWorkspaceDetails(params: ConfigurationTaskGetDataWorkspaceDetailsParams, requestOptions?: any): IPromise; + /** + * Gets a single user group in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getGroup) + * + * @param groupId The unique id of the group whose information will be retrieved. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getGroup(groupId: number, requestOptions?: any): IPromise; + /** + * Gets the detailed configuration properties of a job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getJobTypeDetails) + * + * @param jobTypeId The unique id of a job type. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getJobTypeDetails(jobTypeId: number, requestOptions?: any): IPromise; + /** + * Gets the configuration of a publicly accessible job query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getPublicJobQueryDetails) + * + * @param queryId The unique id of public query. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getPublicJobQueryDetails(queryId: number, requestOptions?: any): IPromise; + /** + * Gets the [configuration information](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) specific to a Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getServiceInfo) + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getServiceInfo(requestOptions?: any): IPromise; + /** + * Gets an array of registered [table relationships](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getTableRelationshipsDetails) + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getTableRelationshipsDetails(requestOptions?: any): IPromise; + /** + * Gets information for a single user in the system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUser) + * + * @param user The user name of the user whose information will be returned. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getUser(user: string, requestOptions?: any): IPromise; + /** + * Gets the configuration of a user-owned job query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.queryId The unique id of user query. + * @param params.user The user name of the user who is requesting the information. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getUserJobQueryDetails(params: ConfigurationTaskGetUserJobQueryDetailsParams, requestOptions?: any): IPromise; + /** + * Gets all the job types a user is allowed to see and create. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getVisibleJobTypes) + * + * @param user The user name of the user for whom the information will be retrieved. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getVisibleJobTypes(user: string, requestOptions?: any): IPromise; } interface ConfigurationTaskConstructor { + + new(properties?: ConfigurationTaskProperties): ConfigurationTask; } export const ConfigurationTask: ConfigurationTaskConstructor; interface ConfigurationTaskProperties extends TaskProperties { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#url) + */ url?: string; } - export interface ConfigurationTaskGetDataWorkspaceDetailsParams { + + export interface ConfigurationTaskGetDataWorkspaceDetailsParams extends Object { + /** + * The unique id of the data workspace, whose version will be returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) + */ dataWorkspaceId: string; + /** + * The user name of the user who is requesting the information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) + */ user: string; } - export interface ConfigurationTaskGetUserJobQueryDetailsParams { + + export interface ConfigurationTaskGetUserJobQueryDetailsParams extends Object { + /** + * The unique id of user query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) + */ queryId: number; + /** + * The user name of the user who is requesting the information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) + */ user: string; } - export interface DataWorkspace { + /** + * A geospatial database that will be used for editing in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) + */ + export interface DataWorkspace extends Object { + /** + * The unique id of the data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) + */ id: string; + /** + * The name of the data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) + */ name: string; } - export interface GroupMembership { + /** + * The membership attributes of a group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) + */ + export interface GroupMembership extends Object { + /** + * The unique id for the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) + */ id: number; + /** + * The name of the group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) + */ name: string; } - export interface HoldType { + /** + * The type of hold that can be applied to suspend the execution of a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) + */ + export interface HoldType extends Object { + /** + * The description of the type of hold. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) + */ description: string; + /** + * The unique id for the hold type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) + */ id: number; + /** + * The name of the hold type + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) + */ name: string; } - export interface JobPriority { + /** + * The properties of a job priority. Job priority is a way to assign a level of importance to the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) + */ + export interface JobPriority extends Object { + /** + * The description of the priority. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) + */ description: string; + /** + * The name of the priority. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) + */ name: string; + /** + * The unique id of the priority. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) + */ value: number; } - export interface JobQuery { + /** + * A query that is available to the user to execute. A query returns jobs based on a specific criteria. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) + */ + export interface JobQuery extends Object { + /** + * The unique id for the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) + */ id: number; + /** + * The name of the priority. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) + */ name: string; } - export interface JobQueryContainer { + /** + * A container of job queries, it can also contain nested containers with child job query containers under it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) + */ + export interface JobQueryContainer extends Object { + /** + * One or more [job query containers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) which are nested under the parent container. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) + */ containers: JobQueryContainer[]; + /** + * The unique id for the container. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) + */ id: number; + /** + * The name of the query container. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) + */ name: string; + /** + * An array of [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) inside the query container. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) + */ queries: JobQuery[]; } - export interface JobQueryDetails { + /** + * Detailed properties of a job query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) + */ + export interface JobQueryDetails extends Object { + /** + * An array of field aliases included in the select statement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) + */ aliases: string[]; + /** + * An array of fields included in the select statement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) + */ fields: string[]; + /** + * The unique id for the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) + */ id: number; + /** + * The name of the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) + */ name: string; + /** + * The field used to order the results returned by the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) + */ orderBy: string; + /** + * An array of tables selected from and used in the where clause. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) + */ tables: string[]; + /** + * The where clause used as filter for selecting job information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) + */ where: string; } - export interface JobStatus { + /** + * Properties of a job status. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) + */ + export interface JobStatus extends Object { + /** + * An alias name for the status. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) + */ caption: string; + /** + * The description of the type of status. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) + */ description: string; + /** + * The unique id for the status type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) + */ id: number; + /** + * The name of the status type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) + */ name: string; } - export interface JobType { + /** + * A list of properties that describe a job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) + */ + export interface JobType extends Object { + /** + * A category to group other similar job types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) + */ category: string; + /** + * The description of the job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) + */ description: string; + /** + * The unique id for the job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) + */ id: string; + /** + * The name of the job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) + */ name: string; + /** + * The state of the job type. **Possible Values:** draft | active | retired + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) + */ state: string; } - export interface JobTypeDetails { + /** + * Detailed information of a job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ + export interface JobTypeDetails extends Object { + /** + * The name of the geodatabase version that will be assigned the parent version of the job's geodatabase by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultParentVersionName: string; + /** + * Indicates whether jobs of this type will have their workflows automatically executed, when created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ autoExecuteCreatedJobs: boolean; + /** + * The category of the job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ category: string; + /** + * The name of the user or group that the job will be assigned to by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultAssignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned by default. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultAssignedType: string; + /** + * The unique id of the default data workspace of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultDataWorkspaceId: string; + /** + * The description that gets associated with the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultDescription: string; + /** + * The default due date of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultDueDate: string; + /** + * The duration for completing the job assigned by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultJobDuration: number; + /** + * Indicates whether jobs of this type allows users to modify the current data workspace in the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ canDataWorkspaceChange: boolean; + /** + * The numeric priority value assigned to the job by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultPriority: string; + /** + * The default start date of this job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ defaultStartDate: Date; + /** + * The description of the job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ description: string; + /** + * The unique id automatically generated for this job type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ id: string; + /** + * The naming scheme for this job type, which would serve as template for the name of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ jobNamingScheme: string; + /** + * The naming scheme for this job type, which would serve as template for the name of job's version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ jobVersionNamingScheme: string; + /** + * The naming scheme for this job type, which would serve as template for the name of job's map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ mxdNamingScheme: string; + /** + * The job type name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ name: string; + /** + * The state of the job type. **Possible Values:** draft | active | retired + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ state: string; } - export interface Privilege { + /** + * A privilege in the Workflow Manager system that controls application access. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) + */ + export interface Privilege extends Object { + /** + * The description of the privilege. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) + */ description: string; + /** + * The unique id for the privilege. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) + */ id: number; + /** + * The name of the privilege. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) + */ name: string; } - export interface TableRelationship { + /** + * TableRelationship represents a list of extended properties tables and the properties that identify them like name and cardinality. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) + */ + export interface TableRelationship extends Object { + /** + * The type of extra property table relationship, one-to-one represents one row for each property and one-to-many represents there will be multiple values for the property. **Possible Values:** one-to-one | one-to-many + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) + */ cardinality: string; + /** + * The foreign key field used to join the jobs table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) + */ linkField: string; + /** + * The alias name of the table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) + */ tableAlias: string; + /** + * The name of the extended properties table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) + */ tableName: string; } - export interface UserDetails { + /** + * A list of properties including groups and privileges associated with a Workflow Manager user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ + export interface UserDetails extends Object { + /** + * The last name of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ lastName: string; + /** + * The address of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ address: string; + /** + * The fax number of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ faxNumber: string; + /** + * The first name of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ firstName: string; + /** + * The full name of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ fullName: string; + /** + * An array of [group memberships](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ groups: GroupMembership[]; + /** + * The email address of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ email: string; + /** + * The phone number of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ phoneNumber: string; + /** + * An array of [application privileges](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ privileges: Privilege[]; + /** + * The room number of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ roomNumber: string; + /** + * The login username for the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ userName: string; + /** + * An array of [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) owned by the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ userQueries: JobQueryContainer[]; + /** + * The zip code of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ zipCode: string; } - export interface VersionInfo { + /** + * A list of properties that describe a geodatabase version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) + */ + export interface VersionInfo extends Object { + /** + * The level of access to the geodatabase version. **Possible Values:** esriVersionAccessPrivate | esriVersionAccessPublic | esriVersionAccessProtected + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) + */ access: string; + /** + * The name of the geodatabase version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) + */ name: string; + /** + * The name of the parent version of the geodatabase. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) + */ parent: string; } - export interface WorkflowManagerServiceInfo { + /** + * The base properties of a Workflow Manager service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ + export interface WorkflowManagerServiceInfo extends Object { + /** + * An array of [job priorities](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ jobPriorities: JobPriority[]; + /** + * An array of activity types in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ activityTypes: ActivityType[]; + /** + * The current software version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ currentVersion: number; + /** + * An array of [data workspaces](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ dataWorkspaces: DataWorkspace[]; + /** + * An array of [hold types](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ holdTypes: HoldType[]; + /** + * The configuration properties of the Workflow Manager system stored in the database table as key/value pairs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ configProperties: WorkflowManagerServiceInfoConfigProperties; + /** + * An array of [job statuses](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ jobStatuses: JobStatus[]; + /** + * An array of [job types](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ jobTypes: JobType[]; + /** + * An array of notification types in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ notificationTypes: NotificationType[]; + /** + * An array of [privileges](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ privileges: Privilege[]; + /** + * The array of [public queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ publicQueries: JobQueryContainer[]; } - export interface WorkflowManagerServiceInfoConfigProperties { + + export interface WorkflowManagerServiceInfoConfigProperties extends Object { + /** + * Indicates whether the location of interest (LOI) for jobs are allowed to overlap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ AOIOVERLAP: string; + /** + * The color of the current job's LOI when selected in the LOI tab. The value is in range of 0 to 167772155. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ AOISELECTIONCOLOR: number; + /** + * Indicates whether the job will be automatically assigned based on step assignment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ AUTOASSIGNJOB: boolean; + /** + * Indicates whether the job will be automatically closed after the last step in the workflow is marked as complete. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ AUTOCLOSEJOB: boolean; + /** + * Indicates whether the job workflow witll be automatically committed to the database when saved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ AUTOCOMMITWORKFLOW: boolean; + /** + * Indicates whether the status of the jobs will be automatically assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ AUTOSTATUSASSIGN: boolean; + /** + * Indicates whether the user will be required to confirm that they want to mark the current procedural step as complete. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ CONFIRMPROCEDURALCHECK: boolean; + /** + * The default email address to be used in the sender field when sending notifications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ DEFAULT_SENDER_EMAIL: string; + /** + * The default name displayed to be used in the sender field when sending notifications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ DEFAULT_SENDER_NAME: string; + /** + * Indicates whether notifications will be sent as HTML. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ HTML_SUPPORT: string; + /** + * The starting value of job ids in the system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ JOB_ID_START_VALUE: string; + /** + * Indicates whether the the number of days for each hold is taken out of the pending days calculation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ PENDING_DAYS_USE_HOLDS: boolean; + /** + * Indicates whether the user attempting to delete a job version would be prompted to enter a password for the sde owner of the versions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ PROMPTSDEPWD: boolean; + /** + * Indicates whether it will be required to mark procedural steps as started. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ REQUIREPROCEDURALCHECKSTART: number; + /** + * Indicates whether the editing behavior will be restricted to data in the job's AOI using editing restriction rules. **Possible Values:** Warn | NoSelect | Off + * * `Warn` - Warn users when selecting features outside the job AOI. + * * `NoSelect` - Prevent users from selecting features outside the job AOI. + * * `Off` - Allow edits to features outside the job AOI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ RESTRICT_AOI_OPTION: string; + /** + * Indicates whether the spatial notifications will be sent on Workflow Manager Post. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SEND_SN_CUSTOM_POST: boolean; + /** + * Indicates whether to show step ids on workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SHOW_STEP_IDS: boolean; + /** + * Indicates whether the step completion percentage will be displayed on the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SHOW_STEP_PERCENT_COMPLETE: boolean; + /** + * The password of the authenticated SMTP user in the secure SMTP server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SMTP_PASSWORD: string; + /** + * Indicates whether the pending days will be displayed in the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SHOW_PENDING_DAYS: boolean; + /** + * The SMTP server port to be used for sending notifications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SMTP_PORT: string; + /** + * SMTP Authentication protocol. **Possible Values:** SSL | TLS + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SMTP_PROTOCOL: string; + /** + * The name of the SMTP Server to be used for sending notifications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SMTP_SERVER: string; + /** + * The user name that is authenticated in the secure SMTP server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ SMTP_USERNAME: string; + /** + * Indicates whether to use step status assignment such that the job's status updates to match the step status when the step is reached. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ USE_STEP_STATUS: boolean; + /** + * Indicates the user store of the Workflow Manager system, whether the users will be stored in a Portal or the Workflow Manager system. **Possible Values:** traditional | portal + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ USER_STORE: string; + /** + * Indicates whether a user will be authenticated using domain along with the user name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ USEUSERDOMAIN: boolean; + /** + * The fill color of a selected step in a workflow. The value is in range of 0 to 167772155. When the option is disabled it's value is -1. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ WF_SEL_STEP_FILL_COLOR: number; + /** + * The outline color of a selected step in a workflow. The value is in range of 0 to 167772155. When the option is disabled it's value is -1. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ WF_SEL_STEP_OUTLINE_COLOR: number; + /** + * The outline width of a selected step in a workflow. **Possible Values:** 1 | 2 | 3 + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ WF_SEL_STEP_OUTLINE_WIDTH: number; + /** + * Indicates whether the LOI of the job will be automatically zoomed to in the LOI tab. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ ZOOMTOAOI: boolean; } interface JobTask extends Task { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#url) + */ url: string; + /** + * Uploads a file and attaches it to the job as an embedded attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.form The form element that contains the file input control. The form parameter can be an instance of FormData. Using FormData you can send a "multipart/form-data" request to the server without having to create an HTML form element in markup. Note that the FormData api is not available in all browsers. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ addEmbeddedAttachment(params: JobTaskAddEmbeddedAttachmentParams, requestOptions?: any): IPromise; + /** + * Adds a linked attachment to a job (url or file). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.attachmentType The type of attachment to be added. **Possible Values:** linked-file | url + * @param params.path The file path to the attachment. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ addLinkedAttachment(params: JobTaskAddLinkedAttachmentParams, requestOptions?: any): IPromise; + /** + * Adds a linked property record to a job's linked properties table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.tableName The name of the table to which the record will be added. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ addLinkedRecord(params: JobTaskAddLinkedRecordParams, requestOptions?: any): IPromise; + /** + * Assigns one or more jobs to a user or group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobIds An array of unique job Ids. + * @param params.assignedType Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * @param params.assignedTo The name of the user or group to whom the job will be assigned. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ assignJobs(params: JobTaskAssignJobsParams, requestOptions?: any): IPromise; + /** + * Closes one or more jobs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobIds An array of unique job Ids. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ closeJobs(params: JobTaskCloseJobsParams, requestOptions?: any): IPromise; + /** + * Creates a job dependency. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.heldOnType Indicates whether the current job (to which the dependency is being added) will be held at a step, stage or status. **Possible Values:** step | stage | status + * @param params.heldOnValue The value of the step, stage or status at which the current job will be held. + * @param params.depJobId The unique id of the job on which the current job will depend. + * @param params.depOnType Indicates whether the current job (to which the dependency is being added) will be dependent on a step, stage or status of the other job. **Possible Values:** step | stage | status + * @param params.depOnValue The value of the step or status of the other job on which the current job will be dependent. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ createDependency(params: JobTaskCreateDependencyParams, requestOptions?: any): IPromise; + /** + * Creates a job hold. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.holdTypeId The unique id representing the hold type to be placed on the job. + * @param params.comments Reason or more detailed information regarding why the hold is being added. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ createHold(params: JobTaskCreateHoldParams, requestOptions?: any): IPromise; + /** + * Creates new jobs based on the provided parameters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobs) + * + * @param params The parameters to be used for job creation, parameters defined in the job type can be overritten. The jobTypeId and user are required parameters when creating a job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ createJobs(params: JobCreationParameters, requestOptions?: any): IPromise; + /** + * Creates a version specific to the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.name The name of the version to be created. + * @param params.parent The name of the job's assigned geodatabase (data workspace) version, based on which the new version will be created. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ createJobVersion(params: JobTaskCreateJobVersionParams, requestOptions?: any): IPromise; + /** + * Deletes an attachment from a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.attachmentId The unique id of the attachment to be deleted. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ deleteAttachment(params: JobTaskDeleteAttachmentParams, requestOptions?: any): IPromise; + /** + * Deletes a job dependency. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.dependencyId The unique id of the dependency to be deleted. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ deleteDependency(params: JobTaskDeleteDependencyParams, requestOptions?: any): IPromise; + /** + * Delete one or more jobs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobIds An array of unique job Ids. + * @param params.deleteHistory Indicates whether or not to delete the associated job history, the default is to delete job history. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ deleteJobs(params: JobTaskDeleteJobsParams, requestOptions?: any): IPromise; + /** + * Deletes a record from a job's linked properties table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.tableName The name of the table from which linked record will be deleted. + * @param params.recordId The unique id of the record in the table. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ deleteLinkedRecord(params: JobTaskDeleteLinkedRecordParams, requestOptions?: any): IPromise; + /** + * Gets the activity log for a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getActivityLog) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getActivityLog(jobId: number, requestOptions?: any): IPromise; + /** + * Gets the URL to access the file content of an embedded job attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.attachmentId The Id of the attachment to be retrieved. + * + */ getAttachmentContentUrl(params: JobTaskGetAttachmentContentUrlParams): string; + /** + * Gets all the attachments associated with the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachments) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getAttachments(jobId: number, requestOptions?: any): IPromise; + /** + * Gets an array of dependencies configured for a job. A job with a dependency is held at a step, stage or status of the other job, and cannot progress until the other job reaches the step, stage or status defined in the dependency. Once the other job reaches step, stage or status as defined in the dependency criteria the dependency is released and the dependent job can progress. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getDependencies) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getDependencies(jobId: number, requestOptions?: any): IPromise; + /** + * Gets an array of [extended properties](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) for a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getExtendedProperties) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getExtendedProperties(jobId: number, requestOptions?: any): IPromise; + /** + * Gets an array of holds on a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getHolds) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getHolds(jobId: number, requestOptions?: any): IPromise; + /** + * Gets the [job](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) object based on the given id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getJob) + * + * @param jobId The unique id of the job to be retrieved. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getJob(jobId: number, requestOptions?: any): IPromise; + /** + * Gets all the job ids in the system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getJobIds) + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getJobIds(requestOptions?: any): IPromise; + /** + * Gets the notes for a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getNotes) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getNotes(jobId: number, requestOptions?: any): IPromise; + /** + * Gets an array of [values and descriptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) for a geodatabase domain or table list extended property field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.tableName The name of the extended property table. + * @param params.field The field name of the extended property for which to retrieve values. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ listFieldValues(params: JobTaskListFieldValuesParams, requestOptions?: any): IPromise; + /** + * Gets an array of [display values](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) for a given fields that comprise a multi-level table list extended property. As each display field is selected, for example using a dropdown UI control, this method can be called to obtain a list of values to display in the subsequent dropdown control. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.field The name of the field. + * @param params.previousSelectedValues The array of previous values, on which the current value is dependent on. For example, when selecting a city based on the state and county. The value for the state and county would be the previous values. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ listMultiLevelFieldValues(params: JobTaskListMultiLevelFieldValuesParams, requestOptions?: any): IPromise; + /** + * Logs an action in a job's activity log. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.activityTypeId The unique id representing the [activity type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) of the action associated with this log record. + * @param params.comments The comment that is added to the history. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ logAction(params: JobTaskLogActionParams, requestOptions?: any): IPromise; + /** + * Queries the jobs using the queryId of an existing query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.queryId The unique id of a query, used to query jobs in the database. + * @param params.user The username of the user who is requesting query. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ queryJobs(params: JobTaskQueryJobsParams, requestOptions?: any): IPromise; + /** + * Queries the jobs using an ad-hoc query definition and gets the [query result](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobsAdHoc) + * + * @param params The [parameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) to query jobs. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ queryJobsAdHoc(params: JobQueryParameters, requestOptions?: any): IPromise; + /** + * Gets an array of string values representing the current display values for each display field in a multi-level table list extended property. The values from this method should be used to pre-select items in dropdown lists when initially displaying the extended properties of a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.field The name of the field. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ queryMultiLevelSelectedValues(params: JobTaskQueryMultiLevelSelectedValuesParams, requestOptions?: any): IPromise; + /** + * Releases a job hold. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.holdId The unique id of the hold. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ releaseHold(params: JobTaskReleaseHoldParams, requestOptions?: any): IPromise; + /** + * Reopens one or more closed jobs. Supported from 10.3 onwards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobIds An array of unique job Ids. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ reopenClosedJobs(params: JobTaskReopenClosedJobsParams, requestOptions?: any): IPromise; + /** + * Performs a freeform text search and returns a set of matching job records. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.text The text which will be used to perform the search. + * @param params.user The username of the user who is requesting search. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ searchJobs(params: JobTaskSearchJobsParams, requestOptions?: any): IPromise; + /** + * Unassigns one or more jobs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobIds An array of unique job Ids. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ unassignJobs(params: JobTaskUnassignJobsParams, requestOptions?: any): IPromise; + /** + * Update a job's properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateJob) + * + * @param params The [parameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) to be used for job properties update, the jobId and the user are required when updating jobs. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ updateJob(params: JobUpdateParameters, requestOptions?: any): IPromise; + /** + * Updates the notes for a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.notes The new notes for the job. Set to an empty (zero-length) string to clear the job notes. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ updateNotes(params: JobTaskUpdateNotesParams, requestOptions?: any): IPromise; + /** + * Updates the values of an extended or linked properties record. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.record The record to be updated. + * @param params.user The user name of the user who is requesting the change. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ updateRecord(params: JobTaskUpdateRecordParams, requestOptions?: any): IPromise; } interface JobTaskConstructor { + /** + * Helps you work with Workflow Manager jobs. A job is a single unit of work that is carried out within an organization. Various methods are available in the class to work with the following: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html) + */ + new(properties?: JobTaskProperties): JobTask; } export const JobTask: JobTaskConstructor; interface JobTaskProperties extends TaskProperties { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#url) + */ url?: string; } - export interface ActivityType { + /** + * ActivityType represents an activity type template that gets logged on a job when a certain event is fired in the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) + */ + export interface ActivityType extends Object { + /** + * The description of the activity being recorded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) + */ desription: string; + /** + * The unique id of the activity that is logged. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) + */ id: number; + /** + * The message that will be logged when this type of activity occurs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) + */ message: string; + /** + * The name of the activity that occured. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) + */ name: string; } - export interface AuxRecord { + /** + * AuxRecord represents the extended/linked properties record information associated with a job so that you can fetch or update the information for a specified record. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) + */ + export interface AuxRecord extends Object { + /** + * The display value of the record. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) + */ displayProperty: any; + /** + * The unique id of the record. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) + */ id: number; + /** + * The array of the values in the [records](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) + */ recordvalues: AuxRecordValue; } - export interface AuxRecordContainer { + /** + * AuxRecordContainer represents the extended/linked properties table characteristics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) + */ + export interface AuxRecordContainer extends Object { + /** + * The array of extended property [records](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) + */ records: AuxRecord; + /** + * The type of extended property relationship. **Possible Values:** one-to-one | one-to-many + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) + */ relationshipType: string; + /** + * The table alias. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) + */ tableAlias: string; + /** + * The table name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) + */ tableName: string; } - export interface AuxRecordDescription { + /** + * AuxRecordDescription represents the type of value that is captured in a specific AuxRecord field. There are multiple data types supported in Workflow Manager like - file, folder, text, date, etc. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) + */ + export interface AuxRecordDescription extends Object { + /** + * The array of property/value pairs of the record. + * + * [Read more...](properties.html) + */ properties: any; + /** + * The unique id of the record. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) + */ recordId: number; + /** + * The table name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) + */ tableName: string; } - export interface AuxRecordValue { + /** + * AuxRecordValue represents the values of extended/linked properties associated with a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ + export interface AuxRecordValue extends Object { + /** + * The filter to restrict the types of records supported. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ filter: string; + /** + * The alias for the field in the table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ alias: string; + /** + * The data contained in the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ data: any; + /** + * The type of data expected in the field. **Possible Values:** small-integer | integer | single | double | string | date | oid | geometry | blob | raster | guid | global-id | xml + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ dataType: string; + /** + * The order each field is displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ displayOrder: number; + /** + * The type of extended property item. **Possible Values:** default | text | date | domain | file | geo-file | folder | list | table-list | multi-level-table-list + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ displayType: string; + /** + * The domain value configured for the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ domain: string; + /** + * Indicates whether the extended property value can be updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ canUpdate: boolean; + /** + * The length of the property string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ length: number; + /** + * The name property associated with the record. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ name: string; + /** + * Indicates whether the property is a required or optional field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ required: boolean; + /** + * The lookup table that contains the list of values which will be selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ tableListClass: string; + /** + * The field that will be displayed for the extended property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ tableListDisplayField: string; + /** + * The field that contains the value that gets stored as the extended property value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ tableListStoreField: string; + /** + * Indicates whether the value will be visible to the user or not. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ userVisible: boolean; } - export interface FieldValue { + /** + * FieldValue represents a single entry of a geodatabase domain or table list, applicable to constraining the values of an extended or linked property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) + */ + export interface FieldValue extends Object { + /** + * The description of the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) + */ description: string; + /** + * The value that is stored for the extended properties record. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) + */ value: any; } - export interface JobAttachment { + /** + * JobAttachment represents an attachments associated with a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) + */ + export interface JobAttachment extends Object { + /** + * The name of the file attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) + */ filename: string; + /** + * The file folder path or a URL. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) + */ folder: string; + /** + * The unique id of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) + */ id: number; + /** + * The storage type of the attachment. **Possible Values:** linked-file | embedded | url + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) + */ storageType: string; } - export interface JobCreationParameters { + /** + * JobCreationParameters provides information about the properties used for creating a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ + export interface JobCreationParameters extends Object { + /** + * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ loi: Geometry; + /** + * The name of the user or group to whom the job will be assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ assignedTo: string; + /** + * Indicates whether the workflow will be automatically committed upon creation of the job. The workflow cannot be edited after being committed to the system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ autoCommitWorkflow: boolean; + /** + * Indicates whether the job workflow will start execution automatically upon creation of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ autoExecute: boolean; + /** + * The unique id of the data workspace of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ dataWorkspaceId: string; + /** + * The description of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ description: string; + /** + * The date on which the job is expected to be complete. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ dueDate: Date; + /** + * The unique id of the job type from which to create the new job from. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ jobTypeId: number; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ assignedType: string; + /** + * The name of the new job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ name: string; + /** + * The number of jobs to be created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ numJobs: string; + /** + * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ ownedBy: string; + /** + * The unique id of the job that will be designated as the parent job of the new job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ parentJobId: number; + /** + * The name of the geodatabase version that will be the parent version of the new job's version. By default it'll be the parent version of the data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ parentVersion: string; + /** + * The numeric value to denote priority of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ priority: number; + /** + * The date on which the job is scheduled to begin. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ startDate: Date; + /** + * The username of the user creating the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ user: string; } - export interface JobDependency { + /** + * JobDependency represents a dependency associated with a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) + */ + export interface JobDependency extends Object { + /** + * The unique id of the job on which the current job depends. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) + */ depJobId: number; + /** + * Indicates whether the job is dependent on a step, stage or status of the other job. **Possible Values:** step | stage | status + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) + */ depOnType: string; + /** + * The value of the step, stage or status of the other job on which the current job is dependent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) + */ depOnValue: string; + /** + * The value of the step, stage or status at which the current job will be held. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) + */ heldOnValue: number; + /** + * Indicates whether the job is held at a step, stage or status. **Possible Values:** step | stage | status + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) + */ holdOnType: string; + /** + * The unique id of the dependency. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) + */ id: number; + /** + * The unique id of the job on which the dependency exists. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) + */ jobID: string; } - export interface JobTaskJobInfo { + /** + * JobInfo represents a collection of job properties + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ + export interface JobTaskJobInfo extends Object { + /** + * The name of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ name: string; + /** + * The name of the user or group to whom the job is assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ assignedTo: string; + /** + * An array of unique job ids designated as child jobs for the current job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ childJobIds: number[]; + /** + * The user name of the person that created the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ createdBy: string; + /** + * The date the job was created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ createdDate: Date; + /** + * The unique id of the data workspace of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ dataWorkspaceId: string; + /** + * The description of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ description: string; + /** + * The date on which the job is expected to be complete. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ dueDate: Date; + /** + * The actual date the job's workflow was completed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ endDate: Date; + /** + * The unique id to identify the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ id: number; + /** + * The unique id of the job type whose instance is the current job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ jobTypeId: number; + /** + * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ loi: Geometry; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ assignedType: string; + /** + * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ ownedBy: string; + /** + * The unique id of the job that will be designated as the parent job of the new job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ parentJobId: number; + /** + * The name of the geodatabase version that is the parent version of the job's version. By default it'll be the parent version of the data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ parentVersion: string; + /** + * The number of days that the job has been active. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ pendingDays: number; + /** + * The percentage of work completed on the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ percentageComplete: number; + /** + * The numeric value to denote priority of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ priority: number; + /** + * The internal stage of the job which corresponds to the status of the job. **Possible Values:** created | ready | working | done | closed + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ stage: string; + /** + * The date on which the job is scheduled to begin. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ startDate: Date; + /** + * The numeric value to represent the current status of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ status: number; + /** + * Indicates whether a version exists for the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ versionExists: boolean; + /** + * The information about job's geodatabase version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ versionInfo: JobVersionInfo; + /** + * The name of the job's geodatabase version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ versionName: string; } - export interface JobQueryParameters { + /** + * JobQueryParameters is a full query definition of the selected query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) + */ + export interface JobQueryParameters extends Object { + /** + * An alias of fields included in the select statement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) + */ aliases: string; + /** + * An array of fields included in the select statement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) + */ fields: string; + /** + * The field that will be used to order the results returned by the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) + */ orderBy: string; + /** + * The tables that will be used in the where clause for selection. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) + */ tables: string; + /** + * The where clause used as a filter for selecting job information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) + */ where: string; + /** + * The username of the user who is requesting query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) + */ user: string; } - export interface JobTaskAddEmbeddedAttachmentParams { + + export interface JobTaskAddEmbeddedAttachmentParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) + */ jobId: number; + /** + * The form element that contains the file input control. The form parameter can be an instance of FormData. Using FormData you can send a "multipart/form-data" request to the server without having to create an HTML form element in markup. Note that the FormData api is not available in all browsers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) + */ form: any; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) + */ user: string; } - export interface JobTaskAddLinkedAttachmentParams { + + export interface JobTaskAddLinkedAttachmentParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) + */ jobId: number; + /** + * The type of attachment to be added. **Possible Values:** linked-file | url + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) + */ attachmentType: number; + /** + * The file path to the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) + */ path: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) + */ user: string; } - export interface JobTaskAddLinkedRecordParams { + + export interface JobTaskAddLinkedRecordParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) + */ jobId: number; + /** + * The name of the table to which the record will be added. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) + */ tableName: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) + */ user: string; } - export interface JobTaskAssignJobsParams { + + export interface JobTaskAssignJobsParams extends Object { + /** + * An array of unique job Ids. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) + */ jobIds: number[]; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) + */ assignedType: string; + /** + * The name of the user or group to whom the job will be assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) + */ assignedTo: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) + */ user: string; } - export interface JobTaskCloseJobsParams { + + export interface JobTaskCloseJobsParams extends Object { + /** + * An array of unique job Ids. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) + */ jobIds: number[]; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) + */ user: string; } - export interface JobTaskCreateDependencyParams { + + export interface JobTaskCreateDependencyParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) + */ jobId: number; + /** + * Indicates whether the current job (to which the dependency is being added) will be held at a step, stage or status. **Possible Values:** step | stage | status + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) + */ heldOnType: string; + /** + * The value of the step, stage or status at which the current job will be held. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) + */ heldOnValue: number; + /** + * The unique id of the job on which the current job will depend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) + */ depJobId: number; + /** + * Indicates whether the current job (to which the dependency is being added) will be dependent on a step, stage or status of the other job. **Possible Values:** step | stage | status + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) + */ depOnType: string; + /** + * The value of the step or status of the other job on which the current job will be dependent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) + */ depOnValue: number; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) + */ user: string; } - export interface JobTaskCreateHoldParams { + + export interface JobTaskCreateHoldParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) + */ jobId: number; + /** + * The unique id representing the hold type to be placed on the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) + */ holdTypeId: number; + /** + * Reason or more detailed information regarding why the hold is being added. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) + */ comments: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) + */ user: string; } - export interface JobTaskCreateJobVersionParams { + + export interface JobTaskCreateJobVersionParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) + */ jobId: number; + /** + * The name of the version to be created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) + */ name: string; + /** + * The name of the job's assigned geodatabase (data workspace) version, based on which the new version will be created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) + */ parent: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) + */ user: string; } - export interface JobTaskDeleteAttachmentParams { + + export interface JobTaskDeleteAttachmentParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) + */ jobId: number; + /** + * The unique id of the attachment to be deleted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) + */ attachmentId: number; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) + */ user: string; } - export interface JobTaskDeleteDependencyParams { + + export interface JobTaskDeleteDependencyParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) + */ jobId: number; + /** + * The unique id of the dependency to be deleted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) + */ dependencyId: number; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) + */ user: string; } - export interface JobTaskDeleteJobsParams { + + export interface JobTaskDeleteJobsParams extends Object { + /** + * An array of unique job Ids. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) + */ jobIds: number[]; + /** + * Indicates whether or not to delete the associated job history, the default is to delete job history. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) + */ deleteHistory?: boolean; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) + */ user: string; } - export interface JobTaskDeleteLinkedRecordParams { + + export interface JobTaskDeleteLinkedRecordParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) + */ jobId: number; + /** + * The name of the table from which linked record will be deleted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) + */ tableName: string; + /** + * The unique id of the record in the table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) + */ recordId: number; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) + */ user: string; } - export interface JobTaskGetAttachmentContentUrlParams { + + export interface JobTaskGetAttachmentContentUrlParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) + */ jobId: number; + /** + * The Id of the attachment to be retrieved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) + */ attachmentId: number; } - export interface JobTaskListFieldValuesParams { + + export interface JobTaskListFieldValuesParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) + */ jobId: number; + /** + * The name of the extended property table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) + */ tableName: string; + /** + * The field name of the extended property for which to retrieve values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) + */ field: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) + */ user: string; } - export interface JobTaskListMultiLevelFieldValuesParams { + + export interface JobTaskListMultiLevelFieldValuesParams extends Object { + /** + * The name of the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) + */ field: string; + /** + * The array of previous values, on which the current value is dependent on. For example, when selecting a city based on the state and county. The value for the state and county would be the previous values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) + */ previousSelectedValues: string[]; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) + */ user: string; } - export interface JobTaskLogActionParams { + + export interface JobTaskLogActionParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) + */ jobId: number; + /** + * The unique id representing the [activity type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) of the action associated with this log record. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) + */ activityTypeId: number; + /** + * The comment that is added to the history. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) + */ comments: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) + */ user: string; } - export interface JobTaskQueryJobsParams { + + export interface JobTaskQueryJobsParams extends Object { + /** + * The unique id of a query, used to query jobs in the database. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) + */ queryId: number; + /** + * The username of the user who is requesting query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) + */ user: string; } - export interface JobTaskQueryMultiLevelSelectedValuesParams { + + export interface JobTaskQueryMultiLevelSelectedValuesParams extends Object { + /** + * The name of the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) + */ field: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) + */ user: string; } - export interface JobTaskReleaseHoldParams { + + export interface JobTaskReleaseHoldParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) + */ jobId: number; + /** + * The unique id of the hold. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) + */ holdId: number; } - export interface JobTaskReopenClosedJobsParams { + + export interface JobTaskReopenClosedJobsParams extends Object { + /** + * An array of unique job Ids. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) + */ jobIds: number[]; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) + */ user: string; } - export interface JobTaskSearchJobsParams { + + export interface JobTaskSearchJobsParams extends Object { + /** + * The text which will be used to perform the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) + */ text: string; + /** + * The username of the user who is requesting search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) + */ user: string; } - export interface JobTaskUnassignJobsParams { + + export interface JobTaskUnassignJobsParams extends Object { + /** + * An array of unique job Ids. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) + */ jobIds: number[]; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) + */ user: string; } - export interface JobTaskUpdateNotesParams { + + export interface JobTaskUpdateNotesParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) + */ jobId: number; + /** + * The new notes for the job. Set to an empty (zero-length) string to clear the job notes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) + */ notes: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) + */ user: string; } - export interface JobTaskUpdateRecordParams { + + export interface JobTaskUpdateRecordParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) + */ jobId: number; + /** + * The record to be updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) + */ record: AuxRecordDescription; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) + */ user: string; } - export interface JobUpdateParameters { + /** + * JobUpdateParameters is a collection of properties that can be updated for jobs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ + export interface JobUpdateParameters extends Object { + /** + * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ ownedBy: string; + /** + * The name of the user or group to whom the job will be assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ assignedTo: string; + /** + * The unique id of the data workspace of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ dataWorkspaceId: string; + /** + * The description of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ description: string; + /** + * The date on which the job is expected to be complete. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ dueDate: Date; + /** + * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ loi: Geometry; + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ jobId: number; + /** + * The name of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ name: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ assignedType: string; + /** + * The unique id of the job that will be designated as the parent job of the new job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ parentJobId: number; + /** + * The name of the geodatabase version that will be the parent version of the new job's version. By default it'll be the parent version of the data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ parentVersion: string; + /** + * The percentage of work completed on the job's current step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ percent: number; + /** + * The numeric value to denote priority of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ priority: number; + /** + * The date on which the job is scheduled to begin. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ startDate: Date; + /** + * The unique id of the job's new status. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ status: number; + /** + * The name of the geodatabase version to be used for the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ versionName: string; + /** + * The user name of the user who is requesting the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ user: string; } - export interface JobVersionInfo { + /** + * JobVersionInfo represents a collection of properties for a job's version. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) + */ + export interface JobVersionInfo extends Object { + /** + * The unique id of the data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) + */ dataWorkspaceId: string; + /** + * The name of the data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) + */ name: string; + /** + * The parent version of the geodatabase. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) + */ parent: string; + /** + * Indicates whether the version has been created or not. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) + */ created: boolean; + /** + * The name of the version owner. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) + */ owner: string; } - export interface QueryFieldInfo { + /** + * QueryFieldInfo represents a collection of field properties that are returned as part of a query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) + */ + export interface QueryFieldInfo extends Object { + /** + * The alias name of the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) + */ alias: string; + /** + * The field length. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) + */ length: string; + /** + * The name of the data workspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) + */ name: string; + /** + * The type of data expected in the field. **Possible Values:** small-integer | integer | single | double | string | date | oid | geometry | blob | raster | guid | global-id | xml + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) + */ type: string; } - export interface QueryResult { + /** + * QueryResult contains the result of a query after it has been executed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) + */ + export interface QueryResult extends Object { + /** + * An array of fields and field properties in the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) + */ fields: QueryFieldInfo[]; + /** + * The rows of results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) + */ rows: string[]; } interface NotificationTask extends Task { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#url) + */ url: string; + /** + * Creates a new spatial notification change rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.rule The [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) to be added. + * @param params.user The username requesting the addition of the rule. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ addChangeRule(params: NotificationTaskAddChangeRuleParams, requestOptions?: any): IPromise; + /** + * Deletes a spatial notification change rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.ruleId The unique id of the rule to be deleted. + * @param params.user The username requesting the deletion of the rule. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ deleteChangeRule(params: NotificationTaskDeleteChangeRuleParams, requestOptions?: any): IPromise; + /** + * Get an array of all the spatial notification [change rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) configured in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getAllChangeRules) + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getAllChangeRules(requestOptions?: any): IPromise; + /** + * Get a single spatial notification [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) by ruleId. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getChangeRule) + * + * @param ruleId The unique id of the [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule). + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getChangeRule(ruleId: string, requestOptions?: any): IPromise; + /** + * Get information about a [match](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) for a change and change rule related to a spatial notification. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getChangeRuleMatch) + * + * @param matchId The unique id of the spatial notification match. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getChangeRuleMatch(matchId: string, requestOptions?: any): IPromise; + /** + * Get the current time of the database. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getDatabaseTime) + * + * @param dataWorkspaceId The unique id of the dataWorkspace. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getDatabaseTime(dataWorkspaceId: string, requestOptions?: any): IPromise; + /** + * Get an array of [matches](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) that match the change rule criteria in a specific editing session. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getSessionMatches) + * + * @param sessionId The unique id of the spatial notification session. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getSessionMatches(sessionId: string, requestOptions?: any): IPromise; + /** + * Sends the notifications configured for the matches found during a rule evaluation session. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.sessionid The unique id of the spatial notification session. + * @param params.deleteAfter Indicates whether to delete the session matches after sending any notifications. The default is false. + * @param params.user The username requesting the sending of notification. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ notifySession(params: NotificationTaskNotifySessionParams, requestOptions?: any): IPromise; + /** + * Queries the array of spatial notification [change rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) based on specified criteria. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.name A search string to find within change rule names. + * @param params.description A search string to find within change rule descriptions. + * @param params.searchType The type of search to perform, default is contains. **Possible Values:** contains | exact | starts-with | ends-with + * @param params.user The username requesting the search. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ queryChangeRules(params: NotificationTaskQueryChangeRulesParams, requestOptions?: any): IPromise; + /** + * Executes the configured spatial notification change rules on a data workspace by evaluating the geodatabase archive. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.dataWorkspaceId The unique id of the dataWorkspace. + * @param params.from The starting time to query for new changes. + * @param params.to The ending time to query for new changes. + * @param params.logMatches Indicates whether to keep the matches found, stored in the ArcGIS Workflow Manager repository. The default is false. + * @param params.send Indicates whether to the send notifications at the time matches are found. The default is false. + * @param params.user The username requesting the execution of the rule. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ runSpatialNotificationOnHistory(params: NotificationTaskRunSpatialNotificationOnHistoryParams, requestOptions?: any): IPromise; + /** + * Sends an email of the specified [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.notificationType The name of the [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) to be sent. + * @param params.user The username requesting to send the notification. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ sendNotification(params: NotificationTaskSendNotificationParams, requestOptions?: any): IPromise; + /** + * Adds an email address to the subscriber list for a specific notification type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.notificationTypeId The unique id of the notification type to which the email address will be added. + * @param params.email The email address to add to the notification type's subscriber list. May contain tokens. + * @param params.user The username requesting the addition of email address to the notification subscriber's list. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ subscribeToNotification(params: NotificationTaskSubscribeToNotificationParams, requestOptions?: any): IPromise; + /** + * Removes an email address from the subscriber list for a specific notification type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.notificationTypeId The unique id of the notification type from which the email address will be removed. + * @param params.email The email address to remove from the notification type's subscriber list. May contain tokens. + * @param params.user The username requesting the removal of email address to the notification subscriber's list. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ unsubscribeFromNotification(params: NotificationTaskUnsubscribeFromNotificationParams, requestOptions?: any): IPromise; } interface NotificationTaskConstructor { + /** + * Exposes functions to perform operations with Workflow Manager notifications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html) + */ + new(properties?: NotificationTaskProperties): NotificationTask; } export const NotificationTask: NotificationTaskConstructor; interface NotificationTaskProperties extends TaskProperties { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#url) + */ url?: string; } - export interface AOIEvaluator { + /** + * AOIEvaluator represents the rules that triggers a spatial notification based on area of interest(AOI). This contains the geometric operation and the criteria to be used based on the AOI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) + */ + export interface AOIEvaluator extends Object { + /** + * The area of interest. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) + */ aoi: Polygon; + /** + * Indicates whether to inverse the spatial relationship or not. For example, if the spatial relationship is inversed for operator Within, then features that are not within will be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) + */ inverse: boolean; + /** + * The name of the AOI evaluator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) + */ name: string; + /** + * The spatial relationship to be applied for evaluation of the rule. **Possible Values:** intersects | contains | crosses | envelope-intersects | index-intersects | overlaps | touches | within | relation + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) + */ relation: string; + /** + * The type of the AOI evaluator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) + */ type: string; + /** + * Indicates whether job AOI should be used as the extent or not for the evaluation of the rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) + */ useJobAOI: boolean; } - export interface ChangeRule { + /** + * ChangeRule represents a single change rule that triggers a spatial notification. When the criteria defined in the rule is met an email notification is sent to recipients. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) + */ + export interface ChangeRule extends Object { + /** + * The description of the change rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) + */ description: string; + /** + * An array of [AOI](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) and [Dataset](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) evaluators. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) + */ evaluators: any[]; + /** + * The unique id of the change rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) + */ id: number; + /** + * The name of the change rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) + */ name: string; + /** + * The type of notifier, the default is [email notifier](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier). This can be extended to use your own notifiers like SMS, instant messaging. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) + */ notifier: any; + /** + * Indicates whether to summarize email contents or not. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) + */ summarize: boolean; } - export interface ChangeRuleMatch { + /** + * ChangeRuleMatch represents information about the change and change rule related to a spatial notification match. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) + */ + export interface ChangeRuleMatch extends Object { + /** + * The time the change occured to the data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) + */ changeTime: Date; + /** + * The type of change that happened to the data. **Possible Values:** add | modify | delete | all + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) + */ changeType: string; + /** + * The dataset that changed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) + */ dataset: string; + /** + * The unique id of the data workspace containing the changed data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) + */ dataWorkspaceId: string; + /** + * The unique id of the associated to the change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) + */ id: string; + /** + * The unique id of the job where the change was made. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) + */ jobID: string; + /** + * The unique id of the change rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) + */ ruleID: string; } - export interface DatasetConfiguration { + /** + * DatasetConfiguration represents the criteria and dataset that the change rule applies to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) + */ + export interface DatasetConfiguration extends Object { + /** + * This indicates whether the notification will be sent always or if values change to defined in whereConditions or if values change from defined in whereConditions. **Possible Values:** always | changed-to | changed-from + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) + */ changeCondition: number; + /** + * The name of the fields, changes to which trigger the notification. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) + */ changeFields: string; + /** + * The name of the dataset that will trigger the notification. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) + */ dataset: string; + /** + * The unique id of the data workspace containing the changed data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) + */ dataWorkspaceId: string; + /** + * The name of the dataset configuration rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) + */ name: string; + /** + * The [where conditions](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) defining the criteria to trigger the rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) + */ whereConditions: WhereCondition[]; } - export interface DataSetEvaluator { + /** + * DataSetEvaluator represents the rules that triggers a spatial notification based on the changes in a dataset. This contains the specific features and feature class that are participating in a spatial notification rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) + */ + export interface DataSetEvaluator extends Object { + /** + * The array of [DatasetConfigurations](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) representing the dataset to which the rule applies. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) + */ dataSetConfigurations: DatasetConfiguration[]; + /** + * The name of the dataset evaluator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) + */ name: string; + /** + * The type of the dataset evaluator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) + */ type: string; } - export interface EmailNotifier { + /** + * EmailNotifier represents the properties of a notification type that is configured in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ + export interface EmailNotifier extends Object { + /** + * Indicates whether the job's file attachment will be attached to the email. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ attachJobAttachments: boolean; + /** + * The message content sent as part of the email. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ message: string; + /** + * The name of the notifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ name: string; + /** + * The sender's (from) email address. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ senderEmail: string; + /** + * The sender's (from) name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ senderName: string; + /** + * The subject of the email. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ subject: string; + /** + * The array of subscribers who will get the email. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ subscribers: string[]; + /** + * The type of notifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) + */ type: string; } - export interface NotificationTaskAddChangeRuleParams { + + export interface NotificationTaskAddChangeRuleParams extends Object { + /** + * The [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) to be added. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) + */ rule: ChangeRule; + /** + * The username requesting the addition of the rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) + */ user: string; } - export interface NotificationTaskDeleteChangeRuleParams { + + export interface NotificationTaskDeleteChangeRuleParams extends Object { + /** + * The unique id of the rule to be deleted. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) + */ ruleId: string; + /** + * The username requesting the deletion of the rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) + */ user: string; } - export interface NotificationTaskNotifySessionParams { + + export interface NotificationTaskNotifySessionParams extends Object { + /** + * The unique id of the spatial notification session. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) + */ sessionid: string; + /** + * Indicates whether to delete the session matches after sending any notifications. The default is false. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) + */ deleteAfter: boolean; + /** + * The username requesting the sending of notification. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) + */ user: string; } - export interface NotificationTaskQueryChangeRulesParams { + + export interface NotificationTaskQueryChangeRulesParams extends Object { + /** + * A search string to find within change rule names. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) + */ name: string; + /** + * A search string to find within change rule descriptions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) + */ description: string; + /** + * The type of search to perform, default is contains. **Possible Values:** contains | exact | starts-with | ends-with + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) + */ searchType: string; + /** + * The username requesting the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) + */ user: string; } - export interface NotificationTaskRunSpatialNotificationOnHistoryParams { + + export interface NotificationTaskRunSpatialNotificationOnHistoryParams extends Object { + /** + * The unique id of the dataWorkspace. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) + */ dataWorkspaceId: string; + /** + * The starting time to query for new changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) + */ from: Date; + /** + * The ending time to query for new changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) + */ to: Date; + /** + * Indicates whether to keep the matches found, stored in the ArcGIS Workflow Manager repository. The default is false. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) + */ logMatches: boolean; + /** + * Indicates whether to the send notifications at the time matches are found. The default is false. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) + */ send: boolean; + /** + * The username requesting the execution of the rule. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) + */ user: string; } - export interface NotificationTaskSendNotificationParams { + + export interface NotificationTaskSendNotificationParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) + */ jobId: number; + /** + * The name of the [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) to be sent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) + */ notificationType: string; + /** + * The username requesting to send the notification. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) + */ user: string; } - export interface NotificationTaskSubscribeToNotificationParams { + + export interface NotificationTaskSubscribeToNotificationParams extends Object { + /** + * The unique id of the notification type to which the email address will be added. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) + */ notificationTypeId: number; + /** + * The email address to add to the notification type's subscriber list. May contain tokens. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) + */ email: string; + /** + * The username requesting the addition of email address to the notification subscriber's list. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) + */ user: string; } - export interface NotificationTaskUnsubscribeFromNotificationParams { + + export interface NotificationTaskUnsubscribeFromNotificationParams extends Object { + /** + * The unique id of the notification type from which the email address will be removed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) + */ notificationTypeId: number; + /** + * The email address to remove from the notification type's subscriber list. May contain tokens. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) + */ email: string; + /** + * The username requesting the removal of email address to the notification subscriber's list. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) + */ user: string; } - export interface NotificationType { + /** + * NotificationType represents the properties of a notification type that are sent when certain events happen in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ + export interface NotificationType extends Object { + /** + * Indicates whether the job's file attachment will be attached to the email. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ attachJobAttachments: boolean; + /** + * The unique id of the notification type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ id: number; + /** + * The message content sent as part of the email. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ message: string; + /** + * The sender's (from) email address. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ senderEmail: string; + /** + * The sender's (from) name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ senderName: string; + /** + * The subject of the email. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ subject: string; + /** + * The array of subscribers who will get the email. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ subscribers: string[]; + /** + * The type of notifier. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) + */ type: string; } - export interface WhereCondition { + /** + * WhereCondition returns the condition set in [DatasetConfiguration](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) for a [Dataset](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) evaluator. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) + */ + export interface WhereCondition extends Object { + /** + * The value to be compared/evaluated with. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) + */ compareValue: any; + /** + * The field name that contains the value to be compared. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) + */ field: string; + /** + * The operator to be used for comparison. **Possible Values:** equal | not-equal | greater-than | greater-or-equal | less-than | less-or-equal | contains + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) + */ operator: string; } interface ReportTask extends Task { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#url) + */ url: string; + /** + * Generates a report and returns the output as formatted HTML. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.reportId The id of the report. + * @param params.user The user name requesting the report. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ generateReport(params: ReportTaskGenerateReportParams, requestOptions?: any): IPromise; + /** + * Gets all the [reports](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) that are configured in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getAllReports) + * + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getAllReports(requestOptions?: any): IPromise; + /** + * Returns the URL string for the report content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.reportId The id of the report. + * @param params.user The username of the user requesting the report content. + * + */ getReportContentUrl(params: ReportTaskGetReportContentUrlParams): string; + /** + * Executes a report and returns the raw [report data](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.reportId The id of the report. + * @param params.user The username of the user requesting the report data. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getReportData(params: ReportTaskGetReportDataParams, requestOptions?: any): IPromise; + /** + * Gets the XSLT stylesheet for the specified report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportStylesheet) + * + * @param reportId The id of the report. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getReportStylesheet(reportId: number, requestOptions?: any): IPromise; } interface ReportTaskConstructor { + /** + * Helps you generate reports about the work being managed in your Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html) + */ + new(properties?: ReportTaskProperties): ReportTask; } export const ReportTask: ReportTaskConstructor; interface ReportTaskProperties extends TaskProperties { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#url) + */ url?: string; } - export interface Report { + /** + * Report represents a configured report in the Workflow Manager system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) + */ + export interface Report extends Object { + /** + * A description of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) + */ description: string; + /** + * The category to which the report belongs in the system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) + */ hierarchy: string; + /** + * A unique id for the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) + */ id: number; + /** + * The name of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) + */ name: string; + /** + * The title of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) + */ title: string; } - export interface ReportData { + /** + * ReportData is the generated result of a report after it has been executed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) + */ + export interface ReportData extends Object { + /** + * The name of columns returned as part of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) + */ columns: string[]; + /** + * A description of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) + */ description: string; + /** + * The [aggregation of the report data](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) into subcategories. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) + */ groups: ReportDataGroup[]; + /** + * The title of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) + */ title: string; } - export interface ReportDataGroup { + /** + * ReportDataGroup aggregates the report results into user defined categories. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) + */ + export interface ReportDataGroup extends Object { + /** + * The label of the aggregate category as defined in the report, eg. Total Jobs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) + */ aggregateLabel: string; + /** + * The value of the aggregate category based on the calculation defined in the report section options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) + */ aggregateValue: string; + /** + * The rows containing the data returned in the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) + */ row: string[]; + /** + * The data value based on which the section is created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) + */ value: string; } - export interface ReportTaskGenerateReportParams { + + export interface ReportTaskGenerateReportParams extends Object { + /** + * The id of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) + */ reportId: number; + /** + * The user name requesting the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) + */ user: string; } - export interface ReportTaskGetReportContentUrlParams { + + export interface ReportTaskGetReportContentUrlParams extends Object { + /** + * The id of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) + */ reportId: number; + /** + * The username of the user requesting the report content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) + */ user: number; } - export interface ReportTaskGetReportDataParams { + + export interface ReportTaskGetReportDataParams extends Object { + /** + * The id of the report. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) + */ reportId: number; + /** + * The username of the user requesting the report data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) + */ user: string; } interface TokenTask extends Task { + /** + * Parses a string with embedded tokens using user and job information. The string is returned with embedded tokens replaced by their actual values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId A unique id for the job. + * @param params.stringToParse The string representing the tokens to be parsed. + * @param params.user The username of the user requesting token parsing. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ parseTokens(params: TokenTaskParseTokensParams, requestOptions?: any): IPromise; } interface TokenTaskConstructor { + /** + * Helps you parse Workflow Manager tokens to the actual value of tokens in the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html) + */ + new(properties?: TokenTaskProperties): TokenTask; } @@ -7989,217 +34230,1033 @@ declare namespace __esri { } - export interface TokenTaskParseTokensParams { + + export interface TokenTaskParseTokensParams extends Object { + /** + * A unique id for the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) + */ jobId: any; + /** + * The string representing the tokens to be parsed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) + */ stringToParse: string; + /** + * The username of the user requesting token parsing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) + */ user: string; } interface WorkflowTask extends Task { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#url) + */ url: string; + /** + * Get the information which indicates whether this workflow step can be run. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.stepId The unique id of the step. + * @param params.user The user name of the user wanting to run the step. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ canRunStep(params: WorkflowTaskCanRunStepParams, requestOptions?: any): IPromise; + /** + * Executes the specified steps in order and gets back [execution information](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) of the steps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.stepIds The array of unique step Ids. + * @param params.auto Indicates whether to automatically execute as many steps as possible, based on the workflow configuration. The default is false, to execute only the current step. + * @param params.user The user name of the user executing the step. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ executeSteps(params: WorkflowTaskExecuteStepsParams, requestOptions?: any): IPromise; + /** + * Gets all workflow [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getAllSteps) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getAllSteps(jobId: number, requestOptions?: any): IPromise; + /** + * Gets all current [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. A workflow will have more than one current step if it is configured to support parallel steps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getCurrentSteps) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getCurrentSteps(jobId: number, requestOptions?: any): IPromise; + /** + * Gets a specific workflow [step](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.stepId The unique id of the step. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getStep(params: WorkflowTaskGetStepParams, requestOptions?: any): IPromise; + /** + * Get the help associated with a workflow step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.stepId The unique id of the step. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getStepDescription(params: WorkflowTaskGetStepDescriptionParams, requestOptions?: any): IPromise; + /** + * Gets a URL to access the file content of a file step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.stepId The unique id of the step. + * + */ getStepFileUrl(params: WorkflowTaskGetStepFileUrlParams): string; + /** + * Get a job's [workflow display details](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getWorkflowDisplayDetails) + * + * @param jobId The unique id of the job. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ getWorkflowDisplayDetails(jobId: number, requestOptions?: any): IPromise; + /** + * Gets a URL of an image depicting the current state of a job's workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getWorkflowImageUrl) + * + * @param jobId The unique id of the job. + * + */ getWorkflowImageUrl(jobId: number): string; + /** + * Marks the specified steps of a job workflow as completed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.stepIds The array of unique step Ids. + * @param params.user The user name of the user marking the step complete. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ markStepsAsDone(params: WorkflowTaskMarkStepsAsDoneParams, requestOptions?: any): IPromise; + /** + * Advances the workflow to the next step based on a return code value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job Id. + * @param params.stepId The unique id of the step. + * @param params.returnCode A numeric value representing the return code. + * @param params.user The user name of the user advancing the workflow to the next step. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ moveToNextStep(params: WorkflowTaskMoveToNextStepParams, requestOptions?: any): IPromise; + /** + * The job workflow is updated with the latest workflow of job type, after the job has been created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.user The user name of the user recreating the workflow. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ recreateWorkflow(params: WorkflowTaskRecreateWorkflowParams, requestOptions?: any): IPromise; + /** + * Resolves workflow path conflicts resulting from executing or marking as complete a step, which can have two or more next steps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.stepId The unique id of the step. + * @param params.optionReturnCode A numeric value representing the return code from the step where the conflict was encountered. + * @param params.optionStepIds An array of unique step IDs of all the possible next steps. + * @param params.user The user name of the user resolving the conflict. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ resolveConflict(params: WorkflowTaskResolveConflictParams, requestOptions?: any): IPromise; + /** + * Sets a step as the current active step of a job workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) + * + * @param params See the object specifications in table below for the structure of the `params` object. + * @param params.jobId The unique id of the job. + * @param params.stepId The unique id of the step. + * @param params.user The user name of the user setting the current step. + * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). + * + */ setCurrentStep(params: WorkflowTaskSetCurrentStepParams, requestOptions?: any): IPromise; } interface WorkflowTaskConstructor { + /** + * Class to perform operations on Workflow Manager workflows and steps. The workflows are collections of steps that are executed while working on a job. Workflows are designed to organize and simplify tasks to ensure that no step is missed. The steps are the building blocks of your workflows and are connected using paths. Step and path properties determine the flow of the work. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html) + */ + new(properties?: WorkflowTaskProperties): WorkflowTask; } export const WorkflowTask: WorkflowTaskConstructor; interface WorkflowTaskProperties extends TaskProperties { + /** + * URL to the ArcGIS Workflow Manager REST service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#url) + */ url?: string; } - export interface ExecuteInfo { + /** + * ExecuteInfo provides information on whether a step can be executed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ + export interface ExecuteInfo extends Object { + /** + * Information about [conflicts](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) in workflow step progression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ conflicts: WorkflowConflicts; + /** + * The error code returned by the steps in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ errorCode: number; + /** + * The description for the errors returned by the steps in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ errorDescription: string; + /** + * The result of a step execution. **Possible Values:** executed | dependent-on-step | dependent-on-stage | dependent-on-status | job-on-hold | step-depends-on-step | check | step-assigned-to-other-user | step-assigned-to-other-group | job-assigned-to-others | job-closed | invalid-platform | invalid-step | dependent-on-job | not-current-step + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ executionResult: string; + /** + * Indicates whether a step has conflicts. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ hasConflicts: boolean; + /** + * Indicates whether a step has return code. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ hasReturnCode: boolean; + /** + * The unique id of current job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ jobID: number; + /** + * The return code for the current workflow step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ returnCode: number; + /** + * The unique id of the current step in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ stepID: number; + /** + * Indicates whether the step threw an error during execution. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) + */ threwError: boolean; } - export interface Step { + /** + * Step retpresents the properties of a step that is used in a job's workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ + export interface Step extends Object { + /** + * Indicates whether the step has already been executed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ hasBeenExecuted: boolean; + /** + * The user or group to whom the step is assigned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ assignedTo: string; + /** + * Indicates whether the step can be run asynchronously. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ async: boolean; + /** + * Indicates whether the step can be automatically executed when reached. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ autoRun: boolean; + /** + * Indicates whether the step can be skipped without executing it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ canSkip: boolean; + /** + * Indicates whether the step can start parallel execution of other steps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ canSpawnConcurrency: boolean; + /** + * The unique id of step type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ commonId: number; + /** + * The default percentage completion of the job once step is reached. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ defaultPercentComplete: number; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** none | unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ assignedType: string; + /** + * Indicates whether the step has been started. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ hasBeenStarted: boolean; + /** + * The unique id generated as the step Id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ id: number; + /** + * The name of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ name: string; + /** + * Indicates whether the step will be automatically marked as complete when complete. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ selfCheck: boolean; + /** + * The unique numeric status value configured as the status of the job once step is reached. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ statusId: number; + /** + * The percentage completion of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ stepPercentComplete: number; + /** + * The type of notification that will be sent when the step finishes execution. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ notificationType: string; + /** + * The [step template](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) for current step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ stepType: StepType; } - export interface StepType { + /** + * StepType represents properties of step templates that are available in the Workflow Manager system for authoring workflows. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ + export interface StepType extends Object { + /** + * The program/application/code that will be executed on this step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ program: string; + /** + * The step arguments required at runtime. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ arguments: string; + /** + * The type of execution for the step. **Possible Values:** executable | function | procedural | launch-url | question | open-file + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ executionType: string; + /** + * The unique id for the step type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ id: number; + /** + * The name of the step type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ name: string; + /** + * The description of the step type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ description: string; + /** + * The path/URL of the step description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ stepDescriptionLink: string; + /** + * The type of step description. **Possible Values:** none | embedded-html | link + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ stepDescriptionType: string; + /** + * The shape of the step as it will appear in a workflow graphic. **Possible Values:** rounded-rectangle | rectangle | oval | diamond | parallelogram + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ stepIndicatorType: string; + /** + * The platform on which the step can be executed. **Possible Values:** desktop | server | both + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ supportedPlatform: string; + /** + * Indicates whether Workflow Manager will be minimized and hidden during step execution. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ visible: boolean; } - export interface WorkflowAnnotationDisplayDetails { + /** + * WorkflowAnnotationDisplayDetails represents properties of a workflow annotation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ + export interface WorkflowAnnotationDisplayDetails extends Object { + /** + * The X coordinate of the annotation object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ centerX: number; + /** + * The Y coordinate of the annotation object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ centerY: number; + /** + * The fill color of the annotation object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ fillColor: Color; + /** + * The height of the annotation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ height: number; + /** + * The annotation text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ label: string; + /** + * The color of annotation label text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ labelColor: Color; + /** + * The outline color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ OutlineColor: Color; + /** + * The width of the annotation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) + */ width: number; } - export interface WorkflowConflicts { + /** + * WorkflowConflicts represents properties for workflows that have a conflicting path or multiple possible paths for progression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) + */ + export interface WorkflowConflicts extends Object { + /** + * The unique id of currently active job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) + */ jobID: number; + /** + * The information about the step in the workflow returned as [WorkflowOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) + */ options: WorkflowOption[]; + /** + * Indicates whether the step will begin a concurrent path in the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) + */ spawnsConcurrency: boolean; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) + */ stepId: number; } - export interface WorkflowDisplayDetails { + /** + * WorkflowDisplayDetails represents a collection of properties that constitute a workflow - annotations, steps, and paths. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) + */ + export interface WorkflowDisplayDetails extends Object { + /** + * The properties of how the [annotations are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) + */ annotations: WorkflowAnnotationDisplayDetails[]; + /** + * The properties of how the [path are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) + */ paths: WorkflowPathDisplayDetails[]; + /** + * The properties of how the [step are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) + */ steps: WorkflowStepDisplayDetails[]; } - export interface WorkflowOption { + /** + * WorkflowOption represents properties of a workflow that have return codes and step branches. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) + */ + export interface WorkflowOption extends Object { + /** + * The return code generated from a step execution. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) + */ returnCode: number; + /** + * The collection of [descriptions for workflow steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) + */ steps: WorkflowStepInfo[]; } - export interface WorkflowPathDisplayDetails { + /** + * WorkflowPathDisplayDetails represents properties of a workflow's path properties like location, destination steps, postion on the workflow canvas. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ + export interface WorkflowPathDisplayDetails extends Object { + /** + * The unique id of the step to which the path will lead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ destStepId: number; + /** + * The unique id of the step just executed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ sourceStepID: number; + /** + * The label associated with the path. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ label: string; + /** + * The color of the label on the path. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ labelColor: Color; + /** + * The X coordinate of the label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ labelX: number; + /** + * The Y coordinate of the label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ labelY: number; + /** + * The color of the line representing the path. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ lineColor: Color; + /** + * An object with following properties. + * + * Name | Type | Description + * ---------|--------|------------- + * isDefault | Boolean | Indicates whehter this is the default path(only path) from the source step. + * numReturnValues | Number[] | The number of possible return values for the path. + * returnValueX | Number[] | The return values associated with the path. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) + */ pathObject: any; } - export interface WorkflowStepDisplayDetails { + /** + * WorkflowStepDisplayDetails represents properties of a workflow step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ + export interface WorkflowStepDisplayDetails extends Object { + /** + * The color of step label text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ labelColor: Color; + /** + * The X coordinate of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ centerX: number; + /** + * The fill color of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ fillColor: Color; + /** + * The height of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ height: number; + /** + * The step text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ label: string; + /** + * The Y coordinate of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ centerY: number; + /** + * The outline color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ OutlineColor: Color; + /** + * The shape of the step. **Possible Values:** rounded-rectangle | rectangle | oval | diamond | parallelogram + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ shape: string; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ stepId: number; + /** + * The step execution type. **Possible Values:** executable | function | procedural | launch-url | question | open-file + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ stepType: string; + /** + * The width of the annotation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ width: number; } - export interface WorkflowStepInfo { + /** + * WorkflowStepInfo represents collection of descriptions for workflow's steps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) + */ + export interface WorkflowStepInfo extends Object { + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) + */ id: number; + /** + * The name of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) + */ name: string; } - export interface WorkflowTaskCanRunStepParams { + + export interface WorkflowTaskCanRunStepParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) + */ jobId: number; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) + */ stepId: number; + /** + * The user name of the user wanting to run the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) + */ user: string; } - export interface WorkflowTaskExecuteStepsParams { + + export interface WorkflowTaskExecuteStepsParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) + */ jobId: number; + /** + * The array of unique step Ids. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) + */ stepIds: number[]; + /** + * Indicates whether to automatically execute as many steps as possible, based on the workflow configuration. The default is false, to execute only the current step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) + */ auto: boolean; + /** + * The user name of the user executing the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) + */ user: string; } - export interface WorkflowTaskGetStepDescriptionParams { + + export interface WorkflowTaskGetStepDescriptionParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) + */ jobId: number; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) + */ stepId: number; } - export interface WorkflowTaskGetStepFileUrlParams { + + export interface WorkflowTaskGetStepFileUrlParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) + */ jobId: number; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) + */ stepId: number; } - export interface WorkflowTaskGetStepParams { + + export interface WorkflowTaskGetStepParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) + */ jobId: number; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) + */ stepId: number; } - export interface WorkflowTaskMarkStepsAsDoneParams { + + export interface WorkflowTaskMarkStepsAsDoneParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) + */ jobId: number; + /** + * The array of unique step Ids. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) + */ stepIds: number[]; + /** + * The user name of the user marking the step complete. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) + */ user: string; } - export interface WorkflowTaskMoveToNextStepParams { + + export interface WorkflowTaskMoveToNextStepParams extends Object { + /** + * The unique id of the job Id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) + */ jobId: number; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) + */ stepId: number; + /** + * A numeric value representing the return code. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) + */ returnCode: number; + /** + * The user name of the user advancing the workflow to the next step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) + */ user: string; } - export interface WorkflowTaskRecreateWorkflowParams { + + export interface WorkflowTaskRecreateWorkflowParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) + */ jobId: number; + /** + * The user name of the user recreating the workflow. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) + */ user: string; } - export interface WorkflowTaskResolveConflictParams { + + export interface WorkflowTaskResolveConflictParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) + */ jobId: number; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) + */ stepId: number; + /** + * A numeric value representing the return code from the step where the conflict was encountered. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) + */ optionReturnCode: number; + /** + * An array of unique step IDs of all the possible next steps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) + */ optionStepIds: number[]; + /** + * The user name of the user resolving the conflict. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) + */ user: string; } - export interface WorkflowTaskSetCurrentStepParams { + + export interface WorkflowTaskSetCurrentStepParams extends Object { + /** + * The unique id of the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) + */ jobId: number; + /** + * The unique id of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) + */ stepId: number; + /** + * The user name of the user setting the current step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) + */ user: string; } interface Viewpoint extends Accessor, JSONSupport { + /** + * The viewpoint camera (3D only). + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#camera) + */ camera: Camera; + /** + * The rotation of due north in relation to the top of the view in degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#rotation) + * + * @default 0 + */ rotation: number; + /** + * The scale of the viewpoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#scale) + */ scale: number; + /** + * The target geometry framed by the viewpoint. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#targetGeometry) + */ targetGeometry: Geometry; + /** + * Create a deep clone of the viewpoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone) + * + * + */ clone(): Viewpoint; } interface ViewpointConstructor { + + new(properties?: ViewpointProperties): Viewpoint; fromJSON(json: any): Viewpoint; @@ -8208,303 +35265,1164 @@ declare namespace __esri { export const Viewpoint: ViewpointConstructor; interface ViewpointProperties { + /** + * The viewpoint camera (3D only). + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#camera) + */ camera?: CameraProperties; + /** + * The rotation of due north in relation to the top of the view in degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#rotation) + * + * @default 0 + */ rotation?: number; + /** + * The scale of the viewpoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#scale) + */ scale?: number; + /** + * The target geometry framed by the viewpoint. + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#targetGeometry) + */ targetGeometry?: GeometryProperties; } interface Draw extends Accessor { - activeAction: PointDrawAction | PolygonDrawAction | PolylineDrawAction; + /** + * A reference to the active draw action. 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: PointDrawAction | MultipointDrawAction | PolygonDrawAction | PolylineDrawAction; + /** + * 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; - create(drawAction: string): PointDrawAction | PolygonDrawAction | PolylineDrawAction; + /** + * 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 to create. See the table below for a list of known values and type of draw action it creates. **Known Values:** point | multipoint | polyline | polygon + * + */ + create(drawAction: string): PointDrawAction | MultipointDrawAction | PolylineDrawAction | PolygonDrawAction; + /** + * 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 geometries. For example, if you want to prevent users from drawing 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 { - activeAction?: PointDrawActionProperties | PolygonDrawActionProperties | PolylineDrawActionProperties; + /** + * A reference to the active draw action. 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?: PointDrawActionProperties | MultipointDrawActionProperties | PolygonDrawActionProperties | PolylineDrawActionProperties; + /** + * 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; } - interface PointDrawAction extends Accessor, Evented { + interface MultipointDrawAction extends Accessor, Evented { + /** + * 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[][]; + /** + * 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-MultipointDrawAction.html#view) + */ view: MapView; + /** + * Indicates if the [redo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#redo) method can be called on the action instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#canRedo) + * + * + */ + canRedo(): boolean; + /** + * Indicates if the [undo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#undo) method can be called on the action instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#canUndo) + * + * + */ + canUndo(): boolean; + /** + * 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; + /** + * Incrementally redo actions recorded in the stack. Call [canRedo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.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-MultipointDrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#event:vertex-remove) event depending on the last action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.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-MultipointDrawAction.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-MultipointDrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#event:vertex-remove) event depending on the last action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#undo) + * + * + */ + undo(): void; + + + on(name: "cursor-update", eventHandler: MultipointDrawActionCursorUpdateEventHandler): IHandle; + + on(name: "cursor-update", modifiers: string[], eventHandler: MultipointDrawActionCursorUpdateEventHandler): IHandle; + + on(name: "vertex-add", eventHandler: MultipointDrawActionVertexAddEventHandler): IHandle; + + on(name: "vertex-add", modifiers: string[], eventHandler: MultipointDrawActionVertexAddEventHandler): IHandle; + + on(name: "vertex-remove", eventHandler: MultipointDrawActionVertexRemoveEventHandler): IHandle; + + on(name: "vertex-remove", modifiers: string[], eventHandler: MultipointDrawActionVertexRemoveEventHandler): IHandle; + + on(name: "draw-complete", eventHandler: MultipointDrawActionDrawCompleteEventHandler): IHandle; + + on(name: "draw-complete", modifiers: string[], eventHandler: MultipointDrawActionDrawCompleteEventHandler): IHandle; + } + + interface MultipointDrawActionConstructor { + + + new(properties?: MultipointDrawActionProperties): MultipointDrawAction; + } + + export const MultipointDrawAction: MultipointDrawActionConstructor; + + interface MultipointDrawActionProperties { + /** + * 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-MultipointDrawAction.html#view) + */ + view?: MapViewProperties; + } + + export interface MultipointDrawActionCursorUpdateEvent { + + defaultPrevented: boolean; + + preventDefault: Function; + + type: string; + + vertexIndex: number; + + vertices: number[][]; + } + + export interface MultipointDrawActionDrawCompleteEvent { + + defaultPrevented: boolean; + + preventDefault: Function; + + type: string; + + vertices: number[][]; + } + + export interface MultipointDrawActionVertexAddEvent { + + defaultPrevented: boolean; + + preventDefault: Function; + + type: string; + + vertexIndex: number; + + vertices: number[][]; + } + + export interface MultipointDrawActionVertexRemoveEvent { + + defaultPrevented: boolean; + + preventDefault: Function; + + type: string; + + vertexIndex: number; + + vertices: number[][]; + } + + interface PointDrawAction extends Accessor, Evented { + /** + * 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) + */ + coordinates: number[]; + /** + * 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-PointDrawAction.html#view) + */ + view: MapView; + + /** + * 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; + on(name: "cursor-update", eventHandler: PointDrawActionCursorUpdateEventHandler): IHandle; + on(name: "cursor-update", modifiers: string[], eventHandler: PointDrawActionCursorUpdateEventHandler): IHandle; + on(name: "draw-complete", eventHandler: PointDrawActionDrawCompleteEventHandler): IHandle; + on(name: "draw-complete", modifiers: string[], eventHandler: PointDrawActionDrawCompleteEventHandler): IHandle; } interface PointDrawActionConstructor { + + new(properties?: PointDrawActionProperties): PointDrawAction; } export const PointDrawAction: PointDrawActionConstructor; interface PointDrawActionProperties { + /** + * 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) + */ + coordinates?: number[]; + /** + * 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-PointDrawAction.html#view) + */ view?: MapViewProperties; } export interface PointDrawActionCursorUpdateEvent { + coordinates: number[]; + defaultPrevented: boolean; + preventDefault: Function; + type: string; } export interface PointDrawActionDrawCompleteEvent { + coordinates: number[]; + defaultPrevented: boolean; + preventDefault: Function; + type: string; } interface PolygonDrawAction extends Accessor, Evented { - vertices: number[][]; + /** + * 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[][]; + /** + * 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-PolygonDrawAction.html#view) + */ view: MapView; + /** + * Indicates if the [redo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#redo) method can be called on the action instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#canRedo) + * + * + */ canRedo(): boolean; + /** + * Indicates if the [undo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#undo) method can be called on the action instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#canUndo) + * + * + */ canUndo(): boolean; + /** + * 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; + /** + * Incrementally redo actions recorded in the stack. Call [canRedo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.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-PolygonDrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#event:vertex-remove) events depending on the last action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.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-PolygonDrawAction.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-PolygonDrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#event:vertex-remove) events depending on the last action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#undo) + * + * + */ undo(): void; + on(name: "cursor-update", eventHandler: PolygonDrawActionCursorUpdateEventHandler): IHandle; + on(name: "cursor-update", modifiers: string[], eventHandler: PolygonDrawActionCursorUpdateEventHandler): IHandle; + on(name: "vertex-add", eventHandler: PolygonDrawActionVertexAddEventHandler): IHandle; + on(name: "vertex-add", modifiers: string[], eventHandler: PolygonDrawActionVertexAddEventHandler): IHandle; + on(name: "vertex-remove", eventHandler: PolygonDrawActionVertexRemoveEventHandler): IHandle; + on(name: "vertex-remove", modifiers: string[], eventHandler: PolygonDrawActionVertexRemoveEventHandler): IHandle; + on(name: "draw-complete", eventHandler: PolygonDrawActionDrawCompleteEventHandler): IHandle; + on(name: "draw-complete", modifiers: string[], eventHandler: PolygonDrawActionDrawCompleteEventHandler): IHandle; } interface PolygonDrawActionConstructor { + + new(properties?: PolygonDrawActionProperties): PolygonDrawAction; } export const PolygonDrawAction: PolygonDrawActionConstructor; interface PolygonDrawActionProperties { - vertices?: number[][]; + /** + * 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-PolygonDrawAction.html#view) + */ view?: MapViewProperties; } export interface PolygonDrawActionCursorUpdateEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; } export interface PolygonDrawActionDrawCompleteEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertices: number[][]; } export interface PolygonDrawActionVertexAddEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; } export interface PolygonDrawActionVertexRemoveEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; } interface PolylineDrawAction extends Accessor, Evented { - vertices: number[][]; + /** + * 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[][]; + /** + * 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-PolylineDrawAction.html#view) + */ view: MapView; + /** + * Indicates if the [redo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#redo) method can be called on the action instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#canRedo) + * + * + */ canRedo(): boolean; + /** + * Indicates if the [undo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#undo) method can be called on the action instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#canUndo) + * + * + */ canUndo(): boolean; + /** + * 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; + /** + * Incrementally redo actions recorded in the stack. Call [canRedo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.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-PolylineDrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#event:vertex-remove) event depending on the last action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.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-PolylineDrawAction.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-PolylineDrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#event:vertex-remove) event depending on the last action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#undo) + * + * + */ undo(): void; + on(name: "cursor-update", eventHandler: PolylineDrawActionCursorUpdateEventHandler): IHandle; + on(name: "cursor-update", modifiers: string[], eventHandler: PolylineDrawActionCursorUpdateEventHandler): IHandle; + on(name: "vertex-add", eventHandler: PolylineDrawActionVertexAddEventHandler): IHandle; + on(name: "vertex-add", modifiers: string[], eventHandler: PolylineDrawActionVertexAddEventHandler): IHandle; + on(name: "vertex-remove", eventHandler: PolylineDrawActionVertexRemoveEventHandler): IHandle; + on(name: "vertex-remove", modifiers: string[], eventHandler: PolylineDrawActionVertexRemoveEventHandler): IHandle; + on(name: "draw-complete", eventHandler: PolylineDrawActionDrawCompleteEventHandler): IHandle; + on(name: "draw-complete", modifiers: string[], eventHandler: PolylineDrawActionDrawCompleteEventHandler): IHandle; } interface PolylineDrawActionConstructor { + + new(properties?: PolylineDrawActionProperties): PolylineDrawAction; } export const PolylineDrawAction: PolylineDrawActionConstructor; interface PolylineDrawActionProperties { - vertices?: number[][]; + /** + * 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-PolylineDrawAction.html#view) + */ view?: MapViewProperties; } export interface PolylineDrawActionCursorUpdateEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; } export interface PolylineDrawActionDrawCompleteEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertices: number[][]; } export interface PolylineDrawActionVertexAddEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; } export interface PolylineDrawActionVertexRemoveEvent { + defaultPrevented: boolean; + preventDefault: Function; + type: string; + vertexIndex: number; + vertices: number[][]; } + /** + * map/scene on screen. The ArcGIS API for JavaScript offers a low-level interface to access the SceneView's WebGL context, and thus enables creating custom visualizations that interact with the scene the same way as built-in layers. Developers can either write WebGL code directly, or integrate with third-party WebGL libraries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html) + */ interface externalRenderers { + /** + * Adds an external renderer to the view. The external renderer is defined by an object that contains certain methods and properties, as defined by [ExternalRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#add) + * + * @param view The view to which to attach the external renderer. + * @param renderer The external renderer. + * + */ add(view: SceneView, renderer: ExternalRenderer): void; - fromRenderCoordinates(view: SceneView, srcCoordinates: number[] | any, srcStart: number, destCoordinates: number[] | any, destStart: number, destSpatialReference: SpatialReference, count: number): number[] | any; + /** + * Transforms positions from the internal rendering coordinate system to the output spatial reference. The allowable output spatial reference is limited and depends on the [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode): + * * In `global` mode, it can either be Web Mercator or WGS84. + * * In `local` mode, it has to match [view.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#spatialReference), and the call to this function simply copies the coordinates from `srcCoordinates` to `destCoordinates`. + * + * + * If these conditions are not met, nothing is written to `destCoordinates` and the function returns `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#fromRenderCoordinates) + * + * @param view The view related to the input coordinates. + * @param srcCoordinates A linear array of one or more vectors that are interpreted as XYZ coordinates. For example, two position vectors would be represented as `[x1, y1, z1, x2, y2, z2]`. This must contain at least `srcStart + 3 * count` elements. + * @param srcStart An index in `srcCoordinates` from which the coordinates will start being read. + * @param destCoordinates A reference to an array in which the results will be written. + * @param destStart An index in `destCoordinates` in which the coordinates will start to be written. + * @param destSpatialReference The spatial reference of the output coordinates. When `null`, `view.spatialReference` is used instead. + * @param count The number of vertices to be transformed. + * + */ + fromRenderCoordinates(view: SceneView, srcCoordinates: number[] | Float32Array, srcStart: number, destCoordinates: number[] | Float32Array, destStart: number, destSpatialReference: SpatialReference, count: number): number[] | Float32Array; + /** + * Removes an external renderer from the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#remove) + * + * @param view The view from which to remove the external renderer. + * @param renderer The external renderer. + * + */ remove(view: SceneView, renderer: ExternalRenderer): void; - renderCoordinateTransformAt(view: SceneView, origin: number[] | any, srcSpatialReference?: SpatialReference, dest?: number[] | any): number[] | any; + /** + * Computes a 4x4 affine transformation matrix that constitutes a linear coordinate transformation from a local Cartesian coordinate system to the virtual world coordinate system. For example, this matrix can be used to transform the vertices of a 3D model to the rendering coordinate system. The local Cartesian system is defined by its origin and the following axis definition: + * * X: Easting + * * Y: Northing + * * Z: Elevation + * + * + * ![externalRenderers-renderCoordinateTransformAt](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/3d/externalRenderers-renderCoordinateTransformAt.png) When [view.viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) is `global`, a linear transformation does not take the curvature of the globe or other non-linear projection aspects into account. Thus, the resulting coordinates will only appear correct within a small region around the origin of the local Cartesian system. The allowable spatial reference of `origin` depends on the [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode): + * * In `global` mode, it can either be Web Mercator or WGS84. + * * In `local` mode, it has to match [view.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#spatialReference). + * + * + * If these conditions are not met, nothing will be written to `dest` and the function will return `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#renderCoordinateTransformAt) + * + * @param view The view for which the transformation will be used. + * @param origin The global coordinates of the origin in the local Cartesian coordinate system. + * @param srcSpatialReference The spatial reference of the origin coordinates. If undefined, `view.spatialReference` is used instead. + * @param dest A reference to an array where the 16 matrix elements will be stored. The resulting matrix follows OpenGL conventions where the translation components occupy the 13th, 14th and 15th elements. If undefined, a newly created matrix returned. + * + */ + renderCoordinateTransformAt(view: SceneView, origin: number[] | Float32Array, srcSpatialReference?: SpatialReference, dest?: number[] | Float32Array): number[] | Float32Array; + /** + * Requests the view to be redrawn. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#requestRender) + * + * @param view The view to which the external renderer is attached. + * + */ requestRender(view: SceneView): void; - toRenderCoordinates(view: SceneView, srcCoordinates: number[] | any, srcStart: number, srcSpatialReference: SpatialReference, destCoordinates: number[] | any, destStart: number, count: number): number[] | any; + /** + * Transforms positions from the given spatial reference to the internal rendering coordinate system. The allowable input spatial reference is limited and depends on the [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode): + * * In `global` mode, it can either be Web Mercator or WGS84. + * * In `local` mode, it has to match [view.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#spatialReference); the call to this function simply copies the coordinates from `srcCoordinates` to `destCoordinates`. + * + * + * If these conditions are not met, nothing is written to `destCoordinates` and the function returns `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#toRenderCoordinates) + * + * @param view The view in which the coordinates will be used. + * @param srcCoordinates A linear array of one or more vectors which are interpreted as XYZ coordinates. For example, two position vectors would be represented as `[x1, y1, z1, x2, y2, z2]`. This must contain at least `srcStart + 3 * count` elements. + * @param srcStart An index in `srcCoordinates` from which the coordinates start to be read. + * @param srcSpatialReference The spatial reference of the input coordinates. When `null`, `view.spatialReference` is used instead. + * @param destCoordinates A reference to an array where the results will be written. + * @param destStart An index in `destCoordinates` to which the coordinates will start to be written. + * @param count The number of vertices to be transformed. + * + */ + toRenderCoordinates(view: SceneView, srcCoordinates: number[] | Float32Array, srcStart: number, srcSpatialReference: SpatialReference, destCoordinates: number[] | Float32Array, destStart: number, count: number): number[] | Float32Array; } export const externalRenderers: externalRenderers; - export interface ColorAndIntensity { + /** + * Tuple of an RGB color value and an intensity value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) + */ + export interface ColorAndIntensity extends Object { + /** + * RGB color with values between 0 and 1. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) + */ color: any; + /** + * Scalar intensity value by which the color should be scaled for compositing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) + */ intensity: number; } - export interface ExternalRenderer { + /** + * Defines an external renderer using callbacks and properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) + */ + export interface ExternalRenderer extends Object { + /** + * Typically called once after adding the external renderer to a view, or whenever the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) becomes [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ready). It may be called again if the ready state cycles, for example when a different [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) is assigned to the view. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) + * + * + */ setup(): void; + /** + * Called in every frame to execute the state update and draw calls. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) + * + * + */ render(): void; + /** + * Called when the external renderer is removed from a view, or when the [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ready) state of the view turns false. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) + * + * + */ dispose(): void; } - export interface RenderCamera { + /** + * The camera object passed to renderer callbacks in [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). This is not the same as [Camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html). All properties are read-only and defined in terms of the internal rendering coordinate system (see the [section on coordinate systems](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#coordinate-systems) at the top of this page). Vectors (`Vec3`) are presented as arrays with 3 elements (x, y, z). Matrices (`Mat4`) are presented as linear arrays with 16 elements following the OpenGL conventions where the translation components occupy the 13th, 14th, and 15th elements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ + export interface RenderCamera extends Object { + /** + * A 4x4 matrix that transforms coordinates from world space to camera space. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ viewMatrix: any; + /** + * The inverse transpose of `viewMatrix`, used to transform normals from world space to camera space. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ viewInverseTransposeMatrix: any; + /** + * A 4x4 matrix that defines the perspective projection transformation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ projectionMatrix: any; + /** + * The position of the camera in the internal Cartesian rendering coordinate system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ eye: any; + /** + * The camera target ("look at") position in the internal Cartesian rendering coordinate system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ center: any; + /** + * The camera up vector. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ up: any; + /** + * The distance to the near plane. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ near: number; + /** + * The distance to the far plane. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ far: number; + /** + * The horizontal field of view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ fovX: number; + /** + * The vertical field of view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) + */ fovY: number; } - export interface RenderContext { + /** + * The object passed as a parameter to every call to `setup` and `render` the external renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) + */ + export interface RenderContext extends Object { + /** + * The WebGL rendering context. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) + */ gl: any; + /** + * The camera used to render the current frame. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) + */ camera: RenderCamera; + /** + * The lighting used by [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) to render the current frame. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) + */ sunLight: SunLight; + /** + * A convenience function provided to completely reset the WebGL state after using it. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) + * + * + */ resetWebGLState(): void; + /** + * Binds the color and depth buffers an external renderer is supposed to render into. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) + * + * + */ bindRenderTarget(): void; } - export interface SunLight { + /** + * Describes the lighting used by [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), derived from its sun lighting model. It consists of a directional Lambertian (`diffuse`) and a constant (`ambient`) term, which should be treated in the sense of the [Phong Reflection Model](https://en.wikipedia.org/wiki/Phong_reflection_model). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) + */ + export interface SunLight extends Object { + /** + * The incident light direction in render coordinates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) + */ direction: any; + /** + * The diffuse light color and intensity. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) + */ diffuse: ColorAndIntensity; + /** + * The ambient light color and intensity. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) + */ ambient: ColorAndIntensity; } interface BreakpointsOwner { + /** + * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) + */ breakpoints: BreakpointsOwnerBreakpoints; + /** + * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. + * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. + * + * Possible Value | Description + * ---------------|------------ + * xsmall | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * small | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `xsmall` and `small` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * medium | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * large | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * xlarge | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) + */ heightBreakpoint: string; - orientation: string; + /** + * A convenience property indicating the view's orientation. See the table below for a list of possible values. + * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. + * + * Possible Value | Description + * ---------------|------------ + * landscape | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is greater than its [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height). + * portrait | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is equal to or smaller than its [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#orientation) + */ + readonly orientation: string; + /** + * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. + * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. + * + * Possible Value | Description + * ---------------|------------ + * xsmall | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * small | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `xsmall` and `small` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * medium | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * large | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * xlarge | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) + */ widthBreakpoint: string; } interface BreakpointsOwnerConstructor { + + new(): BreakpointsOwner; } export const BreakpointsOwner: BreakpointsOwnerConstructor; interface BreakpointsOwnerProperties { + /** + * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) + */ breakpoints?: BreakpointsOwnerBreakpoints; + /** + * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. + * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. + * + * Possible Value | Description + * ---------------|------------ + * xsmall | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * small | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `xsmall` and `small` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * medium | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * large | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * xlarge | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) + */ heightBreakpoint?: string; - orientation?: string; + /** + * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. + * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. + * + * Possible Value | Description + * ---------------|------------ + * xsmall | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * small | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `xsmall` and `small` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * medium | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * large | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * xlarge | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) + */ widthBreakpoint?: string; } - export interface BreakpointsOwnerBreakpoints { - xsmall: number; - small: number; - medium: number; - large: number; + + export interface BreakpointsOwnerBreakpoints extends Object { + /** + * Sets the `xsmall` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is smaller than this value, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `xsmall`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) + * + * @default 544 + */ + xsmall?: number; + /** + * Sets the `small` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `xsmall` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `small`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) + * + * @default 768 + */ + small?: number; + /** + * Sets the `medium` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `small` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `medium`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) + * + * @default 992 + */ + medium?: number; + /** + * Sets the `large` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `medium` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `large`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) + * + * @default 1200 + */ + large?: number; } interface DOMContainer { + /** + * The `id` or node representing the DOM element containing the view. This is typically set in the view's constructor. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container) + */ container: HTMLDivElement | string; - height: number; + /** + * The height of the view in pixels read from the view container element. The view container needs to have a height greater than 0 to be displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#height) + * + * @default 0 + */ + readonly height: number; + /** + * A Popup object that displays general content or attributes from [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#map). The view has a default instance of [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) with predefined styles and a template for defining content. The content in this default instance may be modified directly in the [popup's content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) or in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). You may create a new [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) instance and set it to this property to customize the style, positioning, and content of the popup in favor of using the default popup instance on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#popup) + */ popup: Popup; - resizing: boolean; - size: number[]; - suspended: boolean; + /** + * Indicates if the view is being resized. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#resizing) + * + * @default false + */ + readonly resizing: boolean; + /** + * An array containing the width and height of the view in pixels, e.g. `[width, height]`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#size) + */ + readonly size: number[]; + /** + * Indicates if the view is visible on the page. Is `true` if the view has no [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container), a [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#width) equal to 0, or the CSS `visibility` is `hidden`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#suspended) + * + * @default true + */ + readonly suspended: boolean; + /** + * Exposes the default widgets available in the view and allows you to toggle them on and off. See [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) for more details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#ui) + */ ui: DefaultUI; - width: number; + /** + * The width of the view in pixels read from the view container element. The view container needs to have a width greater than 0 to be displayed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#width) + * + * @default 0 + */ + readonly width: number; } interface DOMContainerConstructor { + + new(): DOMContainer; } export const DOMContainer: DOMContainerConstructor; interface DOMContainerProperties { + /** + * The `id` or node representing the DOM element containing the view. This is typically set in the view's constructor. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container) + */ container?: HTMLDivElement | string; - height?: number; + /** + * A Popup object that displays general content or attributes from [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#map). The view has a default instance of [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) with predefined styles and a template for defining content. The content in this default instance may be modified directly in the [popup's content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) or in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). You may create a new [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) instance and set it to this property to customize the style, positioning, and content of the popup in favor of using the default popup instance on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#popup) + */ popup?: PopupProperties; - resizing?: boolean; - size?: number[]; - suspended?: boolean; + /** + * Exposes the default widgets available in the view and allows you to toggle them on and off. See [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) for more details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#ui) + */ ui?: DefaultUIProperties; - width?: number; } interface CSVLayerView 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-CSVLayerView.html#highlight) + * + * @param target The feature(s) to highlight. + * + */ highlight(target?: Graphic | Graphic[]): any; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryExtent) + * + * @param params Specifies the attributes and spatial filter of the query. Only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. If query parameters are not provided, the extent and count of all features available for drawing are returned. + * + */ queryExtent(params?: Query): 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatureCount) + * + * @param params Specifies the attributes and spatial filter of the query. Only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. If query parameters are not provided, the count of all features available for drawing is returned. + * + */ queryFeatureCount(params?: Query): 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 an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). If query parameters are not provided, all features available for drawing are returned. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatures) + * + * @param params Specifies the attributes and spatial filter of the query. Only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. If specifying a [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) parameter, note that [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) is the only supported geometry. If query parameters are not provided, all features available for drawing are returned. + * + */ queryFeatures(params?: Query): 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryObjectIds) + * + * @param params Specifies the attributes and spatial filter of the query. Only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. + * + */ queryObjectIds(params?: Query): IPromise; } interface CSVLayerViewConstructor { + + new(properties?: CSVLayerViewProperties): CSVLayerView; } @@ -8515,14 +36433,65 @@ declare namespace __esri { } interface FeatureLayerView extends LayerView { + /** + * Highlights the given feature(s). + * > **Known Limitations** In 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) this method is only supported for [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that have opted in to [WebGL rendering](esri-layers-FeatureLayer.html#webgl-rendering). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) + * + * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. + * + */ highlight(target?: Graphic | Graphic[] | number | number[]): any; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. Valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. If query parameters are not provided, the extent and count of all features available for drawing are returned. + * > To query for the extent of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent) + * + * @param params Specifies the attributes and spatial filter of the query. Only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. If query parameters are not provided, the extent and count of all features available for drawing are returned. + * + */ queryExtent(params?: Query): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. + * > To query for the count of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatureCount) + * + * @param params Specifies the attributes and spatial filter of the query. Only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. If query parameters are not provided, the count of all features available for drawing is returned. + * + */ queryFeatureCount(params?: Query): 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 an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.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 visible in the view, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. + * + * [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. Only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. If specifying a [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) parameter, note that [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) is the only supported geometry. If query parameters are not provided, all features available for drawing are returned. + * + */ queryFeatures(params?: Query): 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. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryObjectIds) + * + * @param params Specifies the attributes and spatial filter of the query. Only the [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), and [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) properties should be specified. Adding any other properties will return an error. If specifying a spatialRelationship, note that `intersects` is the only supported operation. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. + * + */ queryObjectIds(params?: Query): IPromise; } interface FeatureLayerViewConstructor { + /** + * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html) + */ + new(properties?: FeatureLayerViewProperties): FeatureLayerView; } @@ -8533,11 +36502,33 @@ declare namespace __esri { } interface GraphicsLayerView 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-GraphicsLayerView.html#highlight) + * + * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. + * + */ highlight(target?: Graphic | Graphic[] | number | number[]): any; + /** + * Returns all graphics available for drawing in the layer view as an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GraphicsLayerView.html#queryGraphics) + * + * + */ queryGraphics(): IPromise; } 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; } @@ -8548,53 +36539,231 @@ declare namespace __esri { } interface ImageryLayerView extends LayerView { + /** + * An object that provides the user access to [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) and their values in the layer. See the object specifications table below for details about each property. This object is used as input in the [pixelFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function for filtering and processing each pixel in the block. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) + */ pixelData: ImageryLayerViewPixelData; } interface ImageryLayerViewConstructor { + /** + * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html) + */ + new(properties?: ImageryLayerViewProperties): ImageryLayerView; } export const ImageryLayerView: ImageryLayerViewConstructor; interface ImageryLayerViewProperties extends LayerViewProperties { + /** + * An object that provides the user access to [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) and their values in the layer. See the object specifications table below for details about each property. This object is used as input in the [pixelFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function for filtering and processing each pixel in the block. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) + */ pixelData?: ImageryLayerViewPixelData; } - export interface ImageryLayerViewPixelData { + + export interface ImageryLayerViewPixelData extends Object { + /** + * The extent of the `pixelBlock`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) + */ extent?: Extent; + /** + * An object representing the pixels in the view. This provides the user access to each pixel on the client via the `pixels` property of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) + */ pixelBlock: PixelBlock; } + interface KMLLayerView extends LayerView { + /** + * A collection of all the [MapImages](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) from visible sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisibleMapImages) + */ + readonly allVisibleMapImages: Collection; + /** + * A collection of all the points from visible sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePoints) + */ + readonly allVisiblePoints: Collection; + /** + * A collection of all the polygons from visible sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePolygons) + */ + readonly allVisiblePolygons: Collection; + /** + * A collection of all the polylines from visible sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePolylines) + */ + readonly allVisiblePolylines: Collection; + } + + interface KMLLayerViewConstructor { + + + new(properties?: KMLLayerViewProperties): KMLLayerView; + } + + export const KMLLayerView: KMLLayerViewConstructor; + + interface KMLLayerViewProperties extends LayerViewProperties { + + } + + /** + * **MapImage** represents an image overlay draped onto the terrain. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) + */ + export interface KMLLayerViewMapImage extends Object { + /** + * Map image id. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) + */ + id: number; + /** + * URL to the map image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) + */ + href: string; + /** + * The [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of the map image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) + */ + Extent: Extent; + /** + * Rotation of the map image about its center, in degrees. Values can be ±180. The default is 0 (north). Rotations are specified in a counterclockwise direction. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) + */ + rotation: number; + } + interface LayerView extends Accessor, corePromise { - layer: Layer; - suspended: boolean; - updating: boolean; + /** + * The layer being viewed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#layer) + */ + readonly layer: Layer; + /** + * Value is `true` if the layer is suspended (i.e., layer will not redraw or update itself when the extent changes). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#suspended) + */ + readonly suspended: boolean; + /** + * Value is `true` when the layer is updating; for example, if it is in the process of fetching data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#updating) + * + * @default false + */ + readonly updating: boolean; + /** + * When `true`, the layer is visible in the view. Set this property to `false` to hide the layer from the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#visible) + * + * @default true + */ visible: boolean; } interface LayerViewConstructor { + + new(properties?: LayerViewProperties): LayerView; } export const LayerView: LayerViewConstructor; interface LayerViewProperties { - layer?: LayerProperties; - suspended?: boolean; - updating?: boolean; + /** + * When `true`, the layer is visible in the view. Set this property to `false` to hide the layer from the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#visible) + * + * @default true + */ visible?: boolean; } interface SceneLayerView extends LayerView { + /** + * Highlights the given feature(s). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#highlight) + * + * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. + * + */ highlight(target?: Graphic | Graphic[] | number | number[]): any; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the 3D [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If query parameters are not provided, the extent and count of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. + * > To query for the extent of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryExtent) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryExtent) + * + * @param params Specifies the attributes of the query. Only the [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) property should be specified. Adding any other properties will return an error. If query parameters are not provided, the extent and count of all loaded features are returned. + * + */ queryExtent(params?: Query): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all loaded features is returned. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. + * > To query for the count of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatureCount) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryFeatureCount) + * + * @param params Specifies the attributes of the query. Only the [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) property should be specified. Adding any other properties will return an error. If query parameters are not provided, the count of all loaded features is returned. + * + */ queryFeatureCount(params?: Query): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. + * > To execute a query against all the features in a Scene Service rather than only those loaded for the current view, you must use the [SceneLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryFeatures) + * + * @param params Specifies the attributes of the query. Only the [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) and [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. + * + */ queryFeatures(params?: Query): IPromise; + /** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns an array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. + * > To query for ObjectIDs of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryObjectIds) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryObjectIds) + * + * @param params Specifies the attributes of the query. Only the [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) property should be specified. Adding any other properties will return an error. If query parameters are not provided, the ObjectIDs of all loaded features are returned. + * + */ queryObjectIds(params?: Query): IPromise; } interface SceneLayerViewConstructor { + /** + * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) + */ + new(properties?: SceneLayerViewProperties): SceneLayerView; } @@ -8605,1941 +36774,8717 @@ declare namespace __esri { } interface StreamLayerView extends LayerView, Evented { - connectionError: Error; - connectionStatus: string; - filter: StreamLayerViewFilter; + /** + * The error that explains an unsuccessful attempt to connect to the stream service or an unexpected disconnection from the stream service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionError) + */ + readonly connectionError: Error; + /** + * The status of the Web Socket connection with the stream service. This property can be watched to see if the connection is lost unexpectedly. **Possible Values:** connected | disconnected + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionStatus) + */ + readonly connectionStatus: string; + /** + * Contains the attribute and spatial filters used to filter messages sent to the given layer view by a stream service. To change the filter for only a single layer view, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) method. The layer view's filter is always updated when the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method of the associated stream layer instance is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) + */ + readonly filter: StreamLayerViewFilter; + /** + * Contains the collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) visible in the layer view for the live stream. Graphics may be removed from the layer view by calling the [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) method from [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics) + */ graphics: Collection; + /** + * Opens a web socket connection with the stream service to start receiving messages. This is called internally when the StreamLayer is added to a view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connect) + * + * + */ connect(): IPromise; + /** + * Closes the web socket connection with the stream service. This is called internally when the StreamLayer is removed from a view. To verify when the connection is closed, watch the [connectionStatus](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#property:connectionStatus) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#disconnect) + * + * + */ disconnect(): void; + /** + * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) on the StreamLayerView. The filter is updated only on the layer view from which it is called. To update the filter on all layer views generated from a common layer, use the [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. If the input `filter` object is `undefined` or `null`, the spatial and attribute filters are removed. Filter changes only apply to incoming features. Features already displayed in the view are not filtered. Therefore, you may want to clear the graphics in the layer view prior to applying a new filter. To do so, get the layer view then call [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) on the [StreamLayerView.graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics). You may also filter features already present in the view using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. See the examples below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) + * + * @param filter Updates the spatial and attribute [filters](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter). If `null`, all filters are cleared. + * @param filter.geometry A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. If `null`, the spatial filter is cleared. + * @param filter.where A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. + * + */ updateFilter(filter: StreamLayerViewUpdateFilterFilter): IPromise; + on(name: "data-received", eventHandler: StreamLayerViewDataReceivedEventHandler): IHandle; + on(name: "data-received", modifiers: string[], eventHandler: StreamLayerViewDataReceivedEventHandler): IHandle; } interface StreamLayerViewConstructor { + /** + * The StreamLayerView provides methods for connecting, disconnecting, and filtering data received from a stream service for a layer view associated with a [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html) + */ + new(properties?: StreamLayerViewProperties): StreamLayerView; } export const StreamLayerView: StreamLayerViewConstructor; interface StreamLayerViewProperties extends LayerViewProperties { - connectionError?: Error; - connectionStatus?: string; - filter?: StreamLayerViewFilter; + /** + * Contains the collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) visible in the layer view for the live stream. Graphics may be removed from the layer view by calling the [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) method from [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics) + */ graphics?: CollectionProperties; } export interface StreamLayerViewDataReceivedEvent { } - export interface StreamLayerViewFilter { + + 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 { + + export interface StreamLayerViewUpdateFilterFilter extends Object { + /** + * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. If `null`, the spatial filter is cleared. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) + */ geometry?: Extent; + /** + * A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) + */ where?: string; } interface MapView extends View, BreakpointsOwner { + /** + * Represents the view's center point; when setting the center, you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing a longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) properties are also set in the constructor. The returned [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object is always in the spatial reference of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) and may be modified internally. To persist the returned object, create a clone using [Point.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) + */ center: Point; + /** + * Specifies constraints to [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale), [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom), and [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) that may be applied to the MapView. See object specification below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ constraints: MapViewConstraints; + /** + * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) + * + * @default null + */ extent: Extent; + /** + * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. + * > **Known Limitations** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) renderered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. See [FeatureLayerView.highlight()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) for details of how to highlight features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) + */ highlightOptions: MapViewHighlightOptions; + /** + * Defines which anchor stays still while resizing the browser window. The default, `center`, ensures the view's center point remains constantly visible as the window size changes. The other options allow the respective portion of the view to remain visible when the window's size is changed. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resizeAlign) + * + * @default center + */ resizeAlign: string; + /** + * The clockwise rotation of due north in relation to the top of the view in degrees. The view may be rotated by directly setting the rotation or by using the following mouse event: `Right-click + Drag`. Map rotation may be disabled by setting the `rotationEnabled` property in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) to `false`. See the code snippet below for an example of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) + * + * @default 0 + */ rotation: number; + /** + * Represents the map scale at the center of the view. Setting the scale immediately changes the view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) + */ scale: number; + /** + * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) + */ viewpoint: Viewpoint; + /** + * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) is a convenient way to set the initial extent of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) + */ zoom: number; + /** + * Sets the focus on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#focus) + * + * + */ focus(): void; - goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | MapViewGoToTarget, options?: MapViewGoToOptions): IPromise; + /** + * 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). Take note that if you pass in an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) as the `target` geometry, the `goTo` method will zoom to the nearest LOD of the basemap. + * + * [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. + * @param options.duration The duration of the animation in milliseconds. + * @param options.easing The easing function used for the animation. **Possible Values:** linear | ease | ease-in | ease-out | ease-in-out + * + */ + 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) + * + * @param type The name of the event. + * + */ hasEventListener(type: string): boolean; + /** + * Returns the topmost feature from each layer that intersects the specified screen coordinates. The following layer types will return a result if a hit is made on an intersecting feature: [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html), [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html), [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html). At 4.6 and later, a hit test will always return a result from [VectorTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html). However, the result will only indicate the ID and the name of the layer within the [vector tile style](https://doc.arcgis.com/en/arcgis-online/reference/tile-layers.htm#ESRI_SECTION1_8F68399EB47B48FF9EF46719FCC96978) that intersects the screen point. Detailed attribute and spatial information about the actual feature represented in the layer is not returned. HitTest results returned from VectorTileLayers are primarily used for [Vector tile style editor applications](https://maps.esri.com/jg/VectorBasemapStyleEditor/index.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) + * + * @param screenPoint The screen coordinates of the click on the view. + * @param screenPoint.x The horizontal screen coordinate of the click on the view. + * @param screenPoint.y The vertical screen coordinate of the click on the view. + * + */ hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; + /** + * Registers an event handler on the instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#events-summary) for a list of listened events. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#on) + * + * @param type The name of the event or the events to listen for. + * @param modifiersOrHandler Additional modifier keys to filter the events by. Alternatively, if no modifiers are required, the function to call when the event is fired. + * @param handler? The function to call when the event is fired, if modifiers were specified. + * + */ on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle; + /** + * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) + * + * @param screenPoint The screen coordinates to convert. + * @param screenPoint.x The horizontal screen coordinate to convert. + * @param screenPoint.y The vertical screen coordinate to convert. + * + */ toMap(screenPoint: MapViewToMapScreenPoint): Point; + /** + * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toScreen) + * + * @param point A point geometry. + * @param screenPoint ScreenPoint object that will reference the result. + * + */ toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; + on(name: "resize", eventHandler: MapViewResizeEventHandler): IHandle; + on(name: "resize", modifiers: string[], eventHandler: MapViewResizeEventHandler): IHandle; + on(name: "layerview-create", eventHandler: MapViewLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: MapViewLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: MapViewLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: MapViewLayerviewDestroyEventHandler): IHandle; + on(name: "click", eventHandler: MapViewClickEventHandler): IHandle; + on(name: "click", modifiers: string[], eventHandler: MapViewClickEventHandler): IHandle; + on(name: "double-click", eventHandler: MapViewDoubleClickEventHandler): IHandle; + on(name: "double-click", modifiers: string[], eventHandler: MapViewDoubleClickEventHandler): IHandle; + on(name: "hold", eventHandler: MapViewHoldEventHandler): IHandle; + on(name: "hold", modifiers: string[], eventHandler: MapViewHoldEventHandler): IHandle; + on(name: "drag", eventHandler: MapViewDragEventHandler): IHandle; + on(name: "drag", modifiers: string[], eventHandler: MapViewDragEventHandler): IHandle; + on(name: "mouse-wheel", eventHandler: MapViewMouseWheelEventHandler): IHandle; + on(name: "mouse-wheel", modifiers: string[], eventHandler: MapViewMouseWheelEventHandler): IHandle; + on(name: "key-down", eventHandler: MapViewKeyDownEventHandler): IHandle; + on(name: "key-down", modifiers: string[], eventHandler: MapViewKeyDownEventHandler): IHandle; + on(name: "key-up", eventHandler: MapViewKeyUpEventHandler): IHandle; + on(name: "key-up", modifiers: string[], eventHandler: MapViewKeyUpEventHandler): IHandle; + on(name: "pointer-down", eventHandler: MapViewPointerDownEventHandler): IHandle; + on(name: "pointer-down", modifiers: string[], eventHandler: MapViewPointerDownEventHandler): IHandle; + on(name: "pointer-move", eventHandler: MapViewPointerMoveEventHandler): IHandle; + on(name: "pointer-move", modifiers: string[], eventHandler: MapViewPointerMoveEventHandler): IHandle; + on(name: "pointer-up", eventHandler: MapViewPointerUpEventHandler): IHandle; + on(name: "pointer-up", modifiers: string[], eventHandler: MapViewPointerUpEventHandler): IHandle; + + on(name: "pointer-enter", eventHandler: MapViewPointerEnterEventHandler): IHandle; + + on(name: "pointer-enter", modifiers: string[], eventHandler: MapViewPointerEnterEventHandler): IHandle; + + on(name: "pointer-leave", eventHandler: MapViewPointerLeaveEventHandler): IHandle; + + on(name: "pointer-leave", modifiers: string[], eventHandler: MapViewPointerLeaveEventHandler): IHandle; } interface MapViewConstructor { + /** + * A MapView displays a 2D view of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance. An instance of MapView must be created to render a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) (along with its operational and base layers) in 2D. To render a map and its layers in 3D, see the documentation for [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). For a general overview of views, see [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) + */ + new(properties?: MapViewProperties): MapView; } export const MapView: MapViewConstructor; interface MapViewProperties extends ViewProperties, BreakpointsOwnerProperties { - center?: PointProperties; + /** + * Represents the view's center point; when setting the center, you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing a longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) properties are also set in the constructor. The returned [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object is always in the spatial reference of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) and may be modified internally. To persist the returned object, create a clone using [Point.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) + */ + center?: PointProperties | number[]; + /** + * Specifies constraints to [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale), [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom), and [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) that may be applied to the MapView. See object specification below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ constraints?: MapViewConstraints; + /** + * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) + * + * @default null + */ extent?: ExtentProperties; - highlightOptions?: MapViewHighlightOptions; + /** + * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. + * > **Known Limitations** Only [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) renderered with [WebGL](esri-layers-FeatureLayer.html#webgl-rendering) support highlight. See [FeatureLayerView.highlight()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) for details of how to highlight features. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) + */ + highlightOptions?: MapViewHighlightOptionsProperties; + /** + * Defines which anchor stays still while resizing the browser window. The default, `center`, ensures the view's center point remains constantly visible as the window size changes. The other options allow the respective portion of the view to remain visible when the window's size is changed. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resizeAlign) + * + * @default center + */ resizeAlign?: string; + /** + * The clockwise rotation of due north in relation to the top of the view in degrees. The view may be rotated by directly setting the rotation or by using the following mouse event: `Right-click + Drag`. Map rotation may be disabled by setting the `rotationEnabled` property in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) to `false`. See the code snippet below for an example of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) + * + * @default 0 + */ rotation?: number; + /** + * Represents the map scale at the center of the view. Setting the scale immediately changes the view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) + */ scale?: number; + /** + * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) + */ viewpoint?: ViewpointProperties; + /** + * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) is a convenient way to set the initial extent of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) + */ zoom?: number; } export interface MapViewClickEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface MapViewDoubleClickEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface MapViewDragEvent { + action: string; + native: any; + origin: MapViewDragEventOrigin; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } - export interface HitTestResult { + /** + * Object specification for the result of the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) + */ + export interface HitTestResult extends Object { + /** + * An array of result objects returned from the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest). Results are returned when the location of the input screen coordinates intersect a [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the view. See the table below for the specification of each object in this array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) + */ results: HitTestResultResults[]; } export interface MapViewHoldEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface MapViewKeyDownEvent { + key: string; + native: any; + repeat: boolean; + stopPropagation: Function; + timestamp: number; + type: string; } export interface MapViewKeyUpEvent { + native: any; + stopPropagation: Function; + timestamp: number; + type: string; } export interface MapViewLayerviewCreateEvent { + layer: Layer; + layerView: LayerView; } export interface MapViewLayerviewDestroyEvent { + layer: Layer; + layerView: LayerView; } - export interface MapViewConstraints { + + export interface MapViewConstraints extends Object { + /** + * An array of [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html). If not specified, this value is read from the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). This property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ lods?: LOD[]; + /** + * The minimum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ minScale?: number; + /** + * The maximum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. Setting this value to `0` allows the user to overzoom layer tiles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ maxScale?: number; + /** + * The minimum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ minZoom?: number; + /** + * The maximum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. Setting this value to `0` allows the user to overzoom layer tiles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ maxZoom?: number; + /** + * When `true`, the view snaps to the next LOD when zooming in or out. When `false`, the zoom is continuous. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + * + * @default true + */ snapToZoom?: boolean; + /** + * Indicates whether the user can rotate the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + * + * @default true + */ rotationEnabled?: boolean; + /** + * A read-only property that specifies the levels of detail (LODs) read from the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ effectiveLODs?: LOD[]; + /** + * A read-only property that specifies the minimum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ effectiveMinZoom?: number; + /** + * A read-only property that specifies the maximum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ effectiveMaxZoom?: number; + /** + * A read-only property that specifies the minimum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ effectiveMinScale?: number; + /** + * A read-only property that specifies the maximum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) + */ effectiveMaxScale?: number; } - export interface MapViewGoToOptions { + + export interface MapViewGoToOptions extends Object { + /** + * Indicates if the transition to the new view should be animated. + * + * [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) + */ duration?: number; + /** + * The easing function used for the animation. **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 { + + 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 MapViewHighlightOptions { - color?: Color; + + export interface MapViewHighlightOptionsProperties extends Object { + /** + * The color of the highlight. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) + * + * @default #00ffff + */ + color?: Color | number[] | string; + /** + * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) + * + * @default 1 + */ haloOpacity?: number; + /** + * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) + * + * @default 0.25 + */ fillOpacity?: number; } - export interface MapViewHitTestScreenPoint { + export interface MapViewHighlightOptions extends AnonymousAccessor { + /** + * The color of the highlight. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) + * + * @default #00ffff + */ + color?: Color; + /** + * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) + * + * @default 1 + */ + haloOpacity?: number; + /** + * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) + * + * @default 0.25 + */ + fillOpacity?: number; + } + + + export interface MapViewHitTestScreenPoint extends Object { + /** + * The horizontal screen coordinate of the click on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) + */ x: number; + /** + * The vertical screen coordinate of the click on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) + */ y: number; } - export interface MapViewToMapScreenPoint { + + export interface MapViewToMapScreenPoint extends Object { + /** + * The horizontal screen coordinate to convert. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) + */ x: number; + /** + * The vertical screen coordinate to convert. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) + */ y: number; } export interface MapViewMouseWheelEvent { + deltaY: number; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface MapViewPointerDownEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + + y: number; + } + + export interface MapViewPointerEnterEvent { + + native: any; + + pointerId: number; + + pointerType: string; + + stopPropagation: Function; + + timestamp: number; + + type: string; + + x: number; + + y: number; + } + + export interface MapViewPointerLeaveEvent { + + native: any; + + pointerId: number; + + pointerType: string; + + stopPropagation: Function; + + timestamp: number; + + type: string; + + x: number; + y: number; } export interface MapViewPointerMoveEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface MapViewPointerUpEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface MapViewResizeEvent { + height: number; + oldHeight: number; + oldWidth: number; + width: number; } - export interface MapViewDragEventOrigin { + + export interface MapViewDragEventOrigin extends Object { + x: number; + y: number; } - export interface HitTestResultResults { + + export interface HitTestResultResults extends Object { + /** + * A graphic representing a feature in the view that intersects the input screen coordinates. If the graphic comes from a layer with an applied [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html), then the [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) property will be empty. Other properties may be empty based on the context in which the graphic is fetched. If the result comes from a [VectorTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html) then a static graphic is returned with two `attributes`: `layerId` and `layerName`. These correspond to the name and id of the style-layer in the [vector tile style](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Vector_Tile_Style/02r3000002nv000000/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) + */ graphic: Graphic; + /** + * The point geometry in the spatial reference of the view corresponding with the input screen coordinates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) + */ mapPoint: Point; } interface SceneView extends View, BreakpointsOwner { + /** + * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) + */ camera: Camera; + /** + * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) + */ center: Point; + /** + * Represents an optional clipping area used to define the visible [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. The `clippingArea` property only applies to [local](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) scenes. ![scene-clipping-area](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-clipping-area.png%20%22Local%20scene%20with%20clippingArea%22) The clippingArea property contains an internal reference which may be modified in the future. To persist or modify the clippingArea, create a clone using [clippingArea.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) + */ clippingArea: Extent; + /** + * Specifies constraints for [Camera tilt](esri-Camera.html#tilt) and altitude that may be applied to the SceneView. See the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ constraints: SceneViewConstraints; + /** + * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. + * ```js + * var view = new SceneView({ + * map: map, + * container: "viewDiv" + * }); + * + * // Set the sun position to reflect the current time + * view.environment.lighting.date = Date.now(); + * + * // Disable automatic lighting updates by camera tracking + * view.environment.lighting.cameraTrackingEnabled = true; + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ environment: SceneViewEnvironment; + /** + * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) + * + * @default null + */ extent: Extent; + /** + * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) + */ highlightOptions: SceneViewHighlightOptions; + /** + * SceneView can draw scenes in two different quality modes: `high` and `low`. Using the `low` quality profile significantly increases performance on slower browsers and devices by reducing the visual quality in the following aspects: + * * Map resolution + * * Scene layer detail level + * * Anti-aliasing (edge smoothing) + * + * + * The default value is based on the detected browser: + * * `low` for Internet Explorer 11 and Safari + * * `high` for any other browser + * + * + * Overriding the default value is best done in the constructor (see example below). If the value is modified after construction, only a subset of the quality aspects are affected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#qualityProfile) + */ qualityProfile: string; + /** + * Represents an approximation of the map scale at the center of the view. Setting the scale immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) property. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) + */ scale: number; + /** + * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. + * + * Value | Example | Description + * ------|-------|------------ + * global | ![scene-global](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-global.png) | Global scenes allow the entire globe to render in the view, showing the curvature of the earth. + * local | ![scene-local](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-local.png) | Local scenes render the earth on a flat surface. They can be constrained to only show a "local" area by setting the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clipplingArea) property. Local scenes also allow for displaying and exploring data that would otherwise be hidden by the surface of the earth. + * + * Depending on the viewing mode different [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) + * + * @default global + */ viewingMode: string; + /** + * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. In SceneViews, [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) should be used in favor of viewpoint for watching or changing the point of view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) is also set in the constructor. The viewpoint property contains an internal reference which may be modified in the future. To persist or modify the viewpoint, create a clone using [viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) + */ viewpoint: Viewpoint; + /** + * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) is a convenient way to set the initial extent of the view. If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), or [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) properties are also set in the constructor. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) + */ zoom: number; + /** + * Sets the focus on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#focus) + * + * + */ focus(): void; + /** + * 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) + * * [Camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html) + * * Object with a combination of `target`, `center`, `scale`, `position`, `heading` and `tilt` properties (with `target` being any of the types listed above). The `center` property is provided as a convenience to animate the [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) and is the equivalent of specifying the `target` with the center [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The target must be provided in the spatial reference of the view. + * + * + * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [SceneView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#animation). If the given target is far away from the current camera position, then heading and tilt will be automatically set to their neutral values (facing north, looking top down). Tilt and heading can always be explicitly set to override this behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + * + * @param target The target location/viewpoint to go to. When using an object for `target`, use the properties in the table below. + * @param target.target The target of the animation. + * @param target.center The [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) to go to. + * @param target.scale The [SceneView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) to go to. + * @param target.zoom The final [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) value to go to. + * @param target.heading The [Camera.heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to go to. + * @param target.tilt The [Camera.tilt](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. + * @param target.position The [Camera.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. + * @param options View transition options. + * @param options.animate Indicates if the transition to the new view should be animated. + * @param options.speedFactor Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly. + * @param options.duration Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. + * @param options.maxDuration The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. + * @param options.easing The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function. + * + */ goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | SceneViewGoToTarget, options?: SceneViewGoToOptions): IPromise; + /** + * Indicates whether there is an event listener on the instance that matches the provided event name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hasEventListener) + * + * @param type The name of the event. + * + */ hasEventListener(type: string): boolean; + /** + * Returns the topmost feature from each layer that intersects the specified screen coordinates. The following layer types will return a result if a hit is made on an intersecting feature: [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html), [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html), [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html). Draped graphics (i.e. graphics in layers where the [elevation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) is `on-the-ground`) are currently **not** returned from this method, even when they intersect the input screen point. When the ground surface is hit, but no graphic is found, then the result of hitTest will be a single object with its mapPoint set to the point on the surface that was hit, but its graphic will be set to `null`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) + * + * @param screenPoint The screen coordinates of the click on the view. + * @param screenPoint.x The horizontal screen coordinate of the click on the view. + * @param screenPoint.y The vertical screen coordinate of the click on the view. + * + */ hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; + /** + * Registers an event handler on the instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#events-summary) for a list of listened events. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#on) + * + * @param type The name of the event or the events to listen for. + * @param modifiersOrHandler Additional modifier keys to filter the events by. Alternatively, if no modifiers are required, the function to call when the event is fired. + * @param handler? The function to call when the event is fired, if modifiers were specified. + * + */ on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle; + /** + * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) + * + * @param screenPoint The screen coordinates to convert. + * @param screenPoint.x The horizontal screen coordinate to convert. + * @param screenPoint.y The vertical screen coordinate to convert. + * @param mapPoint The point object that will reference the result. + * + */ toMap(screenPoint: SceneViewToMapScreenPoint, mapPoint?: Point): Point; + /** + * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toScreen) + * + * @param point A point geometry. + * @param screenPoint ScreenPoint object that will reference the result. + * + */ toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; + on(name: "resize", eventHandler: SceneViewResizeEventHandler): IHandle; + on(name: "resize", modifiers: string[], eventHandler: SceneViewResizeEventHandler): IHandle; + on(name: "layerview-create", eventHandler: SceneViewLayerviewCreateEventHandler): IHandle; + on(name: "layerview-create", modifiers: string[], eventHandler: SceneViewLayerviewCreateEventHandler): IHandle; + on(name: "layerview-destroy", eventHandler: SceneViewLayerviewDestroyEventHandler): IHandle; + on(name: "layerview-destroy", modifiers: string[], eventHandler: SceneViewLayerviewDestroyEventHandler): IHandle; + on(name: "click", eventHandler: SceneViewClickEventHandler): IHandle; + on(name: "click", modifiers: string[], eventHandler: SceneViewClickEventHandler): IHandle; + on(name: "double-click", eventHandler: SceneViewDoubleClickEventHandler): IHandle; + on(name: "double-click", modifiers: string[], eventHandler: SceneViewDoubleClickEventHandler): IHandle; + on(name: "hold", eventHandler: SceneViewHoldEventHandler): IHandle; + on(name: "hold", modifiers: string[], eventHandler: SceneViewHoldEventHandler): IHandle; + on(name: "drag", eventHandler: SceneViewDragEventHandler): IHandle; + on(name: "drag", modifiers: string[], eventHandler: SceneViewDragEventHandler): IHandle; + on(name: "mouse-wheel", eventHandler: SceneViewMouseWheelEventHandler): IHandle; + on(name: "mouse-wheel", modifiers: string[], eventHandler: SceneViewMouseWheelEventHandler): IHandle; + on(name: "key-down", eventHandler: SceneViewKeyDownEventHandler): IHandle; + on(name: "key-down", modifiers: string[], eventHandler: SceneViewKeyDownEventHandler): IHandle; + on(name: "key-up", eventHandler: SceneViewKeyUpEventHandler): IHandle; + on(name: "key-up", modifiers: string[], eventHandler: SceneViewKeyUpEventHandler): IHandle; + on(name: "pointer-down", eventHandler: SceneViewPointerDownEventHandler): IHandle; + on(name: "pointer-down", modifiers: string[], eventHandler: SceneViewPointerDownEventHandler): IHandle; + on(name: "pointer-move", eventHandler: SceneViewPointerMoveEventHandler): IHandle; + on(name: "pointer-move", modifiers: string[], eventHandler: SceneViewPointerMoveEventHandler): IHandle; + on(name: "pointer-up", eventHandler: SceneViewPointerUpEventHandler): IHandle; + on(name: "pointer-up", modifiers: string[], eventHandler: SceneViewPointerUpEventHandler): IHandle; + + on(name: "pointer-enter", eventHandler: SceneViewPointerEnterEventHandler): IHandle; + + on(name: "pointer-enter", modifiers: string[], eventHandler: SceneViewPointerEnterEventHandler): IHandle; + + on(name: "pointer-leave", eventHandler: SceneViewPointerLeaveEventHandler): IHandle; + + on(name: "pointer-leave", modifiers: string[], eventHandler: SceneViewPointerLeaveEventHandler): IHandle; } interface SceneViewConstructor { + /** + * A SceneView displays a 3D view of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) instance using WebGL. To render a map and its layers in 2D, see the documentation for [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). For a general overview of views, see [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) + */ + new(properties?: SceneViewProperties): SceneView; } export const SceneView: SceneViewConstructor; interface SceneViewProperties extends ViewProperties, BreakpointsOwnerProperties { + /** + * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) + */ camera?: CameraProperties; - center?: PointProperties; + /** + * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) + */ + center?: PointProperties | number[]; + /** + * Represents an optional clipping area used to define the visible [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. The `clippingArea` property only applies to [local](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) scenes. ![scene-clipping-area](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-clipping-area.png%20%22Local%20scene%20with%20clippingArea%22) The clippingArea property contains an internal reference which may be modified in the future. To persist or modify the clippingArea, create a clone using [clippingArea.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) + */ clippingArea?: ExtentProperties; + /** + * Specifies constraints for [Camera tilt](esri-Camera.html#tilt) and altitude that may be applied to the SceneView. See the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ constraints?: SceneViewConstraintsProperties; + /** + * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. + * ```js + * var view = new SceneView({ + * map: map, + * container: "viewDiv" + * }); + * + * // Set the sun position to reflect the current time + * view.environment.lighting.date = Date.now(); + * + * // Disable automatic lighting updates by camera tracking + * view.environment.lighting.cameraTrackingEnabled = true; + * ``` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ environment?: SceneViewEnvironmentProperties; + /** + * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) + * + * @default null + */ extent?: ExtentProperties; - highlightOptions?: SceneViewHighlightOptions; + /** + * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) + */ + highlightOptions?: SceneViewHighlightOptionsProperties; + /** + * SceneView can draw scenes in two different quality modes: `high` and `low`. Using the `low` quality profile significantly increases performance on slower browsers and devices by reducing the visual quality in the following aspects: + * * Map resolution + * * Scene layer detail level + * * Anti-aliasing (edge smoothing) + * + * + * The default value is based on the detected browser: + * * `low` for Internet Explorer 11 and Safari + * * `high` for any other browser + * + * + * Overriding the default value is best done in the constructor (see example below). If the value is modified after construction, only a subset of the quality aspects are affected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#qualityProfile) + */ qualityProfile?: string; + /** + * Represents an approximation of the map scale at the center of the view. Setting the scale immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) property. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) + */ scale?: number; + /** + * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. + * + * Value | Example | Description + * ------|-------|------------ + * global | ![scene-global](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-global.png) | Global scenes allow the entire globe to render in the view, showing the curvature of the earth. + * local | ![scene-local](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-local.png) | Local scenes render the earth on a flat surface. They can be constrained to only show a "local" area by setting the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clipplingArea) property. Local scenes also allow for displaying and exploring data that would otherwise be hidden by the surface of the earth. + * + * Depending on the viewing mode different [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) + * + * @default global + */ viewingMode?: string; + /** + * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. In SceneViews, [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) should be used in favor of viewpoint for watching or changing the point of view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) is also set in the constructor. The viewpoint property contains an internal reference which may be modified in the future. To persist or modify the viewpoint, create a clone using [viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) + */ viewpoint?: ViewpointProperties; + /** + * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) is a convenient way to set the initial extent of the view. If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), or [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) properties are also set in the constructor. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) + */ zoom?: number; } export interface SceneViewClickEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface SceneViewDoubleClickEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface SceneViewDragEvent { + action: string; + native: any; + origin: SceneViewDragEventOrigin; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export type EasingFunction = (t: number, duration: number) => number; - export interface SceneViewHitTestResult { + /** + * Object specification for the result of the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ + export interface SceneViewHitTestResult extends Object { + /** + * An array of result objects returned from the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest). Results are returned when the location of the input screen coordinates intersect a [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the view. See the table below for the specification of each object in this array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ results: SceneViewHitTestResultResults[]; } export interface SceneViewHoldEvent { + button: number; + mapPoint: Point; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface SceneViewKeyDownEvent { + key: string; + native: any; + repeat: boolean; + stopPropagation: Function; + timestamp: number; + type: string; } export interface SceneViewKeyUpEvent { + native: any; + stopPropagation: Function; + timestamp: number; + type: string; } export interface SceneViewLayerviewCreateEvent { + layer: Layer; + layerView: LayerView; } export interface SceneViewLayerviewDestroyEvent { + layer: Layer; + layerView: LayerView; } export interface SceneViewMouseWheelEvent { + deltaY: number; + native: any; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface SceneViewPointerDownEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + + y: number; + } + + export interface SceneViewPointerEnterEvent { + + native: any; + + pointerId: number; + + pointerType: string; + + stopPropagation: Function; + + timestamp: number; + + type: string; + + x: number; + + y: number; + } + + export interface SceneViewPointerLeaveEvent { + + native: any; + + pointerId: number; + + pointerType: string; + + stopPropagation: Function; + + timestamp: number; + + type: string; + + x: number; + y: number; } export interface SceneViewPointerMoveEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface SceneViewPointerUpEvent { + native: any; + pointerId: number; + pointerType: string; + stopPropagation: Function; + timestamp: number; + type: string; + x: number; + y: number; } export interface SceneViewResizeEvent { + height: number; + oldHeight: number; + oldWidth: number; + width: number; } - export interface SceneViewConstraintsProperties { + + export interface SceneViewConstraintsProperties extends Object { + /** + * Specifies a constraint on the minimum and maximum allowed camera altitude. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ altitude?: SceneViewConstraintsAltitudeProperties; + /** + * Specifies the near and far webgl clip distances. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ clipDistance?: SceneViewConstraintsClipDistanceProperties; + /** + * When enabled, prevents the user from navigating below the surface in a local SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ collision?: SceneViewConstraintsCollision; + /** + * Specifies a constraint on the amount of allowed tilting of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ tilt?: SceneViewConstraintsTiltProperties; } - export interface SceneViewConstraints extends Accessor { + + export interface SceneViewConstraints extends AnonymousAccessor { + /** + * Specifies a constraint on the minimum and maximum allowed camera altitude. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ altitude?: SceneViewConstraintsAltitude; + /** + * Specifies the near and far webgl clip distances. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ clipDistance?: SceneViewConstraintsClipDistance; + /** + * When enabled, prevents the user from navigating below the surface in a local SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ collision?: SceneViewConstraintsCollision; + /** + * Specifies a constraint on the amount of allowed tilting of the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ tilt?: SceneViewConstraintsTilt; } - export interface SceneViewConstraintsAltitudeProperties { - min?: number; - max?: number; - } - export interface SceneViewConstraintsAltitude extends Accessor { + + export interface SceneViewConstraintsAltitudeProperties extends Object { + /** + * The minimum allowed camera altitude (in meters). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default -∞ + */ min?: number; + /** + * The maximum allowed camera altitude (in meters). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default EARTH_RADIUS * 4 + */ max?: number; } - export interface SceneViewConstraintsClipDistanceProperties { - near?: number; - far?: number; - mode?: string; + export interface SceneViewConstraintsAltitude extends AnonymousAccessor { + /** + * The minimum allowed camera altitude (in meters). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default -∞ + */ + min?: number; + /** + * The maximum allowed camera altitude (in meters). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default EARTH_RADIUS * 4 + */ + max?: number; } - export interface SceneViewConstraintsClipDistance extends Accessor { + + + export interface SceneViewConstraintsClipDistanceProperties extends Object { + /** + * The near clip distance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ near?: number; + /** + * The far clip distance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ far?: number; + /** + * Specifies the mode of the constraint which is either `auto` or `manual`. In `auto` mode, the near and far clip distance values are automatically determined. In `manual` mode, the near and far clip distance values are user defined, constant values. Note that the mode automatically changes to `manual` whenever the `near` or `far` property is set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default auto + */ mode?: string; } - export interface SceneViewConstraintsCollision { + export interface SceneViewConstraintsClipDistance extends AnonymousAccessor { + /** + * The near clip distance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ + near?: number; + /** + * The far clip distance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ + far?: number; + /** + * Specifies the mode of the constraint which is either `auto` or `manual`. In `auto` mode, the near and far clip distance values are automatically determined. In `manual` mode, the near and far clip distance values are user defined, constant values. Note that the mode automatically changes to `manual` whenever the `near` or `far` property is set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default auto + */ + mode?: string; + } + + + export interface SceneViewConstraintsCollision extends Object { + /** + * Set to `false` to permit the user to navigate below the surface in a local SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default true + */ enabled?: boolean; } - export interface SceneViewConstraintsTiltProperties { - max?: number; - mode?: string; - } - export interface SceneViewConstraintsTilt extends Accessor { + + export interface SceneViewConstraintsTiltProperties extends Object { + /** + * Specifies the maximum amount of tilt (in degrees) allowed in the view and may range from 0.5 to 179.5 degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ max?: number; + /** + * Specifies the mode of the constraint. There are two possible values: `auto` or `manual`. In `auto` mode, the maximum tilt value is automatically determined based on the altitude of the view camera. In `manual` mode, the maximum tilt value is a user defined, constant value. **Note:** The mode automatically changes to `manual` whenever the `max` property is set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default auto + */ mode?: string; } - export interface SceneViewEnvironmentProperties { + export interface SceneViewConstraintsTilt extends AnonymousAccessor { + /** + * Specifies the maximum amount of tilt (in degrees) allowed in the view and may range from 0.5 to 179.5 degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + */ + max?: number; + /** + * Specifies the mode of the constraint. There are two possible values: `auto` or `manual`. In `auto` mode, the maximum tilt value is automatically determined based on the altitude of the view camera. In `manual` mode, the maximum tilt value is a user defined, constant value. **Note:** The mode automatically changes to `manual` whenever the `max` property is set. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) + * + * @default auto + */ + mode?: string; + } + + + export interface SceneViewEnvironmentProperties extends Object { + /** + * Lighting conditions of the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ lighting?: SceneViewEnvironmentLightingProperties; + /** + * Indicates whether atmosphere visualization is enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ atmosphereEnabled?: boolean; + /** + * Atmosphere conditions of the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ atmosphere?: SceneViewEnvironmentAtmosphereProperties; + /** + * Indicates whether stars visualization is enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default true + */ starsEnabled?: boolean; } - export interface SceneViewEnvironment extends Accessor { + + export interface SceneViewEnvironment extends AnonymousAccessor { + /** + * Lighting conditions of the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ lighting?: SceneViewEnvironmentLighting; + /** + * Indicates whether atmosphere visualization is enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ atmosphereEnabled?: boolean; + /** + * Atmosphere conditions of the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + */ atmosphere?: SceneViewEnvironmentAtmosphere; + /** + * Indicates whether stars visualization is enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default true + */ starsEnabled?: boolean; } - export interface SceneViewEnvironmentAtmosphereProperties { - quality?: string; - } - export interface SceneViewEnvironmentAtmosphere extends Accessor { + + export interface SceneViewEnvironmentAtmosphereProperties extends Object { + /** + * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). + * + * Known Value | Example + * ------------|--------- + * low | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-atmosphere.png) + * high | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-atmosphere-realistic.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default low + */ quality?: string; } - export interface SceneViewEnvironmentLightingProperties { + export interface SceneViewEnvironmentAtmosphere extends AnonymousAccessor { + /** + * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). + * + * Known Value | Example + * ------------|--------- + * low | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-atmosphere.png) + * high | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/img/apiref/views/scene-atmosphere-realistic.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default low + */ + quality?: string; + } + + + export interface SceneViewEnvironmentLightingProperties extends Object { + /** + * The current date and time of the simulated sun. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default new Date("March 15, 2015 12:00:00") + */ date?: DateProperties; + /** + * Indicates whether to show shadows cast by the sun + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default false + */ directShadowsEnabled?: boolean; + /** + * Indicates whether to show ambient occlusion shading. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default false + */ ambientOcclusionEnabled?: boolean; - cameraTrackingEnabled?: boolean; - } - export interface SceneViewEnvironmentLighting extends Accessor { - date?: Date; - directShadowsEnabled?: boolean; - ambientOcclusionEnabled?: boolean; + /** + * Indicates whether the date and time of the simulated sun is automatically updated to maintain the current time of day while the camera changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default true + */ cameraTrackingEnabled?: boolean; } - export interface SceneViewGoToOptions { + export interface SceneViewEnvironmentLighting extends AnonymousAccessor { + /** + * The current date and time of the simulated sun. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default new Date("March 15, 2015 12:00:00") + */ + date?: Date; + /** + * Indicates whether to show shadows cast by the sun + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default false + */ + directShadowsEnabled?: boolean; + /** + * Indicates whether to show ambient occlusion shading. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default false + */ + ambientOcclusionEnabled?: boolean; + /** + * Indicates whether the date and time of the simulated sun is automatically updated to maintain the current time of day while the camera changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) + * + * @default true + */ + cameraTrackingEnabled?: boolean; + } + + + export interface SceneViewGoToOptions extends Object { + /** + * Indicates if the transition to the new view should be animated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + * + * @default true + */ animate?: boolean; + /** + * Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + * + * @default 1 + */ speedFactor?: number; + /** + * Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ duration?: number; + /** + * The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + * + * @default 8000 + */ maxDuration?: number; + /** + * The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ easing?: string | EasingFunction; } - export interface SceneViewGoToTarget { + + export interface SceneViewGoToTarget extends Object { + /** + * The target of the animation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ target?: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera; + /** + * The [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ center?: number[]; + /** + * The [SceneView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ scale?: number; + /** + * The final [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) value to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ zoom?: number; + /** + * The [Camera.heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ heading?: number; + /** + * The [Camera.tilt](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ tilt?: number; + /** + * The [Camera.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) + */ position?: number; } - export interface SceneViewHighlightOptions { - color?: Color; + + export interface SceneViewHighlightOptionsProperties extends Object { + /** + * The color of the highlight. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) + * + * @default #00ffff + */ + color?: Color | number[] | string; + /** + * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) + * + * @default 1 + */ haloOpacity?: number; + /** + * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) + * + * @default 0.25 + */ fillOpacity?: number; } - export interface SceneViewHitTestScreenPoint { + export interface SceneViewHighlightOptions extends AnonymousAccessor { + /** + * The color of the highlight. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) + * + * @default #00ffff + */ + color?: Color; + /** + * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) + * + * @default 1 + */ + haloOpacity?: number; + /** + * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) + * + * @default 0.25 + */ + fillOpacity?: number; + } + + + export interface SceneViewHitTestScreenPoint extends Object { + /** + * The horizontal screen coordinate of the click on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) + */ x: number; + /** + * The vertical screen coordinate of the click on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) + */ y: number; } - export interface SceneViewToMapScreenPoint { + + export interface SceneViewToMapScreenPoint extends Object { + /** + * The horizontal screen coordinate to convert. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) + */ x: number; + /** + * The vertical screen coordinate to convert. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) + */ y: number; } - export interface SceneViewDragEventOrigin { + + export interface SceneViewDragEventOrigin extends Object { + x: number; + y: number; } - export interface SceneViewHitTestResultResults { + + export interface SceneViewHitTestResultResults extends Object { + /** + * A graphic present in the view that intersects the input screen coordinates. If the graphic comes from a layer with an applied [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html), then the [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) property will be empty. Other properties will be empty based on the context in which the graphic is fetched. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ graphic: Graphic; + /** + * The point geometry in the spatial reference of the view corresponding with the input screen coordinates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) + */ mapPoint: Point; } interface DefaultUI extends UI { + /** + * An array of strings representing the default widgets visible when a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` + * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content. For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation. For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) + */ components: string[]; } interface DefaultUIConstructor { + /** + * The DefaultUI class exposes the default [widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) [components](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) available in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This class also provides a simple API for [adding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#add), [moving](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#move) and [removing](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#remove) [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) and other HTML components from the view's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) + */ + new(properties?: DefaultUIProperties): DefaultUI; } export const DefaultUI: DefaultUIConstructor; interface DefaultUIProperties extends UIProperties { + /** + * An array of strings representing the default widgets visible when a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` + * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content. For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation. For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) + */ components?: string[]; } interface UI extends Accessor { + /** + * The HTML Element that contains the the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) + */ container: HTMLElement; - height: number; + /** + * The height of the UI container. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#height) + */ + readonly height: number; + /** + * Defines the padding for the UI from the top, left, right, and bottom sides of the container or [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). If the value is a number, it will be used to pad all sides of the container. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#padding) + * + * @default { left: 15, top: 15, right: 15, bottom: 15 } + */ padding: any | number; + /** + * The view associated with the UI components. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#view) + */ view: MapView | SceneView; - width: number; + /** + * The width of the UI container. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#width) + */ + readonly width: number; + /** + * Adds one or more HTML component(s) or [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) to the UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) + * + * @param component The component(s) to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. + * @param component.component The component to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID. + * @param component.position The position in the view at which to add the component. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | 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. **Known 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. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * @param position.index The placement index of the component(s). This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. + * + */ add(component: Widget | HTMLElement | string | any[] | UIAddComponent, position?: string | UIAddPosition): void; + /** + * Removes all components from a given position. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#empty) + * + * @param position The position from which to remove all components. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * + */ empty(position?: string): void; + /** + * Moves one or more UI component(s) to the specified position. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) + * + * @param component The component(s) to move. This value can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. + * @param component.component The component to move. This can be a widget instance, HTML element, a string value representing a DOM node ID. + * @param component.position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Known 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. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * + */ move(component: Widget | HTMLElement | string | any[] | UIMoveComponent, position?: string): void; + /** + * Removes one or more HTML component(s) or [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) from the UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#remove) + * + * @param component The component(s) to remove from the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. + * + */ remove(component: Widget | HTMLElement | string | any[]): void; } interface UIConstructor { + /** + * This class provides a simple interface for [adding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add), [moving](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) and [removing](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#remove) components from a view's user interface (UI). In most cases, you will work with the view's [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) which places default [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html), such as [Zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html) and [Attribution](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html) + */ + new(properties?: UIProperties): UI; } export const UI: UIConstructor; interface UIProperties { + /** + * The HTML Element that contains the the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) + */ container?: HTMLElement; - height?: number; + /** + * Defines the padding for the UI from the top, left, right, and bottom sides of the container or [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). If the value is a number, it will be used to pad all sides of the container. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#padding) + * + * @default { left: 15, top: 15, right: 15, bottom: 15 } + */ padding?: any | number; + /** + * The view associated with the UI components. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#view) + */ view?: MapViewProperties | SceneViewProperties; - width?: number; } - export interface UIAddComponent { + + export interface UIAddComponent extends Object { + /** + * The component to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) + */ component: Widget | HTMLElement | string; + /** + * The position in the view at which to add the component. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) + */ position?: string; + /** + * The placement index of the component. This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) + */ index?: number; } - export interface UIAddPosition { + + 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. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) + */ position?: string; + /** + * The placement index of the component(s). This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) + */ index: number; } - export interface UIMoveComponent { + + export interface UIMoveComponent extends Object { + /** + * The component to move. This can be a widget instance, HTML element, a string value representing a DOM node ID. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) + */ component: Widget | HTMLElement | string; + /** + * The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Known Values:** top-left | top-right | bottom-left | bottom-right | manual + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) + */ position?: string; } interface View extends Accessor, corePromise, DOMContainer { + /** + * Collection containing a flat list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) related to the basemap, operational layers, and group layers in this view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#allLayerViews) + */ allLayerViews: Collection; + /** + * Represents an ongoing view animation initialized by [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). You may [watch](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch) this property to be notified when the view's extent changes . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#animation) + */ animation: ViewAnimation; + /** + * Allows for adding [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) directly to the default graphics in the View. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) + */ graphics: Collection; - interacting: boolean; + /** + * Indication whether the view is being interacted with (for example when panning). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#interacting) + * + * @default false + */ + readonly interacting: boolean; + /** + * A collection containing a hierarchical list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of the [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#layerViews) + */ layerViews: Collection; + /** + * An instance of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) object to display in the view. A view may only display one map at a time. On the other hand, one [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) may be viewed by multiple [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and/or [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) simultaneously. This property is typically set in the constructor of the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [class description](#) for examples demonstrating the relationship between the map and the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) + */ map: Map; + /** + * Use the padding property to make the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center), and [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent), etc. work off a subsection of the full view. This is particularly useful when layering UI elements or semi-transparent content on top of portions of the view. See the [view padding sample](https://developers.arcgis.com/javascript/latest/sample-code/view-padding/index.html) for an example of how this works. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) + * + * @default {left: 0, top: 0, right: 0, bottom: 0} + */ padding: ViewPadding; - ready: boolean; + /** + * When `true`, this property indicates whether the view successfully satisfied all dependencies, signaling that the following conditions are met. + * * The view has a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map). If [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) is a [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html) or a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html), then the map or scene must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded). + * * The view has a [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) with a size greater than `0`. + * * The view has a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference). + * + * + * When a view becomes ready it will resolve itself and invoke the callback defined in [when()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#when) where code can execute on a working view. Subsequent changes to a view's readiness would typically be handled by watching `view.ready` and providing logic for cases where the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) or [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) change. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ready) + * + * @default false + */ + readonly ready: boolean; + /** + * The spatial reference of the view. This indicates the [Projected Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) or the [Geographic Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. The spatial reference can either be set explicitly or automatically derived from the following: + * * In the case of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#map) is a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) instance, the [WebScene.initialViewProperties.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) is used. + * * In all other cases, the spatial reference is derived from the first layer that loads in this order: + * * [map.basemap.baseLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) + * * [map.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) + * * [map.ground.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) + * + * + * When using an [Esri basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), the default spatial reference is Web Mercator Auxiliary Sphere. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) + * + * @default null + */ spatialReference: SpatialReference; - stationary: boolean; - type: string; - updating: boolean; + /** + * Indication whether the view is animating, being interacted with or resizing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#stationary) + * + * @default true + */ + readonly stationary: boolean; + /** + * The type of the view is either `2d` (indicating a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)) or `3d` (indicating a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#type) + */ + readonly type: string; + /** + * Indicates whether the view is being updated by additional data requests to the network, or by processing received data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#updating) + * + * @default false + */ + readonly updating: boolean; + /** + * Gets the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) created on the view for the given layer. The returned promise resolves when the layer view for the given layer has been created, or rejects with an error (for example if the layer is not part of the view, or if the layer type is not supported in this view). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView) + * + * @param layer The layer for which to obtain its LayerView. + * + */ whenLayerView(layer: Layer): IPromise; } interface ViewConstructor { + /** + * A view provides the means of viewing and interacting with the components of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). The [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) is merely a container, storing the geographic information contained in base layers and operational layers. The View renders the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) and its various [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers), making them visible to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) + */ + new(properties?: ViewProperties): View; } export const View: ViewConstructor; interface ViewProperties extends DOMContainerProperties { + /** + * Collection containing a flat list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) related to the basemap, operational layers, and group layers in this view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#allLayerViews) + */ allLayerViews?: CollectionProperties; + /** + * Represents an ongoing view animation initialized by [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). You may [watch](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch) this property to be notified when the view's extent changes . + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#animation) + */ animation?: ViewAnimationProperties; + /** + * Allows for adding [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) directly to the default graphics in the View. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) + */ graphics?: CollectionProperties; - interacting?: boolean; + /** + * A collection containing a hierarchical list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of the [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#layerViews) + */ layerViews?: CollectionProperties; + /** + * An instance of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) object to display in the view. A view may only display one map at a time. On the other hand, one [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) may be viewed by multiple [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and/or [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) simultaneously. This property is typically set in the constructor of the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [class description](#) for examples demonstrating the relationship between the map and the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) + */ map?: MapProperties; + /** + * Use the padding property to make the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center), and [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent), etc. work off a subsection of the full view. This is particularly useful when layering UI elements or semi-transparent content on top of portions of the view. See the [view padding sample](https://developers.arcgis.com/javascript/latest/sample-code/view-padding/index.html) for an example of how this works. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) + * + * @default {left: 0, top: 0, right: 0, bottom: 0} + */ padding?: ViewPadding; - ready?: boolean; + /** + * The spatial reference of the view. This indicates the [Projected Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) or the [Geographic Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. The spatial reference can either be set explicitly or automatically derived from the following: + * * In the case of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#map) is a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) instance, the [WebScene.initialViewProperties.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) is used. + * * In all other cases, the spatial reference is derived from the first layer that loads in this order: + * * [map.basemap.baseLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) + * * [map.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) + * * [map.ground.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) + * + * + * When using an [Esri basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), the default spatial reference is Web Mercator Auxiliary Sphere. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) + * + * @default null + */ spatialReference?: SpatialReferenceProperties; - stationary?: boolean; - type?: string; - updating?: boolean; } - export interface ViewPadding { + + export interface ViewPadding extends Object { + /** + * The left padding (in pixels). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) + */ left?: number; + /** + * The top padding (in pixels). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) + */ top?: number; + /** + * The right padding (in pixels). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) + */ right?: number; + /** + * The bottom padding (in pixels). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) + */ bottom?: number; } interface ViewAnimation extends Accessor, corePromise { - state: string; + /** + * The state of the animation. The animation terminates when the state is either `finished` or `stopped` and cannot transition again to `running`. The `finished` state indicates the animation has successfully ended, while the `stopped` state indicates that the animation was interrupted before it reached its final target. **Known Values:** running | finished | stopped + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#state) + * + * @default running + */ + readonly state: string; + /** + * The target of the animation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#target) + */ target: Viewpoint; + /** + * Finishes the view animation by immediately going to the target and sets the state of the animation to `finished`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#finish) + * + * + */ finish(): void; + /** + * Stops the view animation at its current state and sets the state of the animation to `stopped`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#stop) + * + * + */ stop(): void; } interface ViewAnimationConstructor { + /** + * Contains a [state](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#state) property used for checking the state of the animation. The view animation is resolved when the animation has `finished` and is rejected if it is `stopped`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html) + */ + new(properties?: ViewAnimationProperties): ViewAnimation; } export const ViewAnimation: ViewAnimationConstructor; interface ViewAnimationProperties { - state?: string; + /** + * The target of the animation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#target) + */ target?: ViewpointProperties; } interface WebMap extends Map, corePromise { + /** + * Object responsible for containing the viewing and editing properties of the WebMap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#applicationProperties) + */ applicationProperties: any; + /** + * An array of saved geographic extents that allow end users to quickly navigate to a particular area of interest. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks) + */ bookmarks: any[]; + /** + * The initial view of the WebMap. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference), that should be applied to the view when the WebMap loads. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#initialViewProperties) + */ initialViewProperties: InitialViewProperties; - loaded: boolean; - loadError: Error; - loadStatus: string; + /** + * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A WebMap is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap) are created, but not yet loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loaded) + * + * @default false + */ + readonly loaded: boolean; + /** + * The Error object returned if an error occurred while loading. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadError) + * + * @default null + */ + readonly loadError: Error; + /** + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#load) operation. + * + * Value | Description + * ------|------------ + * not-loaded | The object's resources have not loaded. + * loading | The object's resources are currently loading. + * loaded | The object's resources have loaded without errors. + * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadError) for more details. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadStatus) + * + * @default not-loaded + */ + readonly loadStatus: string; + /** + * The portal item from which the WebMap is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem) + */ portalItem: PortalItem; + /** + * Provides multiple slides. Each slide has a different "title", "extent", "basemap", "layers" etc. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#presentation) + */ presentation: any; - sourceVersion: WebMapSourceVersion; + /** + * The version of the source document from which the WebMap was read. The WebMap must be version 2.x to load into an app. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) + */ + readonly sourceVersion: WebMapSourceVersion; + /** + * An array of table objects in the WebMap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#tables) + */ tables: any[]; + /** + * The widgets object contains widgets that should be exposed to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#widgets) + */ widgets: any; + /** + * Triggers the loading of the WebMap instance. A WebMap is considered [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loaded) when its [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap) are fully created. When created with a [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem), `load()` will first fetch its data to create the content, otherwise it resolves immediately. The [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) automatically calls the `load()` method when a WebMap instance is added to its [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) property so it can display in the view and load each individual layer. If the WebMap is used outside of a view, for example to preload it, you must call `load()` explicitly to interact with its resources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#load) + * + * + */ load(): IPromise; } 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 [Portal for ArcGIS](http://server.arcgis.com/en/portal/) into a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html) + */ + new(properties?: WebMapProperties): WebMap; } export const WebMap: WebMapConstructor; interface WebMapProperties extends MapProperties { + /** + * Object responsible for containing the viewing and editing properties of the WebMap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#applicationProperties) + */ applicationProperties?: any; + /** + * An array of saved geographic extents that allow end users to quickly navigate to a particular area of interest. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks) + */ bookmarks?: any[]; + /** + * The initial view of the WebMap. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference), that should be applied to the view when the WebMap loads. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#initialViewProperties) + */ initialViewProperties?: InitialViewPropertiesProperties; - loaded?: boolean; - loadError?: Error; - loadStatus?: string; + /** + * The portal item from which the WebMap is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem) + */ portalItem?: PortalItemProperties; + /** + * Provides multiple slides. Each slide has a different "title", "extent", "basemap", "layers" etc. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#presentation) + */ presentation?: any; - sourceVersion?: WebMapSourceVersion; + /** + * An array of table objects in the WebMap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#tables) + */ tables?: any[]; + /** + * The widgets object contains widgets that should be exposed to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#widgets) + */ widgets?: any; } interface InitialViewProperties extends Accessor, corePromise { + /** + * The spatial reference of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). This indicates the [Projected Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) or the [Geographic Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) used to locate geographic features in the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference) + */ spatialReference: SpatialReference; + /** + * The initial viewpoint of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint) + */ viewpoint: Viewpoint; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#clone) + * + * + */ clone(): InitialViewProperties; } interface InitialViewPropertiesConstructor { + + new(properties?: InitialViewPropertiesProperties): InitialViewProperties; } export const InitialViewProperties: InitialViewPropertiesConstructor; interface InitialViewPropertiesProperties { + /** + * The spatial reference of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). This indicates the [Projected Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) or the [Geographic Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) used to locate geographic features in the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; + /** + * The initial viewpoint of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint) + */ viewpoint?: ViewpointProperties; } - export interface WebMapSourceVersion { + + export interface WebMapSourceVersion extends Object { + /** + * The major version of the WebMap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) + */ major: number; + /** + * The minor version of the WebMap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) + */ minor: number; } interface WebScene extends Map, corePromise { + /** + * *This property only applies to local scenes.* Represents an optional clipping area used to define the bounds or [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. Set the [clippingEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) property to `true` to apply the specified clippingArea to the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) + */ clippingArea: Extent; + /** + * *This property only applies to local scenes.* Determines whether clipping using the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) is enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) + * + * @default false + */ clippingEnabled: boolean; + /** + * The height model info of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This object defines the characteristics of the vertical coordinate system used by the scene. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), the height model info is used to avoid combining layers that have incompatible vertical coordinate systems. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#heightModelInfo) + */ heightModelInfo: HeightModelInfo; + /** + * The initial view of the WebScene. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference), [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode), and [environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) that should be applied to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the scene loads. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) + */ initialViewProperties: websceneInitialViewProperties; - loaded: boolean; - loadError: Error; - loadStatus: string; + /** + * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A WebScene is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#basemap) are fully created, but not yet loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded) + * + * @default false + */ + readonly loaded: boolean; + /** + * The Error object returned if an error occurred while loading. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadError) + * + * @default null + */ + readonly loadError: Error; + /** + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) operation. + * + * Value | Description + * ------|------------ + * not-loaded | The object's resources have not loaded. + * loading | The object's resources are currently loading. + * loaded | The object's resources have loaded without errors. + * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadError) for more details. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadStatus) + * + * @default not-loaded + */ + readonly loadStatus: string; + /** + * The portal item from which the WebScene is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem) + */ portalItem: PortalItem; + /** + * Provides a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of slides that act as bookmarks for saving predefined [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) and visible layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation) + */ presentation: Presentation; - sourceVersion: WebSceneSourceVersion; + /** + * The version of the source document from which the WebScene was read. The WebScene must be version 1.x to load into an app. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) + */ + readonly sourceVersion: WebSceneSourceVersion; + /** + * Triggers the loading of the WebScene instance. A WebScene is considered [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded) when its [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers), [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#basemap) and [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#ground) are fully created. When created with a [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem), `load()` will first fetch its data to create the content, otherwise it resolves immediately. The [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) automatically calls the `load()` method when a WebScene instance is added to its [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#map) property so it can display in the view and load each individual layer. If the WebScene is used outside of a view, for example to preload it, you must call `load()` explicitly to interact with its resources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) + * + * + */ load(): IPromise; + /** + * Saves the webscene to its associated portal item. The portal item to save to must already exist and be valid. This is a convenience method that will use [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) to store the webscene in the item. The web scene is saved according to [web scene specification](https://developers.arcgis.com/web-scene-specification/) standards. Use [updateFrom](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) to store the current view properties in the webscene before saving it. Note that this saves the webscene to its existing item. Depending on how the scene is shared, users that do not own the scene may modify it. To save an existing scene as a new item owned by the user signed into the portal instance, use [saveAs()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs). The webscene will be automatically loaded if it is not already before saving. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save) + * + * @param options Additional options. + * @param options.ignoreUnsupported When `true`, the scene will save even if it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. + * + */ save(options?: WebSceneSaveOptions): IPromise; - saveAs(portalItem: PortalItem, options?: WebSceneSaveAsOptions): IPromise; + /** + * Saves the webscene to a new portal item. If saving has completed successfully, then the saved portal item will be set in the portalItem property of the WebScene. This is a convenience method that will create a new [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) and use [PortalUser.addItem()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) to store the webscene in a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html). Use [updateFrom](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) to store the current view properties in the webscene before saving it. Note that this always saves the webscene as a new portal item owned by the user performing the edits and executing the `saveAs()` method. If you want to modify the existing item without changing its ownership use [save()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save). The webscene will be automatically loaded if it is not already before saving. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) + * + * @param portalItem The new portal item to which the scene will be saved. Portal item properties such as the title or description need to be explicitly set on the item and will not be automatically copied from the current associated scene portal item (if any). + * @param options additional save options. + * @param options.folder the folder in which to save the item. + * @param options.ignoreUnsupported allow the scene to be saved even in the case it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. + * + */ + saveAs(portalItem: PortalItem | PortalItemProperties, options?: WebSceneSaveAsOptions): IPromise; + /** + * Converts an instance of [this class]() to its ArcGIS Portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide and the [web scene specification](https://developers.arcgis.com/web-scene-specification/) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#toJSON) + * + * + */ toJSON(): any; + /** + * Update properties of the WebScene related to the view. This should usually be called just before saving a scene. The following properties are updated from the view: 1. `initialViewProperties.spatialReference` 2. `initialViewProperties.viewingMode` 3. `clippingArea` 4. `heightModelInfo` Depending on the provided options, the following properties are also updated: 1. `initialViewProperties.environment` 1. `initialViewProperties.viewpoint` + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) + * + * @param view the view to update from. + * @param options update options. + * @param options.environmentExcluded update the initial environment from the view, defaults to false. + * @param options.viewpointExcluded update the initial viewpoint from the view, defaults to false. + * + */ updateFrom(view: SceneView, options?: WebSceneUpdateFromOptions): void; } interface WebSceneConstructor { + /** + * The web scene is the core element of 3D mapping across the ArcGIS platform. It defines the content, style, environment, and slides of your scene and it can be shared across multiple ArcGIS web and desktop applications. Web scenes can be created, published, and consumed in [ArcGIS Pro](http://pro.arcgis.com/en/pro-app/help/mapping/map-authoring/author-a-web-scene.htm) and ArcGIS Online with the [Scene Viewer](http://server.arcgis.com/en/portal/latest/use/make-your-first-scene.htm). The web scene is saved as a JSON document that can be consumed by the ArcGIS API for JavaScript via the WebScene class to easily create compelling 3D applications. The JSON document is written according to the [web scene specification](https://developers.arcgis.com/web-scene-specification/). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) + */ + new(properties?: WebSceneProperties): WebScene; + /** + * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. If the [WebScene]() is used outside of a view, you must call [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) explicitly to interact with its resources. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#fromJSON) + * + * @param json A JSON representation of the instance in the ArcGIS format. See the [web scene specification](https://developers.arcgis.com/web-scene-specification/) for more detailed information on serializing web scenes to JSON. + * + */ fromJSON(json: any): any; } export const WebScene: WebSceneConstructor; interface WebSceneProperties extends MapProperties { + /** + * *This property only applies to local scenes.* Represents an optional clipping area used to define the bounds or [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. Set the [clippingEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) property to `true` to apply the specified clippingArea to the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) + */ clippingArea?: ExtentProperties; + /** + * *This property only applies to local scenes.* Determines whether clipping using the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) is enabled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) + * + * @default false + */ clippingEnabled?: boolean; + /** + * The height model info of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This object defines the characteristics of the vertical coordinate system used by the scene. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), the height model info is used to avoid combining layers that have incompatible vertical coordinate systems. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#heightModelInfo) + */ heightModelInfo?: HeightModelInfoProperties; + /** + * The initial view of the WebScene. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference), [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode), and [environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) that should be applied to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the scene loads. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) + */ initialViewProperties?: websceneInitialViewPropertiesProperties; - loaded?: boolean; - loadError?: Error; - loadStatus?: string; + /** + * The portal item from which the WebScene is loaded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem) + */ portalItem?: PortalItemProperties; + /** + * Provides a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of slides that act as bookmarks for saving predefined [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) and visible layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation) + */ presentation?: PresentationProperties; - sourceVersion?: WebSceneSourceVersion; } interface Environment extends Accessor { + /** + * Settings for defining the lighting of the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#lighting) + */ lighting: Lighting; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#clone) + * + * + */ clone(): Environment; } interface EnvironmentConstructor { + + new(properties?: EnvironmentProperties): Environment; } export const Environment: EnvironmentConstructor; interface EnvironmentProperties { + /** + * Settings for defining the lighting of the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#lighting) + */ lighting?: LightingProperties; } interface websceneInitialViewProperties extends Accessor, corePromise { + /** + * The initial environment settings of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) + */ environment: Environment; + /** + * The spatial reference of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This indicates the [Projected Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) or the [Geographic Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference) + */ spatialReference: SpatialReference; + /** + * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Known Values:** global | local + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode) + * + * @default global + */ viewingMode: string; + /** + * The initial viewpoint of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint) + */ viewpoint: Viewpoint; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#clone) + * + * + */ clone(): websceneInitialViewProperties; } interface websceneInitialViewPropertiesConstructor { + + new(properties?: websceneInitialViewPropertiesProperties): websceneInitialViewProperties; } export const websceneInitialViewProperties: websceneInitialViewPropertiesConstructor; interface websceneInitialViewPropertiesProperties { + /** + * The initial environment settings of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) + */ environment?: EnvironmentProperties; + /** + * The spatial reference of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This indicates the [Projected Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Projected_coordinate_systems/02r3000000vt000000/) or the [Geographic Coordinate System](http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Geographic_coordinate_systems/02r300000105000000/) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference) + */ spatialReference?: SpatialReferenceProperties; + /** + * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Known Values:** global | local + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode) + * + * @default global + */ viewingMode?: string; + /** + * The initial viewpoint of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint) + */ viewpoint?: ViewpointProperties; } interface Lighting extends Accessor, corePromise { + /** + * The time and date for which the sun position and light direction is computed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#date) + * + * @default null + */ date: Date; + /** + * The type of direct shadows. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#directShadowsEnabled) + * + * @default false + */ directShadowsEnabled: boolean; + /** + * The UTC timezone offset in hours that should be displayed in the UI to represent the date. This value does not have an impact on the actual lighting of the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#displayUTCOffset) + * + * @default null + */ displayUTCOffset: number; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#clone) + * + * + */ clone(): Lighting; } interface LightingConstructor { + + new(properties?: LightingProperties): Lighting; } export const Lighting: LightingConstructor; interface LightingProperties { + /** + * The time and date for which the sun position and light direction is computed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#date) + * + * @default null + */ date?: DateProperties; + /** + * The type of direct shadows. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#directShadowsEnabled) + * + * @default false + */ directShadowsEnabled?: boolean; + /** + * The UTC timezone offset in hours that should be displayed in the UI to represent the date. This value does not have an impact on the actual lighting of the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#displayUTCOffset) + * + * @default null + */ displayUTCOffset?: number; } interface Presentation extends Accessor { + /** + * A collection of [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) that bookmark [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), visible layers, and other settings previously defined in a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) + */ slides: Collection; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#clone) + * + * + */ clone(): Presentation; } interface PresentationConstructor { + + new(properties?: PresentationProperties): Presentation; } export const Presentation: PresentationConstructor; interface PresentationProperties { + /** + * A collection of [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) that bookmark [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), visible layers, and other settings previously defined in a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) + */ slides?: CollectionProperties; } interface Slide extends Accessor { - basemap: Basemap | string; + /** + * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * + * Value | Description + * ------|------------ + * streets | ![basemap-streets](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) + * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/satellite.jpg) + * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/hybrid.jpg) + * topo | ![basemap-topo](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) + * gray | ![basemap-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) + * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) + * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/oceans.jpg) + * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/national-geographic.jpg) + * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/terrain.jpg) + * osm | ![basemap-osm](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/osm.jpg) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap) + */ + basemap: Basemap; + /** + * The description of the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) + */ description: SlideDescription; + /** + * Represents settings that affect the environment in which the WebScene is displayed (such as lighting). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#environment) + */ environment: Environment; + /** + * The unique id of a slide within the [slides property](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) of a [Presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#id) + */ id: string; + /** + * A data URI encoded thumbnail. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) + */ thumbnail: SlideThumbnail; + /** + * The title of the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) + */ title: SlideTitle; + /** + * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) + */ viewpoint: Viewpoint; + /** + * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: + * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer instances](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html): `[layerInstance, layerInstance]` + * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer IDs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id): `["layer-1", "layer-2"]` + * + * + * The specification for each object in the collection is outlined in the table below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) + */ visibleLayers: Collection; + /** + * Applies a slide's settings to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) + * + * @param view The SceneView the slide should be applied to. + * @param options Animation options. See properties below for object specifications. + * @param options.animate Indicates whether to animate the slide transition. + * @param options.speedFactor Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly. + * @param options.duration Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. + * @param options.maxDuration The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. + * @param options.easing The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function. + * + */ applyTo(view: SceneView, options?: SlideApplyToOptions): IPromise; + /** + * Creates a deep clone of this object. Note that the basemap instance is cloned, but the layers within the basemap are copied. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#clone) + * + * + */ clone(): Slide; + /** + * Updates a slide from a [WebScene's slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides). Updating the slide is asynchronous and a snapshot of the view is only complete once the returned promise has resolved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) + * + * @param view The SceneView from which the slide should update. + * @param options Update options. See properties below for object specifications. + * @param options.screenshot Screenshot options to use. See properties below for object specifications. + * + */ updateFrom(view: SceneView, options?: SlideUpdateFromOptions): IPromise; } interface SlideConstructor { + /** + * A slide stores a snapshot of several pre-set properties of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) and [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), such as the [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap), [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) and [visible layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers). The [visible layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) may contain references (by [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id)) to both operational layers from the [scene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) as well as elevation layers from the [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers), which affect the surface elevation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) + */ + new(properties?: SlideProperties): Slide; + /** + * Creates a slide from a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), which may be added to the [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) in the WebScene's [presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation). Updating the slide is asynchronous and a snapshot of the view is only complete once the returned promise has resolved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) + * + * @param view The SceneView from which the slide should be created. + * @param options Creation options. See properties below for object specifications. + * @param options.screenshot Screenshot options to use. See properties below for object specifications. + * + */ createFrom(view: SceneView, options?: SlideCreateFromOptions): IPromise; } export const Slide: SlideConstructor; interface SlideProperties { + /** + * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * + * Value | Description + * ------|------------ + * streets | ![basemap-streets](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/streets.jpg) + * satellite | ![basemap-satellite](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/satellite.jpg) + * hybrid | ![basemap-hybrid](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/hybrid.jpg) + * topo | ![basemap-topo](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/topo.jpg) + * gray | ![basemap-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/gray.jpg) + * dark-gray | ![basemap-dark-gray](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/dark-gray.jpg) + * oceans | ![basemap-oceans](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/oceans.jpg) + * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/national-geographic.jpg) + * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/terrain.jpg) + * osm | ![basemap-osm](https://developers.arcgis.com/javascript/latest/assets/img/apiref/basemap/osm.jpg) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap) + */ basemap?: BasemapProperties | string; + /** + * The description of the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) + */ description?: SlideDescriptionProperties; + /** + * Represents settings that affect the environment in which the WebScene is displayed (such as lighting). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#environment) + */ environment?: EnvironmentProperties; + /** + * The unique id of a slide within the [slides property](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) of a [Presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#id) + */ id?: string; + /** + * A data URI encoded thumbnail. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) + */ thumbnail?: SlideThumbnailProperties; + /** + * The title of the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) + */ title?: SlideTitleProperties; + /** + * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) + */ viewpoint?: ViewpointProperties; + /** + * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: + * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer instances](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html): `[layerInstance, layerInstance]` + * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer IDs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id): `["layer-1", "layer-2"]` + * + * + * The specification for each object in the collection is outlined in the table below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) + */ visibleLayers?: CollectionProperties; } - export interface SlideApplyToOptions { - animate: boolean; + + export interface SlideApplyToOptions extends Object { + /** + * Indicates whether to animate the slide transition. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) + * + * @default true + */ + animate?: boolean; + /** + * Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) + * + * @default 1 + */ speedFactor?: number; + /** + * Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) + */ duration?: number; + /** + * The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) + * + * @default 8000 + */ maxDuration?: number; + /** + * The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) + */ easing?: string | EasingFunction; } - export interface SlideCreateFromOptions { - screenshot: SlideCreateFromOptionsScreenshot; + + export interface SlideCreateFromOptions extends Object { + /** + * Screenshot options to use. See properties below for object specifications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) + */ + screenshot?: SlideCreateFromOptionsScreenshot; } - export interface SlideCreateFromOptionsScreenshot { - format: string; - quality: number; - width: number; - height: number; + + export interface SlideCreateFromOptionsScreenshot extends Object { + /** + * The image format. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) + * + * @default jpeg + */ + format?: string; + /** + * The image quality (due to compression). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) + * + * @default 80 + */ + quality?: number; + /** + * The image width. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) + * + * @default 112 + */ + width?: number; + /** + * The image height. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) + * + * @default 61 + */ + height?: number; } - export interface SlideDescriptionProperties { - text?: string; - } - export interface SlideDescription extends Accessor { + + export interface SlideDescriptionProperties extends Object { + /** + * The description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) + */ text?: string; } - export interface SlideThumbnailProperties { - url?: string; + export interface SlideDescription extends AnonymousAccessor { + /** + * The description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) + */ + text?: string; } - export interface SlideThumbnail extends Accessor { + + + export interface SlideThumbnailProperties extends Object { + /** + * The URI pointing to the thumbnail image representing the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) + */ url?: string; } - export interface SlideTitleProperties { - text?: string; + export interface SlideThumbnail extends AnonymousAccessor { + /** + * The URI pointing to the thumbnail image representing the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) + */ + url?: string; } - export interface SlideTitle extends Accessor { + + + export interface SlideTitleProperties extends Object { + /** + * The title. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) + */ text?: string; } - export interface SlideUpdateFromOptions { + export interface SlideTitle extends AnonymousAccessor { + /** + * The title. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) + */ + text?: string; + } + + + export interface SlideUpdateFromOptions extends Object { + /** + * Screenshot options to use. See properties below for object specifications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) + */ screenshot: SlideUpdateFromOptionsScreenshot; } - export interface SlideUpdateFromOptionsScreenshot { - format: string; - quality: number; - width: number; - height: number; + + export interface SlideUpdateFromOptionsScreenshot extends Object { + /** + * The image format. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) + * + * @default jpeg + */ + format?: string; + /** + * The image quality (due to compression). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) + * + * @default 80 + */ + quality?: number; + /** + * The image width. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) + * + * @default 120 + */ + width?: number; + /** + * The image height. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) + * + * @default 75 + */ + height?: number; } - export interface SlideVisibleLayersProperties { + + export interface SlideVisibleLayersProperties extends Object { + /** + * The ID of a [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) in the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) or [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that is made `visible` in the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the slide is applied to the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) + */ id?: string; } - export interface SlideVisibleLayers extends Accessor { + + export interface SlideVisibleLayers extends AnonymousAccessor { + /** + * The ID of a [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) in the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) or [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that is made `visible` in the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the slide is applied to the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) + */ id: string; } - export interface WebSceneSaveAsOptions { + + export interface WebSceneSaveAsOptions extends Object { + /** + * the folder in which to save the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) + */ folder?: PortalFolder; + /** + * allow the scene to be saved even in the case it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) + */ ignoreUnsupported?: boolean; } - export interface WebSceneSaveOptions { + + export interface WebSceneSaveOptions extends Object { + /** + * When `true`, the scene will save even if it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save) + */ ignoreUnsupported?: boolean; } - export interface WebSceneSourceVersion { + + export interface WebSceneSourceVersion extends Object { + /** + * The major version of the WebScene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) + */ major: number; + /** + * The minor version of the WebScene. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) + */ minor: number; } - export interface WebSceneUpdateFromOptions { + + export interface WebSceneUpdateFromOptions extends Object { + /** + * update the initial environment from the view, defaults to false. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) + */ environmentExcluded?: boolean; + /** + * update the initial viewpoint from the view, defaults to false. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) + */ viewpointExcluded?: boolean; } interface Attribution extends Widget { + /** + * Full attribution text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#attributionText) + */ + readonly attributionText: string; + /** + * Text used to split attribution by [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#itemDelimiter) + * + * @default | + */ + itemDelimiter: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [AttributionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#viewModel) + */ viewModel: AttributionViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#render) + * + * + */ render(): any; } interface AttributionConstructor { + /** + * The Attribution displays attribution text for the layers in a map. The text displayed for the layers is either a list of data providers or sources as defined in the layer's custom attribution data, or the copyright text. This widget automatically updates based on layer visibility and map extent and displays a single line of attribution that can be expanded with a single click to view all data sources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) + */ + new(properties?: AttributionProperties): Attribution; } export const Attribution: AttributionConstructor; interface AttributionProperties extends WidgetProperties { + /** + * Text used to split attribution by [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#itemDelimiter) + * + * @default | + */ + itemDelimiter?: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [AttributionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#viewModel) + */ viewModel?: AttributionViewModel; } interface AttributionViewModel { - attributionText: string; - itemDelimiter: string; - state: string; + /** + * Array of attribution items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#items) + */ + readonly items: AttributionItem[]; + /** + * The view model's state. **Known Values:** ready | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view from which the view model will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#view) + */ view: MapView | SceneView; } interface AttributionViewModelConstructor { + /** + * Provides the logic for the [Attribution](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) widget. Displays attribution text for the layers in a map. The text displayed for the layers is either a list of data providers or sources as defined in the layer's custom attribution data, or the copyright text. The attribution is automatically updated based on layer visibility and map extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) + */ + + new(properties?: any): AttributionViewModel; } export const AttributionViewModel: AttributionViewModelConstructor; + /** + * The following properties define an attribution item that contains the attribution text for a set of layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) + */ + export interface AttributionItem extends Object { + /** + * The attribution text for one or more layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) + */ + text: boolean; + /** + * The associated layers that share the attribution text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) + */ + layers: Layer[]; + } + interface BasemapGallery extends Widget { + /** + * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#activeBasemap) + */ activeBasemap: Basemap; + /** + * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance, or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#source) + */ source: LocalBasemapsSource | PortalBasemapsSource; + /** + * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#viewModel) + */ viewModel: BasemapGalleryViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#render) + * + * + */ render(): any; } interface BasemapGalleryConstructor { + /** + * The BasemapGallery widget displays a collection images representing basemaps from ArcGIS.com or a user-defined set of map or image services. When a new basemap is selected from the BasemapGallery, the map's basemap layers are removed and replaced with the basemap layers of the associated basemap selected in the gallery. By default, the BasemapGallery widget looks like the following image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) + */ + new(properties?: BasemapGalleryProperties): BasemapGallery; } export const BasemapGallery: BasemapGalleryConstructor; interface BasemapGalleryProperties extends WidgetProperties { + /** + * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#activeBasemap) + */ activeBasemap?: BasemapProperties; - source?: LocalBasemapsSource | PortalBasemapsSource; + /** + * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance, or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#source) + */ + source?: LocalBasemapsSourceProperties | PortalBasemapsSourceProperties; + /** + * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#viewModel) + */ viewModel?: BasemapGalleryViewModelProperties; } - interface BasemapGalleryItem { - basemap: Basemap; - error: Error; - state: string; - view: MapView | SceneView; - } - - export const BasemapGalleryItem: BasemapGalleryItem; - interface BasemapGalleryViewModel extends Accessor { + /** + * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#activeBasemap) + */ activeBasemap: Basemap; + /** + * A collection of [BasemapGalleryItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html)s representing basemaps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#items) + */ items: Collection; + /** + * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#source) + */ source: LocalBasemapsSource | PortalBasemapsSource; - state: string; + /** + * The view model's state. **Known Values:** ready | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#view) + */ view: MapView | SceneView; + /** + * A convenience function to check basemap equality. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#basemapEquals) + * + * @param basemap1 The basemap to compare against `basemap2`. + * @param basemap2 The basemap to compare against `basemap1`. + * + */ basemapEquals(basemap1: Basemap, basemap2: Basemap): boolean; } interface BasemapGalleryViewModelConstructor { + + new(properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; } export const BasemapGalleryViewModel: BasemapGalleryViewModelConstructor; interface BasemapGalleryViewModelProperties { + /** + * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#activeBasemap) + */ activeBasemap?: BasemapProperties; + /** + * A collection of [BasemapGalleryItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html)s representing basemaps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#items) + */ items?: CollectionProperties; - source?: LocalBasemapsSource | PortalBasemapsSource; - state?: string; + /** + * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#source) + */ + source?: LocalBasemapsSourceProperties | PortalBasemapsSourceProperties; + /** + * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; } - interface LocalBasemapsSource { - basemaps: Collection; - state: string; + + interface BasemapGalleryItem { + /** + * The item's associated basemap. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#basemap) + */ + basemap: Basemap; + /** + * The Error object returned if an error occurred. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#error) + */ + readonly error: Error; + /** + * The item's state. **Known Values:** loading | ready | error + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#state) + * + * @default loading + */ + readonly state: string; + /** + * The view associated with this item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#view) + */ + view: MapView | SceneView; } - export const LocalBasemapsSource: LocalBasemapsSource; + export const BasemapGalleryItem: BasemapGalleryItem; - interface PortalBasemapsSource { + interface LocalBasemapsSource extends Accessor { + /** + * A collection of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#basemaps) + */ basemaps: Collection; + /** + * The source's state. The state is always `ready`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#state) + */ + readonly state: string; + + /** + * Refreshes the source basemaps. Note: `refresh` will not affect LocalBasemapsSource. Modify basemaps directly instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#refresh) + * + * + */ + refresh(): void; + } + + interface LocalBasemapsSourceConstructor { + + + new(properties?: LocalBasemapsSourceProperties): LocalBasemapsSource; + } + + export const LocalBasemapsSource: LocalBasemapsSourceConstructor; + + interface LocalBasemapsSourceProperties { + /** + * A collection of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#basemaps) + */ + basemaps?: CollectionProperties; + } + + interface PortalBasemapsSource extends LocalBasemapsSource { + /** + * Function used to filter basemaps after being fetched from the Portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#filterFunction) + */ filterFunction: Function; + /** + * The Portal from which to fetch basemaps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#portal) + */ portal: Portal; + /** + * An object with key-value pairs used to create a custom basemap gallery group query. Note that all parameters will be joined using the `AND` operator. A query string can also be provided for more advanced use cases. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#query) + */ query: any | string; - state: string; } - export const PortalBasemapsSource: PortalBasemapsSource; + interface PortalBasemapsSourceConstructor { + + + new(properties?: PortalBasemapsSourceProperties): PortalBasemapsSource; + } + + export const PortalBasemapsSource: PortalBasemapsSourceConstructor; + + interface PortalBasemapsSourceProperties extends LocalBasemapsSourceProperties { + /** + * Function used to filter basemaps after being fetched from the Portal. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#filterFunction) + */ + filterFunction?: Function; + /** + * The Portal from which to fetch basemaps. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#portal) + */ + portal?: PortalProperties; + /** + * An object with key-value pairs used to create a custom basemap gallery group query. Note that all parameters will be joined using the `AND` operator. A query string can also be provided for more advanced use cases. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#query) + */ + query?: any | string; + } interface BasemapToggle extends Widget { - activeBasemap: Basemap; - nextBasemap: Basemap | string; + /** + * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#activeBasemap) + */ + readonly activeBasemap: Basemap; + /** + * The next basemap for toggling. One of the following values may be set to this property: + * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. + * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap) + */ + nextBasemap: Basemap; + /** + * Indicates if the title of the basemap is visible in the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#titleVisible) + * + * @default false + */ titleVisible: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This view provides the BasemapToggle widget with access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BasemapToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#viewModel) + */ viewModel: BasemapToggleViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#render) + * + * + */ render(): any; + /** + * Toggles to the [next basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#toggle) + * + * + */ toggle(): void; } interface BasemapToggleConstructor { + /** + * The BasemapToggle provides a widget which allows an end-user to switch between two basemaps. The toggled basemap is set inside the [view's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) + */ + new(properties?: BasemapToggleProperties): BasemapToggle; } export const BasemapToggle: BasemapToggleConstructor; interface BasemapToggleProperties extends WidgetProperties { - activeBasemap?: BasemapProperties; + /** + * The next basemap for toggling. One of the following values may be set to this property: + * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. + * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap) + */ nextBasemap?: BasemapProperties | string; + /** + * Indicates if the title of the basemap is visible in the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#titleVisible) + * + * @default false + */ titleVisible?: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This view provides the BasemapToggle widget with access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BasemapToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#viewModel) + */ viewModel?: BasemapToggleViewModelProperties; } interface BasemapToggleViewModel extends Accessor, Evented { - activeBasemap: Basemap; - nextBasemap: Basemap | string; - state: string; + /** + * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#activeBasemap) + */ + readonly activeBasemap: Basemap; + /** + * The next basemap for toggling. One of the following values may be set to this property: + * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. + * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap) + */ + nextBasemap: Basemap; + /** + * The view model's state. **Known Values:** ready | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view from which the widget will operate. This view provides access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#view) + */ view: MapView | SceneView; + /** + * Toggles to the [next basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#toggle) + * + * + */ toggle(): void; } interface BasemapToggleViewModelConstructor { + + new(properties?: BasemapToggleViewModelProperties): BasemapToggleViewModel; + /** + * Helper method to find a basemap's thumbnail URL. If the basemap does not have a thumbnail URL defined, this utility will try to find a thumbnail URL from the best matching well-known basemap. If no match is found, a thumbnail URL from the basemap's base layers will be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#getThumbnailUrl) + * + * @param basemap The basemap used to retrieve the thumbnail URL. + * + */ getThumbnailUrl(basemap: Basemap): string; } export const BasemapToggleViewModel: BasemapToggleViewModelConstructor; interface BasemapToggleViewModelProperties { - activeBasemap?: BasemapProperties; + /** + * The next basemap for toggling. One of the following values may be set to this property: + * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. + * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap) + */ nextBasemap?: BasemapProperties | string; - state?: string; + /** + * The view from which the widget will operate. This view provides access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; } interface ColorSlider extends Accessor, Widgette { + /** + * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#handlesVisible) + * + * @default true + */ handlesVisible: boolean; + /** + * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) + */ histogram: HistogramResult; + /** + * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramVisible) + * + * @default true + */ histogramVisible: boolean; + /** + * The width of the histogram in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramWidth) + * + * @default 100 + */ histogramWidth: number; + /** + * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#labelsVisible) + * + * @default true + */ labelsVisible: boolean; + /** + * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be less than the value of the maximum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) + */ maxValue: number; + /** + * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be greater than the value of the minimum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) + */ minValue: number; + /** + * Indicates the number of handles to show on the slider. Acceptable values are `2` or `3`. If `3` handles are specified, then the [syncedHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) property may be enabled to sync the movement of the outside handles with the middle, or primary, handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) + * + * @default {"value":2,"set":""} + */ numHandles: number; + /** + * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) of the slider if values for those properties are not already provided. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) + */ statistics: ColorSliderStatistics; + /** + * Indicates whether to show the average in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statisticsVisible) + * + * @default true + */ statisticsVisible: boolean; + /** + * Only applicable when [numHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) is set to `3`. This property indicates whether the outside handles are synced with the middle, or primary, handle. If the primary handle is dragged then the outside handles are dragged while maintaining the same distance from the primary handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) + * + * @default false + */ syncedHandles: boolean; + /** + * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#ticksVisible) + * + * @default true + */ ticksVisible: boolean; - values: ColorSliderValues[]; + /** + * Each object in this array represents a stop in the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) associated with the slider. The properties of each object describe whether the stop has a slider handle, the value of the handle and its associated color. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) + */ + readonly values: ColorSliderValues[]; + /** + * The color visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the [colorRendererCreator](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) helper methods. A new color visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) + */ visualVariable: ColorVisualVariable; } interface ColorSliderConstructor { + /** + * The ColorSlider is a widget intended for authoring and exploring data-driven visualizations in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) using color. To display properly, this slider requires a [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) and a [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) object. Other optional properties may be used, including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html) + */ + new(properties?: ColorSliderProperties): ColorSlider; } export const ColorSlider: ColorSliderConstructor; interface ColorSliderProperties extends WidgetteProperties { + /** + * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#handlesVisible) + * + * @default true + */ handlesVisible?: boolean; + /** + * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) + */ histogram?: HistogramResult; + /** + * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramVisible) + * + * @default true + */ histogramVisible?: boolean; + /** + * The width of the histogram in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramWidth) + * + * @default 100 + */ histogramWidth?: number; + /** + * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#labelsVisible) + * + * @default true + */ labelsVisible?: boolean; + /** + * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be less than the value of the maximum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) + */ maxValue?: number; + /** + * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be greater than the value of the minimum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) + */ minValue?: number; + /** + * Indicates the number of handles to show on the slider. Acceptable values are `2` or `3`. If `3` handles are specified, then the [syncedHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) property may be enabled to sync the movement of the outside handles with the middle, or primary, handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) + * + * @default {"value":2,"set":""} + */ numHandles?: number; + /** + * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) of the slider if values for those properties are not already provided. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) + */ statistics?: ColorSliderStatistics; + /** + * Indicates whether to show the average in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statisticsVisible) + * + * @default true + */ statisticsVisible?: boolean; + /** + * Only applicable when [numHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) is set to `3`. This property indicates whether the outside handles are synced with the middle, or primary, handle. If the primary handle is dragged then the outside handles are dragged while maintaining the same distance from the primary handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) + * + * @default false + */ syncedHandles?: boolean; + /** + * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#ticksVisible) + * + * @default true + */ ticksVisible?: boolean; - values?: ColorSliderValues[]; + /** + * The color visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the [colorRendererCreator](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) helper methods. A new color visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) + */ visualVariable?: ColorVisualVariable; } - export interface ColorSliderStatistics { + + export interface ColorSliderStatistics extends Object { + /** + * The average of all data values represented in the color visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) + */ avg: number; + /** + * The maximum of all data values represented in the color visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) + */ max: number; + /** + * The minimum of all data values represented in the color visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) + */ min: number; + /** + * The standard deviation calculated from all data values represented in the color visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) + */ stddev: number; } - export interface ColorSliderValues { + + export interface ColorSliderValues extends Object { + /** + * The color used to represent features with values at the associated stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) + */ color: Color; + /** + * The value of the stop for the associated handle. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) + */ value: number; + /** + * The label used to display the value to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) + */ label: string; } interface Compass extends Widget { + /** + * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [CompassViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#viewModel) + */ viewModel: CompassViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#render) + * + * + */ render(): any; + /** + * If working in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), sets the view's [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) to `0`. If working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), sets the camera's [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to `0`. This method is executed each time the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#reset) + * + * + */ reset(): void; } interface CompassConstructor { + /** + * The Compass widget indicates where north is in relation to the current view [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) or [camera heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading). Clicking the Compass widget rotates the view to face north (heading = 0). This widget is added to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) + */ + new(properties?: CompassProperties): Compass; } export const Compass: CompassConstructor; interface CompassProperties extends WidgetProperties { + /** + * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [CompassViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#viewModel) + */ viewModel?: CompassViewModelProperties; } interface CompassViewModel extends Accessor { + /** + * The orientation axes (x, y, z). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#orientation) + * + * @default { x: 0, y: 0, z: 0 } + */ orientation: any; - state: string; + /** + * The view model's state. **Known Values:** compass | rotation | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#view) + */ view: MapView | SceneView; + /** + * If working in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), sets the view's [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) is to `0`. If working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), sets the camera's [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to `0`. This method is executed each time the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#reset) + * + * + */ reset(): void; } interface CompassViewModelConstructor { + /** + * Provides the logic for the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) + */ + new(properties?: CompassViewModelProperties): CompassViewModel; } export const CompassViewModel: CompassViewModelConstructor; interface CompassViewModelProperties { + /** + * The orientation axes (x, y, z). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#orientation) + * + * @default { x: 0, y: 0, z: 0 } + */ orientation?: any; - state?: string; + /** + * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; } - interface Expand extends Widget { - autoCollapse: boolean; - collapseIconClass: string; - collapseTooltip: string; - content: Node | string | Widget; - expanded: boolean; - expandIconClass: string; - expandTooltip: string; - iconNumber: string; + interface Directions extends Widget { + /** + * The maximum number of stops allowed for routing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#maxStops) + * + * @default 50 + */ + maxStops: number; + /** + * The URL of the REST endpoint of the Route service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeServiceUrl) + * + * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" + */ + routeServiceUrl: string; + /** + * Defines the symbol used to draw the route on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeSymbol) + */ + routeSymbol: SimpleLineSymbol; + /** + * This property controls the default properties for [Searching](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). These properties can be configured per application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#searchProperties) + */ + searchProperties: DirectionsSearchProperties; + /** + * The default stop symbols used to display locations between the origin and final destination. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) + */ + stopSymbols: DirectionsStopSymbols; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [DirectionsViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#viewModel) + */ + viewModel: DirectionsViewModel; + + /** + * Calculate the route to the input locations and display the list of directions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#getDirections) + * + * + */ + getDirections(): IPromise; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#render) + * + * + */ + render(): any; + /** + * Zoom so that the full route is displayed within the current map extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#zoomToRoute) + * + * + */ + zoomToRoute(): void; + } + + interface DirectionsConstructor { + /** + * The Directions Widget provides a way to build driving and walking directions using ArcGIS online and custom Network Analysis Route services. Similar to how the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) works, this widget generates a route finding a least-cost path between multiple points using a specified network. The resulting directions are displayed with detailed turn-by-turn instructions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html) + */ + + new(properties?: DirectionsProperties): Directions; + } + + export const Directions: DirectionsConstructor; + + interface DirectionsProperties extends WidgetProperties { + /** + * The maximum number of stops allowed for routing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#maxStops) + * + * @default 50 + */ + maxStops?: number; + /** + * The URL of the REST endpoint of the Route service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeServiceUrl) + * + * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" + */ + routeServiceUrl?: string; + /** + * Defines the symbol used to draw the route on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeSymbol) + */ + routeSymbol?: SimpleLineSymbolProperties; + /** + * This property controls the default properties for [Searching](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). These properties can be configured per application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#searchProperties) + */ + searchProperties?: DirectionsSearchProperties; + /** + * The default stop symbols used to display locations between the origin and final destination. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) + */ + stopSymbols?: DirectionsStopSymbols; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view) + */ + view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [DirectionsViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#viewModel) + */ + viewModel?: DirectionsViewModelProperties; + } + + interface DirectionsViewModel extends Accessor { + /** + * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#impedanceAttribute) + */ + impedanceAttribute: string; + /** + * The most recent route result. Returns an object containing properties for any barriers used when generating the route, messages that may arise when solving the route, and finally an array of returned [RouteResults](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) + * + * @default null + */ + readonly lastRoute: DirectionsViewModelLastRoute; + /** + * The maximum number of stops allowed for routing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#maxStops) + * + * @default 50 + */ + maxStops: number; + /** + * Route Parameters object used to call the service. Please refer to the [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html) documentation for the list of available settings. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeParameters) + */ + routeParameters: RouteParameters; + /** + * The URL of the REST endpoint of the Route service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeServiceUrl) + * + * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" + */ + routeServiceUrl: string; + /** + * Defines the symbol used to draw the route on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeSymbol) + */ + routeSymbol: SimpleLineSymbol; + /** + * The selected travel mode. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) + * + * @default null | 'Driving Time' + */ + readonly selectedTravelMode: DirectionsViewModelSelectedTravelMode; + /** + * The Service Description object returned by the Route REST Endpoint. This object contains service specific details like available Cost attributes, supported Restrictions, default Attribute Parameter Values, Service Limits (like maximum input stop count), default Impedance Attribute, etc. This information is useful when implementing complex logistics scenarios operating with limitations or preferences on vehicle or stop properties, for example avoiding toll roads, dealing with hazardous materials, working with stop service times, etc. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#serviceDescription) + * + * @default null + */ + readonly serviceDescription: any; + /** + * The current state of the view model. **Possible Values:** disabled | ready + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * An array of graphics that define the stop locations along the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stops) + */ + stops: Collection; + /** + * The default stop symbols used to display locations between the origin and final destination. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) + */ + stopSymbols: DirectionsViewModelStopSymbols; + /** + * The name of the network attribute to use for the drive time when computing directions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) + */ + timeAttribute: DirectionsViewModelTimeAttribute; + /** + * Array of objects containing properties specific to either an ArcGIS service or organization's travel modes. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#travelModes) + */ + readonly travelModes: TravelMode[]; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#view) + */ + view: MapView | SceneView; + + /** + * Centers the map at the specified maneuver or stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#centerAt) + * + * @param stopOrManeuver The stop or maneuver where the map should be centered. + * + */ + centerAt(stopOrManeuver: Graphic): void; + /** + * Clears any highlighted route segments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#clearHighlights) + * + * + */ + clearHighlights(): void; + /** + * Removes the route directions from the directions list, leaving the inputs untouched. The route and locations persist on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#clearResults) + * + * + */ + clearResults(): void; + /** + * Returns cost attribute name specific to a particular route service. This can be used as a [travel mode impedance](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getCostAttribute) + * + * @param attributeName The attribute name specifying the cost attribute used as an impedance. + * + */ + getCostAttribute(attributeName: string): string; + /** + * Calculate the route to the input locations and display the list of directions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getDirections) + * + * + */ + getDirections(): IPromise; + /** + * Highlights the specified route segment on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#highlightSegment) + * + * @param maneuver The route segment to highlight. + * + */ + highlightSegment(maneuver: Graphic): void; + /** + * Resets the state of the ViewModel, clearing off all the input stops, and results in the widget. The results persist in the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#reset) + * + * + */ + reset(): void; + /** + * Zoom so that the full route is displayed within the current map extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#zoomToRoute) + * + * + */ + zoomToRoute(): void; + } + + 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; + } + + export const DirectionsViewModel: DirectionsViewModelConstructor; + + interface DirectionsViewModelProperties { + /** + * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#impedanceAttribute) + */ + impedanceAttribute?: string; + /** + * The maximum number of stops allowed for routing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#maxStops) + * + * @default 50 + */ + maxStops?: number; + /** + * Route Parameters object used to call the service. Please refer to the [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html) documentation for the list of available settings. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeParameters) + */ + routeParameters?: RouteParametersProperties; + /** + * The URL of the REST endpoint of the Route service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeServiceUrl) + * + * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" + */ + routeServiceUrl?: string; + /** + * Defines the symbol used to draw the route on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeSymbol) + */ + routeSymbol?: SimpleLineSymbolProperties; + /** + * An array of graphics that define the stop locations along the route. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stops) + */ + stops?: CollectionProperties; + /** + * The default stop symbols used to display locations between the origin and final destination. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) + */ + stopSymbols?: DirectionsViewModelStopSymbols; + /** + * The name of the network attribute to use for the drive time when computing directions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) + */ + timeAttribute?: DirectionsViewModelTimeAttribute; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#view) + */ + view?: MapViewProperties | SceneViewProperties; + } + + + export interface DirectionsViewModelLastRoute extends Object { + /** + * Array of graphics representing the point barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) + */ + barriers: Graphic[]; + /** + * An array of messages serialized to JSON. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) + */ + messages: DirectionsViewModelLastRouteMessages[]; + /** + * Array of graphics representing the polygon barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) + */ + polygonBarriers: Graphic[]; + /** + * Array of graphics representing the polygon barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) + */ + polylineBarriers: Graphic[]; + /** + * An array of [RouteResults](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) + */ + routeResults: RouteResult; + } + + + export interface DirectionsViewModelLastRouteMessages extends Object { + /** + * A descriptive message of the returned mesage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) + */ + description: string; + /** + * Number indicating the message type returned from the service. This number correlates to one of the known values listed below. + * + * Number | Value + * ------|------------ + * 0 | informative + * 1 | process-definition + * 2 | process-start + * 3 | process-stop + * 50 | warning + * 100 | error + * 101 | empty + * 200 | abort + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) + */ + type: number; + } + + + export interface DirectionsViewModelSelectedTravelMode extends TravelMode { + /** + * The description explaining the selected travel mode. A listing of these descriptions can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) + */ + description: string; + /** + * The unique identifier specific for this travel mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) + */ + id: string; + /** + * The cost attribute on which to optimize the analysis. For example `Miles`, `Minutes`, `Travel Time`, `Kilometers`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. Take note that attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) + */ + impedanceAttributeName: string; + /** + * Name of the travel mode. Users of ArcGIS Online or Portal for ArcGIS can define custom travel modes inside their Organization settings. Authors of stand alone Network Analysis Services can define their own travel modes inside a network dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) + */ + name: string; + /** + * The time-based cost attribute for reporting directions. For example, `Minutes`, `Travel Time`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) + */ + timeAttributeName: string; + } + + + export interface DirectionsViewModelStopSymbols extends Object { + /** + * The first stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) + */ + first?: Symbol; + /** + * The middle stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) + */ + middle?: Symbol; + /** + * The last stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) + */ + last?: Symbol; + /** + * An unlocated stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) + */ + unlocated?: Symbol; + /** + * A waypoint stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) + */ + waypoint?: Symbol; + } + + + export interface DirectionsViewModelTimeAttribute extends Object { + /** + * The name of the network attribute to use for the drive time when computing directions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) + */ + name: string; + /** + * The units to use when calculating drive time for directions. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) + */ + units?: string; + } + + /** + * Array of objects containing properties specific to either an ArcGIS service or organization's travel modes. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) + */ + export interface TravelMode extends Object { + /** + * The description explaining the selected travel mode. A listing of these descriptions can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) + */ + description?: string; + /** + * The unique identifier specific for this travel mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) + */ + id?: string; + /** + * The cost attribute on which to optimize the analysis. For example `Miles`, `Minutes`, `Travel Time`, `Kilometers`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. Take note that attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) + */ + impedanceAttributeName?: string; + /** + * Name of the travel mode. Users of ArcGIS Online or Portal for ArcGIS can define custom travel modes inside their Organization settings. Authors of stand alone Network Analysis Services can define their own travel modes inside a network dataset. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) + */ + name?: string; + /** + * The time-based cost attribute for reporting directions. For example, `Minutes`, `Travel Time`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) + */ + timeAttributeName?: string; + } + + + export interface DirectionsStopSymbols extends Object { + /** + * The first stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) + */ + first?: Symbol; + /** + * The middle stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) + */ + middle?: Symbol; + /** + * The last stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) + */ + last?: Symbol; + /** + * An unlocated stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) + */ + unlocated?: Symbol; + /** + * A waypoint stop symbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) + */ + waypoint?: Symbol; + } + + /** + * Configurable Search properties of the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + export interface DirectionsSearchProperties extends Object { + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + popupOpenOnSelect?: boolean; + /** + * Number index indicating the current selected source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + activeSourceIndex?: number; + /** + * Indicates whether to automatically navigate to the selected result once selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + autoNavigate?: boolean; + /** + * Indicates whether to automatically select and zoom to the first geocoded result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + autoSelect?: boolean; + /** + * Indicates the maximum number of search results to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + maxResults?: number; + /** + * Indicates the maximum number of suggestions to return for the widget's input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + maxSuggestions?: number; + /** + * Indicates the minimum number of characters required before querying for a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + minSuggestCharacters?: number; + /** + * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + popupEnabled?: boolean; + /** + * String value used as a hint for input text when searching on multiple sources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + allPlaceholder?: string; + /** + * A customized PopupTemplate for the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + popupTemplate?: PopupTemplate; + /** + * Indicates whether to show a graphic on the map for the selected source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + resultGraphicEnabled?: boolean; + /** + * Indicates whether to display the option to search all sources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + searchAllEnabled?: boolean; + /** + * The value of the search box input text string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + searchTerm?: string; + /** + * Specifies the sources to search in the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + sources?: Collection; + /** + * Indicates whether to display suggestions as the user enters input text in the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + suggestionsEnabled?: boolean; + /** + * The view of the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + view?: MapView | SceneView; + /** + * The Search widget's view model. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + viewModel?: SearchViewModel; + } + + interface DirectLineMeasurement3D extends Widget { + /** + * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#view) + */ + view: SceneView; + + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#render) + * + * + */ + render(): any; + } + + interface DirectLineMeasurement3DConstructor { + /** + * The DirectLineMeasurement3D widget calculates and displays the 3D distance between two points. This widget can be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) to measure the vertical, horizontal, and direct distance between two points. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html) + */ + + new(properties?: DirectLineMeasurement3DProperties): DirectLineMeasurement3D; + } + + export const DirectLineMeasurement3D: DirectLineMeasurement3DConstructor; + + interface DirectLineMeasurement3DProperties extends WidgetProperties { + /** + * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#view) + */ + view?: SceneViewProperties; + } + + interface Expand extends Widget { + /** + * Automatically collapses the expand widget instance when the view's viewpoint updates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#autoCollapse) + * + * @default false + */ + autoCollapse: boolean; + /** + * Icon font used to style the Expand button. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseIconClass) + */ + collapseIconClass: string; + /** + * Tooltip to display to indicate Expand widget can be collapsed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseTooltip) + * + * @default "Collapse" (English locale) + */ + collapseTooltip: string; + /** + * The content to display within the expanded Expand widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) + */ + content: Node | string | Widget; + /** + * Whether the widget is currently expanded or not. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expanded) + * + * @default false + */ + readonly expanded: boolean; + /** + * Icon font used to style the Expand button. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) + */ + expandIconClass: string; + /** + * Tooltip to display to indicate Expand widget can be expanded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandTooltip) + * + * @default "Expand" (English locale) + */ + expandTooltip: string; + /** + * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group) + */ + group: string; + /** + * A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices. ![expand widget icon number](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/expand-with-iconnumber.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#iconNumber) + */ + iconNumber: number; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#view) + */ + view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ExpandViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#viewModel) + */ viewModel: ExpandViewModel; + /** + * Collapse the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapse) + * + * + */ collapse(): void; + /** + * Expand the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expand) + * + * + */ expand(): void; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#render) + * + * + */ render(): any; + /** + * Toggle the widget by expanding it if it's collapsed, or collapsing it if it's expanded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#toggle) + * + * + */ toggle(): void; } interface ExpandConstructor { + + new(properties?: ExpandProperties): Expand; } export const Expand: ExpandConstructor; interface ExpandProperties extends WidgetProperties { + /** + * Automatically collapses the expand widget instance when the view's viewpoint updates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#autoCollapse) + * + * @default false + */ autoCollapse?: boolean; + /** + * Icon font used to style the Expand button. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseIconClass) + */ collapseIconClass?: string; + /** + * Tooltip to display to indicate Expand widget can be collapsed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseTooltip) + * + * @default "Collapse" (English locale) + */ collapseTooltip?: string; + /** + * The content to display within the expanded Expand widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) + */ content?: Node | string | WidgetProperties; - expanded?: boolean; + /** + * Icon font used to style the Expand button. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) + */ expandIconClass?: string; + /** + * Tooltip to display to indicate Expand widget can be expanded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandTooltip) + * + * @default "Expand" (English locale) + */ expandTooltip?: string; - iconNumber?: string; + /** + * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group) + */ + group?: string; + /** + * A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices. ![expand widget icon number](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/expand-with-iconnumber.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#iconNumber) + */ + iconNumber?: number; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ExpandViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#viewModel) + */ viewModel?: ExpandViewModelProperties; } interface ExpandViewModel extends Accessor { + /** + * Automatically collapses the expand widget instance when the view's viewpoint updates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#autoCollapse) + * + * @default false + */ autoCollapse: boolean; - expanded: boolean; - state: string; + /** + * Whether the widget is currently expanded or not. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#expanded) + * + * @default false + */ + readonly expanded: boolean; + /** + * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#group) + */ + group: string; + /** + * The view model's state. **Known Values:** ready | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view in which the Expand is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#view) + */ view: MapView | SceneView; } interface ExpandViewModelConstructor { + + new(properties?: ExpandViewModelProperties): ExpandViewModel; } export const ExpandViewModel: ExpandViewModelConstructor; interface ExpandViewModelProperties { + /** + * Automatically collapses the expand widget instance when the view's viewpoint updates. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#autoCollapse) + * + * @default false + */ autoCollapse?: boolean; - expanded?: boolean; - state?: string; + /** + * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#group) + */ + group?: string; + /** + * The view in which the Expand is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#view) + */ + view?: MapViewProperties | SceneViewProperties; + } + + interface Fullscreen extends Widget { + /** + * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#element) + */ + element: HTMLElement; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#view) + */ + view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FullscreenViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#viewModel) + */ + viewModel: FullscreenViewModel; + + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#render) + * + * + */ + render(): any; + } + + interface FullscreenConstructor { + /** + * Provides a simple widget to present the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) or a user-defined [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) using the entire screen. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html) + */ + + new(properties?: FullscreenProperties): Fullscreen; + } + + export const Fullscreen: FullscreenConstructor; + + interface FullscreenProperties extends WidgetProperties { + /** + * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#element) + */ + element?: HTMLElement; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#view) + */ + view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FullscreenViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#viewModel) + */ + viewModel?: FullscreenViewModelProperties; + } + + interface FullscreenViewModel extends Accessor { + /** + * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#element) + */ + element: HTMLElement; + /** + * The view model's state. **Known Values:** active | ready | feature-unsupported | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view associated with the widget instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#view) + */ + view: MapView | SceneView; + + /** + * Enter fullscreen + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#enter) + * + * + */ + enter(): void; + /** + * Exit fullscreen + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#exit) + * + * + */ + exit(): void; + /** + * Toggle fullscreen + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#toggle) + * + * + */ + toggle(): void; + } + + interface FullscreenViewModelConstructor { + + + new(properties?: FullscreenViewModelProperties): FullscreenViewModel; + } + + export const FullscreenViewModel: FullscreenViewModelConstructor; + + interface FullscreenViewModelProperties { + /** + * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#element) + */ + element?: HTMLElement; + /** + * The view associated with the widget instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; } interface Home extends Widget { + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [HomeViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewModel) + */ viewModel: HomeViewModel; + /** + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. + * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. + * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint) + */ viewpoint: Viewpoint; + /** + * Animates the view to the initial Viewpoint of the view or the value of [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#go) + * + * + */ go(): void; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#render) + * + * + */ render(): any; } interface HomeConstructor { + /** + * Provides a simple widget that switches the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to its initial [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or a previously defined [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint). By default this button looks like the following: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html) + */ + new(properties?: HomeProperties): Home; } export const Home: HomeConstructor; interface HomeProperties extends WidgetProperties { + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [HomeViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewModel) + */ viewModel?: HomeViewModelProperties; + /** + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. + * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. + * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint) + */ viewpoint?: ViewpointProperties; } interface HomeViewModel extends Accessor, Evented { - state: string; + /** + * The current state of the widget. **Possible Values:** disabled | ready | going-home + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view associated with the widget instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#view) + */ view: MapView | SceneView; + /** + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. + * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. + * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint) + * + * @default null + */ viewpoint: Viewpoint; + /** + * Animates the view to the initial [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) of the view or the value of [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#go) + * + * + */ go(): void; } interface HomeViewModelConstructor { + + new(properties?: HomeViewModelProperties): HomeViewModel; } export const HomeViewModel: HomeViewModelConstructor; interface HomeViewModelProperties { - state?: string; + /** + * The view associated with the widget instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. + * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. + * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint) + * + * @default null + */ viewpoint?: ViewpointProperties; } interface LayerList extends Widget { + /** + * **Use [listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) instead.** Specify the function that will create actions for [ListItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Actions are defined with the properties listed in the [Action class](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). This function must return a two-dimensional array of [Actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#createActionsFunction) + */ createActionsFunction: Function; + /** + * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable propeties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) + */ listItemCreatedFunction: Function; + /** + * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#operationalItems) + */ operationalItems: Collection; + /** + * Option for enabling status indicators, which indicate whether or not each layer is loading resources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#statusIndicatorsVisible) + * + * @default true + */ statusIndicatorsVisible: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [LayerListViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#viewModel) + */ viewModel: LayerListViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#render) + * + * + */ render(): any; + /** + * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#triggerAction) + * + * @param action The action to execute. + * @param item An item associated with the action. + * + */ triggerAction(action: Action, item: ListItem): void; } interface LayerListConstructor { + + new(properties?: LayerListProperties): LayerList; } export const LayerList: LayerListConstructor; interface LayerListProperties extends WidgetProperties { + /** + * **Use [listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) instead.** Specify the function that will create actions for [ListItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Actions are defined with the properties listed in the [Action class](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). This function must return a two-dimensional array of [Actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#createActionsFunction) + */ createActionsFunction?: Function; + /** + * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable propeties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) + */ listItemCreatedFunction?: Function; + /** + * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#operationalItems) + */ operationalItems?: CollectionProperties; + /** + * Option for enabling status indicators, which indicate whether or not each layer is loading resources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#statusIndicatorsVisible) + * + * @default true + */ statusIndicatorsVisible?: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [LayerListViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#viewModel) + */ viewModel?: LayerListViewModelProperties; } interface LayerListViewModel extends Accessor { + /** + * **Use [listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) instead.** Specify the function that will create actions for [ListItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Actions are defined with the properties listed in the [Action class](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#createActionsFunction) + */ createActionsFunction: Function; + /** + * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable propeties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) + */ listItemCreatedFunction: Function; - operationalItems: Collection; - state: string; + /** + * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#operationalItems) + */ + readonly operationalItems: Collection; + /** + * The view model's state. **Known Values:** ready | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#view) + */ view: MapView | SceneView; + /** + * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#triggerAction) + * + * @param action The action to execute. + * @param item An item associated with the action. + * + */ triggerAction(action: Action, item: ListItem): void; } interface LayerListViewModelConstructor { + + new(properties?: LayerListViewModelProperties): LayerListViewModel; } export const LayerListViewModel: LayerListViewModelConstructor; interface LayerListViewModelProperties { + /** + * **Use [listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) instead.** Specify the function that will create actions for [ListItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Actions are defined with the properties listed in the [Action class](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#createActionsFunction) + */ createActionsFunction?: Function; + /** + * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable propeties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) + */ listItemCreatedFunction?: Function; - operationalItems?: CollectionProperties; - state?: string; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; } interface ListItem { + /** + * Whether the actional panel is open in the LayerList. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsOpen) + * + * @default false + */ actionsOpen: boolean; + /** + * A nested 2-dimensional collection of actions that could be triggered on the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) + */ actionsSections: Collection>; + /** + * When a layer contains sublayers, this property is a Collection of ListItem objects belonging to the given layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#children) + */ children: Collection; - error: Error; + /** + * The Error object returned if an error occurred. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#error) + */ + readonly error: Error; + /** + * The layer associated with the triggered action. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layer) + * + * @default null + */ layer: Layer; - layerView: LayerView; + /** + * The [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) displaying data for the associated [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layer). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layerView) + */ + readonly layerView: LayerView; + /** + * Whether the layer is open in the LayerList. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#open) + * + * @default false + */ open: boolean; + /** + * The parent of this item + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#parent) + * + * @default null + */ parent: ListItem; + /** + * The title of the layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#title) + */ title: string; - updating: boolean; + /** + * Value is `true` when the layer is updating; for example, if it is in the process of fetching data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#updating) + * + * @default false + */ + readonly updating: boolean; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#view) + */ view: MapView | SceneView; - visibilityMode: string; + /** + * Indicates how to manage the visibility of the children layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visibilityMode) + */ + readonly visibilityMode: string; + /** + * Indicates if the ListItem is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visible) + * + * @default true + */ visible: boolean; - visibleAtCurrentScale: boolean; + /** + * Whether the layer is visible at the current scale or not. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visibleAtCurrentScale) + * + * @default true + */ + readonly visibleAtCurrentScale: boolean; + /** + * Creates a deep clone of this object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#clone) + * + * + */ clone(): ListItem; } interface ListItemConstructor { + + + new(): ListItem; } export const ListItem: ListItemConstructor; interface Legend extends Widget { + /** + * Specifies a subset of the layers to display in the legend. If this property is not set, all layers in the map will display in the legend. Objects in this array are defined with the properties listed below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) + */ layerInfos: LegendLayerInfos[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#view) + */ view: MapView | SceneView; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#render) + * + * + */ render(): any; } interface LegendConstructor { + /** + * The Legend widget displays labels and symbols for layers in a map. Labels and their corresponding symbols depend on the values set in the [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) of the layer. The legend will only display layers and sublayers that are visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) + */ + new(properties?: LegendProperties): Legend; } export const Legend: LegendConstructor; interface LegendProperties extends WidgetProperties { + /** + * Specifies a subset of the layers to display in the legend. If this property is not set, all layers in the map will display in the legend. Objects in this array are defined with the properties listed below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) + */ layerInfos?: LegendLayerInfos[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#view) + */ view?: MapViewProperties | SceneViewProperties; } - export interface LegendLayerInfos { + + export interface LegendLayerInfos extends Object { + /** + * Specifies a title for the layer to display above its symbols and descriptions. If no title is specified the service name is used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) + */ title?: string; + /** + * A layer to display in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) + */ layer: Layer; } interface Locate extends Widget { + /** + * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#geolocationOptions) + * + * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } + */ geolocationOptions: any; + /** + * Indicates whether the widget should navigate the view to the position and scale of the geolocated result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#goToLocationEnabled) + * + * @default true + */ goToLocationEnabled: boolean; + /** + * The graphic used to show the user's location on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#graphic) + */ graphic: Graphic; + /** + * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#useHeadingEnabled) + * + * @default true + */ + useHeadingEnabled: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [LocateViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#viewModel) + */ viewModel: LocateViewModel; + /** + * Animates the view to the user's location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#locate) + * + * + */ locate(): IPromise; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#render) + * + * + */ render(): any; } interface LocateConstructor { + /** + * Provides a simple widget that animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's current location. The view rotates according to the direction where the tracked device is heading towards. By default the widget looks like the following: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html) + */ + new(properties?: LocateProperties): Locate; } export const Locate: LocateConstructor; interface LocateProperties extends WidgetProperties { + /** + * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#geolocationOptions) + * + * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } + */ geolocationOptions?: any; + /** + * Indicates whether the widget should navigate the view to the position and scale of the geolocated result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#goToLocationEnabled) + * + * @default true + */ goToLocationEnabled?: boolean; + /** + * The graphic used to show the user's location on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#graphic) + */ graphic?: GraphicProperties; + /** + * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#useHeadingEnabled) + * + * @default true + */ + useHeadingEnabled?: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [LocateViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#viewModel) + */ viewModel?: LocateViewModelProperties; } interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { - state: string; + /** + * The current state of the widget. **Possible Values:** disabled | ready | locating + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * Animates the view to the user's location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate) + * + * + */ locate(): IPromise; } interface LocateViewModelConstructor { + /** + * Provides the logic for the [Locate](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html) widget, which animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's current location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) + */ + new(properties?: LocateViewModelProperties): LocateViewModel; } export const LocateViewModel: LocateViewModelConstructor; interface LocateViewModelProperties extends GeolocationPositioningProperties { - state?: string; + } interface NavigationToggle extends Widget { + /** + * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. + * + * Possible Value | Example + * ---------------|-------- + * vertical | ![navigation-toggle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/navigation-toggle.png) + * horizontal | ![navigation-toggle-horizontal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/navigation-toggle-horizontal.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#layout) + * + * @default vertical + */ layout: string; + /** + * A reference to the SceneView. Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) + */ view: SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [NavigationToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#viewModel) + */ viewModel: NavigationToggleViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#render) + * + * + */ render(): any; + /** + * Toggles the navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) from `pan` to `rotate` or vice versa. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#toggle) + * + * + */ toggle(): void; } interface NavigationToggleConstructor { + /** + * Provides two simple buttons for toggling the [navigation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Note that this widget is designed only for 3D mouse interaction in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It has no effect on touch navigation and it should not be used with 2D mouse interaction in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html) + */ + new(properties?: NavigationToggleProperties): NavigationToggle; } export const NavigationToggle: NavigationToggleConstructor; interface NavigationToggleProperties extends WidgetProperties { + /** + * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. + * + * Possible Value | Example + * ---------------|-------- + * vertical | ![navigation-toggle](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/navigation-toggle.png) + * horizontal | ![navigation-toggle-horizontal](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/navigation-toggle-horizontal.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#layout) + * + * @default vertical + */ layout?: string; + /** + * A reference to the SceneView. Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) + */ view?: SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [NavigationToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#viewModel) + */ viewModel?: NavigationToggleViewModelProperties; } interface NavigationToggleViewModel extends Accessor { + /** + * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------- + * pan | The mouse drag gesture pans the view. Right-click + drag allows the user to perform a 3D rotate around the center of the view. + * rotate | The mouse drag gesture performs a 3D rotate around the center of the view and the right-click + drag gesture pans the view. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) + * + * @default pan + */ navigationMode: string; - state: string; + /** + * The state of the widget. **Possible Values:** disabled | ready + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view associated with the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) + */ view: SceneView; + /** + * Toggles the navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) from `pan` to `rotate` or vice versa. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#toggle) + * + * + */ toggle(): void; } interface NavigationToggleViewModelConstructor { + /** + * Provides the logic for the [NavigationToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html) widget, which provides two simple buttons for toggling the [navigation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Note that this is not designed for 2D mouse interaction in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), nor for touch navigation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) + */ + new(properties?: NavigationToggleViewModelProperties): NavigationToggleViewModel; } export const NavigationToggleViewModel: NavigationToggleViewModelConstructor; interface NavigationToggleViewModelProperties { + /** + * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. + * + * Possible Value | Description + * ---------------|------------- + * pan | The mouse drag gesture pans the view. Right-click + drag allows the user to perform a 3D rotate around the center of the view. + * rotate | The mouse drag gesture performs a 3D rotate around the center of the view and the right-click + drag gesture pans the view. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) + * + * @default pan + */ navigationMode?: string; - state?: string; + /** + * The view associated with the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) + */ view?: SceneViewProperties; } interface Popup extends Widget, Evented { + /** + * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) + */ actions: Collection; + /** + * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoCloseEnabled) + * + * @default false + */ autoCloseEnabled: boolean; + /** + * Indicates whether the popup displays its content. If `true`, only the header displays. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapsed) + * + * @default false + */ collapsed: boolean; - content: string | Node; - currentDockPosition: string; + /** + * Indicates whether to enable collapse functionality for the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapseEnabled) + * + * @default true + */ + collapseEnabled: boolean; + /** + * The content of the popup. When set directly on the Popup, this content is static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) + */ + content: string | HTMLElement | Widget; + /** + * Dock position in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). **Known Values:** top-left | top-center | top-right | bottom-left | bottom-center | bottom-right + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#currentDockPosition) + */ + readonly currentDockPosition: string; + /** + * Indicates whether the placement of the popup is docked to the side of the view. Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is attached to a side, the top, or the bottom of the view. See [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) to override default options related to docking the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockEnabled) + * + * @default false + */ dockEnabled: boolean; + /** + * Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is placed in one of the corners of the view or to the top or bottom of it. This property allows the developer to set various options for docking the popup. See the object specification table below to override default docking properties on the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) + */ dockOptions: PopupDockOptions; - featureCount: number; + /** + * The number of selected [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) available to the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#featureCount) + * + * @default 0 + */ + readonly featureCount: number; + /** + * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the 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.html#selectedFeature). This value is `null` if no features are associated with the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) + */ features: Graphic[]; + /** + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) + * + * @default true + */ highlightEnabled: boolean; + /** + * Point used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) + */ location: Point; + /** + * An array of pending Promises that have not yet been fulfilled. If there are no pending promises, the value is `null`. When the pending promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) + */ promises: IPromise[]; - selectedFeature: Graphic; + /** + * The selected feature accessed by the popup. The content of the Popup is determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) assigned to this feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) + */ + readonly selectedFeature: Graphic; + /** + * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) are set, the first index is automatically selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeatureIndex) + */ selectedFeatureIndex: number; + /** + * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) + */ title: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#view) + */ view: MapView | SceneView; + /** + * This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PopupViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#viewModel) + */ viewModel: PopupViewModel; + /** + * Indicates whether the popup is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) + */ visible: boolean; + /** + * Use this method to remove focus from the Widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#blur) + * + * + */ + blur(): void; + /** + * Removes [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises), [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features), [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content), [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) and [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) from the Popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#clear) + * + * + */ clear(): void; + /** + * Closes the popup by setting its [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `false`. Users can alternatively close the popup by directly setting the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `false`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#close) + * + * + */ close(): void; + /** + * Use this method to give focus to the Widget if the widget is able to be focused. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#focus) + * + * + */ + focus(): void; + /** + * Selects the feature at the next index in relation to the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#next) + * + * + */ next(): PopupViewModel; + /** + * Opens the popup at the given location with content defined either explicitly with `content` or driven from the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) of input features. This method sets the popup's [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `true`. Users can alternatively open the popup by directly setting the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `true`. The popup will only display if the view's size constraints in [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) are met or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) property is set to a geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + * + * @param options Defines the location and content of the popup when opened. + * @param options.title Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup. + * @param options.content Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the popup. + * @param options.location Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location), which is the geometry used to position the popup. + * @param options.features Sets the popup's [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features), which populate the title and content of the popup based on each graphic's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * @param options.promises Sets pending [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) on the popup. The popup will display once the promises resolve. Each promise must resolve to an array of [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). + * @param options.featureMenuOpen **Since:** 4.5 This property enables multiple features in a popup to display in a list rather than displaying the first selected feature. Setting this to `true` allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. + * @param options.updateLocationEnabled When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) geometry. + * @param options.collapsed **Since:** 4.5 When `true`, indicates that only the popup header will display. + * + */ open(options?: PopupOpenOptions): void; + /** + * Selects the feature at the previous index in relation to the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#previous) + * + * + */ previous(): PopupViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#render) + * + * + */ render(): any; + /** + * Positions the popup on the view. Moves the popup into the view's extent if the popup is partially or fully outside the view's extent. If the popup is partially out of view, the view will move to fully show the popup. If the popup is fully out of view, the view will move to the popup's location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#reposition) + * + * + */ reposition(): void; + /** + * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event and executes the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) at the specified index in the [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#triggerAction) + * + * @param actionIndex The index of the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) to execute. + * + */ triggerAction(actionIndex: number): void; } interface PopupConstructor { + /** + * The popup widget allows users to view content from feature attributes. Popups enhance web applications by providing users with a simple way to interact with and view attributes in a layer. They play an important role in relaying information to the user, which improves the storytelling capabilities of the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) + */ + new(properties?: PopupProperties): Popup; } export const Popup: PopupConstructor; interface PopupProperties extends WidgetProperties { + /** + * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) + */ actions?: CollectionProperties; + /** + * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoCloseEnabled) + * + * @default false + */ autoCloseEnabled?: boolean; + /** + * Indicates whether the popup displays its content. If `true`, only the header displays. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapsed) + * + * @default false + */ collapsed?: boolean; - content?: string | Node; - currentDockPosition?: string; + /** + * Indicates whether to enable collapse functionality for the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapseEnabled) + * + * @default true + */ + collapseEnabled?: boolean; + /** + * The content of the popup. When set directly on the Popup, this content is static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) + */ + content?: string | HTMLElement | WidgetProperties; + /** + * Indicates whether the placement of the popup is docked to the side of the view. Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is attached to a side, the top, or the bottom of the view. See [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) to override default options related to docking the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockEnabled) + * + * @default false + */ dockEnabled?: boolean; + /** + * Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is placed in one of the corners of the view or to the top or bottom of it. This property allows the developer to set various options for docking the popup. See the object specification table below to override default docking properties on the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) + */ dockOptions?: PopupDockOptions; - featureCount?: number; + /** + * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.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.html#selectedFeature). This value is `null` if no features are associated with the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) + */ features?: GraphicProperties[]; + /** + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) + * + * @default true + */ highlightEnabled?: boolean; + /** + * Point used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) + */ location?: PointProperties; + /** + * An array of pending Promises that have not yet been fulfilled. If there are no pending promises, the value is `null`. When the pending promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) + */ promises?: IPromise[]; - selectedFeature?: GraphicProperties; + /** + * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) are set, the first index is automatically selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeatureIndex) + */ selectedFeatureIndex?: number; + /** + * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) + */ title?: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PopupViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#viewModel) + */ viewModel?: PopupViewModelProperties; + /** + * Indicates whether the popup is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) + */ visible?: boolean; } interface PopupViewModel extends Accessor, Evented { - actions: Collection>; + /** + * [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-Action.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) + */ + actions: Collection; + /** + * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoCloseEnabled) + * + * @default false + */ autoCloseEnabled: boolean; - content: string | Node; - featureCount: number; + /** + * The content of the popup. When set directly on the Popup, this content may only be static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) + */ + content: string | HTMLElement | Widget; + /** + * The number of selected [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) available to the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#featureCount) + * + * @default 0 + */ + readonly featureCount: number; + /** + * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the poup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). This value is `null` if no features are associated with the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) + */ features: Graphic[]; + /** + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) + * + * @default true + */ highlightEnabled: boolean; + /** + * Geometry used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) + */ location: Point; - pendingPromisesCount: number; - promiseCount: number; + /** + * The number of [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) remaining to be resolved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#pendingPromisesCount) + * + * @default 0 + */ + readonly pendingPromisesCount: number; + /** + * The number of selected [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) available to the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promiseCount) + * + * @default 0 + */ + readonly promiseCount: number; + /** + * An array of pending Promises that have not yet been fulfilled. If there are no pending Promises, the value is `null`. When the pending Promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) + */ promises: IPromise[]; - selectedFeature: Graphic; + /** + * The selected feature accessed by the popup. The content of the Popup is determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) assigned to this feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) + */ + readonly selectedFeature: Graphic; + /** + * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) are set, the first index is automatically selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeatureIndex) + */ selectedFeatureIndex: number; - state: string; + /** + * The view model's state. **Known Values:** ready | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) + */ title: string; + /** + * The view associated with the Popup instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#view) + */ view: MapView | SceneView; + /** + * Indicates whether the popup is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) + */ visible: boolean; + /** + * Removes [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises), [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features), [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content), [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) and [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) from the Popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#clear) + * + * + */ clear(): void; + /** + * Selects the feature at the next index in relation to the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#next) + * + * + */ next(): PopupViewModel; + /** + * Selects the feature at the previous index in relation to the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#previous) + * + * + */ previous(): PopupViewModel; + /** + * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event and executes the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) at the specified index in the [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#triggerAction) + * + * @param actionIndex The index of the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) to execute. + * + */ triggerAction(actionIndex: number): void; + + + on(name: "trigger-action", eventHandler: PopupViewModelTriggerActionEventHandler): IHandle; + + on(name: "trigger-action", modifiers: string[], eventHandler: PopupViewModelTriggerActionEventHandler): IHandle; } interface PopupViewModelConstructor { + /** + * Provides the logic for the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) widget, which allows users to view content from feature attributes. Popups enhance web applications by providing users with a simple way to interact with and view attributes in a layer. They play an important role in relaying information to the user, which improves the storytelling capabilities of the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) + */ + new(properties?: PopupViewModelProperties): PopupViewModel; } export const PopupViewModel: PopupViewModelConstructor; interface PopupViewModelProperties { - actions?: CollectionProperties>; + /** + * [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-Action.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [Action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-Action.html) class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) + */ + actions?: CollectionProperties; + /** + * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoCloseEnabled) + * + * @default false + */ autoCloseEnabled?: boolean; - content?: string | Node; - featureCount?: number; + /** + * The content of the popup. When set directly on the Popup, this content may only be static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) + */ + content?: string | HTMLElement | WidgetProperties; + /** + * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the poup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). This value is `null` if no features are associated with the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) + */ features?: GraphicProperties[]; + /** + * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Currently highlight only works in 3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) + * + * @default true + */ highlightEnabled?: boolean; + /** + * Geometry used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) to the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) + */ location?: PointProperties; - pendingPromisesCount?: number; - promiseCount?: number; + /** + * An array of pending Promises that have not yet been fulfilled. If there are no pending Promises, the value is `null`. When the pending Promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) array. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) + */ promises?: IPromise[]; - selectedFeature?: GraphicProperties; + /** + * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) are set, the first index is automatically selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeatureIndex) + */ selectedFeatureIndex?: number; - state?: string; + /** + * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) + */ title?: string; + /** + * The view associated with the Popup instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * Indicates whether the popup is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) + */ visible?: boolean; } - export interface PopupDockOptions { + export interface PopupViewModelTriggerActionEvent { + + action: Action; + } + + + export interface PopupDockOptions extends Object { + /** + * Defines the dimensions of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which to dock the popup. Set to `false` to disable docking at a breakpoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) + * + * @default true + */ breakpoint?: boolean | PopupDockOptionsBreakpoint; + /** + * If `true`, displays the dock button. If `false`, hides the dock button from the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) + */ buttonEnabled?: boolean; + /** + * The position in the view at which to dock the popup. Can be set as either a string or function. See the table below for known string values and their position in the view based on the view's size. + * + * Known Value | View size > breakpoint | View size < breakpoint + * --------------- | ------------------------------- | ------------- + * auto | top-right | bottom 100% + * top-left | top-left | top 100% + * top-center | top-center | top 100% + * top-right | top-right | top 100% + * bottom-left | bottom-left | bottom 100% + * bottom-center | bottom-center | bottom 100% + * bottom-right | bottom-right | bottom 100% + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) + * + * @default auto + */ position?: string | Function; } - export interface PopupDockOptionsBreakpoint { + + export interface PopupDockOptionsBreakpoint extends Object { + /** + * The maximum width of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which the popup will be set to dockEnabled automatically. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) + * + * @default 544 + */ width?: number; + /** + * The maximum height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which the popup will be set to dockEnabled automatically. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) + * + * @default 544 + */ height?: number; } - export interface PopupOpenOptions { + + export interface PopupOpenOptions extends Object { + /** + * Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + */ title?: string; + /** + * Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + */ content?: string; + /** + * Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location), which is the geometry used to position the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + */ location?: Geometry; + /** + * Sets the popup's [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features), which populate the title and content of the popup based on each graphic's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + */ features?: Graphic[]; + /** + * Sets pending [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) on the popup. The popup will display once the promises resolve. Each promise must resolve to an array of [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + */ promises?: IPromise[]; + /** + * **Since:** 4.5 This property enables multiple features in a popup to display in a list rather than displaying the first selected feature. Setting this to `true` allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + * + * @default false + */ featureMenuOpen?: boolean; + /** + * When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + * + * @default false + */ updateLocationEnabled?: boolean; + /** + * **Since:** 4.5 When `true`, indicates that only the popup header will display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) + * + * @default false + */ collapsed?: boolean; } interface Print extends Widget { + /** + * The URL of the REST endpoint of the Export Web Map Task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#printServiceUrl) + */ printServiceUrl: string; + /** + * Defines the layout template options used by the [Print](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) widget to generate the print page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#templateOptions) + */ + templateOptions: TemplateOptions; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#view) + */ view: MapView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PrintViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#viewModel) + */ viewModel: PrintViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#render) + * + * + */ render(): any; } interface PrintConstructor { + /** + * The Print widget connects your application with a [printing service](https://server.arcgis.com/en/portal/latest/administer/windows/configure-the-portal-to-print-maps.htm) to allow the map to be printed. It takes advantage of server-side, high-quality, full cartographic print functionality using the ExportWebMap service of ArcGIS, which can be configured with custom layout templates. One is provided that shows the map only, while another provides a layout with legend, etc. The Print widget works with the [PrintTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html) which generates a printer-ready version of the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) + */ + new(properties?: PrintProperties): Print; } export const Print: PrintConstructor; interface PrintProperties extends WidgetProperties { + /** + * The URL of the REST endpoint of the Export Web Map Task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#printServiceUrl) + */ printServiceUrl?: string; + /** + * Defines the layout template options used by the [Print](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) widget to generate the print page. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#templateOptions) + */ + templateOptions?: TemplateOptionsProperties; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#view) + */ view?: MapViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PrintViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#viewModel) + */ viewModel?: PrintViewModelProperties; } interface PrintViewModel extends Accessor { + /** + * The URL of the REST endpoint of the Export Web Map Task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#printServiceUrl) + */ printServiceUrl: string; + /** + * The time interval in milliseconds between each job status request sent to an asynchronous GP task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#updateDelay) + * + * @default 1000 + */ updateDelay: number; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#view) + */ view: MapView; + /** + * Prints (exports) the current MapView according to selected options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#print) + * + * @param printTemplate The [PrintTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html) is used to specify the layout template options which is then used by the PrintTask to generate the print page. + * + */ print(printTemplate: PrintTemplate): IPromise; } interface PrintViewModelConstructor { + + new(properties?: PrintViewModelProperties): PrintViewModel; } export const PrintViewModel: PrintViewModelConstructor; interface PrintViewModelProperties { + /** + * The URL of the REST endpoint of the Export Web Map Task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#printServiceUrl) + */ printServiceUrl?: string; + /** + * The time interval in milliseconds between each job status request sent to an asynchronous GP task. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#updateDelay) + * + * @default 1000 + */ updateDelay?: number; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#view) + */ view?: MapViewProperties; } + interface TemplateOptions extends Accessor { + /** + * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#attributionEnabled) + * + * @default true + */ + attributionEnabled: boolean; + /** + * The text used for the author if the specified layout contains an author text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#author) + */ + author: string; + /** + * The text used for the copyright if the specified layout contains an copyright text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#copyright) + */ + copyright: string; + /** + * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#format) + */ + format: string; + /** + * Map height. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#height) + */ + height: number; + /** + * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: + * + * Value | Description + * | --- | --- + * map-only | Map does not contain any layout elements. Only map image is printed. + * a3-landscape | 16.54 x 11.69 in + * a3-portrait | 11.69 x 16.54 in + * a4-landscape | 11.69 x 8.27 in + * a4-portrait | 8.27 × 11.69 in + * letter-ansi-a-landscape | 11.0 x 8.5 in + * letter-ansi-a-portrait | 8.5 x 11.0 in + * tabloid-ansi-b-landscape| 17.0 x 11.0 in + * tabloid-ansi-b-portrait | 11.0 x 17.0 in + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) + */ + layout: string; + /** + * When `false`, the legend is not displayed on the printout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#legendEnabled) + * + * @default true + */ + legendEnabled: boolean; + /** + * When `true`, scale is used in the printed map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#scaleEnabled) + * + * @default false + */ + scaleEnabled: boolean; + /** + * The text used for the map title if the specified layout contains a title text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#title) + */ + title: string; + /** + * Map width. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#width) + */ + width: number; + } + + interface TemplateOptionsConstructor { + + + new(properties?: TemplateOptionsProperties): TemplateOptions; + } + + export const TemplateOptions: TemplateOptionsConstructor; + + interface TemplateOptionsProperties { + /** + * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#attributionEnabled) + * + * @default true + */ + attributionEnabled?: boolean; + /** + * The text used for the author if the specified layout contains an author text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#author) + */ + author?: string; + /** + * The text used for the copyright if the specified layout contains an copyright text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#copyright) + */ + copyright?: string; + /** + * The output format for the printed map. **Known Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#format) + */ + format?: string; + /** + * Map height. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#height) + */ + height?: number; + /** + * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: + * + * Value | Description + * | --- | --- + * map-only | Map does not contain any layout elements. Only map image is printed. + * a3-landscape | 16.54 x 11.69 in + * a3-portrait | 11.69 x 16.54 in + * a4-landscape | 11.69 x 8.27 in + * a4-portrait | 8.27 × 11.69 in + * letter-ansi-a-landscape | 11.0 x 8.5 in + * letter-ansi-a-portrait | 8.5 x 11.0 in + * tabloid-ansi-b-landscape| 17.0 x 11.0 in + * tabloid-ansi-b-portrait | 11.0 x 17.0 in + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) + */ + layout?: string; + /** + * When `false`, the legend is not displayed on the printout. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#legendEnabled) + * + * @default true + */ + legendEnabled?: boolean; + /** + * When `true`, scale is used in the printed map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#scaleEnabled) + * + * @default false + */ + scaleEnabled?: boolean; + /** + * The text used for the map title if the specified layout contains a title text element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#title) + */ + title?: string; + /** + * Map width. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#width) + */ + width?: number; + } + interface ScaleBar extends Widget { + /** + * The style for the scale bar. Valid values are `ruler` or `line`. When `unit` is set to `dual`, the style will always be `line`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style) + */ style: string; + /** + * Units to use for the scale bar. Valid values are `non-metric`, `metric` or `dual`. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) + * + * @default non-metric (i.e. miles and feet) + */ unit: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#view) + */ view: MapView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ScaleBarViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#viewModel) + */ viewModel: ScaleBarViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#render) + * + * + */ render(): any; } interface ScaleBarConstructor { + /** + * The ScaleBar widget displays a scale bar on the map or in a specified HTML node. The widget respects various coordinate systems and displays units in metric or non-metric values. Metric values shows either kilometers or meters depending on the scale, and likewise non-metric values shows miles and feet depending on the scale. When working with Web Mercator or geographic coordinate systems the scale bar takes into account projection distortion and dynamically adjusts the scale bar. The ScaleBar sample, which uses a map using the Web Mercator projection, shows this behavior. Open the sample and note that as you pan the map south towards the equator the scale bar gets shorter and as you pan north it gets longer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html) + */ + new(properties?: ScaleBarProperties): ScaleBar; } export const ScaleBar: ScaleBarConstructor; interface ScaleBarProperties extends WidgetProperties { + /** + * The style for the scale bar. Valid values are `ruler` or `line`. When `unit` is set to `dual`, the style will always be `line`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style) + */ style?: string; + /** + * Units to use for the scale bar. Valid values are `non-metric`, `metric` or `dual`. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) + * + * @default non-metric (i.e. miles and feet) + */ unit?: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#view) + */ view?: MapViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ScaleBarViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#viewModel) + */ viewModel?: ScaleBarViewModelProperties; } interface ScaleBarViewModel extends Accessor { + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html#view) + */ view: MapView; } interface ScaleBarViewModelConstructor { + + new(properties?: ScaleBarViewModelProperties): ScaleBarViewModel; } export const ScaleBarViewModel: ScaleBarViewModelConstructor; interface ScaleBarViewModelProperties { + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html#view) + */ view?: MapViewProperties; } interface Search extends Widget { - activeSource: FeatureLayer | Locator; + /** + * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) object currently selected. Can be either a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [locator task](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSource) + */ + readonly activeSource: FeatureLayer | Locator; + /** + * The selected source's index. This value is `-1` when all sources are selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSourceIndex) + * + * @default 0 + */ activeSourceIndex: number; + /** + * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-allplaceholder.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allPlaceholder) + * + * @default "Find address or place" + */ allPlaceholder: string; + /** + * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#event:search-complete) event handler and get the results through the event object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#autoSelect) + * + * @default true + */ autoSelect: boolean; - defaultSource: LocatorSource | FeatureLayerSource; + /** + * The default source used for the Search widget. These can range from a [Locator Source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) to a [Feature Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#defaultSource) + */ + readonly defaultSource: LocatorSource | FeatureLayerSource; + /** + * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#locationEnabled) + * + * @default true + */ + locationEnabled: boolean; + /** + * The maximum number of results returned by the widget if not specified by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxResults) + * + * @default 6 + */ maxResults: number; + /** + * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxSuggestions) + * + * @default 6 + */ maxSuggestions: number; + /** + * The minimum number of characters needed for the search if not specified by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#minSuggestCharacters) + * + * @default 1 + */ minSuggestCharacters: number; + /** + * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupEnabled) + * + * @default true + */ popupEnabled: boolean; + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupOpenOnSelect) + * + * @default true + */ popupOpenOnSelect: boolean; + /** + * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) + */ popupTemplate: PopupTemplate; - resultGraphic: Graphic; + /** + * The graphic used to highlight the resulting feature or location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) + */ + readonly resultGraphic: Graphic; + /** + * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) will display at the location of the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphicEnabled) + * + * @default true + */ resultGraphicEnabled: boolean; + /** + * An array of objects, each containing a [SearchResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) from the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#results) + */ results: any[]; + /** + * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchAllEnabled) + * + * @default true + */ searchAllEnabled: boolean; - searching: boolean; + /** + * The value of the search box input text string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchTerm) + */ searchTerm: string; - selectedResult: SearchResult; + /** + * The result selected from a search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#selectedResult) + */ + readonly selectedResult: SearchResult; + /** + * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: + * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + * * [FeatureLayerSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + * + * + * Any combination of one or more [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) sources may be used together in the same instance of the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) + */ sources: Collection; - suggestions: SuggestResult[]; + /** + * The current state of the widget. **Known Values:** ready | disabled | searching + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#state) + * + * @default ready + */ + readonly state: string; + /** + * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). This is available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestions) + */ + readonly suggestions: SuggestResult[]; + /** + * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestionsEnabled) + * + * @default true + */ suggestionsEnabled: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#viewModel) + */ viewModel: SearchViewModel; + /** + * Unfocuses the widget's text input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#blur) + * + * + */ blur(): void; + /** + * Clears the current searchTerm, search results, suggest results, graphic, and graphics layer. It also hides any open menus. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#clear) + * + * + */ clear(): void; + /** + * Brings focus to the widget's text input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#focus) + * + * + */ focus(): void; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#render) + * + * + */ render(): any; + /** + * Depending on the sources specified, search() queries the feature layer(s) and/or performs address matching using any specified [Locator(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and returns any applicable results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search) + * + * @param searchTerm This searchTerm can be a string, geometry, suggest candidate object, or an array of [longitude,latitude] coordinate pairs. If a geometry is supplied, then it will reverse geocode (locator) or findAddressCandidates with geometry instead of text. + * + */ search(searchTerm?: string | Geometry | SuggestResult | number[][]): IPromise; + /** + * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest) + * + * @param value The string value used to suggest() on an active Locator or feature layer. If nothing is passed in, takes the current value of the widget. + * + */ suggest(value?: string): IPromise; } interface SearchConstructor { + /** + * The Search widget provides a way to perform search operations on [locator service(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and/or [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html)/[feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) service feature layer(s). If using a locator with a geocoding service, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation is used, whereas [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) are used on feature layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) + */ + new(properties?: SearchProperties): Search; } export const Search: SearchConstructor; interface SearchProperties extends WidgetProperties { - activeSource?: FeatureLayerProperties | LocatorProperties; + /** + * The selected source's index. This value is `-1` when all sources are selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSourceIndex) + * + * @default 0 + */ activeSourceIndex?: number; + /** + * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-allplaceholder.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allPlaceholder) + * + * @default "Find address or place" + */ allPlaceholder?: string; + /** + * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#event:search-complete) event handler and get the results through the event object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#autoSelect) + * + * @default true + */ autoSelect?: boolean; - defaultSource?: LocatorSource | FeatureLayerSource; + /** + * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-locationEnabled.png) + * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#locationEnabled) + * + * @default true + */ + locationEnabled?: boolean; + /** + * The maximum number of results returned by the widget if not specified by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxResults) + * + * @default 6 + */ maxResults?: number; + /** + * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxSuggestions) + * + * @default 6 + */ maxSuggestions?: number; + /** + * The minimum number of characters needed for the search if not specified by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#minSuggestCharacters) + * + * @default 1 + */ minSuggestCharacters?: number; + /** + * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupEnabled) + * + * @default true + */ popupEnabled?: boolean; + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupOpenOnSelect) + * + * @default true + */ popupOpenOnSelect?: boolean; + /** + * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) + */ popupTemplate?: PopupTemplateProperties; - resultGraphic?: GraphicProperties; + /** + * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) will display at the location of the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphicEnabled) + * + * @default true + */ resultGraphicEnabled?: boolean; + /** + * An array of objects, each containing a [SearchResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) from the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#results) + */ results?: any[]; + /** + * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchAllEnabled) + * + * @default true + */ searchAllEnabled?: boolean; - searching?: boolean; + /** + * The value of the search box input text string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchTerm) + */ searchTerm?: string; - selectedResult?: SearchResult; + /** + * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: + * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + * * [FeatureLayerSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + * + * + * Any combination of one or more [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) sources may be used together in the same instance of the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) + */ sources?: CollectionProperties; - suggestions?: SuggestResult[]; + /** + * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestionsEnabled) + * + * @default true + */ suggestionsEnabled?: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#viewModel) + */ viewModel?: SearchViewModelProperties; } interface SearchViewModel extends Accessor, Evented { - activeSource: FeatureLayer | Locator; + /** + * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) object currently selected. Can be either a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [locator task](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSource) + */ + readonly activeSource: FeatureLayer | Locator; + /** + * The selected source's index. This value is `-1` when all sources are selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSourceIndex) + * + * @default 0 + */ activeSourceIndex: number; + /** + * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-allplaceholder.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allPlaceholder) + * + * @default "Find address or place" + */ allPlaceholder: string; + /** + * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#event:search-complete) event handler and get the results through the event object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#autoSelect) + */ autoSelect: boolean; - defaultSource: SearchViewModelFeatureLayerSource | SearchViewModelLocatorSource; + /** + * The default source used for the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSource) + */ + readonly defaultSource: SearchViewModelFeatureLayerSource | SearchViewModelLocatorSource; + /** + * The maximum character length of the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxInputLength) + */ maxInputLength: number; + /** + * The maximum number of results returned by the widget if not specified by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults) + */ maxResults: number; + /** + * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions) + */ maxSuggestions: number; + /** + * The minimum number of characters needed for the search if not specified by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#minSuggestCharacters) + */ minSuggestCharacters: number; - placeholder: string; + /** + * The placeholder used by the [activeSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSource). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#placeholder) + */ + readonly placeholder: string; + /** + * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) + */ popupEnabled: boolean; + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) + */ popupOpenOnSelect: boolean; + /** + * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupTemplate) + */ popupTemplate: PopupTemplate; - resultGraphic: Graphic; + /** + * The graphic used to highlight the resulting feature or location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) + */ + readonly resultGraphic: Graphic; + /** + * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphicEnabled) + * + * @default true + */ resultGraphicEnabled: boolean; + /** + * An array of current results from the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#results) + */ results: any[]; + /** + * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) + */ searchAllEnabled: boolean; + /** + * The value of the search box input text string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchTerm) + */ searchTerm: string; - selectedResult: any; + /** + * The result selected from a search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#selectedResult) + */ + readonly selectedResult: any; + /** + * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: + * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + * * [FeatureLayerSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + * + * + * Any combination of one or more [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) sources may be used together in the same instance of the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) + */ sources: Collection; + /** + * The millisecond delay after keyup and before making a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) network request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionDelay) + */ suggestionDelay: number; - suggestions: SearchViewModelSuggestResult[]; + /** + * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). This is available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestions) + */ + readonly suggestions: SearchViewModelSuggestResult[]; + /** + * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) + */ suggestionsEnabled: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) + */ view: MapView | SceneView; + /** + * Clears the current value, search results, suggest results, graphic, and graphics layer. It also hides any open menus. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#clear) + * + * + */ clear(): void; + /** + * Depending on the sources specified, `search()` queries the feature layer(s) and/or performs address matching using any specified [Locator(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and returns the applicable results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search) + * + * @param searchTerm This searchTerm can be a string, geometry, suggest candidate object, or an array of [latitude,longitude]. If a geometry is supplied, then it will reverse geocode (locator) or findAddressCandidates with geometry instead of text (featurelayer). + * + */ search(searchTerm?: string | Geometry | SearchViewModelSuggestResult | number[][]): IPromise; + /** + * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e.`supportsPagination = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) + * + * @param value The string value used to suggest() on an active Locator or feature layer. If nothing is passed in, takes the current value of the widget. + * + */ suggest(value?: string): IPromise; + on(name: "search-clear", eventHandler: SearchViewModelSearchClearEventHandler): IHandle; + on(name: "search-clear", modifiers: string[], eventHandler: SearchViewModelSearchClearEventHandler): IHandle; + on(name: "search-start", eventHandler: SearchViewModelSearchStartEventHandler): IHandle; + on(name: "search-start", modifiers: string[], eventHandler: SearchViewModelSearchStartEventHandler): IHandle; + on(name: "suggest-start", eventHandler: SearchViewModelSuggestStartEventHandler): IHandle; + on(name: "suggest-start", modifiers: string[], eventHandler: SearchViewModelSuggestStartEventHandler): IHandle; - on(name: "load", eventHandler: SearchViewModelLoadEventHandler): IHandle; - on(name: "load", modifiers: string[], eventHandler: SearchViewModelLoadEventHandler): IHandle; + on(name: "search-complete", eventHandler: SearchViewModelSearchCompleteEventHandler): IHandle; + on(name: "search-complete", modifiers: string[], eventHandler: SearchViewModelSearchCompleteEventHandler): IHandle; + on(name: "select-result", eventHandler: SearchViewModelSelectResultEventHandler): IHandle; + on(name: "select-result", modifiers: string[], eventHandler: SearchViewModelSelectResultEventHandler): IHandle; + on(name: "suggest-complete", eventHandler: SearchViewModelSuggestCompleteEventHandler): IHandle; + on(name: "suggest-complete", modifiers: string[], eventHandler: SearchViewModelSuggestCompleteEventHandler): IHandle; } interface SearchViewModelConstructor { + + new(properties?: SearchViewModelProperties): SearchViewModel; } export const SearchViewModel: SearchViewModelConstructor; interface SearchViewModelProperties { - activeSource?: FeatureLayerProperties | LocatorProperties; + /** + * The selected source's index. This value is `-1` when all sources are selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSourceIndex) + * + * @default 0 + */ activeSourceIndex?: number; + /** + * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-allplaceholder.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allPlaceholder) + * + * @default "Find address or place" + */ allPlaceholder?: string; + /** + * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#event:search-complete) event handler and get the results through the event object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#autoSelect) + */ autoSelect?: boolean; - defaultSource?: SearchViewModelFeatureLayerSource | SearchViewModelLocatorSource; + /** + * The maximum character length of the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxInputLength) + */ maxInputLength?: number; + /** + * The maximum number of results returned by the widget if not specified by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults) + */ maxResults?: number; + /** + * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions) + */ maxSuggestions?: number; + /** + * The minimum number of characters needed for the search if not specified by the source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#minSuggestCharacters) + */ minSuggestCharacters?: number; - placeholder?: string; + /** + * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). This is not the same as using [popupOpenOnSelect](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) which opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but it is not opened by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) + */ popupEnabled?: boolean; + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. Using `popupOpenOnSelect` opens the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) any time a search is performed. It is possible to have `popupOpenOnSelect=false` but `popupEnabled=true` so the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) can be opened by someone but not opened by default. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupOpenOnSelect) + */ popupOpenOnSelect?: boolean; + /** + * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupTemplate) + */ popupTemplate?: PopupTemplateProperties; - resultGraphic?: GraphicProperties; + /** + * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphicEnabled) + * + * @default true + */ resultGraphicEnabled?: boolean; + /** + * An array of current results from the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#results) + */ results?: any[]; + /** + * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/search-enablesearchingall-false.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) + */ searchAllEnabled?: boolean; + /** + * The value of the search box input text string. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchTerm) + */ searchTerm?: string; - selectedResult?: any; + /** + * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: + * * [LocatorSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + * * [FeatureLayerSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + * + * + * Any combination of one or more [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) sources may be used together in the same instance of the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) + */ sources?: CollectionProperties; + /** + * The millisecond delay after keyup and before making a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) network request. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionDelay) + */ suggestionDelay?: number; - suggestions?: SearchViewModelSuggestResult[]; + /** + * Enable suggestions for the widget. This is only available if working with a 10.3 geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 feature layer that supports pagination, i.e. `supportsPagination = true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) + */ suggestionsEnabled?: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; } - export interface SearchViewModelFeatureLayerSource { + /** + * The following properties define a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)-based [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) whose features may be searched by the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + export interface SearchViewModelFeatureLayerSource extends Object { + /** + * The Popup instance used for the selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ popup: Popup; - autoNavigate: boolean; - exactMatch: boolean; + /** + * Indicates whether to automatically navigate to the selected result once selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + autoNavigate?: boolean; + /** + * Indicates to only return results that match the search value exactly. This property only applies to `string` field searches. `exactMatch` is always `true` when searching fields of type `number`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + exactMatch?: boolean; + /** + * The feature layer queried in the search. This is **required**. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ featureLayer: FeatureLayer; + /** + * As of version 4.4, this property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ filter: SearchViewModelFeatureLayerSourceFilter; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; + /** + * Indicates the maximum number of search results to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + maxResults?: number; + /** + * Indicates the maximum number of suggestions to return for the widget's input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + maxSuggestions?: number; + /** + * Indicates the minimum number of characters required before querying for a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + minSuggestCharacters?: number; + /** + * The name of the source for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ name: string; + /** + * Specifies the fields returned with the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ outFields: string[]; + /** + * Used as a hint for the source input text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ placeholder: string; + /** + * The results are displayed using this field. Defaults to the layer's `displayField` or the first string field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ displayField: string; - popupEnabled: boolean; - popupOpenOnSelect: boolean; + /** + * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + popupEnabled?: boolean; + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + popupOpenOnSelect?: boolean; + /** + * Specify this to prefix the input for the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ prefix: string; - resultGraphicEnabled: boolean; + /** + * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultSymbol). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ + resultGraphicEnabled?: boolean; + /** + * The symbol used for the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ resultSymbol: Symbol; + /** + * An array of string values representing the names of fields in the feature layer to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ searchFields: string[]; + /** + * Specify this to suffix the input for the search value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ suffix: string; + /** + * Indicates whether to display suggestions as the user enters input text in the widget. The default value is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ suggestionsEnabled: boolean; + /** + * A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over `displayField`. Field names in the template must have the following format: `{FieldName}`. An example suggestionTemplate could look something like: `Name: {OWNER}, Parcel: {PARCEL_ID}`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ suggestionTemplate: string; + /** + * Indicates whether to constrain the search results to the view's extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ withinViewEnabled: boolean; + /** + * Applicable to the specified source. If the result does not have an associated extent, specify this number to use as the zoom scale for the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ zoomScale: number; } - export interface SearchViewModelLoadEvent { - } - - export interface SearchViewModelLocatorSource { + /** + * The following properties define a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) pointing to a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) that may be used to geocode locations with the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + export interface SearchViewModelLocatorSource extends Object { + /** + * Used as a hint for the source input text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ placeholder: string; - autoNavigate: boolean; + /** + * Indicates whether to automatically navigate to the selected result once selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + autoNavigate?: boolean; + /** + * Constricts search results to a specified country code. For example, `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ countryCode: string; + /** + * As of version 4.4, this property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ filter: SearchViewModelLocatorSourceFilter; + /** + * Sets the sources for local `distance` and `minScale` for searching. See the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ localSearchOptions: SearchViewModelLocatorSourceLocalSearchOptions; - locationToAddressDistance: number; + /** + * When reverse geocoding a result, use this distance in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + locationToAddressDistance?: number; + /** + * The locator task used to search. This is **required** and defaults to the [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ locator: Locator; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; + /** + * Indicates the maximum number of search results to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + maxResults?: number; + /** + * Indicates the maximum number of suggestions to return for the widget's input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + maxSuggestions?: number; + /** + * Indicates the minimum number of characters required before querying for a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + minSuggestCharacters?: number; + /** + * The name of the source for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ name: string; + /** + * Specifies the fields returned with the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ outFields: string[]; + /** + * A string array which limits the results to one or more categories. For example "Populated Place" or "airport". Only applicable when using the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ categories: string[]; + /** + * The Popup instance used for the selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ popup: Popup; - popupEnabled: boolean; - popupOpenOnSelect: boolean; + /** + * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + popupEnabled?: boolean; + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + popupOpenOnSelect?: boolean; + /** + * Specify this to prefix the input for the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ prefix: string; - resultGraphicEnabled: boolean; + /** + * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultSymbol). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + resultGraphicEnabled?: boolean; + /** + * The symbol used for the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ resultSymbol: Symbol; + /** + * A template string used to display multiple fields in a defined order when results are displayed, e.g. `"{Street}, {City}, {ZIP}"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ searchTemplate: string; + /** + * The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are `SingleLine` and `SingleLineFieldName`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ singleLineFieldName: string; - suggestionsEnabled: boolean; + /** + * Indicates whether to display suggestions as the user enters input text in the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ + suggestionsEnabled?: boolean; + /** + * Specify this to suffix the input for the search value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ suffix: string; + /** + * Indicates whether to constrain the search results to the view's extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ withinViewEnabled: boolean; + /** + * Applicable to the specified source. If the result does not have an associated extent, specify this number to use as the zoom scale for the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ zoomScale: number; } @@ -10547,24 +45492,79 @@ declare namespace __esri { } export interface SearchViewModelSearchCompleteEvent { + activeSourceIndex: number; + errors: Error[]; + numResults: number; + results: SearchViewModelSearchCompleteEventResults[]; + searchTerm: string; } - export interface SearchViewModelSearchResponse { + /** + * When resolved, returns this response after calling [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ + export interface SearchViewModelSearchResponse extends Object { + /** + * The index of the source from which the search result was obtained. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ activeSourceIndex: number; + /** + * An array of error objects returned from the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ errors: Error[]; + /** + * The number of search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ numResults: number; + /** + * The searched expression + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ searchTerm: string; + /** + * An array of objects representing the results of search. See object specification table below for more information about the result object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ results: SearchViewModelSearchResponseResults[]; } - export interface SearchViewModelSearchResult { + /** + * The result object returned from the [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) + */ + export interface SearchViewModelSearchResult extends Object { + /** + * The extent, or bounding box, of the returned feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) + */ extent: Extent; + /** + * The resulting feature or location obtained from the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) + */ feature: Graphic; + /** + * The name of the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) + */ name: string; } @@ -10572,478 +45572,1959 @@ declare namespace __esri { } export interface SearchViewModelSelectResultEvent { + result: SearchViewModelSelectResultEventResult; + source: any; + sourceIndex: number; } export interface SearchViewModelSuggestCompleteEvent { + activeSourceIndex: number; + errors: Error[]; + numResults: number; + results: SearchViewModelSuggestCompleteEventResults[]; + searchTerm: string; } - export interface SearchViewModelSuggestResponse { + /** + * When resolved, returns this reponse after calling [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ + export interface SearchViewModelSuggestResponse extends Object { + /** + * The index of the source from which suggestions are obtained. This value is `-1` when all sources are selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ activeSourceIndex: number; + /** + * An array of error objects returned from the suggest results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ errors: Error[]; + /** + * The number of suggest results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ numResults: number; + /** + * The search expression used for the suggest. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ searchTerm: string; + /** + * An array of objects representing the results of suggest. See object specification table below for more information about the result object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ results: SearchViewModelSuggestResponseResults[]; } - export interface SearchViewModelSuggestResult { + /** + * The result object returned from a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) + */ + export interface SearchViewModelSuggestResult extends Object { + /** + * The key related to the suggest result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) + */ key: string; + /** + * The string name of the suggested location to geocode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) + */ text: string; + /** + * The index of the currently selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) + */ sourceIndex: number; } export interface SearchViewModelSuggestStartEvent { } - export interface SearchViewModelFeatureLayerSourceFilter { + + export interface SearchViewModelFeatureLayerSourceFilter extends Object { + /** + * The where clause specified for filtering suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ where: string; + /** + * The filter geometry for suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#FeatureLayerSource) + */ geometry: Geometry; } - export interface SearchViewModelLocatorSourceFilter { + + export interface SearchViewModelLocatorSourceFilter extends Object { + /** + * The where clause specified for filtering suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ where: string; + /** + * The filter geometry for suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ geometry: Geometry; } - export interface SearchViewModelLocatorSourceLocalSearchOptions { + + export interface SearchViewModelLocatorSourceLocalSearchOptions extends Object { + /** + * The distance to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ distance: number; + /** + * The minimum scale used to search locally. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#LocatorSource) + */ minScale: number; } - export interface SearchViewModelSearchCompleteEventResults { + + export interface SearchViewModelSearchCompleteEventResults extends Object { + results: SearchResult[]; + sourceIndex: number; + source: any[]; } - export interface SearchViewModelSearchResponseResults { + + export interface SearchViewModelSearchResponseResults extends Object { + /** + * An array of search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ results: SearchViewModelSearchResult[]; + /** + * The index of the currently selected source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ sourceIndex: number; + /** + * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) of the selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) + */ source: any; } - export interface SearchViewModelSelectResultEventResult { + + export interface SearchViewModelSelectResultEventResult extends Object { + extent: Extent; + feature: Graphic; + name: string; } - export interface SearchViewModelSuggestCompleteEventResults { + + export interface SearchViewModelSuggestCompleteEventResults extends Object { + results: SearchViewModelSuggestResult[]; + sourceIndex: number; + source: any; } - export interface SearchViewModelSuggestResponseResults { + + export interface SearchViewModelSuggestResponseResults extends Object { + /** + * An array of suggest results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ results: SearchViewModelSuggestResult[]; + /** + * The index of the currently selected source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ sourceIndex: number; + /** + * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) of the selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) + */ source: any; } - export interface FeatureLayerSource { + /** + * The following properties define a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)-based [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) whose features may be searched by the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + export interface FeatureLayerSource extends Object { + /** + * The Popup instance used for the selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ popup: Popup; - autoNavigate: boolean; - exactMatch: boolean; + /** + * Indicates whether to automatically navigate to the selected result once selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + autoNavigate?: boolean; + /** + * Indicates to only return results that match the search value exactly. This property only applies to `string` field searches. `exactMatch` is always `true` when searching fields of type `number`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + exactMatch?: boolean; + /** + * The feature layer queried in the search. This is **required**. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ featureLayer: FeatureLayer; + /** + * As of version 4.4, this property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ filter: FeatureLayerSourceFilter; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; + /** + * Indicates the maximum number of search results to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + maxResults?: number; + /** + * Indicates the maximum number of suggestions to return for the widget's input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + maxSuggestions?: number; + /** + * Indicates the minimum number of characters required before querying for a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + minSuggestCharacters?: number; + /** + * The name of the source for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ name: string; + /** + * Specifies the fields returned with the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ outFields: string[]; + /** + * Used as a hint for the source input text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ placeholder: string; + /** + * The results are displayed using this field. Defaults to the layer's `displayField` or the first string field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ displayField: string; - popupEnabled: boolean; - popupOpenOnSelect: boolean; + /** + * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + popupEnabled?: boolean; + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + popupOpenOnSelect?: boolean; + /** + * Specify this to prefix the input for the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ prefix: string; - resultGraphicEnabled: boolean; + /** + * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultSymbol). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + resultGraphicEnabled?: boolean; + /** + * The symbol used for the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ resultSymbol: Symbol; + /** + * An array of string values representing the names of fields in the feature layer to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ searchFields: string[]; + /** + * Specify this to suffix the input for the search value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ suffix: string; - suggestionsEnabled: boolean; + /** + * Indicates whether to display suggestions as the user enters input text in the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ + suggestionsEnabled?: boolean; + /** + * A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over `displayField`. Field names in the template must have the following format: `{FieldName}`. An example suggestionTemplate could look something like: `Name: {OWNER}, Parcel: {PARCEL_ID}`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ suggestionTemplate: string; + /** + * Indicates whether to constrain the search results to the view's extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ withinViewEnabled: boolean; + /** + * The set zoom scale for the resulting search result. This scale is automatically honored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ zoomScale: number; } - export interface LocatorSource { + /** + * The following properties define a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) pointing to a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) that may be used to geocode locations with the Search widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + export interface LocatorSource extends Object { + /** + * Used as a hint for the source input text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ placeholder: string; - autoNavigate: boolean; + /** + * Indicates whether to automatically navigate to the selected result once selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + autoNavigate?: boolean; + /** + * Constricts search results to a specified country code. For example, `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ countryCode: string; + /** + * As of version 4.4, this property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ filter: LocatorSourceFilter; + /** + * Sets the sources for local `distance` and `minScale` for searching. See the object specification table below for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ localSearchOptions: LocatorSourceLocalSearchOptions; - locationToAddressDistance: number; + /** + * When reverse geocoding a result, use this distance in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + locationToAddressDistance?: number; + /** + * The locator task used to search. This is **required** and defaults to the [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ locator: Locator; - maxResults: number; - maxSuggestions: number; - minSuggestCharacters: number; + /** + * Indicates the maximum number of search results to return. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + maxResults?: number; + /** + * Indicates the maximum number of suggestions to return for the widget's input. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + maxSuggestions?: number; + /** + * Indicates the minimum number of characters required before querying for a suggestion. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + minSuggestCharacters?: number; + /** + * The name of the source for display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ name: string; + /** + * Specifies the fields returned with the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ outFields: string[]; + /** + * A string array which limits the results to one or more categories. For example "Populated Place" or "airport". Only applicable when using the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ categories: string[]; + /** + * The Popup instance used for the selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ popup: Popup; - popupEnabled: boolean; - popupOpenOnSelect: boolean; + /** + * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + popupEnabled?: boolean; + /** + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + popupOpenOnSelect?: boolean; + /** + * Specify this to prefix the input for the search text. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ prefix: string; - resultGraphicEnabled: boolean; - resultSymbol: Symbol; - searchTemplate: string; + /** + * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultSymbol). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + resultGraphicEnabled?: boolean; + /** + * The symbol used for the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + resultSymbol?: Symbol; + /** + * A template string used to display multiple fields in a defined order when results are displayed, e.g. `"{Street}, {City}, {ZIP}"`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + searchTemplate?: string; + /** + * The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are `SingleLine` and `SingleLineFieldName`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ singleLineFieldName: string; - suggestionsEnabled: boolean; - suffix: string; - withinViewEnabled: boolean; - zoomScale: number; + /** + * Indicates whether to display suggestions as the user enters input text in the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + suggestionsEnabled?: boolean; + /** + * Specify this to suffix the input for the search value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + suffix?: string; + /** + * Indicates whether to constrain the search results to the view's extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + withinViewEnabled?: boolean; + /** + * The set zoom scale for the resulting search result. This scale is automatically honored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ + zoomScale?: number; } - export interface SearchResponse { + /** + * When resolved, returns this response after calling [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ + export interface SearchResponse extends Object { + /** + * The index of the source from which the search result was obtained. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ activeSourceIndex: number; + /** + * An array of error objects returned from the search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ errors: Error[]; + /** + * The number of search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ numResults: number; + /** + * The searched expression + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ searchTerm: string; + /** + * An array of objects representing the results of search. See object specification table below for more information about the result object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ results: SearchResponseResults[]; } - export interface SearchResult { + /** + * The result object returned from a [search()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) + */ + export interface SearchResult extends Object { + /** + * The extent, or bounding box, of the returned feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) + */ extent: Extent; + /** + * The resulting feature or location obtained from the search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) + */ feature: Graphic; + /** + * The name of the result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) + */ name: string; } - export interface SuggestResponse { + /** + * When resolved, returns this response after calling [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ + export interface SuggestResponse extends Object { + /** + * The index of the source from which suggestions are obtained. This value is `-1` when all sources are selected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ activeSourceIndex: number; + /** + * An array of error objects returned from the suggest results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ errors: Error[]; + /** + * The number of suggest results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ numResults: number; + /** + * The search expression used for the suggest. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ searchTerm: string; + /** + * An array of objects representing the results of suggest. See object specification table below for more information about the result object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ results: SuggestResponseResults[]; } - export interface SuggestResult { + /** + * The result object returned from a [suggest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) + */ + export interface SuggestResult extends Object { + /** + * The key related to the suggest result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) + */ key: string; + /** + * The string name of the suggested location to geocode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) + */ text: string; + /** + * The index of the currently selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) + */ sourceIndex: number; } - export interface FeatureLayerSourceFilter { + + export interface FeatureLayerSourceFilter extends Object { + /** + * The where clause specified for filtering suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ where: string; + /** + * The filter geometry for suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#FeatureLayerSource) + */ geometry: Geometry; } - export interface LocatorSourceFilter { + + export interface LocatorSourceFilter extends Object { + /** + * The where clause specified for filtering suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ where: string; + /** + * The filter geometry for suggests or search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ geometry: Geometry; } - export interface LocatorSourceLocalSearchOptions { + + export interface LocatorSourceLocalSearchOptions extends Object { + /** + * The distance to search. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ distance: number; + /** + * The minimum scale used to search locally. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#LocatorSource) + */ minScale: number; } - export interface SearchResponseResults { + + export interface SearchResponseResults extends Object { + /** + * An array of search results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ results: SearchResult[]; + /** + * The index of the currently selected source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ sourceIndex: number; + /** + * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) of the selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) + */ source: any; } - export interface SuggestResponseResults { + + export interface SuggestResponseResults extends Object { + /** + * An array of suggest results. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ results: SuggestResult[]; + /** + * The index of the currently selected source. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ sourceIndex: number; + /** + * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) of the selected result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) + */ source: any; } interface SizeSlider extends Accessor, Widgette { + /** + * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#handlesVisible) + * + * @default true + */ handlesVisible: boolean; + /** + * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) + */ histogram: HistogramResult; + /** + * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramVisible) + * + * @default true + */ histogramVisible: boolean; + /** + * The width of the histogram in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramWidth) + * + * @default 100 + */ histogramWidth: number; + /** + * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#labelsVisible) + * + * @default true + */ labelsVisible: boolean; - maxSize: number; + /** + * The size in points or pixels with which features will be represented at or above the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxSize) + */ + readonly maxSize: number; + /** + * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) + */ maxValue: number; - minSize: number; + /** + * The size in points or pixels with which features will be represented at or below the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minSize) + */ + readonly minSize: number; + /** + * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) + */ minValue: number; + /** + * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) of the slider if values for those properties are not already provided. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) + */ statistics: SizeSliderStatistics; + /** + * Indicates whether to show the average value of features in the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statisticsVisible) + * + * @default true + */ statisticsVisible: boolean; + /** + * The symbol on the slider representing the features in the view. This symbol type should match the symbol type of the appropriate features. This can be an instance of [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), which is the default value, or [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#symbol) + */ symbol: SimpleMarkerSymbol | SimpleLineSymbol; + /** + * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#ticksVisible) + * + * @default true + */ ticksVisible: boolean; - values: number[]; + /** + * Represents the data values corresponding to the handles on the slider. It is an array of numbers indicating the `minDataValue` and the `maxDataValue` of the [visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) represented by the slider. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) + */ + readonly values: number[]; + /** + * The size visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the sizeRendererCreator helper methods. A new size visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) + */ visualVariable: SizeVisualVariable; } interface SizeSliderConstructor { + /** + * The SizeSlider is a widget intended for authoring and exploring data-driven visualizations in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) using the size of marker symbols or 3D object symbol layers. To display properly, this slider requires a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) and [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) object. Other optional properties may be used including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html) + */ + new(properties?: SizeSliderProperties): SizeSlider; } export const SizeSlider: SizeSliderConstructor; interface SizeSliderProperties extends WidgetteProperties { + /** + * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#handlesVisible) + * + * @default true + */ handlesVisible?: boolean; + /** + * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) + */ histogram?: HistogramResult; + /** + * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramVisible) + * + * @default true + */ histogramVisible?: boolean; + /** + * The width of the histogram in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramWidth) + * + * @default 100 + */ histogramWidth?: number; + /** + * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#labelsVisible) + * + * @default true + */ labelsVisible?: boolean; - maxSize?: number; + /** + * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) + */ maxValue?: number; - minSize?: number; + /** + * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) + */ minValue?: number; + /** + * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) of the slider if values for those properties are not already provided. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) + */ statistics?: SizeSliderStatistics; + /** + * Indicates whether to show the average value of features in the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statisticsVisible) + * + * @default true + */ statisticsVisible?: boolean; + /** + * The symbol on the slider representing the features in the view. This symbol type should match the symbol type of the appropriate features. This can be an instance of [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), which is the default value, or [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#symbol) + */ symbol?: SimpleMarkerSymbolProperties | SimpleLineSymbolProperties; + /** + * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#ticksVisible) + * + * @default true + */ ticksVisible?: boolean; - values?: number[]; + /** + * The size visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the sizeRendererCreator helper methods. A new size visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) + */ visualVariable?: SizeVisualVariable; } - export interface SizeSliderStatistics { + + export interface SizeSliderStatistics extends Object { + /** + * The average of all data values represented in the size visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) + */ avg?: number; + /** + * The maximum of all data values represented in the size visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) + */ max: number; + /** + * The minimum of all data values represented in the size visual variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) + */ min: number; } interface SketchViewModel extends Accessor, Evented { + /** + * Graphic representing the temporary geometry that is being drawn on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#graphic) + */ graphic: Graphic; + /** + * GraphicsLayer associated with the SketchViewModel. It allows you to organize where temporary graphics are placed when the drawing is completed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer) + */ + layer: GraphicsLayer; + /** + * A simple marker symbol used for drawing point geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) + */ pointSymbol: SimpleMarkerSymbol; + /** + * A simple fill symbol used for drawing polygon geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) + */ polygonSymbol: SimpleFillSymbol; + /** + * A simple line symbol used for drawing polyline geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) + */ polylineSymbol: SimpleLineSymbol; - state: string; + /** + * The view model's state. **Known Values:** ready | disabled + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view in which geometries will be sketched by the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#view) + */ view: MapView; + /** + * Completes the active drawing and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:draw-complete) event. If called mid-drawing, `complete()` finishes the active drawing and keeps the valid geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#complete) + * + * + */ + complete(): void; + /** + * Creates an instance of the requested draw action type. **Known Values:** point | multipoint | polyline | polygon + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#create) + * + * @param drawAction Name of the draw action tool. + * + */ create(drawAction: string): void; + /** + * Resets SketchViewModel to prepare for another create operation. Reset discards the current drawing, if called mid drawing. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#reset) + * + * + */ reset(): void; } interface SketchViewModelConstructor { + /** + * SketchViewModel simplifies the process of adding temporary geometries to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). It saves the effort of writing lots of code for sketching different geometry types. SketchViewModel is intended for basic usage, without advanced features such as preventing self-intersecting lines or overlapping polygons. If more control is required for creating temporary geometries, then use the [Draw](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html) class instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) + */ + new(properties?: SketchViewModelProperties): SketchViewModel; } export const SketchViewModel: SketchViewModelConstructor; interface SketchViewModelProperties { + /** + * Graphic representing the temporary geometry that is being drawn on the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#graphic) + */ graphic?: GraphicProperties; + /** + * GraphicsLayer associated with the SketchViewModel. It allows you to organize where temporary graphics are placed when the drawing is completed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer) + */ + layer?: GraphicsLayerProperties; + /** + * A simple marker symbol used for drawing point geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) + */ pointSymbol?: SimpleMarkerSymbolProperties; + /** + * A simple fill symbol used for drawing polygon geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) + */ polygonSymbol?: SimpleFillSymbolProperties; + /** + * A simple line symbol used for drawing polyline geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) + */ polylineSymbol?: SimpleLineSymbolProperties; - state?: string; + /** + * The view in which geometries will be sketched by the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#view) + */ view?: MapViewProperties; } interface GeolocationPositioning { + /** + * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#geolocationOptions) + * + * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } + */ geolocationOptions: any; + /** + * Indicates whether to navigate the view to the position and scale of the geolocated result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#goToLocationEnabled) + * + * @default true + */ goToLocationEnabled: boolean; + /** + * The graphic used to show the user's location on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#graphic) + */ graphic: Graphic; + /** + * The view associated with the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#view) + */ view: MapView | SceneView; } interface GeolocationPositioningConstructor { + + new(): GeolocationPositioning; } export const GeolocationPositioning: GeolocationPositioningConstructor; interface GeolocationPositioningProperties { + /** + * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#geolocationOptions) + * + * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } + */ geolocationOptions?: any; + /** + * Indicates whether to navigate the view to the position and scale of the geolocated result. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#goToLocationEnabled) + * + * @default true + */ goToLocationEnabled?: boolean; + /** + * The graphic used to show the user's location on the map. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#graphic) + */ graphic?: GraphicProperties; + /** + * The view associated with the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#view) + */ view?: MapViewProperties | SceneViewProperties; } + interface widget { + /** + * This convenience decorator is used to help simplify accessibility within the widget keyboard events. For example, it can be used to execute a method when the `space` or `enter` keys are pressed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#accessibleHandler) + * + * + */ accessibleHandler(): Function; + /** + * Utility method used for joining CSS classes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#join) + * + * @param classNames The class names to join. + * + */ join(...classNames: string[]): string; + /** + * This convenience decorator marks a property for automatic rendering. It is useful when you want rendering to be scheduled whenever the decorated property changes. Many times this decorator is used in conjunction with the [@property](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html) decorator. Rendering on deep properties is also supported by providing a path to a property deeper in the instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#renderable) + * + * @param propertyName Names of nested renderable properties. + * + */ renderable(propertyName?: string | string[]): Function; + /** + * This convenience method is used to assign an [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) DOM node reference to a variable. It does this by taking a [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) passed from either the [afterUpdate](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) or [afterCreate](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) callbacks. In order to use this, the element must have a set [data-node-ref](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) attribute. In addition, it must also be bound to the widget instance, e.g. `bind={this}`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#storeNode) + * + * @param node The referenced DOM node. + * + */ + storeNode(node: HTMLElement): void; + /** + * This convenience method is used to render the JSX in the [widget.render()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#render) method. It is required to import `tsx` even though it is not explicitly called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#tsx) + * + * @param selector The element to create. + * @param properties The element's properties. + * @param children The element's children. + * + */ tsx(selector: string, properties?: any, children?: any): any; + /** + * This convenience decorator helps dispatch view model events on the widget instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#vmEvent) + * + * @param eventNames The event names to re-dispatch. + * + */ vmEvent(eventNames: string | string[]): Function; } export const widget: widget; interface Track extends Widget { + /** + * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#geolocationOptions) + * + * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } + */ geolocationOptions: any; + /** + * Indicates whether the widget will automatically navigate the view to the user's position when a geolocation result is found. Set to `false` to disable this behavior, leaving full control to the developer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#goToLocationEnabled) + * + * @default true + */ goToLocationEnabled: boolean; + /** + * The graphic used to show the user's location in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#graphic) + */ graphic: Graphic; - tracking: boolean; + /** + * Indicates whether the widget is watching for new positions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#tracking) + * + * @default false + */ + readonly tracking: boolean; + /** + * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#useHeadingEnabled) + * + * @default true + */ + useHeadingEnabled: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [TrackViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#viewModel) + */ viewModel: TrackViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#render) + * + * + */ render(): any; + /** + * When executed, the widget will start [tracking](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#tracking) the user's location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#start) + * + * + */ start(): void; + /** + * Stops tracking the user's location when executed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#stop) + * + * + */ stop(): void; } interface TrackConstructor { + /** + * Provides a simple button that animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's location when clicked. The view rotates according to the direction where the tracked device is heading towards. While tracking, the default button looks like the following: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html) + */ + new(properties?: TrackProperties): Track; } export const Track: TrackConstructor; interface TrackProperties extends WidgetProperties { + /** + * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#geolocationOptions) + * + * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } + */ geolocationOptions?: any; + /** + * Indicates whether the widget will automatically navigate the view to the user's position when a geolocation result is found. Set to `false` to disable this behavior, leaving full control to the developer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#goToLocationEnabled) + * + * @default true + */ goToLocationEnabled?: boolean; + /** + * The graphic used to show the user's location in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#graphic) + */ graphic?: GraphicProperties; - tracking?: boolean; + /** + * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#useHeadingEnabled) + * + * @default true + */ + useHeadingEnabled?: boolean; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [TrackViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#viewModel) + */ viewModel?: TrackViewModelProperties; } interface TrackViewModel extends Accessor, Evented, GeolocationPositioning { - state: string; - tracking: boolean; + /** + * The current state of the widget. **Possible Values:** disabled | ready | tracking | waiting + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * Indicates whether new positions are being watched. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking) + * + * @default false + */ + readonly tracking: boolean; + /** + * When executed, [tracking](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking) starts at the user's location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#start) + * + * + */ start(): void; + /** + * Stops tracking the user's location when executed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#stop) + * + * + */ stop(): void; } interface TrackViewModelConstructor { + /** + * Provides the logic for the [Track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html) widget, which animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's location when clicked and tracks it as the location is updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) + */ + new(properties?: TrackViewModelProperties): TrackViewModel; } export const TrackViewModel: TrackViewModelConstructor; interface TrackViewModelProperties extends GeolocationPositioningProperties { - state?: string; - tracking?: boolean; + } interface UnivariateColorSizeSlider extends Accessor, Widgette { + /** + * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#handlesVisible) + * + * @default true + */ handlesVisible: boolean; + /** + * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) + */ histogram: HistogramResult; + /** + * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramVisible) + * + * @default true + */ histogramVisible: boolean; + /** + * The width of the histogram in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramWidth) + * + * @default 100 + */ histogramWidth: number; + /** + * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#labelsVisible) + * + * @default true + */ labelsVisible: boolean; - maxSize: number; + /** + * The size in points or pixels with which features will be represented at or above the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxSize) + */ + readonly maxSize: number; + /** + * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) + */ maxValue: number; - minSize: number; + /** + * The size in points or pixels with which features will be represented at or below the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minSize) + */ + readonly minSize: number; + /** + * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) + */ minValue: number; + /** + * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) of the slider if values for those properties are not already provided. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) + */ statistics: UnivariateColorSizeSliderStatistics; + /** + * Indicates whether to show the average of the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statisticsVisible) + * + * @default true + */ statisticsVisible: boolean; + /** + * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#ticksVisible) + * + * @default true + */ ticksVisible: boolean; - values: number[]; + /** + * Represents the data values corresponding to the handles on the slider. It is an array of numbers indicating the `minDataValue` and the `maxDataValue` of the visual variables represented by the slider. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) + */ + readonly values: number[]; + /** + * The size and color visual variables represented by the slider. Since this slider represents univariate visualizations, both color and size visual variables must represent data from the same field or expression and be conicident. In other words, the lower stop or bound of the color visual variable must match the lower bound (or `minDataValue`) of the size visual variable. The same is true of the upper bounds of both visual variables. These must be set initially on the slider for it to render in the view. Both visual variables may be created manually (see snippet below) or generated from the [univariateColorSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) helper methods. New coincident color and size visual variables are created each time the user slides the handles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) + */ visualVariables: any[]; } interface UnivariateColorSizeSliderConstructor { + /** + * The UnivariateColorSizeSlider is a widget intended for authoring and exploring data-driven univariate visualizations in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) using color and size. To display properly, this slider requires [color and size visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) and a [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) object. Other optional properties may be used including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html) + */ + new(properties?: UnivariateColorSizeSliderProperties): UnivariateColorSizeSlider; } export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; interface UnivariateColorSizeSliderProperties extends WidgetteProperties { + /** + * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#handlesVisible) + * + * @default true + */ handlesVisible?: boolean; + /** + * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) + */ histogram?: HistogramResult; + /** + * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramVisible) + * + * @default true + */ histogramVisible?: boolean; + /** + * The width of the histogram in pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramWidth) + * + * @default 100 + */ histogramWidth?: number; + /** + * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#labelsVisible) + * + * @default true + */ labelsVisible?: boolean; - maxSize?: number; + /** + * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) + */ maxValue?: number; - minSize?: number; + /** + * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) + */ minValue?: number; + /** + * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) of the slider if values for those properties are not already provided. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) + */ statistics?: UnivariateColorSizeSliderStatistics; + /** + * Indicates whether to show the average of the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statisticsVisible) + * + * @default true + */ statisticsVisible?: boolean; + /** + * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#ticksVisible) + * + * @default true + */ ticksVisible?: boolean; - values?: number[]; + /** + * The size and color visual variables represented by the slider. Since this slider represents univariate visualizations, both color and size visual variables must represent data from the same field or expression and be conicident. In other words, the lower stop or bound of the color visual variable must match the lower bound (or `minDataValue`) of the size visual variable. The same is true of the upper bounds of both visual variables. These must be set initially on the slider for it to render in the view. Both visual variables may be created manually (see snippet below) or generated from the [univariateColorSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) helper methods. New coincident color and size visual variables are created each time the user slides the handles. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) + */ visualVariables?: any[]; } - export interface UnivariateColorSizeSliderStatistics { + + export interface UnivariateColorSizeSliderStatistics extends Object { + /** + * The average of all data values represented in the size and color visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) + */ avg: number; + /** + * The maximum of all data values represented in the size and color visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) + */ max: number; + /** + * The minimum of all all data values represented in the size and color visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) + */ min: number; + /** + * The standard deviation calculated from all data values represented in the size and color visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) + */ stddev: number; } interface Widget extends Accessor, Evented { + /** + * The ID or node representing the DOM element containing the widget. This property can only be set once. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#container) + */ container: string | HTMLElement; + /** + * When `true`, this property indicates whether the widget has been destroyed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroyed) + */ destroyed: boolean; + /** + * The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the container ID, or if that is not present then it will be automatically generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id) + */ id: string; + /** + * Destroys the widget instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroy) + * + * + */ destroy(): void; + /** + * Widget teardown helper. Any handles added to it will be automatically removed when the widget is destroyed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#own) + * + * @param handles Handles marked for removal once the widget is destroyed. + * + */ own(handles: WatchHandle | WatchHandle[]): void; + /** + * *This method is primarily used by developers when implementing custom widgets.* Executes after widget is ready for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#postInitialize) + * + * + */ postInitialize(): void; + /** + * Renders widget to the DOM immediately. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#renderNow) + * + * + */ renderNow(): void; + /** + * *This method is primarily used by developers when implementing custom widgets.* Schedules widget rendering. This method is useful for changes affecting the UI. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#scheduleRender) + * + * + */ scheduleRender(): void; + /** + * Finalizes the creation of the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#startup) + * + * + */ startup(): void; } interface WidgetConstructor { + /** + * The base class for widgets. Each widget's presentation is separate from its properties, methods, and data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) + */ + new(properties?: WidgetProperties): Widget; } export const Widget: WidgetConstructor; interface WidgetProperties { + /** + * The ID or node representing the DOM element containing the widget. This property can only be set once. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#container) + */ container?: string | HTMLElement; + /** + * When `true`, this property indicates whether the widget has been destroyed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroyed) + */ destroyed?: boolean; + /** + * The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the container ID, or if that is not present then it will be automatically generated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id) + */ id?: string; } interface Widgette { + /** + * The ID or node representing the DOM element containing the widget. Note that once set, this property cannot be modified afterwards. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#container) + */ container: string | HTMLElement; + /** + * Indicates whether the widget is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#visible) + * + * @default true + */ visible: boolean; + /** + * Destroys the widget instance. Call this method when the widget is no longer needed by the application. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#destroy) + * + * + */ destroy(): void; + /** + * Registers an event handler on the widget instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#events-summary) for a list of supported events. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#on) + * + * @param type The name of the event. + * @param listener The function to call when the event is fired. + * + */ on(type: string, listener: Function): any; } interface WidgetteConstructor { + + new(): Widgette; } export const Widgette: WidgetteConstructor; interface WidgetteProperties { + /** + * The ID or node representing the DOM element containing the widget. Note that once set, this property cannot be modified afterwards. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#container) + */ container?: string | HTMLElement; + /** + * Indicates whether the widget is visible. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#visible) + * + * @default true + */ visible?: boolean; } interface Zoom extends Widget { + /** + * Determines the layout/orientation of the Zoom widget. **Known Values:** vertical | horizontal + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#layout) + * + * @default vertical + */ layout: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#view) + */ view: MapView | SceneView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ZoomViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#viewModel) + */ viewModel: ZoomViewModel; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#render) + * + * + */ render(): any; + /** + * Zooms the view in by an LOD factor of 0.5. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#zoomIn) + * + * + */ zoomIn(): void; + /** + * Zooms the view out by an LOD factor of 2. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#zoomOut) + * + * + */ zoomOut(): void; } interface ZoomConstructor { + /** + * The Zoom widget allows users to zoom in/out within a view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html) + */ + new(properties?: ZoomProperties): Zoom; } export const Zoom: ZoomConstructor; interface ZoomProperties extends WidgetProperties { + /** + * Determines the layout/orientation of the Zoom widget. **Known Values:** vertical | horizontal + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#layout) + * + * @default vertical + */ layout?: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#view) + */ view?: MapViewProperties | SceneViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ZoomViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#viewModel) + */ viewModel?: ZoomViewModelProperties; } interface ZoomViewModel extends Accessor { + /** + * Indicates if the view can zoom in. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomIn) + */ canZoomIn: boolean; + /** + * Indicates if the view can zoom out. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomOut) + */ canZoomOut: boolean; - state: string; + /** + * The current state of the widget. **Possible Values:** disabled | ready + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * The view from which to operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#view) + */ view: MapView | SceneView; + /** + * Zooms the view in by an LOD factor of 0.5. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#zoomIn) + * + * + */ zoomIn(): void; + /** + * Zooms the view out by an LOD factor of 2. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#zoomOut) + * + * + */ zoomOut(): void; } interface ZoomViewModelConstructor { + + new(properties?: ZoomViewModelProperties): ZoomViewModel; } export const ZoomViewModel: ZoomViewModelConstructor; interface ZoomViewModelProperties { + /** + * Indicates if the view can zoom in. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomIn) + */ canZoomIn?: boolean; + /** + * Indicates if the view can zoom out. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomOut) + */ canZoomOut?: boolean; - state?: string; + /** + * The view from which to operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#view) + */ view?: MapViewProperties | SceneViewProperties; } + export type MultipointDrawActionCursorUpdateEventHandler = (event: MultipointDrawActionCursorUpdateEvent) => void; + + export type MultipointDrawActionDrawCompleteEventHandler = (event: MultipointDrawActionDrawCompleteEvent) => void; + + export type MultipointDrawActionVertexAddEventHandler = (event: MultipointDrawActionVertexAddEvent) => void; + + export type MultipointDrawActionVertexRemoveEventHandler = (event: MultipointDrawActionVertexRemoveEvent) => void; + export type OpenStreetMapLayerLayerviewCreateEventHandler = (event: OpenStreetMapLayerLayerviewCreateEvent) => void; export type OpenStreetMapLayerLayerviewDestroyEventHandler = (event: OpenStreetMapLayerLayerviewDestroyEvent) => void; @@ -11072,6 +47553,8 @@ declare namespace __esri { export type PolylineDrawActionVertexRemoveEventHandler = (event: PolylineDrawActionVertexRemoveEvent) => void; + export type PopupViewModelTriggerActionEventHandler = (event: PopupViewModelTriggerActionEvent) => void; + export type SceneLayerLayerviewCreateEventHandler = (event: SceneLayerLayerviewCreateEvent) => void; export type SceneLayerLayerviewDestroyEventHandler = (event: SceneLayerLayerviewDestroyEvent) => void; @@ -11096,14 +47579,16 @@ declare namespace __esri { export type SceneViewPointerDownEventHandler = (event: SceneViewPointerDownEvent) => void; + export type SceneViewPointerEnterEventHandler = (event: SceneViewPointerEnterEvent) => void; + + export type SceneViewPointerLeaveEventHandler = (event: SceneViewPointerLeaveEvent) => void; + export type SceneViewPointerMoveEventHandler = (event: SceneViewPointerMoveEvent) => void; export type SceneViewPointerUpEventHandler = (event: SceneViewPointerUpEvent) => void; export type SceneViewResizeEventHandler = (event: SceneViewResizeEvent) => void; - export type SearchViewModelLoadEventHandler = (event: SearchViewModelLoadEvent) => void; - export type SearchViewModelSearchClearEventHandler = (event: SearchViewModelSearchClearEvent) => void; export type SearchViewModelSearchCompleteEventHandler = (event: SearchViewModelSearchCompleteEvent) => void; @@ -11616,6 +48101,16 @@ declare module "esri/renderers/PointCloudUniqueValueRenderer" { export = PointCloudUniqueValueRenderer; } +declare module "esri/renderers/support/AuthoringInfo" { + import AuthoringInfo = __esri.AuthoringInfo; + export = AuthoringInfo; +} + +declare module "esri/renderers/support/AuthoringInfoVisualVariable" { + import AuthoringInfoVisualVariable = __esri.AuthoringInfoVisualVariable; + export = AuthoringInfoVisualVariable; +} + declare module "esri/support/Action" { import Action = __esri.Action; export = Action; @@ -12096,6 +48591,11 @@ declare module "esri/views/layers/ImageryLayerView" { export = ImageryLayerView; } +declare module "esri/views/layers/KMLLayerView" { + import KMLLayerView = __esri.KMLLayerView; + export = KMLLayerView; +} + declare module "esri/views/layers/SceneLayerView" { import SceneLayerView = __esri.SceneLayerView; export = SceneLayerView; @@ -12136,6 +48636,11 @@ declare module "esri/views/2d/draw/PolygonDrawAction" { export = PolygonDrawAction; } +declare module "esri/views/2d/draw/MultipointDrawAction" { + import MultipointDrawAction = __esri.MultipointDrawAction; + export = MultipointDrawAction; +} + declare module "esri/webmap/InitialViewProperties" { import InitialViewProperties = __esri.InitialViewProperties; export = InitialViewProperties; @@ -12191,11 +48696,26 @@ declare module "esri/widgets/Compass" { export = Compass; } +declare module "esri/widgets/Directions" { + import Directions = __esri.Directions; + export = Directions; +} + +declare module "esri/widgets/DirectLineMeasurement3D" { + import DirectLineMeasurement3D = __esri.DirectLineMeasurement3D; + export = DirectLineMeasurement3D; +} + declare module "esri/widgets/Expand" { import Expand = __esri.Expand; export = Expand; } +declare module "esri/widgets/Fullscreen" { + import Fullscreen = __esri.Fullscreen; + export = Fullscreen; +} + declare module "esri/widgets/Home" { import Home = __esri.Home; export = Home; @@ -12276,6 +48796,16 @@ declare module "esri/widgets/BasemapGallery/BasemapGalleryViewModel" { export = BasemapGalleryViewModel; } +declare module "esri/widgets/BasemapGallery/support/LocalBasemapsSource" { + import LocalBasemapsSource = __esri.LocalBasemapsSource; + export = LocalBasemapsSource; +} + +declare module "esri/widgets/BasemapGallery/support/PortalBasemapsSource" { + import PortalBasemapsSource = __esri.PortalBasemapsSource; + export = PortalBasemapsSource; +} + declare module "esri/widgets/BasemapToggle/BasemapToggleViewModel" { import BasemapToggleViewModel = __esri.BasemapToggleViewModel; export = BasemapToggleViewModel; @@ -12286,11 +48816,21 @@ declare module "esri/widgets/Compass/CompassViewModel" { export = CompassViewModel; } +declare module "esri/widgets/Directions/DirectionsViewModel" { + import DirectionsViewModel = __esri.DirectionsViewModel; + export = DirectionsViewModel; +} + declare module "esri/widgets/Expand/ExpandViewModel" { import ExpandViewModel = __esri.ExpandViewModel; export = ExpandViewModel; } +declare module "esri/widgets/Fullscreen/FullscreenViewModel" { + import FullscreenViewModel = __esri.FullscreenViewModel; + export = FullscreenViewModel; +} + declare module "esri/widgets/Home/HomeViewModel" { import HomeViewModel = __esri.HomeViewModel; export = HomeViewModel; @@ -12321,6 +48861,11 @@ declare module "esri/widgets/Print/PrintViewModel" { export = PrintViewModel; } +declare module "esri/widgets/Print/TemplateOptions" { + import TemplateOptions = __esri.TemplateOptions; + export = TemplateOptions; +} + declare module "esri/widgets/Popup/PopupViewModel" { import PopupViewModel = __esri.PopupViewModel; export = PopupViewModel; @@ -12406,6 +48951,11 @@ declare module "esri/layers/mixins/PortalLayer" { export = PortalLayer; } +declare module "esri/layers/mixins/RefreshableLayer" { + import RefreshableLayer = __esri.RefreshableLayer; + export = RefreshableLayer; +} + declare module "esri/layers/mixins/ScaleRangeLayer" { import ScaleRangeLayer = __esri.ScaleRangeLayer; export = ScaleRangeLayer; @@ -12491,16 +49041,16 @@ declare module "esri/core/watchUtils" { export = watchUtils; } -declare module "esri/core/accessorSupport/decorators" { - import decorators = __esri.decorators; - export = decorators; -} - declare module "esri/core/workers" { import workers = __esri.workers; export = workers; } +declare module "esri/core/accessorSupport/decorators" { + import decorators = __esri.decorators; + export = decorators; +} + declare module "esri/geometry/geometryEngine" { import geometryEngine = __esri.geometryEngine; export = geometryEngine; @@ -12536,6 +49086,11 @@ declare module "esri/renderers/smartMapping/creators/location" { export = location; } +declare module "esri/renderers/smartMapping/creators/opacity" { + import opacity = __esri.opacity; + export = opacity; +} + declare module "esri/renderers/smartMapping/creators/size" { import size = __esri.size; export = size; @@ -12601,6 +49156,11 @@ declare module "esri/symbols/support/jsonUtils" { export = symbolsSupportJsonUtils; } +declare module "esri/symbols/support/symbolPreview" { + import symbolPreview = __esri.symbolPreview; + export = symbolPreview; +} + declare module "esri/views/3d/externalRenderers" { import externalRenderers = __esri.externalRenderers; export = externalRenderers; @@ -12611,17 +49171,20 @@ declare module "esri/widgets/support/widget" { export = widget; } -declare module "esri/widgets/BasemapGallery/BasemapGalleryItem" { +declare module "esri/widgets/BasemapGallery/support/BasemapGalleryItem" { import BasemapGalleryItem = __esri.BasemapGalleryItem; export = BasemapGalleryItem; } -declare module "esri/widgets/BasemapGallery/support/LocalBasemapsSource" { - import LocalBasemapsSource = __esri.LocalBasemapsSource; - export = LocalBasemapsSource; -} -declare module "esri/widgets/BasemapGallery/support/PortalBasemapsSource" { - import PortalBasemapsSource = __esri.PortalBasemapsSource; - export = PortalBasemapsSource; -} \ No newline at end of file +declare module "esri/geometry" { + export import Extent = __esri.Extent; + export import Multipoint = __esri.Multipoint; + export import Point = __esri.Point; + export import Polygon = __esri.Polygon; + export import Polyline = __esri.Polyline; + export import SpatialReference = __esri.SpatialReference; + export import ScreenPoint = __esri.ScreenPoint; + + export type Geometry = Extent | Multipoint | Point | Polygon | Polyline; +} diff --git a/types/arcgis-js-api/tslint.json b/types/arcgis-js-api/tslint.json new file mode 100644 index 0000000000..e3610fefae --- /dev/null +++ b/types/arcgis-js-api/tslint.json @@ -0,0 +1,80 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "use-default-type-parameter": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arcgis-js-api/v3/index.d.ts b/types/arcgis-js-api/v3/index.d.ts index de4328a957..391dfb6e0a 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.22 +// Type definitions for ArcGIS API for JavaScript 3.23 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -110,7 +110,10 @@ declare module "esri" { resourceInfo?: any; /** When true, the layer's attribution is displayed on the map. */ showAttribution?: boolean; - /** By default, images are exported in MIME format, and the image is streamed to the client. */ + /** + * By default, images are exported in MIME format, and the image is streamed to the client. + * @deprecated + */ useMapImage?: boolean; /** When true, the layer will update its content based on the map's time extent. */ useMapTime?: boolean; @@ -478,6 +481,10 @@ declare module "esri" { zoomOptions?: any; } export interface ColorPickerOptions { + /** Indicates whether the widget displays collapsed. */ + collapsed?: boolean; + /** Indicates whether the widget can be collapsed. */ + collapsible?: boolean; /** The selected color. */ color: Color; /** The row size of the palette. */ @@ -1830,8 +1837,10 @@ declare module "esri" { whereFields: any; } export interface QueryTaskOptions { - /** Specify the geodatabase version to display. */ + /** The geodatabase version to display. */ gdbVersion?: string; + /** The dynamic layer or table source. */ + source?: LayerSource; } export interface RasterLayerOptions { /** Sets the layer's draw mode. */ @@ -2150,9 +2159,15 @@ declare module "esri" { export interface SymbolStylerOptions { /** Added at v. */ portal?: string | any; - /** Self response of Portal used as symbol provider. */ + /** + * Self response of Portal used as symbol provider. + * @deprecated + */ portalSelf?: any; - /** URL to Portal used as symbol provider. */ + /** + * URL to Portal used as symbol provider. + * @deprecated + */ portalUrl?: string; } export interface TemplatePickerOptions { @@ -3852,6 +3867,10 @@ declare module "esri/dijit/ColorPicker" { /** A widget to assist choosing a color from a color palette. */ class ColorPicker { + /** Indicates whether the widget displays collapsed. */ + collapsed: boolean; + /** Indicates whether the widget is collapsible. */ + collapsible: boolean; /** The selected color. */ color: Color; /** The set of available color options. */ @@ -3921,7 +3940,10 @@ declare module "esri/dijit/Directions" { * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ constructor(options: esri.DirectionsOptions, srcNodeRef: Node | string); - /** Deprecated at v3.13. */ + /** + * Deprecated at v3.13. + * @deprecated + */ activate(): void; /** * Add a stop to the directions widget at the specified index location. @@ -3942,7 +3964,10 @@ declare module "esri/dijit/Directions" { centerAtSegmentStart(index: number): void; /** Remove the route directions from the directions list. */ clearDirections(): void; - /** Deprecated at v3.13. */ + /** + * Deprecated at v3.13. + * @deprecated + */ deactivate(): void; /** Destroy the Directions widget. */ destroy(): void; @@ -4106,7 +4131,10 @@ declare module "esri/dijit/FeatureTable" { featureLayer: FeatureLayer; /** An array of objects representing field information. */ fieldInfos: any[]; - /** Reference to the dGrid. */ + /** + * Reference to the dGrid. + * @deprecated + */ grid: any; /** Reference to the 'Options' drop-down menu. */ gridMenu: any; @@ -8158,9 +8186,9 @@ declare module "esri/geometry/geometryEngine" { */ nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): any[]; /** - * Creates offset version of the input geometry. + * The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon. * @param geometry The geometries to offset. - * @param offsetDistance The offset distance for the Geometries. + * @param offsetDistance The planar distance to offset from the input geometry. * @param offsetUnit Measurement unit for the offset. * @param joinType The join type. * @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. @@ -8401,9 +8429,9 @@ declare module "esri/geometry/geometryEngineAsync" { */ nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): any; /** - * Creates offset version of the input geometry. + * The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon. * @param geometry The geometries to offset. - * @param offsetDistance The offset distance for the Geometries. + * @param offsetDistance The planar distance to offset from the input geometry. * @param offsetUnit Measurement unit for the offset. * @param joinType The join type. * @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. @@ -8583,6 +8611,7 @@ declare module "esri/geometry/screenUtils" { * @param width The current width of the map in screen units. * @param height The current height of the map in screen units. * @param screenPoint The screenPoint to convert from screen to map units. + * @deprecated */ toMapPoint(extent: Extent, width: number, height: number, screenPoint: ScreenPoint): Point; /** @@ -8599,6 +8628,7 @@ declare module "esri/geometry/screenUtils" { * @param width The current width of the map in screen units. * @param height The current height of the map in screen units. * @param mapPoint The point to convert from map to screen units. + * @deprecated */ toScreenPoint(extent: Extent, width: number, height: number, mapPoint: Point): ScreenPoint; }; @@ -8691,14 +8721,14 @@ declare module "esri/graphic" { clone(): Graphic; /** Draws the graphic. */ draw(): Graphic; - /** - * Returns the graphics summarized by the given aggregate graphic in a clustering or feature reduction visualization. - * @param aggregateGraphic A graphic representing the aggregation (or reduction) of several individual graphics in a layer. - */ - getChildGraphics(aggregateGraphic: Graphic): Graphic[]; + /** Returns the graphics summarized by an aggregate graphic in a clustering or feature reduction visualization. */ + getChildGraphics(): Graphic[]; /** Returns the content string based on attributes and infoTemplate values. */ getContent(): string; - /** Returns the dojo/gfx/shape.Shape of the Esri graphic. */ + /** + * Returns the dojo/gfx/shape.Shape of the Esri graphic. + * @deprecated + */ getDojoShape(): any; /** Returns the info template associated with the graphic. */ getInfoTemplate(): InfoTemplate; @@ -8880,7 +8910,10 @@ declare module "esri/layers/ArcGISDynamicMapServiceLayer" { timeInfo: TimeInfo; /** Default units of the layer as defined by the service. */ units: string; - /** When true, the image is saved to the server, and a JSON formatted response is sent to the client with the URL location of the image. */ + /** + * When true, the image is saved to the server, and a JSON formatted response is sent to the client with the URL location of the image. + * @deprecated + */ useMapImage: boolean; /** The version of ArcGIS Server where the map service is published. */ version: number; @@ -10836,7 +10869,10 @@ declare module "esri/layers/RasterDataSource" { declare module "esri/layers/RasterFunction" { /** Specifies the processing to be done to the image service. */ class RasterFunction { - /** Deprecated at v3.10, use functionArguments instead. */ + /** + * Deprecated at v3.10, use functionArguments instead. + * @deprecated + */ arguments: any; /** The arguments for the raster function. */ functionArguments: any; @@ -12326,7 +12362,10 @@ declare module "esri/opsdashboard/ExtensionBase" { portalHelperServices: any; /** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */ portalUrl: string; - /** Get the collection of data sources from the host application. */ + /** + * Get the collection of data sources from the host application. + * @deprecated + */ getDataSourceProxies(): any; /** * Get the data source corresponding to the data source id from the host application. @@ -12954,7 +12993,10 @@ declare module "esri/renderers/ClassBreaksRenderer" { attributeField: string; /** To symbolize polygon features with graduated symbols, use backgroundFillSymbol to specify a simple fill symbol to represent polygon features, and use marker symbols of varying sizes in class breaks to indicate the quantity. */ backgroundFillSymbol: FillSymbol; - /** Deprecated at v2.0, use infos instead. */ + /** + * Deprecated at v2.0, use infos instead. + * @deprecated + */ breaks: any[]; /** The classification method used to generate class breaks. */ classificationMethod: string; @@ -13136,13 +13178,25 @@ declare module "esri/renderers/Renderer" { /** The base class for the renderers - SimpleRenderer, ClassBreaksRenderer, UniqueValueRenderer, DotDensityRenderer, ScaleDependentRenderer, TemporalRenderer, HeatmapRenderer, and VectorFieldRenderer used with a GraphicsLayer and FeatureLayer. */ class Renderer { - /** Deprecated. */ + /** + * Deprecated. + * @deprecated + */ colorInfo: any; - /** Deprecated. */ + /** + * Deprecated. + * @deprecated + */ opacityInfo: any; - /** Deprecated. */ + /** + * Deprecated. + * @deprecated + */ rotationInfo: any; - /** Deprecated. */ + /** + * Deprecated. + * @deprecated + */ sizeInfo: any; /** This property allows you to define how to render values in a layer. */ visualVariables: any[]; @@ -13185,21 +13239,25 @@ declare module "esri/renderers/Renderer" { /** * Deprecated. * @param info An info object that defines the color. + * @deprecated */ setColorInfo(info: any): Renderer; /** * Deprecated. * @param info The info parameter is an object with the same properties as opacityInfo. + * @deprecated */ setOpacityInfo(info: any): Renderer; /** * Deprecated. * @param info An object with the same properties as rotationInfo. + * @deprecated */ setRotationInfo(info: any): Renderer; /** * Deprecated. * @param info An object with the same properties as sizeInfo. + * @deprecated */ setSizeInfo(info: any): Renderer; /** @@ -13417,7 +13475,10 @@ declare module "esri/renderers/UniqueValueRenderer" { valueExpression: string; /** The title identifying and describing the associated Arcade expression as defined in the valueExpression property. */ valueExpressionTitle: string; - /** Deprecated at v2.0, use infos instead. */ + /** + * Deprecated at v2.0, use infos instead. + * @deprecated + */ values: string[]; /** * Creates a new UniqueValueRenderer object. @@ -13588,6 +13649,20 @@ declare module "esri/request" { export = request; } +declare module "esri/support/expressionUtils" { + /** A utility module that allows you to enable geometry operations referenced inside Arcade expressions. */ + var expressionUtils: { + /** Loads all geometry operations for use in any Arcade expression within the given application. */ + enableGeometryOperations(): any; + /** + * Indicates if the given Arcade expression contains one or more geometry operations. + * @param expression The Arcade expression to evaluate for the presence of one or more geometry operations. + */ + hasGeometryOperations(expression: string): boolean; + }; + export = expressionUtils; +} + declare module "esri/symbols/CartographicLineSymbol" { import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); import Color = require("esri/Color"); @@ -13718,7 +13793,10 @@ declare module "esri/symbols/Font" { size: number; /** Text style. */ style: string; - /** Text variant. */ + /** + * Text variant (deprecated). + * @deprecated + */ variant: string; /** Text weight. */ weight: string; @@ -13759,8 +13837,9 @@ declare module "esri/symbols/Font" { */ setStyle(style: string): Font; /** - * Sets the font variant. + * Sets the font variant (deprecated). * @param variant Font variant. + * @deprecated */ setVariant(variant: string): Font; /** @@ -14018,6 +14097,8 @@ declare module "esri/symbols/SimpleLineSymbol" { static STYLE_SHORTDOT: any; /** The line is solid. */ static STYLE_SOLID: any; + /** Indicates marker symbols present at the beginning and/or end of a SimpleLineSymbol. */ + marker: any; /** The line style. */ style: string; /** Creates a new empty SimpleLineSymbol object. */ @@ -14034,6 +14115,11 @@ declare module "esri/symbols/SimpleLineSymbol" { * @param json JSON object representing the SimpleLineSymbol. */ constructor(json: Object); + /** + * Sets marker symbols at the beginning and/or end of a SimpleLineSymbol. + * @param options The options defining the marker style and placement. + */ + setMarker(options: any): void; /** * Sets the line symbol style. * @param style Line style. @@ -14143,11 +14229,17 @@ declare module "esri/symbols/TextSymbol" { static DECORATION_OVERLINE: any; /** Text is underlined. */ static DECORATION_UNDERLINE: any; - /** The text alignment in relation to the point. */ + /** + * The text alignment in relation to the point. + * @deprecated + */ align: string; /** Text angle. */ angle: number; - /** The decoration on the text. */ + /** + * The decoration on the text. + * @deprecated + */ decoration: string; /** Font for displaying text. */ font: Font; @@ -14189,6 +14281,7 @@ declare module "esri/symbols/TextSymbol" { /** * Sets the alignment of the text. * @param align The text alignment. + * @deprecated */ setAlign(align: string): TextSymbol; /** @@ -14199,6 +14292,7 @@ declare module "esri/symbols/TextSymbol" { /** * Sets the decoration for the text. * @param decoration The decoration on the text. + * @deprecated */ setDecoration(decoration: string): TextSymbol; /** @@ -15038,7 +15132,7 @@ declare module "esri/tasks/GeometryService" { */ lengths(lengthsParameter: LengthsParameters, callback?: Function, errback?: Function): any; /** - * Constructs the offset of the input geometries. + * Constructs the offset of the input geometries based on a planar distance. * @param params Set the geometries to offset, distance and units. * @param callback The function to call when the method has completed. * @param errback An error object is returned if an error occurs during task execution. @@ -15150,7 +15244,10 @@ declare module "esri/tasks/Geoprocessor" { /** Represents a GP Task resource exposed by the ArcGIS Server REST API. */ class Geoprocessor { - /** Deprecated at v2.0, use outSpatialReference instead. */ + /** + * Deprecated at v2.0, use outSpatialReference instead. + * @deprecated + */ outputSpatialReference: SpatialReference; /** The spatial reference of the output geometries. */ outSpatialReference: SpatialReference; @@ -15219,6 +15316,7 @@ declare module "esri/tasks/Geoprocessor" { /** * Deprecated at v2.0, use setOutSpatialReference instead. * @param spatialReference The well-known ID of a spatial reference. + * @deprecated */ setOutputSpatialReference(spatialReference: SpatialReference): void; /** @@ -15680,7 +15778,7 @@ declare module "esri/tasks/OffsetParameters" { bevelRatio: number; /** The array of geometries to be offset. */ geometries: Geometry[]; - /** Specifies the distance for constructing an offset based on the input geometries. */ + /** Specifies the planar distance for constructing an offset based on the input geometries. */ offsetDistance: number; /** Options that determine how the ends intersect. */ offsetHow: string; @@ -15806,12 +15904,17 @@ declare module "esri/tasks/ProjectParameters" { declare module "esri/tasks/QueryTask" { import esri = require("esri"); + import LayerSource = require("esri/layers/LayerSource"); import Query = require("esri/tasks/query"); import RelationshipQuery = require("esri/tasks/RelationshipQuery"); import FeatureSet = require("esri/tasks/FeatureSet"); /** Executes a query operation on a layer resource of a map service exposed by the ArcGIS Server REST API. */ class QueryTask { + /** The geodatabase version to display. */ + gdbVersion: string; + /** The dynamic layer or table source. */ + source: LayerSource; /** URL to the ArcGIS Server REST resource that represents a map service layer. */ url: string; /** diff --git a/types/arcgis-js-api/v3/tslint.json b/types/arcgis-js-api/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/arcgis-js-api/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arcgis-to-geojson-utils/index.d.ts b/types/arcgis-to-geojson-utils/index.d.ts index 65c78a4230..95ba8db949 100644 --- a/types/arcgis-to-geojson-utils/index.d.ts +++ b/types/arcgis-to-geojson-utils/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Esri/arcgis-to-geojson-utils // Definitions by: Jeff Jacobson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/archy/tslint.json b/types/archy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/archy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/argon2-browser/argon2-browser-tests.ts b/types/argon2-browser/argon2-browser-tests.ts new file mode 100644 index 0000000000..1c1d77032c --- /dev/null +++ b/types/argon2-browser/argon2-browser-tests.ts @@ -0,0 +1,20 @@ +import { argon2 } from 'argon2-browser'; + +const mandatoryOptions = { + pass: 'Qwerty12?', + salt: 'Salty' +}; + +(async () => { + (await argon2.hash(mandatoryOptions)).encoded; // string + (await argon2.hash(mandatoryOptions)).hash; // Uint8Array + (await argon2.hash(mandatoryOptions)).hashHex; // string + + (await argon2.hash({ ...mandatoryOptions, distPath: 'path' })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, hashLen: 24 })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, mem: 1024 })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, parallelism: 1 })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, time: 1 })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, type: argon2.ArgonType.Argon2d })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, type: argon2.ArgonType.Argon2i })).encoded; // string +})(); diff --git a/types/argon2-browser/index.d.ts b/types/argon2-browser/index.d.ts new file mode 100644 index 0000000000..5e7a5b571b --- /dev/null +++ b/types/argon2-browser/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for argon2-browser 1.1 +// Project: https://github.com/antelle/argon2-browser#readme +// Definitions by: Ivan Gabriele +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export namespace argon2 { + function hash(options: Argon2BrowserHashOptions): Promise; + + interface Argon2BrowserHashOptions { + distPath?: string; + hashLen?: number; + mem?: number; + parallelism?: number; + pass: string; + salt: string; + time?: number; + type?: ArgonType; + } + + interface Argon2BrowserHashResult { + encoded: string; + hash: Uint8Array; + hashHex: string; + } + + enum ArgonType { + Argon2d = 0, + Argon2i = 1 + } +} diff --git a/types/argon2-browser/tsconfig.json b/types/argon2-browser/tsconfig.json new file mode 100644 index 0000000000..a380778b29 --- /dev/null +++ b/types/argon2-browser/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "argon2-browser-tests.ts" + ] +} diff --git a/types/expr-eval/tslint.json b/types/argon2-browser/tslint.json similarity index 100% rename from types/expr-eval/tslint.json rename to types/argon2-browser/tslint.json diff --git a/types/args/args-tests.ts b/types/args/args-tests.ts new file mode 100644 index 0000000000..3430288cd3 --- /dev/null +++ b/types/args/args-tests.ts @@ -0,0 +1,67 @@ +import * as args from "args"; + +args + .option("opt1", "desc") + .option("opt2", "desc", false, (value: any): any => value) + .options([ + { + name: 'opt3', + description: 'desc', + defaultValue: 1, + init: (value: any) => { }, + }, + { + name: 'opt4', + description: 'desc', + }, + ]) + .command("cm1", "desc") + .command("cm2", "desc", (value: any): void => { }, ['a']) + .example("ex1", "desc") + .examples([ + { + usage: "ex2", + description: "desc", + }, + ]); + +args.parse(['~/bin/node', '~/dir', 'arg', '--param'], { + help: true, + name: "name", + version: true, + usageFilter: (a: any): any => a, + value: "value", + mri: { + args: ['a'], + alias: { + a: "b", + c: ['d'], + }, + boolean: ['wat'], + default: { + foo: 'bar', + }, + string: ['zulu'], + unknown: (param: string): boolean => true, + }, + minimist: { + string: ['string'], + boolean: ['string'], + alias: { + bar: 'foo', + foo: ['bar1', 'bar2'], + }, + default: { + foo: 'bar', + }, + stopEarly: true, + "--": false, + unknown: (param: string): boolean => true, + }, + mainColor: "yellow", + subColor: "dim" +}); + +args.showHelp(); + +const x: string = args.sub[0]; diff --git a/types/args/index.d.ts b/types/args/index.d.ts new file mode 100644 index 0000000000..70b784564d --- /dev/null +++ b/types/args/index.d.ts @@ -0,0 +1,72 @@ +// Type definitions for args 3.0 +// Project: https://github.com/leo/args#readme +// Definitions by: Slessi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const c: args; +export = c; + +interface args { + sub: string[]; + + option(name: string | [string, string], description: string, defaultValue?: any, init?: OptionInitFunction): args; + options(list: Option[]): args; + command(name: string, description: string, init?: (name: string, sub: string[], options: ConfigurationOptions) => void, aliases?: string[]): args; + example(usage: string, description: string): args; + examples(list: Example[]): args; + parse(argv: string[], options?: ConfigurationOptions): { [key: string]: any }; + showHelp(): void; +} + +type OptionInitFunction = (value: any) => any; + +interface MriOptions { + args?: string[]; + alias?: { + [key: string]: string | string[] + }; + boolean?: string | string[]; + default?: { + [key: string]: any + }; + string?: string | string[]; + unknown?: (param: string) => boolean; +} + +interface MinimistOptions { + string?: string | string[]; + boolean?: boolean | string | string[]; + alias?: { + [key: string]: string | string[] + }; + default?: { + [key: string]: any + }; + stopEarly?: boolean; + "--"?: boolean; + unknown?: (param: string) => boolean; +} + +interface ConfigurationOptions { + help?: boolean; + name?: string; + version?: boolean; + usageFilter?: (output: any) => any; + value?: string; + mri: MriOptions; + minimist?: MinimistOptions; + mainColor: string | string[]; + subColor: string | string[]; +} + +interface Option { + name: string | [string, string]; + description: string; + init?: OptionInitFunction; + defaultValue?: any; +} + +interface Example { + usage: string; + description: string; +} diff --git a/types/args/tsconfig.json b/types/args/tsconfig.json new file mode 100644 index 0000000000..d287417769 --- /dev/null +++ b/types/args/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", + "args-tests.ts" + ] +} \ No newline at end of file diff --git a/types/fecha/tslint.json b/types/args/tslint.json similarity index 100% rename from types/fecha/tslint.json rename to types/args/tslint.json diff --git a/types/argv/tslint.json b/types/argv/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/argv/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arr-union/arr-union-tests.ts b/types/arr-union/arr-union-tests.ts new file mode 100644 index 0000000000..7e46a3787e --- /dev/null +++ b/types/arr-union/arr-union-tests.ts @@ -0,0 +1,7 @@ +import union = require('arr-union'); + +// $ExpectType string[] +union(['a'], ['b', 'c'], ['d', 'e', 'f']); + +// $ExpectType number[] +union([1, 1], [2, 3]); diff --git a/types/arr-union/index.d.ts b/types/arr-union/index.d.ts new file mode 100644 index 0000000000..5893a55361 --- /dev/null +++ b/types/arr-union/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for arr-union 3.1 +// Project: https://github.com/jonschlinkert/arr-union +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function union(...arrays: Array>): T[]; + +export = union; diff --git a/types/arr-union/tsconfig.json b/types/arr-union/tsconfig.json new file mode 100644 index 0000000000..64a3b1efed --- /dev/null +++ b/types/arr-union/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "arr-union-tests.ts" + ] +} diff --git a/types/flatpickr/tslint.json b/types/arr-union/tslint.json similarity index 100% rename from types/flatpickr/tslint.json rename to types/arr-union/tslint.json diff --git a/types/array-foreach/tslint.json b/types/array-foreach/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/array-foreach/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arrify/index.d.ts b/types/arrify/index.d.ts index 896ee23224..a1dda1b9ec 100644 --- a/types/arrify/index.d.ts +++ b/types/arrify/index.d.ts @@ -12,7 +12,6 @@ * arrify(1) // returns [1] * @example * arrify([2, 3]) // returns [2, 3] - * @param val */ declare function arrify(val: undefined | null | T | T[]): T[]; export = arrify; diff --git a/types/artillery/artillery-tests.ts b/types/artillery/artillery-tests.ts new file mode 100644 index 0000000000..b79c3f1c52 --- /dev/null +++ b/types/artillery/artillery-tests.ts @@ -0,0 +1,13 @@ +import { ScenarioContext, Next } from 'artillery'; + +const scenarioContext: ScenarioContext = {vars: {}}; +scenarioContext.vars = {}; +scenarioContext.vars.testing = "value"; +scenarioContext.vars.testing2 = 1; + +const next: Next = (error?: Error) => { + // do nothing. +}; + +next(); +next(new Error()); diff --git a/types/artillery/index.d.ts b/types/artillery/index.d.ts new file mode 100644 index 0000000000..fbc5d41917 --- /dev/null +++ b/types/artillery/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for artillery 1.6 +// Project: https://github.com/shoreditch-ops/artillery#readme +// Definitions by: Kira McCoan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 +import * as request from 'request'; +import * as events from 'events'; + +export interface ScenarioContext { vars: {[key: string]: any}; } +export type Next = (err?: Error) => void; +export type ResponseRequest = request.ResponseRequest; +export type RequestResponse = request.RequestResponse; +export type EventEmitter = events.EventEmitter; diff --git a/types/artillery/tsconfig.json b/types/artillery/tsconfig.json new file mode 100644 index 0000000000..0ad4bae0ee --- /dev/null +++ b/types/artillery/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", + "artillery-tests.ts" + ] +} diff --git a/types/griddle-react/tslint.json b/types/artillery/tslint.json similarity index 100% rename from types/griddle-react/tslint.json rename to types/artillery/tslint.json diff --git a/types/artyom.js/artyom.js-tests.ts b/types/artyom.js/artyom.js-tests.ts deleted file mode 100644 index d301c9a6f4..0000000000 --- a/types/artyom.js/artyom.js-tests.ts +++ /dev/null @@ -1,32 +0,0 @@ -import artyomjs = require('artyom.js'); - -// Get an unique ArtyomJS instance -const artyom = artyomjs.ArtyomBuilder.getInstance(); - -// Add a command (not smart) -artyom.addCommands({ - description: 'Test command', - indexes: ['hello', 'hi'], - action: (i: number) => { - console.log('hello action'); - } -}); - -// Add a smart command -artyom.addCommands({ - description: 'Test command 2', - smart: true, - indexes: ['test *'], - action: (i: number, wildcard: string) => { - console.log('wildcard: ', wildcard); - } -}); - -// Get the browser voices -artyom.getVoices(); - -// Get all supported languages for Artyom -artyom.getLanguage(); - -// Get the artyom.js version -artyom.getVersion(); diff --git a/types/artyom.js/index.d.ts b/types/artyom.js/index.d.ts deleted file mode 100644 index b4f85781c6..0000000000 --- a/types/artyom.js/index.d.ts +++ /dev/null @@ -1,511 +0,0 @@ -// Type definitions for artyom.js 1.0 -// Project: https://github.com/sdkcarlos/artyom.js -// Definitions by: Sema García (José Manuel García) -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * Extension of Window interface - */ -interface ArtyomWindow extends Window { - webkitSpeechRecognition: any; - SpeechRecognition: any; - SpeechSynthesisUtterance: any; -} - -interface SpeechRecognition extends EventTarget { - grammars: SpeechGrammarList; - lang: string; - continuous: boolean; - interimResults: boolean; - maxAlternatives: number; - serviceURI: string; - start(): void; - stop(): void; - abort(): void; - onaudiostart(ev: Event): any; - onsoundstart(ev: Event): any; - onspeechstart(ev: Event): any; - onspeechend(ev: Event): any; - onsoundend(ev: Event): any; - onresult(ev: SpeechRecognitionEvent): any; - onnomatch(ev: SpeechRecognitionEvent): any; - onerror(ev: SpeechRecognitionError): any; - onstart(ev: Event): any; - onend(ev: Event): any; -} - -interface SpeechRecognitionStatic { - prototype: SpeechRecognition; - new (): SpeechRecognition; -} - -declare var SpeechRecognition: SpeechRecognitionStatic; -declare var webkitSpeechRecognition: SpeechRecognitionStatic; - -interface SpeechRecognitionError extends Event { - error: string; - message: string; -} - -interface SpeechRecognitionAlternative { - transcript: string; - confidence: number; -} - -interface SpeechRecognitionResult { - length: number; - item(index: number): SpeechRecognitionAlternative; - [index: number]: SpeechRecognitionAlternative; - isFinal: boolean; -} - -interface SpeechRecognitionResultList { - length: number; - item(index: number): SpeechRecognitionResult; - [index: number]: SpeechRecognitionResult; -} - -interface SpeechRecognitionEvent extends Event { - resultIndex: number; - results: SpeechRecognitionResultList; - interpretation: any; - emma: Document; -} - -interface SpeechGrammar { - src: string; - weight: number; -} - -interface SpeechGrammarStatic { - prototype: SpeechGrammar; - new (): SpeechGrammar; -} - -declare var SpeechGrammar: SpeechGrammarStatic; -declare var webkitSpeechGrammar: SpeechGrammarStatic; - -interface SpeechGrammarList { - length: number; - item(index: number): SpeechGrammar; - [index: number]: SpeechGrammar; - addFromURI(src: string, weight: number): void; - addFromString(string: string, weight: number): void; -} - -interface SpeechGrammarListStatic { - prototype: SpeechGrammarList; - new (): SpeechGrammarList; -} - -declare var SpeechGrammarList: SpeechGrammarListStatic; -declare var webkitSpeechGrammarList: SpeechGrammarListStatic; - -interface SpeechSynthesis extends EventTarget { - pending: boolean; - speaking: boolean; - paused: boolean; - - onvoiceschanged(ev: Event): any; - speak(utterance: SpeechSynthesisUtterance): void; - cancel(): void; - pause(): void; - resume(): void; - getVoices(): SpeechSynthesisVoice[]; -} - -interface SpeechSynthesisGetter { - speechSynthesis: SpeechSynthesis; -} - -declare var speechSynthesis: SpeechSynthesis; - -interface SpeechSynthesisUtterance extends EventTarget { - text: string; - lang: string; - voice: SpeechSynthesisVoice; - volume: number; - rate: number; - pitch: number; - - onstart(ev: SpeechSynthesisEvent): any; - onend(ev: SpeechSynthesisEvent): any; - onerror(ev: SpeechSynthesisErrorEvent): any; - onpause(ev: SpeechSynthesisEvent): any; - onresume(ev: SpeechSynthesisEvent): any; - onmark(ev: SpeechSynthesisEvent): any; - onboundary(ev: SpeechSynthesisEvent): any; -} - -interface SpeechSynthesisUtteranceStatic { - prototype: SpeechSynthesisUtterance; - new (text?: string): SpeechSynthesisUtterance; -} - -declare var SpeechSynthesisUtterance: SpeechSynthesisUtteranceStatic; - -interface SpeechSynthesisEvent extends Event { - utterance: SpeechSynthesisUtterance; - charIndex: number; - elapsedTime: number; - name: string; -} - -interface SpeechSynthesisErrorEvent extends SpeechSynthesisEvent { - error: string; -} - -interface SpeechSynthesisVoice { - voiceURI: string; - name: string; - lang: string; - localService: boolean; - default: boolean; -} - -declare namespace Artyom { - interface ArtyomDevice { - isChrome(): boolean; - isMobile(): boolean; - } - - interface ArtyomBrowserVoiceObject { - default: boolean; - lang: string; - localService: false; - name: string; - voiceURI: string; - } - - interface ArtyomConfigProperties { - /** Set the default language of artyom with this property */ - lang?: string; - recognizing?: boolean; - /** Choose if should listen one command and then stops, or listening forever */ - continuous?: boolean; - /** Moderates the speed with which Artyom talks (0 ~ 1) */ - speed?: number; - /** Adjust the volume of the voice of artyom */ - volume?: number; - /** If listen is equal to true the voice recognition will be started otherwise this property can be ignored */ - listen: boolean; - /** Recognition mode: normal, quick, remote */ - mode?: string; - /** Displays all the grammars recognized in the console */ - debug: boolean; - helpers?: { - redirectRecognizedTextOutput: any; - remoteProcessorHandler: any; - lastSay: any; - }; - /** Set a keyword that allows your command to be executed immediately when you say this word (Useful in noisy environments) */ - executionKeyword?: string; - /** Set a keyword that allows to enable the command recognition automatically if this word is recognized while artyom is paused (artyom.dontObey) */ - obeyKeyword?: string; - speaking?: boolean; - obeying?: boolean; - soundex?: boolean; - } - - interface ArtyomCommand { - /** Triggers of the command */ - indexes: string[]; - /** Logic to execute when the command is triggered */ - action(i: number, wildcard?: string, full?: string): void; - /** Description of the command */ - description?: string; - /** Flag to specify is a command is either normal or smart */ - smart?: boolean; - } - - interface ArtyomFlags { - restartRecognition: boolean; - } - - interface ArtyomRecognizer { - lang: string; - continuous: boolean; - interimResults: boolean; - start(): void; - stop(): void; - onstart(): void; - onresult(event: any): void; - onerror(event: any): void; - onend(): void; - } - - interface ArtyomJS { - /** - * Contains some basic information that artyom needs to know as the type of device and browser - * @see http://ourcodeworld.com/projects/projects-documentation/6/read-doc/artyom-device/artyom-js - */ - device: ArtyomDevice; - - /** - * Object which provides the speech interface, and set some of its attributes and event handlers - */ - artyomWSR: ArtyomRecognizer; - - /** - * Artyom can return inmediately the voices available in your browser. - * @see http://ourcodeworld.com/projects/projects-documentation/14/read-doc/artyom-getvoices/artyom-js - * @returns {Array} - */ - getVoices(): SpeechSynthesisVoice[]; - - /** - * Returns an array with all the available commands for artyom. - * @see http://ourcodeworld.com/projects/projects-documentation/10/read-doc/artyom-getavailablecommands/artyom-js - * @returns {Array} - */ - getAvailableCommands(): ArtyomCommand[]; - - /** - * Set up artyom for the application. This function will set the default language used by artyom - * or notice the user if artyom is not supported in the actual browser. - * @see http://ourcodeworld.com/projects/projects-documentation/15/read-doc/artyom-initialize/artyom-js - * @param {ArtyomConfigProperties} config - * @returns {Boolean} - */ - initialize(config: ArtyomConfigProperties): boolean; - - /** - * Force artyom to stop listen even if is in continuos mode. - * @see http://ourcodeworld.com/projects/projects-documentation/9/read-doc/artyom-fatality/artyom-js - * @returns {Boolean} - */ - fatality(): boolean; - - /** - * Add dinamically commands to artyom using. You can even add commands while artyom is active. - * @see http://ourcodeworld.com/projects/projects-documentation/4/read-doc/artyom-addcommands/artyom-js - * @param {ArtyomCommand | Array[ArtyomCommand]} newCommand - * @returns {Boolean} - */ - addCommands(newCommand: ArtyomCommand | ArtyomCommand[]): boolean; - - /** - * Remove the commands of artyom with indexes that matches with the given text. - * @see http://ourcodeworld.com/projects/projects-documentation/19/read-doc/artyom-removecommands/artyom-js - * @param {string} identifier - * @returns {Array} - */ - removeCommands(identifier: string): number[]; - - /** - * Removes all the added commands of artyom. - * @see http://ourcodeworld.com/projects/projects-documentation/7/read-doc/artyom-emptycommands/artyom-js - * @returns {Array} - */ - emptyCommands(): ArtyomCommand[]; - - /** - * Stops the actual and pendings messages that artyom have to say. - * @see http://ourcodeworld.com/projects/projects-documentation/23/read-doc/artyom-shutup/artyom-js - */ - shutUp(): void; - - /** - * Returns an object with the actual properties of artyom. - * @see http://ourcodeworld.com/projects/projects-documentation/12/read-doc/artyom-getproperties/artyom-js - * @returns {ArtyomConfigProperties} - */ - getProperties(): ArtyomConfigProperties; - - /** - * Create a listener when an artyom action is called. - * @see http://ourcodeworld.com/projects/projects-documentation/24/read-doc/artyom-when/artyom-js - */ - when(event: any, action: any): any; - - /** - * Returns the code language of artyom according to initialize function. - * @see http://ourcodeworld.com/projects/projects-documentation/11/read-doc/artyom-getlanguage/artyom-js - * @returns {String} Language - */ - getLanguage(): string; - - /** - * Talks a text according to the given parameters (private function). - * @param {String} text Text to be spoken - * @param {Int} actualChunk Number of chunk of the - * @param {Int} totalChunks - * @param {any} callbacks - */ - artyomTalk(text: any, actualChunk: any, totalChunks: any, callbacks: any): any; - - /** - * Splits a string into an array of strings with a limited size (chunk_length). - * @param {String} input text to split into chunks - * @param {Integer} chunk_length limit of characters in every chunk - */ - splitStringByChunks(input: any, chunk_length: any): string[]; - - /** - * Process the given text into chunks and execute the private function artyom_talk. - * @param {String} message Text to be spoken - * @param {Object} callbacks { onStart, onEnd } - * @see http://ourcodeworld.com/projects/projects-documentation/20/read-doc/artyom-say/artyom-js - */ - say(message: any, callbacks: any): void; - - /** - * Repeats the last sentence that artyom said. Useful in noisy environments. - * @param {Boolean} returnObject If set to true, an object with the text and the timestamp when was executed will be returned. - * @see http://ourcodeworld.com/projects/projects-documentation/25/read-doc/artyom-repeatlastsay/artyom-js - */ - repeatLastSay(returnObject: any): void; - - /** - * Verify if the browser supports speechSynthesis. - * @see http://ourcodeworld.com/projects/projects-documentation/40/read-doc/artyom-speechsupported/artyom-js - * @returns {Boolean} - */ - speechSupported(): boolean; - - /** - * Verify if the browser supports webkitSpeechRecognition. - * @see http://ourcodeworld.com/projects/projects-documentation/39/read-doc/artyom-recognizingsupported/artyom-js - * @returns {Boolean} - */ - recognizingSupported(): boolean; - - /** - * Simulate a voice command via JS. - * @see http://ourcodeworld.com/projects/projects-documentation/22/read-doc/artyom-simulateinstruction/artyom-js - * @param {string} sentence - * @returns {Boolean} - */ - simulateInstruction(sentence: string): boolean; - - /** - * Returns an object with data of the matched element. - * @param {string} voiceCommand - * @returns {Object | Function}. There is a result field when the function should return a boolean value. - */ - artyomExecute(voiceCommand: string): any; - - /** - * Displays a message in the console if the artyom propery DEBUG is set to true. - * @param {string} error The error to be debugged - * @param {string} traceLevel Error level: { error | warn | info } - * @see http://ourcodeworld.com/projects/projects-documentation/38/read-doc/artyom-debug/artyom-js - */ - debug(stringEvent: string, traceLevel: string): void; - - /** - * Allows to retrieve the recognized spoken text of artyom and do something with it everytime something is recognized. - * @param {Function} action - * @returns {Boolean} - */ - redirectRecognizedTextOutput(action: () => void): boolean; - - /** - * Says a random quote and returns it's object. - * @param data - */ - sayRandom(data: any): any; - - /** - * Artyom provide an easy way to create a dictation for your user. Just create an instance and start and stop when you want. - */ - newDictation(settings: any): any; - - /** - * A voice prompt will be executed. - */ - newPrompt(config: any): any; - - /** - * Artyom awaits for orders when this function is executed. If artyom gets a first parameter the instance will be stopped. - */ - artyomHey(): any; - - /** - * This function will return the webkitSpeechRecognition object used by artyom retrieve it only to debug on it or get some - * values, do not make changes directly. - */ - getNativeApi(): any; - - /** - * This function returns a boolean according to the SpeechRecognition status if artyom is listening, will return true. - * Note: This is not a feature of SpeechRecognition, therefore this value hangs on the fiability of the onStart and onEnd - * events of the SpeechRecognition - * @returns {Boolean} - */ - isRecognizing(): boolean; - - /** - * This function returns a boolean according to the speechSynthesis status if artyom is speaking, will return true. - * Note: This is not a feature of speechSynthesis, therefore this value hangs on the fiability of the onStart and onEnd - * events of the speechSynthesis. - * @returns {Boolean} - */ - isSpeaking(): boolean; - - /** - * The SpeechSynthesisUtterance objects are stored in the artyom_garbage_collector variable to prevent the wrong behaviour - * of artyom.say. Use this method to clear all spoken SpeechSynthesisUtterance unused objects. - * @returns {Boolean} - */ - clearGarbageCollection(): any; - - /** - * Returns the SpeechSynthesisUtterance garbageobjects. - */ - getGarbageCollection(): any; - - /** - * Pause the processing of commands. Artyom still listening in the background and it can be resumed after a couple of seconds. - * @returns {Boolean} - */ - dontObey(): any; - - /** - * Allow artyom to obey commands again. - * @returns {Boolean} - */ - obey(): any; - - /** - * A boolean to check if artyom is obeying commands or not. - * @returns {Boolean} - */ - isObeying(): boolean; - - /** - * Process the recognized text if artyom is active in remote mode. - * @returns {Boolean} - */ - remoteProcessorService(action: any): any; - - /** - * Returns a string with the actual version of Artyom script. - * @returns {String} - */ - getVersion(): string; - - /** - * Add commands like an artisan. If you use artyom for simple - * tasks then probably you don't like to write a lot to achieve it. - * Use the artisan syntax to write less, but with the same accuracy. - * @disclaimer Not a promise-based implementation, just syntax. - * @returns {Object} - */ - on(indexes: any, smart: any): any; - } - - /** - * ArtyomBuilder bla, bla... - */ - class ArtyomBuilder { - /** - * Method to bla, bla, bla... - */ - static getInstance(): ArtyomJS; - } -} - -// tslint:disable-next-line:export-just-namespace -export = Artyom; -export as namespace Artyom; diff --git a/types/artyom.js/tsconfig.json b/types/artyom.js/tsconfig.json deleted file mode 100644 index 1a10beb9c8..0000000000 --- a/types/artyom.js/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "noImplicitThis": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "artyom.js-tests.ts" - ] -} \ No newline at end of file diff --git a/types/asana/tslint.json b/types/asana/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/asana/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ascii2mathml/ascii2mathml-tests.ts b/types/ascii2mathml/ascii2mathml-tests.ts index 7280900922..cbd63e649f 100644 --- a/types/ascii2mathml/ascii2mathml-tests.ts +++ b/types/ascii2mathml/ascii2mathml-tests.ts @@ -1,6 +1,6 @@ import * as ascii2mathml from 'ascii2mathml'; -const fn = ascii2mathml({}); // $ExpectType any +const fn = ascii2mathml({}); // $ExpectType ascii2mathml fn(''); // $ExpectType string ascii2mathml('', {}); // $ExpectType string diff --git a/types/ascii2mathml/index.d.ts b/types/ascii2mathml/index.d.ts index 2b02dfea15..dcb9f7bb98 100644 --- a/types/ascii2mathml/index.d.ts +++ b/types/ascii2mathml/index.d.ts @@ -28,7 +28,7 @@ interface ascii2mathml { /** * Converts ASCIIMath expression to MathML markup. - * @param asciimath {string} ASCIIMath expression + * @param asciimath ASCIIMath expression * @param options Options */ (asciimath: string, options?: Options): string; diff --git a/types/asciify/tslint.json b/types/asciify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/asciify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/askmethat-rating/askmethat-rating-tests.ts b/types/askmethat-rating/askmethat-rating-tests.ts deleted file mode 100644 index af985d6358..0000000000 --- a/types/askmethat-rating/askmethat-rating-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AskmethatRating, AskmethatRatingSteps } from "askmethat-rating"; - -const options = { - backgroundColor: "#e5e500", - hoverColor: "#ffff66", - fontClass: "fa fa-star", - minRating: 1, - maxRating: 5, - readonly: false, - step: AskmethatRatingSteps["OnePerOneStep"], - inputName: "AskmethatRating" -}; - -const div = document.createElement("div"); -const amcRating = new AskmethatRating(div, 2 , options); - -options.readonly = true; -amcRating.defaultOptions = options; diff --git a/types/askmethat-rating/index.d.ts b/types/askmethat-rating/index.d.ts deleted file mode 100644 index a183ecdc30..0000000000 --- a/types/askmethat-rating/index.d.ts +++ /dev/null @@ -1,142 +0,0 @@ -// Type definitions for askmethat-rating 0.3 -// Project: https://alexteixeira.github.io/Askmethat-Rating/ -// Definitions by: Alexandre Teixeira -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -export enum AskmethatRatingSteps { - /** - * Step 0.1 per 0.1 - */ - DecimalStep = 0, - /** - * Step 0.5 per 0.5 - */ - HalfStep = 1, - /** - * Step 1 per 1 - */ - OnePerOneStep = 2, -} -export interface AskmethatRatingOptions { - hoverColor?: string; - /** - * Color when the rating is not hovered - */ - backgroundColor?: string; - /** - * Mininmum rating that the user can set - */ - minRating?: number; - /** - * Maximum rating that the plugin display - */ - maxRating?: number; - /** - * Class to display as rating (FontAwesome or Rating for exemple) - */ - fontClass: string; - /** - * Set the rating to readonly - */ - readonly: boolean; - /** - * The stepping for the rating - */ - step: AskmethatRatingSteps; - /** - * Input name (Default is AskmethatRating) - */ - inputName: string; -} -export class AskmethatRating { - private parentElement; - private pValue; - private styleSheet; - private changeEvent; - private ratingClick; - private mouseMove; - /** - * @function get the current value for the rating - */ - /** - * @function set a new value for the rating - * - * @param _value this is the new value you want to set to the rating - * @returns the current number - */ - value: number; - /** - * Default option base on @type IAskmethatRatingOptions - */ - private _defaultOptions; - /** - * @function get the default option for the rating - * - * @return options based on @type AskmethatRatingOptions - */ - /** - * @function set the default option for the rating - * - * @return options based on @type AskmethatRatingOptions - */ - defaultOptions: AskmethatRatingOptions; - /** - * constructor with div element, default rating value & default options - * - * @param element This is the html container for the rating elements - * @param defaultValue Default value set when the plugin render the rating - * @param options Default option base on AskmethatRatingOptions type - */ - constructor(element: HTMLDivElement, defaultValue?: number, options?: any); - /** - * render a new rating, by default value is the minRating - * - * @param value this is the default value set when the plugin is rendered, by default IAskmethatRatingOptions.minRating - */ - render(value?: number): void; - /** - * @function when a rating is clicked - * @param {type} event : Event {event object} - */ - private onRatingClick(event?); - /** - * @function Calculate the value according to the step provided in options - * @param {Number} value:number the current value - * @return {Number} the new value according to step - */ - protected getValueAccordingToStep(value: number): number; - /** - * @function mouse event enter in rating - * @param {type} event?: Event {event} - */ - private onMouseMove(event?); - /** - * @function mouse out event in rating - * @param {type} event?: Event {event} - */ - private onMouseLeave(event?); - /** - * @function set or unset the active class and color - * @param {HTMLSpanElement} current : current span element - * @param {number} current : value needed for the if - */ - protected setOrUnsetActive(value: number): void; - /** - * Check if disabled attribute is added or removed from the input - * Update readonly status if needed for the rating - */ - private mutationEvent(); - /** - * This is fired by mutation observer when an attribute changed in the hidden input - * Is protected to have some unit tests - * @param {MutationRecord[]} mutations list of mutations record - */ - protected mutationDisableEvent(mutations: MutationRecord[]): void; - /** - * @function static method to retrieve with identifier the value - * @param {string} identifier: string container identifier - * @return {number} current rating - */ - static value(identifier: string): number; -} diff --git a/types/askmethat-rating/tsconfig.json b/types/askmethat-rating/tsconfig.json deleted file mode 100644 index a41db58d7a..0000000000 --- a/types/askmethat-rating/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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", - "askmethat-rating-tests.ts" - ] -} \ No newline at end of file diff --git a/types/asn1js/tslint.json b/types/asn1js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/asn1js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aspnet-identity-pw/tslint.json b/types/aspnet-identity-pw/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aspnet-identity-pw/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/assertion-error/tslint.json b/types/assertion-error/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/assertion-error/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/assertsharp/tslint.json b/types/assertsharp/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/assertsharp/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/async-lock/tslint.json b/types/async-lock/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/async-lock/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/async-polling/tslint.json b/types/async-polling/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/async-polling/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/async-writer/tslint.json b/types/async-writer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/async-writer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 80f2888a8b..17fecb467b 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -11,10 +11,11 @@ export interface Dictionary { [key: string]: T; } export interface ErrorCallback { (err?: T): void; } export interface AsyncBooleanResultCallback { (err?: E, truthValue?: boolean): void; } export interface AsyncResultCallback { (err?: E, result?: T): void; } -export interface AsyncResultArrayCallback { (err?: E, results?: (T | undefined)[]): void; } +export interface AsyncResultArrayCallback { (err?: E, results?: Array): void; } export interface AsyncResultObjectCallback { (err: E | undefined, results: Dictionary): void; } export interface AsyncFunction { (callback: (err?: E, result?: T) => void): void; } +export interface AsyncFunctionEx { (callback: (err?: E, ...results: T[]) => void): void; } export interface AsyncIterator { (item: T, callback: ErrorCallback): void; } export interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } export interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } @@ -115,8 +116,12 @@ export const eachOfLimit: typeof forEachOfLimit; export function map(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export function map(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export const mapSeries: typeof map; -export function mapLimit(arr: T[] | IterableIterator, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function mapLimit(arr: Dictionary, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function mapLimit( + arr: T[] | Dictionary | IterableIterator, + limit: number, + iterator: AsyncResultIterator, + callback?: AsyncResultArrayCallback +): void; export function mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; export function mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; export const mapValuesSeries: typeof mapValues; @@ -164,6 +169,8 @@ export const allLimit: typeof everyLimit; export function concat(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export function concat(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function concatLimit(arr: T[] | IterableIterator, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function concatLimit(arr: Dictionary, limit: number,iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export const concatSeries: typeof concat; // Control Flow @@ -174,9 +181,9 @@ export function parallel(tasks: Dictionary>, callback? export function parallelLimit(tasks: Array>, limit: number, callback?: AsyncResultArrayCallback): void; export function parallelLimit(tasks: Dictionary>, limit: number, callback?: AsyncResultObjectCallback): void; export function whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; -export function doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; +export function doWhilst(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; export function until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; -export function doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; +export function doUntil(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; export function during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; export function doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; export function forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; @@ -221,7 +228,7 @@ export function memoize(fn: Function, hasher?: Function): Function; export function unmemoize(fn: Function): Function; export function ensureAsync(fn: (... argsAndCallback: any[]) => void): Function; export function constant(...values: any[]): Function; -export function asyncify(fn: Function): Function; +export function asyncify(fn: Function): (...args: any[]) => any; export function wrapSync(fn: Function): Function; export function log(fn: Function, ...args: any[]): void; export function dir(fn: Function, ...args: any[]): void; diff --git a/types/async/test/explicit.ts b/types/async/test/explicit.ts index b9ea9c84ed..0c0e1a44ee 100644 --- a/types/async/test/explicit.ts +++ b/types/async/test/explicit.ts @@ -47,13 +47,13 @@ interface NumberCallback { (err?: Error, result?: number): void; } interface AsyncNumberGetter { (callback: NumberCallback): void; } var taskDict: Lookup = { - one: function(callback){ - setTimeout(function(){ + one: function(callback) { + setTimeout(function() { callback(undefined, 1); }, 200); }, - two: function(callback){ - setTimeout(function(){ + two: function(callback) { + setTimeout(function() { callback(undefined, 2); }, 100); } diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 821ccd0650..3c6c2f5dfe 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -239,16 +239,16 @@ async.parallelLimit({ function whileFn(callback: any) { - count++; - setTimeout(callback, 1000); + setTimeout(() => callback(null, ++count), 1000); } function whileTest() { return count < 5; } +function doWhileTest(count: number) { return count < 5; } var count = 0; async.whilst(whileTest, whileFn, function (err) { }); async.until(whileTest, whileFn, function (err) { }); -async.doWhilst(whileFn, whileTest, function (err) { }); -async.doUntil(whileFn, whileTest, function (err) { }); +async.doWhilst(whileFn, doWhileTest, function (err) { }); +async.doUntil(whileFn, doWhileTest, function (err) { }); async.during(function (testCallback) { testCallback(new Error(), false); }, function (callback) { callback() }, function (error) { console.log(error) }); async.doDuring(function (callback) { callback() }, function (testCallback) { testCallback(new Error(), false); }, function (error) { console.log(error) }); diff --git a/types/async/tslint.json b/types/async/tslint.json index b1ab4a96cc..9380375afa 100644 --- a/types/async/tslint.json +++ b/types/async/tslint.json @@ -16,6 +16,7 @@ "no-void-expression": false, "object-literal-key-quotes": false, "object-literal-shorthand": false, + "one-line": false, "one-variable-per-declaration": false, "only-arrow-functions": false, "prefer-const": false, diff --git a/types/asyncblock/asyncblock-tests.ts b/types/asyncblock/asyncblock-tests.ts deleted file mode 100644 index d93c9fc07a..0000000000 --- a/types/asyncblock/asyncblock-tests.ts +++ /dev/null @@ -1,189 +0,0 @@ - -/// - -import asyncblock = require('asyncblock'); -import fs = require('fs'); - - -// Sleeping in series -asyncblock((flow: asyncblock.IFlow) => { - console.time('time'); - - setTimeout(flow.add(), 1000); - flow.wait(); //Wait for the first setTimeout to finish - - setTimeout(flow.add(), 2000); - flow.wait(); //Wait for the second setTimeout to finish - - console.timeEnd('time'); //3 seconds -}); - -// Trapping results -asyncblock((flow) => { - var path1 = '', path2 = ''; - //Start two parallel file reads - fs.readFile(path1, 'utf8', flow.set('contents1')); - fs.readFile(path2, 'utf8', flow.set('contents2')); - - //Print the concatenation of the results when both reads are finished - console.log(flow.get('contents1') + flow.get('contents2')); - - var paths: string[] = []; - //Wait for a large number of tasks - for(var i = 0; i < 100; i++){ - //Add each task in parallel with i as the key - fs.readFile(paths[i], 'utf8', flow.add(i)); - } - - //Wait for all the tasks to finish. Results is an object of the form {key1: value1, key2: value2, ...} - var results = flow.wait(); - - var path = ''; - //One-liner syntax for waiting on a single task - var contents = flow.sync( fs.readFile(path, 'utf8', flow.callback()) ); - - //See overview & API docs for more extensive description of techniques -}); - -// Error handling -var asyncTask = (callback: (err: any) => void) => { - asyncblock((flow) => { - flow.errorCallback = callback; //Setting the errorCallback is the easiest way to perform error handling. If erroCallback isn't set, and an error occurs, it will be thrown instead of returned to the callback - - var path = ''; - fs.readFile(path, 'utf8', flow.add()); //If readFile encountered an error, it would automatically get passed to the callback - var contents = flow.wait(); - - console.log(contents); //If an error occured above, this code won't run - }); -}; - -// Returning results -var asyncTask2 = (callback: (err: any, res: string) => void) => { - asyncblock((flow) => { - var path = ''; - var contents = flow.sync( fs.readFile(path, 'utf8', flow.callback()) ); //If readFile encountered an error, it would automatically get passed to the callback - - return contents; //Return the value you want to be passed to the callback - }, callback); //The callback can be specified as the 2nd arg to asyncblock. It will be called with the value returned from the asyncblock as the 2nd arg. - //If an error occurs, the callback will be called with the error as the first argument. -}; - - -// Sample -asyncblock.nostack((flow) => { - fs.readFile('path1', 'utf8', flow.add('first')); - fs.readFile('path2', 'utf8', flow.add('second')); - - //Wait until done reading the first and second files, then write them to another file - fs.writeFile('path3', flow.wait('first') + flow.wait('second'), flow.add()); - flow.wait(); //Wait on all outstanding tasks - - fs.readFile('path3', 'utf8', flow.add('data')); - - console.log(flow.wait('data')); //Print the 3rd file's data - console.log('all done'); -}); - - -// Formatting results -(function() { - -var asyncTask = function(callback: (err: any, res1: number, res2: number, res3: number) => void) { - process.nextTick(function() { - callback(null, 1, 2, 3); - }); -} - -asyncblock(function(flow) { - asyncTask(flow.add()); - - var result = flow.wait(); - console.log(result); // Prints 1 -}); - -asyncblock(function(flow) { - asyncTask(flow.add(['first', 'second', 'third'])); - - var result = flow.wait(); - console.log(result); // Prints { first: 1, second: 2, third: 3 } - - asyncTask(flow.add('key1', ['first', 'second', 'third'])); - asyncTask(flow.add('key2', ['a', 'b', 'c'])); - var result = flow.wait(); - console.log(result); // Prints { key1: { first: 1, second: 2, third: 3 }, key2: { a: 1, b: 2, c: 3} } -}); - -})(); - - -// Parallel task rate limiting -(function() { - -asyncblock(function(flow) { - flow.queue(function(callback: Function) { - setTimeout(callback, 1000); - }); - - flow.wait(); //This will wait for about a second -}); - -asyncblock(function(flow) { - flow.maxParallel = 2; - - process.nextTick(function(){ - flow.queue(function(callback: Function) { - setTimeout(callback, 1000); - }); - - flow.queue(function(callback: Function) { - setTimeout(callback, 2000); - }); - - flow.queue(function(callback: Function) { - setTimeout(callback, 3000); - }); - - flow.doneAdding(); - }); - - flow.forceWait(); -}); - -asyncblock(function(flow) { - setTimeout(flow.callback(), 1000); - - flow.queue(function(callback: Function) { - setTimeout(callback, 1000); - }); - flow.queue((callback: (err: any, res: string) => void) => { - callback(null, ''); - }); - - flow.wait(); -}); - -})(); - - -// Task timeouts -(function() { - -asyncblock(function(flow){ - setTimeout(flow.add({timeout: 1000, timeoutIsError: false}), 2000); - flow.wait(); //The fiber will yield here for 1 second, then continue - - //Code here will run -}); - -asyncblock(function(flow){ - flow.timeoutIsError = false; - - setTimeout(flow.add({timeout: 1000}), 2000); - flow.wait(); //The fiber will yield here for 1 second, then continue - - //Code here will run -}); - -})(); - diff --git a/types/asyncblock/index.d.ts b/types/asyncblock/index.d.ts deleted file mode 100644 index e848f509fb..0000000000 --- a/types/asyncblock/index.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Type definitions for asyncblock 2.1.23 -// Project: https://github.com/scriby/asyncblock -// Definitions by: Hiroki Horiuchi -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - - -declare function asyncblock(f: (flow: asyncblock.IFlow) => void, callback?: (err: any, res: T) => void): void; - -declare namespace asyncblock { - export function nostack(f: (flow: asyncblock.IFlow) => void, callback?: (err: any, res: T) => void): void; - - export interface IFlow { - add(responseFormat?: string[]): IExecuteFunction; - add(key: string, responseFormat?: string[]): IExecuteFunction; - add(key: number, responseFormat?: string[]): IExecuteFunction; - add(options: IFlowOptions): IExecuteFunction; - callback(responseFormat?: string[]): IExecuteFunction; - callback(key: string, responseFormat?: string[]): IExecuteFunction; - callback(key: number, responseFormat?: string[]): IExecuteFunction; - callback(options: IFlowOptions): IExecuteFunction; - wait(key?: string): T; - wait(key?: number): T; - - get(key: string): T; - set(key: string, responseFormat?: string[]): IExecuteFunction; - set(options: IFlowOptions): IExecuteFunction; - del(key: string): void; - - sync(task: any): T; - queue(toExecute: IExecuteFunction): void; - queue(key: string, toExecute: IExecuteFunction): void; - queue(key: number, toExecute: IExecuteFunction): void; - queue(responseFormat: string[], toExecute: IExecuteFunction): void; - queue(key: string, responseFormat: string[], toExecute: IExecuteFunction): void; - queue(key: number, responseFormat: string[], toExecute: IExecuteFunction): void; - queue(options: IFlowOptions, toExecute: IExecuteFunction): void; - doneAdding(): void; - forceWait(): T; - - maxParallel: number; - errorCallback: (err: any) => void; - taskTimeout: number; - timeoutIsError: boolean; - } - - export interface IFlowOptions { - ignoreError?: boolean; // default false - key?: string; // string | number - responseFormat?: string[]; - timeout?: number; - timeoutIsError?: boolean; - dontWait?: boolean; - firstArgIsError?: boolean; // default true - } - - export interface IExecuteFunction { - (err: any, res1: T1, res2: T2, res3: T3): any; - (err: any, res1: T1, res2: T2): any; - (err: any, res: T): any; - (err: any): any; - - // firstArgIsError === false - (res1: T1, res2: T2, res3: T3): any; - (res1: T1, res2: T2): any; - (res: T): any; - } - -} - -export = asyncblock; diff --git a/types/asyncblock/tsconfig.json b/types/asyncblock/tsconfig.json deleted file mode 100644 index c696706864..0000000000 --- a/types/asyncblock/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "asyncblock-tests.ts" - ] -} \ No newline at end of file diff --git a/types/asynciterator/asynciterator-tests.ts b/types/asynciterator/asynciterator-tests.ts new file mode 100644 index 0000000000..bd4b62c0fe --- /dev/null +++ b/types/asynciterator/asynciterator-tests.ts @@ -0,0 +1,135 @@ +import { ArrayIterator, AsyncIterator, BufferedIterator, ClonedIterator, EmptyIterator, IntegerIterator, + MultiTransformIterator, SingletonIterator, SimpleTransformIterator, TransformIterator } from "asynciterator"; + +function test_asynciterator() { + // We can't instantiate an abstract class. + const it1: AsyncIterator = {}; + const read1: number = it1.read(); + it1.each((data: number) => console.log(data)); + it1.each((data: number) => console.log(data), {}); + it1.close(); + + const it2: AsyncIterator = {}; + const read2: string = it2.read(); + it2.each((data: string) => console.log(data)); + it2.each((data: string) => console.log(data), {}); + it2.close(); + + const it3: AsyncIterator> = {}; + const read3: AsyncIterator = it3.read(); + it3.each((data: AsyncIterator) => data.each((data: string) => console.log(data))); + it3.each((data: AsyncIterator) => data.each((data: string) => console.log(data), {}), {}); + it3.close(); + + const readable2: boolean = it1.readable; + const closed2: boolean = it1.closed; + const ended2: boolean = it1.ended; + + it1.setProperty('name1', 123); + it2.setProperty('name2', 'someValue'); + const p1: number = it1.getProperty('name1'); + const p2: string = it1.getProperty('name2'); + it1.getProperty('name1', (value: number) => console.log(value)); + it1.getProperty('name2', (value: string) => console.log(value)); + const ps1: {[id: string]: any} = it1.getProperties(); + it1.setProperties({ name1: 1234, name2: 'someOtherValue' }); + it1.copyProperties(it2, [ 'name1', 'name2' ]); + + const str: string = it1.toString(); + + const stit1: SimpleTransformIterator = it1.transform(); + const stit2: SimpleTransformIterator = it1.map((number: number) => 'i' + number); + const stit3: AsyncIterator = it1.map((number: number) => 'i' + number); + const stit4: AsyncIterator = it2.map(parseInt); + const stit5: AsyncIterator = it1.map((number: number) => number + 1); + const stit6: AsyncIterator = it1.filter((number: number) => number < 10); + const stit7: AsyncIterator = it1.prepend([0, 1, 2]); + const stit8: AsyncIterator = it1.append([0, 1, 2]); + const stit9: AsyncIterator = it1.surround([0, 1, 2], [0, 1, 2]); + const stit10: AsyncIterator = it1.skip(2); + const stit11: AsyncIterator = it1.take(2); + const stit12: AsyncIterator = it1.range(2, 20); + const stit13: AsyncIterator = it1.clone(); + + const intit1: IntegerIterator = AsyncIterator.range(10, 100, 1); + const intit2: IntegerIterator = AsyncIterator.range(10, 100); + const intit3: IntegerIterator = AsyncIterator.range(10); + const intit4: IntegerIterator = AsyncIterator.range(); +} + +function test_emptyiterator() { + const it1: AsyncIterator = new EmptyIterator(); + const it2: AsyncIterator = new EmptyIterator(); +} + +function test_singletoniterator() { + const it1: AsyncIterator = new SingletonIterator(3); + const it2: AsyncIterator = new SingletonIterator('a'); +} + +function test_arrayiterator() { + const it1: AsyncIterator = new ArrayIterator([1, 2, 3]); + const it2: AsyncIterator = new ArrayIterator(['a', 'b', 'c']); +} + +function test_integeriterator() { + const it1: IntegerIterator = new IntegerIterator(); + const it2: AsyncIterator = new IntegerIterator({}); + const it3: AsyncIterator = new IntegerIterator({ start: 0 }); + const it4: AsyncIterator = new IntegerIterator({ end: 100 }); + const it5: AsyncIterator = new IntegerIterator({ step: 10 }); +} + +function test_bufferediterator() { + const it1: BufferedIterator = new BufferedIterator(); + const it2: AsyncIterator = new BufferedIterator({}); + const it3: AsyncIterator = new BufferedIterator({ maxBufferSize: 10 }); + const it4: AsyncIterator = new BufferedIterator({ autoStart: true }); +} + +function test_transformiterator() { + const it1: TransformIterator = new TransformIterator(); + const it2: AsyncIterator = new TransformIterator(); + const it3: AsyncIterator = new TransformIterator(it1); + const it4: AsyncIterator = new TransformIterator(it1, {}); + const it5: AsyncIterator = new TransformIterator(it1, { optional: true }); + const it6: AsyncIterator = new TransformIterator({ source: it1 }); + + const source: AsyncIterator = it1.source; +} + +function test_simpletransformiterator() { + const it1: SimpleTransformIterator = new SimpleTransformIterator(); + const it2: TransformIterator = new SimpleTransformIterator(); + const it3: AsyncIterator = new SimpleTransformIterator(); + const it4: AsyncIterator = new SimpleTransformIterator(it1); + const it5: AsyncIterator = new SimpleTransformIterator(it1, {}); + const it6: AsyncIterator = new SimpleTransformIterator({}); + const it7: AsyncIterator = new SimpleTransformIterator({ optional: true }); + const it8: AsyncIterator = new SimpleTransformIterator({ source: it1 }); + const it9: AsyncIterator = new SimpleTransformIterator({ offset: 2 }); + const it10: AsyncIterator = new SimpleTransformIterator({ limit: 2 }); + const it11: AsyncIterator = new SimpleTransformIterator({ prepend: [0, 1, 2] }); + const it12: AsyncIterator = new SimpleTransformIterator({ append: [0, 1, 2] }); + const it13: AsyncIterator = new SimpleTransformIterator( + { filter: (val: number) => val > 10 }); + const it14: AsyncIterator = new SimpleTransformIterator({ map: (val: number) => val + 1 }); + const it15: AsyncIterator = new SimpleTransformIterator( + { transform: (val: number, cb: (result: number) => void) => cb(val + 1) }); +} + +function test_multitransformiterator() { + const it1: MultiTransformIterator = new MultiTransformIterator(); + const it2: TransformIterator = new MultiTransformIterator(); + const it3: AsyncIterator = new MultiTransformIterator(); + const it4: AsyncIterator = new MultiTransformIterator(it1); + const it5: AsyncIterator = new MultiTransformIterator(it1, {}); + const it6: AsyncIterator = new MultiTransformIterator({}); + const it7: AsyncIterator = new MultiTransformIterator({ optional: true }); + const it8: AsyncIterator = new MultiTransformIterator({ source: it1 }); +} + +function test_clonediterator() { + const it1: ClonedIterator = new ClonedIterator(); + const it2: ClonedIterator = new ClonedIterator(it1); +} diff --git a/types/asynciterator/index.d.ts b/types/asynciterator/index.d.ts new file mode 100644 index 0000000000..950fb16bbd --- /dev/null +++ b/types/asynciterator/index.d.ts @@ -0,0 +1,164 @@ +// Type definitions for asynciterator 1.1 +// Project: https://github.com/rubenverborgh/AsyncIterator#readme +// Definitions by: Ruben Taelman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import { EventEmitter } from "events"; + +export abstract class AsyncIterator extends NodeJS.EventEmitter { + static STATES: ['INIT', 'OPEN', 'CLOSING', 'CLOSED', 'ENDED']; + static INIT: 0; + static OPEN: 1; + static CLOSING: 2; + static CLOSED: 3; + static ENDED: 4; + + _state: number; + _readable: boolean; + _destination?: AsyncIterator; + + readable: boolean; + closed: boolean; + ended: boolean; + + constructor(); + + read(): T; + each(callback: (data: T) => void, self?: any): void; + close(): void; + + _changeState(newState: number, eventAsync?: boolean): void; + private _hasListeners(eventName: string | symbol): boolean; + // tslint:disable-next-line ban-types + private _addSingleListener(eventName: string | symbol, listener: Function): void; + _end(): void; + + getProperty(propertyName: string, callback?: (value: any) => void): any; + setProperty(propertyName: string, value: any): void; + getProperties(): {[id: string]: any}; + setProperties(properties: {[id: string]: any}): void; + copyProperties(source: AsyncIterator, propertyNames: string[]): void; + + toString(): string; + _toStringDetails(): string; + + transform(options?: SimpleTransformIteratorOptions): SimpleTransformIterator; + map(mapper: (item: T) => T2, self?: object): SimpleTransformIterator; + filter(filter: (item: T) => boolean, self?: object): SimpleTransformIterator; + prepend(items: T[]): SimpleTransformIterator; + append(items: T[]): SimpleTransformIterator; + surround(prepend: T[], append: T[]): SimpleTransformIterator; + skip(offset: number): SimpleTransformIterator; + take(limit: number): SimpleTransformIterator; + range(start: number, end: number): SimpleTransformIterator; + clone(): ClonedIterator; + + static range(start?: number, end?: number, step?: number): IntegerIterator; +} + +export class EmptyIterator extends AsyncIterator { + _state: 4; +} + +export class SingletonIterator extends AsyncIterator { + constructor(item?: T); +} + +export class ArrayIterator extends AsyncIterator { + constructor(items?: T[]); +} + +export interface IntegerIteratorOptions { + step?: number; + end?: number; + start?: number; +} + +export class IntegerIterator extends AsyncIterator { + _step: number; + _last: number; + _next: number; + + constructor(options?: IntegerIteratorOptions); +} + +export interface BufferedIteratorOptions { + maxBufferSize?: number; + autoStart?: boolean; +} + +export class BufferedIterator extends AsyncIterator { + maxBufferSize: number; + _pushedCount: number; + _buffer: T[]; + + _init(autoStart: boolean): void; + _begin(done: () => void): void; + _read(count: number, done: () => void): void; + _push(item: T): void; + _fillBuffer(): void; + _completeClose(): void; + _flush(done: () => void): void; + + constructor(options?: BufferedIteratorOptions); +} + +export interface TransformIteratorOptions extends BufferedIteratorOptions { + optional?: boolean; + source?: AsyncIterator; +} + +export class TransformIterator extends BufferedIterator { + _optional: boolean; + source: AsyncIterator; + + _validateSource(source: AsyncIterator, allowDestination?: boolean): void; + _transform(item: S, done: (result: T) => void): void; + _closeWhenDone(): void; + + constructor(source?: AsyncIterator | TransformIteratorOptions, options?: TransformIteratorOptions); +} + +export interface SimpleTransformIteratorOptions extends TransformIteratorOptions { + offset?: number; + limit?: number; + prepend?: T[]; + append?: T[]; + + filter?(item: S): boolean; + map?(item: S): T; + transform?(item: S, callback: (result: T) => void): void; +} + +export class SimpleTransformIterator extends TransformIterator { + _offset: number; + _limit: number; + _prepender?: ArrayIterator; + _appender?: ArrayIterator; + + _filter?(item: S): boolean; + _map?(item: S): T; + _transform(item: S, done: (result: T) => void): void; + + _insert(inserter: AsyncIterator, done: () => void): void; + + constructor(source?: AsyncIterator | SimpleTransformIteratorOptions, + options?: SimpleTransformIteratorOptions); +} + +export class MultiTransformIterator extends TransformIterator { + _transformerQueue: S[]; + + _createTransformer(element: S): AsyncIterator; + + constructor(source?: AsyncIterator | TransformIteratorOptions, options?: TransformIteratorOptions); +} + +export class ClonedIterator extends TransformIterator { + _readPosition: number; + + constructor(source?: AsyncIterator); +} diff --git a/types/asynciterator/tsconfig.json b/types/asynciterator/tsconfig.json new file mode 100644 index 0000000000..8b8b919abc --- /dev/null +++ b/types/asynciterator/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", + "asynciterator-tests.ts" + ] +} diff --git a/types/flatpickr/v2/tslint.json b/types/asynciterator/tslint.json similarity index 100% rename from types/flatpickr/v2/tslint.json rename to types/asynciterator/tslint.json diff --git a/types/atmosphere.js/tslint.json b/types/atmosphere.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/atmosphere.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/atmosphere/atmosphere-tests.ts b/types/atmosphere/atmosphere-tests.ts deleted file mode 100644 index b353c2c947..0000000000 --- a/types/atmosphere/atmosphere-tests.ts +++ /dev/null @@ -1,46 +0,0 @@ - - -var socket = atmosphere; - -var request1:Atmosphere.Request = new atmosphere.AtmosphereRequest(); - -request1.url = document.location.toString() + 'chat'; -request1.contentType = "application/json"; -request1.transport = 'websocket'; -request1.fallbackTransport = 'long-polling'; - -var request2:Atmosphere.Request = { - url: 'http://localhost:8080/chat', - contentType: "application/json", - logLevel: 'debug', - transport: 'websocket', - fallbackTransport: 'long-polling' -}; - -request1.onError = function (response?:Atmosphere.Response) {}; -request1.onClose = function (response?:Atmosphere.Response) {}; -request1.onOpen = function (response?:Atmosphere.Response) {}; -request1.onMessage = function (response:Atmosphere.Response) {}; -request1.onReopen = function (request?:Atmosphere.Request, response?:Atmosphere.Response) {}; -request1.onReconnect = function (request?:Atmosphere.Request, response?:Atmosphere.Response) {}; -request1.onMessagePublished = function (response?:Atmosphere.Response) {}; -request1.onTransportFailure = function (reason?:string, response?:Atmosphere.Response) {}; -request1.onLocalMessage = function (request?:Atmosphere.Request) {}; -request1.onFailureToReconnect = function (request?:Atmosphere.Request, response?:Atmosphere.Response) {}; -request1.onClientTimeout = function (request?:Atmosphere.Request) {}; - -request1.subscribe = function (options:Atmosphere.Request) {}; -request1.execute = function () {}; -request1.close = function () {}; -request1.disconnect = function () {}; -request1.getUrl = function ():string { return "http://www.toedter.com" }; -request1.push = function (message:string, dispatchUrl?:string) {}; -request1.getUUID = function () {}; -request1.pushLocal = function (message:string) {}; - -var subSocket:Atmosphere.Request = socket.subscribe(request1); -var subSocket2:Atmosphere.Request = socket.subscribe('http://chat.com', function() {}, request2); -subSocket2.close(); - -subSocket.push("test"); -socket.unsubscribe(); \ No newline at end of file diff --git a/types/atmosphere/index.d.ts b/types/atmosphere/index.d.ts deleted file mode 100644 index 7b5565cb1d..0000000000 --- a/types/atmosphere/index.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Type definitions for Atmosphere v2.1.5 -// Project: https://github.com/Atmosphere/atmosphere-javascript -// Definitions by: Kai Toedter -// Fedor Kirpichev -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// This is deprecated due to module name change. Please use 'atmosphere.js' for future development.. - -declare namespace Atmosphere { - interface Atmosphere { - /** - * The atmosphere API is a little bit special here: the first parameter can either be - * a URL string or a Request object. If it is a URL string, then the additional parameters are expected. - */ - subscribe?: (requestOrUrl:any, callback?:Function, request?:Request) => Request; - unsubscribe?: () => void; - - AtmosphereRequest?: AtmosphereRequest; - } - - // needed to fit JavaScript "new atmosphere.AtmosphereRequest()" - // and compile with --noImplicitAny - interface AtmosphereRequest { - new(): Request; - } - - interface Request { - timeout?: number; - method?: string; - headers?: any; - contentType?: string; - callback?: Function; - url?: string; - data?: string; - suspend?: boolean; - maxRequest?: number; - reconnect?: boolean; - maxStreamingLength?: number; - lastIndex?: number; - logLevel?: string; - requestCount?: number; - fallbackMethod?: string; - fallbackTransport?: string; - transport?: string; - webSocketImpl?: any; - webSocketBinaryType?: any; - dispatchUrl?: string; - webSocketPathDelimiter?: string; - enableXDR?: boolean; - rewriteURL?: boolean; - attachHeadersAsQueryString?: boolean; - executeCallbackBeforeReconnect?: boolean; - readyState?: number; - lastTimestamp?: number; - withCredentials?: boolean; - trackMessageLength?: boolean; - messageDelimiter?: string; - connectTimeout?: number; - reconnectInterval?: number; - dropHeaders?: boolean; - uuid?: string; - async?: boolean; - shared?: boolean; - readResponsesHeaders?: boolean; - maxReconnectOnClose?: number; - enableProtocol?: boolean; - pollingInterval?: number; - - onError?: (response?:Response) => void; - onClose?: (response?:Response) => void; - onOpen?: (response?:Response) => void; - onMessage?: (response:Response) => void; - onReopen?: (request?:Request, response?:Response) => void; - onReconnect?: (request?:Request, response?:Response) => void; - onMessagePublished?: (response?:Response) => void; - onTransportFailure?: (reason?:string, response?:Response) => void; - onLocalMessage?: (request?:Request) => void; - onFailureToReconnect?: (request?:Request, response?:Response) => void; - onClientTimeout?: (request?:Request) => void; - - subscribe?: (options:Request) => void; - execute?: () => void; - close?: () => void; - disconnect?: () => void; - getUrl?: () => string; - push?: (message:string, dispatchUrl?:string) => void; - getUUID?: () => void; - pushLocal?: (message:string) => void; - } - - interface Response { - status?: number; - reasonPhrase?: string; - responseBody?: string; - messages?: string[]; - headers?: string[]; - state?: string; - transport?: string; - error?: string; - request?: Request; - partialMessage?: string; - errorHandled?: boolean; - closedByClientTimeout?: boolean; - } -} - -declare var atmosphere:Atmosphere.Atmosphere; -declare module 'atmosphere' { - export = atmosphere; -} diff --git a/types/atmosphere/tsconfig.json b/types/atmosphere/tsconfig.json deleted file mode 100644 index 2fb820bd91..0000000000 --- a/types/atmosphere/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "atmosphere-tests.ts" - ] -} \ No newline at end of file diff --git a/types/atom-keymap/README.md b/types/atom-keymap/README.md index f900dc1a4c..4c58abab17 100644 --- a/types/atom-keymap/README.md +++ b/types/atom-keymap/README.md @@ -19,3 +19,19 @@ Many of the types used by Atom Keymap can be referenced from the AtomKeymap name ```ts function example(keybind: AtomKeymap.KeyBinding) {} ``` + +### Exposing Private Methods and Properties + +[Declaration Merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) can be used to augment any of the types used within Atom Keymap. As an example, if we wanted to reveal the private ```partialMatchTimeout``` property within the KeymapManager class, then we would create a file with the following contents: + +```ts +// <>.d.ts + +declare namespace AtomKeymap { + interface KeymapManager { + partialMatchTimeout: number; + } +} +``` + +Once this file is either referenced or included within your project, then this new property would be freely usable on instances of the KeymapManager class without TypeScript reporting errors. diff --git a/types/atom-keymap/atom-keymap-tests.ts b/types/atom-keymap/atom-keymap-tests.ts index 6c8871c737..ac013b07eb 100644 --- a/types/atom-keymap/atom-keymap-tests.ts +++ b/types/atom-keymap/atom-keymap-tests.ts @@ -1,8 +1,9 @@ +import { Disposable } from "event-kit"; import KeymapManager = require("atom-keymap"); import * as ImportTest from "atom-keymap"; declare const element: HTMLElement; -declare let sub: EventKit.Disposable; +declare let sub: Disposable; declare const event: KeyboardEvent; // NPM Examples =============================================================== @@ -11,17 +12,17 @@ keymaps.defaultTarget = document.body; // Pass all the window's keydown events to the KeymapManager document.addEventListener("keydown", (event): void => { - keymaps.handleKeyboardEvent(event); + keymaps.handleKeyboardEvent(event); }); // Add some keymaps. It can also be a directory of json / cson files. keymaps.loadKeymap("/path/to/keymap-file.json"); // OR keymaps.add("/key/for/these/keymaps", { - body: { - up: "core:move-up", - down: "core:move-down", - }, + body: { + up: "core:move-up", + down: "core:move-down", + }, }); // When a keybinding is triggered, it will dispatch it on the node that was focused @@ -31,17 +32,17 @@ window.addEventListener("core:move-down", (event) => console.log("down", event)) // General Usage ============================================================== const manager = new KeymapManager(); manager.add("some/unique/path", { - ".workspace": { - "ctrl-x": "package:do-something", - "ctrl-y": "package:do-something-else", - }, - ".test": { - enter: "core:confirm", - }, + ".workspace": { + "ctrl-x": "package:do-something", + "ctrl-y": "package:do-something-else", + }, + ".test": { + enter: "core:confirm", + }, }); manager.onDidMatchBinding((event): void => { - console.log(event.binding.command); + console.log(event.binding.command); }); manager.destroy(); @@ -84,8 +85,8 @@ manager.handleKeyboardEvent(event); manager.keystrokeForKeyboardEvent(event); sub = manager.addKeystrokeResolver((event): string => { - event.layoutName; - return "Test"; + event.layoutName; + return "Test"; }); const num: number = manager.getPartialMatchTimeout(); diff --git a/types/atom-keymap/index.d.ts b/types/atom-keymap/index.d.ts index 9472e75215..3660fff3f4 100644 --- a/types/atom-keymap/index.d.ts +++ b/types/atom-keymap/index.d.ts @@ -2,235 +2,245 @@ // Project: https://github.com/atom/atom-keymap // Definitions by: GlenCFL // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 -/// +import { Disposable } from "event-kit"; declare global { - namespace AtomKeymap { - /** Objects that appear as parameters to callbacks. */ - namespace Events { - interface FullKeybindingMatch { - /** The string of keystrokes that matched the binding. */ - keystrokes: string; + namespace AtomKeymap { + /** + * The event objects that are passed into the callbacks which the user provides to + * specific API calls. + */ + namespace Events { + /** + * This custom subclass of CustomEvent exists to provide the ::abortKeyBinding + * method, as well as versions of the ::stopPropagation methods that record the + * intent to stop propagation so event bubbling can be properly simulated for + * detached elements. + */ + interface CommandEvent extends CustomEvent { + keyBindingAborted: boolean; + propagationStopped: boolean; - /** The KeyBinding that the keystrokes matched. */ - binding: KeyBinding; + abortKeyBinding(): void; + stopPropagation(): CustomEvent; + stopImmediatePropagation(): CustomEvent; + } - /** The DOM element that was the target of the most recent keyboard event. */ - keyboardEventTarget: Element; - } + interface FullKeybindingMatch { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; - interface PartialKeybindingMatch { - /** The string of keystrokes that matched the binding. */ - keystrokes: string; + /** The KeyBinding that the keystrokes matched. */ + binding: KeyBinding; - /** The KeyBindings that the keystrokes partially matched. */ - partiallyMatchedBindings: KeyBinding[]; + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - /** DOM element that was the target of the most recent keyboard event. */ - keyboardEventTarget: Element; - } + interface PartialKeybindingMatch { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; - interface FailedKeybindingMatch { - /** The string of keystrokes that failed to match the binding. */ - keystrokes: string; + /** The KeyBindings that the keystrokes partially matched. */ + partiallyMatchedBindings: KeyBinding[]; - /** The DOM element that was the target of the most recent keyboard event. */ - keyboardEventTarget: Element; - } + /** DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - interface FailedKeymapFileRead { - /** The error message. */ - message: string; + interface FailedKeybindingMatch { + /** The string of keystrokes that failed to match the binding. */ + keystrokes: string; - /** The error stack trace. */ - stack: string; - } + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - interface KeymapLoaded { - /** The path of the keymap file. */ - path: string; - } + interface FailedKeymapFileRead { + /** The error message. */ + message: string; - interface AddedKeystrokeResolver { - /** The currently resolved keystroke string. If your function returns a falsy - * value, this is how Atom will resolve your keystroke. - */ - keystroke: string; + /** The error stack trace. */ + stack: string; + } - /** The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation - * for more details. - */ - event: KeyboardEvent; + interface KeymapLoaded { + /** The path of the keymap file. */ + path: string; + } - /** The OS-specific name of the current keyboard layout. */ - layoutName: string; + interface AddedKeystrokeResolver { + /** + * The currently resolved keystroke string. If your function returns a falsy + * value, this is how Atom will resolve your keystroke. + */ + keystroke: string; - /** An object mapping DOM 3 `KeyboardEvent.code` values to objects with the - * typed character for that key in each modifier state, based on the current - * operating system layout. - */ - keymap: object; - } - } + /** + * The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation + * for more details. + */ + event: KeyboardEvent; - /** Objects that appear as parameters to functions. */ - namespace Options { - interface BuildKeyEvent { - ctrl?: boolean; - alt?: boolean; - shift?: boolean; - cmd?: boolean; - which?: number; - target?: Element; - } - } + /** The OS-specific name of the current keyboard layout. */ + layoutName: string; - /** The static side to each exported class. Should generally only be used internally. */ - namespace Statics { - /* tslint:disable:no-unnecessary-qualifier */ - /** The static side to the KeymapManager class. */ - interface KeymapManager { - /** Create a keydown DOM event. */ - buildKeydownEvent(key: string, options?: AtomKeymap.Options.BuildKeyEvent): void; + /** + * An object mapping DOM 3 `KeyboardEvent.code` values to objects with the + * typed character for that key in each modifier state, based on the current + * operating system layout. + */ + keymap: object; + } + } - /** Create a keyup DOM event. */ - buildKeyupEvent(key: string, options?: AtomKeymap.Options.BuildKeyEvent): void; + /** + * The option objects that the user is expected to fill out and provide to + * specific API calls. + */ + namespace Options { + interface BuildKeyEvent { + ctrl?: boolean; + alt?: boolean; + shift?: boolean; + cmd?: boolean; + which?: number; + target?: Element; + } + } - /** Create a new KeymapManager. */ - new (options?: { defaultTarget?: HTMLElement }): AtomKeymap.KeymapManager; - } - /* tslint:enable:no-unnecessary-qualifier */ - } + interface KeyBinding { + // Properties + enabled: boolean; + source: string; + command: string; + keystrokes: string; + keystrokeArray: string[]; + keystrokeCount: number; + selector: string; + specificity: number; - /** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding - * method, as well as versions of the ::stopPropagation methods that record the - * intent to stop propagation so event bubbling can be properly simulated for - * detached elements. - */ - interface CommandEvent extends CustomEvent { - keyBindingAborted: boolean; - propagationStopped: boolean; + // Comparison + /** Determines whether the given keystroke matches any contained within this binding. */ + matches(keystroke: string): boolean; - abortKeyBinding(): void; - stopPropagation(): CustomEvent; - stopImmediatePropagation(): CustomEvent; - } + /** + * Compare another KeyBinding to this instance. + * Returns <= -1 if the argument is considered lesser or of lower priority. + * Returns 0 if this binding is equivalent to the argument. + * Returns >= 1 if the argument is considered greater or of higher priority. + */ + compare(other: KeyBinding): number; + } - interface KeyBinding { - // Properties - enabled: boolean; - source: string; - command: string; - keystrokes: string; - keystrokeArray: string[]; - keystrokeCount: number; - selector: string; - specificity: number; + /** + * Allows commands to be associated with keystrokes in a context-sensitive way. + * In Atom, you can access a global instance of this object via `atom.keymaps`. + */ + interface KeymapManager { + defaultTarget: HTMLElement; - // Comparison - /** Determines whether the given keystroke matches any contained within this binding. */ - matches(keystroke: string): boolean; + partialMatchTimeout: number; - /** Compare another KeyBinding to this instance. - * Returns <= -1 if the argument is considered lesser or of lower priority. - * Returns 0 if this binding is equivalent to the argument. - * Returns >= 1 if the argument is considered greater or of higher priority. - */ - compare(other: KeyBinding): number; - } + /** Clear all registered key bindings and enqueued keystrokes. For use in tests. */ + clear(): void; - /** Allows commands to be associated with keystrokes in a context-sensitive way. - * In Atom, you can access a global instance of this object via `atom.keymaps`. - */ - /** Instance side of KeymapManager class. */ - interface KeymapManager { - defaultTarget: HTMLElement; + /** Unwatch all watched paths. */ + destroy(): void; - partialMatchTimeout: number; + // Event Subscription + /** + * Invoke the given callback when one or more keystrokes completely match a + * key binding. + */ + onDidMatchBinding(callback: (event: Events.FullKeybindingMatch) => void): + Disposable; - /** Clear all registered key bindings and enqueued keystrokes. For use in tests. */ - clear(): void; + /** Invoke the given callback when one or more keystrokes partially match a binding. */ + onDidPartiallyMatchBindings(callback: (event: Events.PartialKeybindingMatch) => + void): Disposable; - /** Unwatch all watched paths. */ - destroy(): void; + /** Invoke the given callback when one or more keystrokes fail to match any bindings. */ + onDidFailToMatchBinding(callback: (event: Events.FailedKeybindingMatch) => + void): Disposable; - // Event Subscription - /** Invoke the given callback when one or more keystrokes completely match a key binding. */ - onDidMatchBinding(callback: (event: Events.FullKeybindingMatch) => void): - EventKit.Disposable; + /** Invoke the given callback when a keymap file is reloaded. */ + onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void): Disposable; - /** Invoke the given callback when one or more keystrokes partially match a binding. */ - onDidPartiallyMatchBindings(callback: (event: Events.PartialKeybindingMatch) => - void): EventKit.Disposable; + /** Invoke the given callback when a keymap file is unloaded. */ + onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void): Disposable; - /** Invoke the given callback when one or more keystrokes fail to match any bindings. */ - onDidFailToMatchBinding(callback: (event: Events.FailedKeybindingMatch) => - void): EventKit.Disposable; + /** Invoke the given callback when a keymap file not able to be loaded. */ + onDidFailToReadFile(callback: (error: Events.FailedKeymapFileRead) => void): + Disposable; - /** Invoke the given callback when a keymap file is reloaded. */ - onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void): - EventKit.Disposable; + // Adding and Removing Bindings + /** Construct KeyBindings from an object grouping them by CSS selector. */ + build(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): KeyBinding[]; - /** Invoke the given callback when a keymap file is unloaded. */ - onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void): - EventKit.Disposable; + /** Add sets of key bindings grouped by CSS selector. */ + add(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): Disposable; - /** Invoke the given callback when a keymap file not able to be loaded. */ - onDidFailToReadFile(callback: (error: Events.FailedKeymapFileRead) => void): - EventKit.Disposable; + // Accessing Bindings + /** Get all current key bindings. */ + getKeyBindings(): KeyBinding[]; - // Adding and Removing Bindings - /** Construct KeyBindings from an object grouping them by CSS selector. */ - build(source: string, bindings: { [key: string]: { [key: string]: string }}, - priority?: number): KeyBinding[]; + /** Get the key bindings for a given command and optional target. */ + findKeyBindings(params?: { + keystrokes?: string, // e.g. 'ctrl-x ctrl-s' + command?: string, // e.g. 'editor:backspace' + target?: Element, + }): KeyBinding[]; - /** Add sets of key bindings grouped by CSS selector. */ - add(source: string, bindings: { [key: string]: { [key: string]: string }}, - priority?: number): EventKit.Disposable; + // Managing Keymap Files + /** Load the key bindings from the given path. */ + loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }): + void; - // Accessing Bindings - /** Get all current key bindings. */ - getKeyBindings(): KeyBinding[]; + /** + * Cause the keymap to reload the key bindings file at the given path whenever + * it changes. + */ + watchKeymap(filePath: string, options?: { priority: number }): void; - /** Get the key bindings for a given command and optional target. */ - findKeyBindings(params?: { - keystrokes?: string, // e.g. 'ctrl-x ctrl-s' - command?: string, // e.g. 'editor:backspace' - target?: Element, - }): KeyBinding[]; + // Managing Keyboard Events + /** + * Dispatch a custom event associated with the matching key binding for the + * given `KeyboardEvent` if one can be found. + */ + handleKeyboardEvent(event: KeyboardEvent): void; - // Managing Keymap Files - /** Load the key bindings from the given path. */ - loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }): - void; + /** Translates a keydown event to a keystroke string. */ + keystrokeForKeyboardEvent(event: KeyboardEvent): string; - /** Cause the keymap to reload the key bindings file at the given path whenever - * it changes. - */ - watchKeymap(filePath: string, options?: { priority: number }): void; + /** Customize translation of raw keyboard events to keystroke strings. */ + addKeystrokeResolver(resolver: (event: Events.AddedKeystrokeResolver) => string): + Disposable; - // Managing Keyboard Events - /** Dispatch a custom event associated with the matching key binding for the - * given `KeyboardEvent` if one can be found. - */ - handleKeyboardEvent(event: KeyboardEvent): void; + /** + * Get the number of milliseconds allowed before pending states caused by + * partial matches of multi-keystroke bindings are terminated. + */ + getPartialMatchTimeout(): number; + } - /** Translates a keydown event to a keystroke string. */ - keystrokeForKeyboardEvent(event: KeyboardEvent): string; + /** The static side to the KeymapManager class. */ + interface KeymapManagerStatic { + /** Create a keydown DOM event. */ + buildKeydownEvent(key: string, options?: Options.BuildKeyEvent): void; - /** Customize translation of raw keyboard events to keystroke strings. */ - addKeystrokeResolver(resolver: (event: Events.AddedKeystrokeResolver) => string): - EventKit.Disposable; + /** Create a keyup DOM event. */ + buildKeyupEvent(key: string, options?: Options.BuildKeyEvent): void; - /** Get the number of milliseconds allowed before pending states caused by - * partial matches of multi-keystroke bindings are terminated. - */ - getPartialMatchTimeout(): number; - } - } + /** Create a new KeymapManager. */ + new (options?: { defaultTarget?: HTMLElement }): KeymapManager; + } + } } -declare const KeymapManager: AtomKeymap.Statics.KeymapManager; +declare const KeymapManager: AtomKeymap.KeymapManagerStatic; export = KeymapManager; diff --git a/types/atom-keymap/tsconfig.json b/types/atom-keymap/tsconfig.json index f501df325f..8a17cc061c 100644 --- a/types/atom-keymap/tsconfig.json +++ b/types/atom-keymap/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/atom-keymap/tslint.json b/types/atom-keymap/tslint.json index 4b036f727a..e0508241c7 100644 --- a/types/atom-keymap/tslint.json +++ b/types/atom-keymap/tslint.json @@ -1,37 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - // Custom rules. - "class-name": true, - "indent": [true, "tabs"], - "jsdoc-format": true, + "indent": [true, "spaces", 4], "max-line-length": [true, 100], - "quotemark": [true, "double", "avoid-escape"], - "trailing-comma": [true, { - "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, - "singleline": { "objects": "never", "arrays": "never", "functions": "never" } - }], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-type", - "check-typecast", - "check-rest-spread", - "check-preblock" - ], - // Soon to be defaults. - "arrow-return-shorthand": [true, "multiline"], - "no-any": true, - "no-floating-promises": true, - "no-unbound-method": true, - "no-unsafe-any": true, - "number-literal-format": true, - "restrict-plus-operands": true, - "return-undefined": true, - "switch-final-break": true + "no-any": true } } diff --git a/types/atom-keymap/v5/.editorconfig b/types/atom-keymap/v5/.editorconfig deleted file mode 100644 index 570211f898..0000000000 --- a/types/atom-keymap/v5/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.ts] -indent_style = tab -indent_size = 4 diff --git a/types/atom-keymap/v5/atom-keymap-tests.ts b/types/atom-keymap/v5/atom-keymap-tests.ts deleted file mode 100644 index 1c92bff5c9..0000000000 --- a/types/atom-keymap/v5/atom-keymap-tests.ts +++ /dev/null @@ -1,20 +0,0 @@ - - -import { KeymapManager, ICompleteMatchEvent } from "atom-keymap"; - -var manager = new KeymapManager(); -manager.add('some/unique/path', { - '.workspace': { - 'ctrl-x': 'package:do-something', - 'ctrl-y': 'package:do-something-else' - }, - '.mini.editor': { - 'enter': 'core:confirm' - } -}); - -manager.onDidMatchBinding((event: ICompleteMatchEvent): void => { - console.log(event.binding.command); -}) - -manager.destroy(); diff --git a/types/atom-keymap/v5/index.d.ts b/types/atom-keymap/v5/index.d.ts deleted file mode 100644 index 9ffa0a41d3..0000000000 --- a/types/atom-keymap/v5/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for atom-keymap v5.1.5 -// Project: https://github.com/atom/atom-keymap/ -// Definitions by: Vadim Macagon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as AtomEventKit from 'event-kit'; - -export = AtomKeymap; - -declare namespace AtomKeymap { - type Disposable = AtomEventKit.Disposable; - - /** Instance side of KeyBinding class. */ - interface KeyBinding { - enabled: boolean; - source: string; - command: string; - keystrokes: string; - keystrokeCount: number; - selector: string; - specificity: number; - - matches(keystroke: string): boolean; - compare(keyBinding: KeyBinding): number; - } - - interface ICompleteMatchEvent { - /** Keystrokes that matched the binding. */ - keystrokes: string; - /** Binding that was matched to the keystrokes. */ - binding: KeyBinding; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } - - interface IPartialMatchEvent { - /** Keystrokes that matched the binding. */ - keystrokes: string; - /** Bindings that were partially matched to the keystrokes. */ - partiallyMatchedBindings: KeyBinding[]; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } - - interface IFailedMatchEvent { - /** Keystrokes that failed to match a binding. */ - keystrokes: string; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } - - interface IKeymapLoadEvent { - /** Path to a keymap file. */ - path: string; - } - - /** Static side of KeymapManager class. */ - interface KeymapManagerStatic { - prototype: KeymapManager; - new (options?: { defaultTarget?: Element }): KeymapManager; - } - - /** Instance side of KeymapManager class. */ - interface KeymapManager { - constructor: KeymapManagerStatic; - /** Unwatches all watched paths. */ - destroy(): void; - - // Event Subscription - - /** Sets callback to invoke when one or more keystrokes completely match a key binding. */ - onDidMatchBinding(callback: (event: ICompleteMatchEvent) => void): Disposable; - /** Sets callback to invoke when one or more keystrokes partially match a binding. */ - onDidPartiallyMatchBindings(callback: (event: IPartialMatchEvent) => void): Disposable; - /** Sets callback to invoke when one or more keystrokes fail to match any bindings. */ - onDidFailToMatchBinding(callback: (event: IFailedMatchEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file is reloaded. */ - onDidReloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file is unloaded. */ - onDidUnloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file could not to be loaded. */ - onDidFailToReadFile(callback: (error: Error) => void): Disposable; - - // Adding and Removing Bindings - - /** Adds sets of key bindings grouped by CSS selector. */ - add(source: string, keyBindingsBySelector: any): Disposable; - - // Accessing Bindings - - getKeyBindings(): KeyBinding[]; - findKeyBindings(params?: { - keystrokes: string; // e.g. 'ctrl-x ctrl-s' - command: string; // e.g. 'editor:backspace' - target?: Element; - }): KeyBinding[]; - - // Managing Keymap Files - - /** - * Loads the key bindings from the given path. - * - * @param bindingsPath A path to a file or a directory. If the path is a directory all files - * inside it will be loaded. - */ - loadKeymap(bindingsPath: string, options?: { watch: boolean }): void; - /** - * Starts watching the given file/directory for changes, reloading any keymaps at that location - * when changes are detected. - * - * @param filePath A path to a file or a directory. - */ - watchKeymap(filePath: string): void; - - // Managing Keyboard Events - - /** - * Dispatches a custom event associated with the matching key binding for the given - * `KeyboardEvent` if one can be found. - */ - handleKeyboardEvent(event: KeyboardEvent): void; - /** Translates a keydown event to a keystroke string. */ - keystrokeForKeyboardEvent(event: KeyboardEvent): string; - /** - * @return The number of milliseconds allowed before pending states caused by partial matches of - * multi-keystroke bindings are terminated. - */ - getPartialMatchTimeout(): number; - } - - /** Allows commands to be associated with keystrokes in a context-sensitive way.*/ - var KeymapManager: KeymapManagerStatic; -} diff --git a/types/atom-keymap/v5/tsconfig.json b/types/atom-keymap/v5/tsconfig.json deleted file mode 100644 index 4995308609..0000000000 --- a/types/atom-keymap/v5/tsconfig.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "atom-keymap": [ - "atom-keymap/v5" - ], - "event-kit": [ - "event-kit/v1" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "atom-keymap-tests.ts" - ] -} \ No newline at end of file diff --git a/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts b/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts index 434e48f261..0bc8205095 100644 --- a/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts +++ b/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts @@ -1,38 +1,39 @@ +import { AtomEnvironment, TestRunnerParams } from "atom"; import { createRunner } from "atom-mocha-test-runner"; import defaultMochaRunner = require("atom-mocha-test-runner"); const extraOptions = { - testSuffixes: ["-spec.js", "-spec.coffee"], + testSuffixes: ["-spec.js", "-spec.coffee"], }; function mochaSetup(mocha: Mocha) { - mocha.addFile("test.file"); + mocha.addFile("test.file"); } let testRunner = createRunner(); testRunner = createRunner(extraOptions); testRunner = createRunner(extraOptions, mochaSetup); testRunner = createRunner({ - colors: true, - globalAtom: true, - htmlTitle: "Test Title", - reporter: "dot", - testSuffixes: ["test.file"], + colors: true, + globalAtom: true, + htmlTitle: "Test Title", + reporter: "dot", + testSuffixes: ["test.file"], }); -declare const atom: Atom.AtomEnvironment; +declare const atom: AtomEnvironment; declare const blob: object; declare let num: number; async function runTests(): Promise { - const runnerArgs: Atom.Structures.TestRunnerArgs = { - testPaths: ["/var/test"], - logFile: "/var/log", - headless: false, - buildDefaultApplicationDelegate: () => blob, - buildAtomEnvironment: () => atom, - }; + const runnerArgs: TestRunnerParams = { + testPaths: ["/var/test"], + logFile: "/var/log", + headless: false, + buildDefaultApplicationDelegate: () => blob, + buildAtomEnvironment: () => atom, + }; - num = await defaultMochaRunner(runnerArgs); - return await testRunner(runnerArgs); + num = await defaultMochaRunner(runnerArgs); + return testRunner(runnerArgs); } diff --git a/types/atom-mocha-test-runner/index.d.ts b/types/atom-mocha-test-runner/index.d.ts index 432d91c71a..3a842f4a5c 100644 --- a/types/atom-mocha-test-runner/index.d.ts +++ b/types/atom-mocha-test-runner/index.d.ts @@ -4,24 +4,25 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// /// +import { TestRunner } from "atom"; + interface AtomMochaOptions { - /** Which reporter to use on the terminal. */ - reporter?: string; + /** Which reporter to use on the terminal. */ + reporter?: string; - /** Whether or not to assign the created Atom environment to `global.atom`. */ - globalAtom?: boolean; + /** Whether or not to assign the created Atom environment to `global.atom`. */ + globalAtom?: boolean; - /** File extensions that indicate that the file contains tests. */ - testSuffixes?: string[]; + /** File extensions that indicate that the file contains tests. */ + testSuffixes?: string[]; - /** Whether or not to colorize output on the terminal. */ - colors?: boolean; + /** Whether or not to colorize output on the terminal. */ + colors?: boolean; - /** The string to use for the window title in the HTML reporter. */ - htmlTitle?: string; + /** The string to use for the window title in the HTML reporter. */ + htmlTitle?: string; } // The test runner function is augmented on export by: @@ -30,9 +31,9 @@ interface AtomMochaOptions { // module.exports = createRunner() // module.exports.createRunner = createRunner // Which is what we're trying to model here. -interface TestRunnerExport extends AtomCore.TestRunner { - createRunner(options?: AtomMochaOptions, mochaConfigFunction?: - (mocha: Mocha) => void): AtomCore.TestRunner; +interface TestRunnerExport extends TestRunner { + createRunner(options?: AtomMochaOptions, mochaConfigFunction?: + (mocha: Mocha) => void): TestRunner; } declare const runner: TestRunnerExport; diff --git a/types/atom-mocha-test-runner/tsconfig.json b/types/atom-mocha-test-runner/tsconfig.json index 22df333ccd..c6e9fb20c0 100644 --- a/types/atom-mocha-test-runner/tsconfig.json +++ b/types/atom-mocha-test-runner/tsconfig.json @@ -9,7 +9,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/atom-mocha-test-runner/tslint.json b/types/atom-mocha-test-runner/tslint.json index 4b036f727a..e0508241c7 100644 --- a/types/atom-mocha-test-runner/tslint.json +++ b/types/atom-mocha-test-runner/tslint.json @@ -1,37 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - // Custom rules. - "class-name": true, - "indent": [true, "tabs"], - "jsdoc-format": true, + "indent": [true, "spaces", 4], "max-line-length": [true, 100], - "quotemark": [true, "double", "avoid-escape"], - "trailing-comma": [true, { - "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, - "singleline": { "objects": "never", "arrays": "never", "functions": "never" } - }], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-type", - "check-typecast", - "check-rest-spread", - "check-preblock" - ], - // Soon to be defaults. - "arrow-return-shorthand": [true, "multiline"], - "no-any": true, - "no-floating-promises": true, - "no-unbound-method": true, - "no-unsafe-any": true, - "number-literal-format": true, - "restrict-plus-operands": true, - "return-undefined": true, - "switch-final-break": true + "no-any": true } } diff --git a/types/atom/README.md b/types/atom/README.md deleted file mode 100644 index ba2d52a6f4..0000000000 --- a/types/atom/README.md +++ /dev/null @@ -1,42 +0,0 @@ -## Atom API Type Definitions - -TypeScript type definitions for the [Atom Text Editor](https://atom.io/) public API, which is used to develop packages for the editor. Documentation for the public API can be found [here](https://atom.io/docs/api/v1.21.0/). - -### Exports - -#### The "atom" Variable - -These definitions declare a global static variable named "atom" as ambient. Once these definitions have been referenced within your project, you will be able to access properties and member functions from the [AtomEnvironment](https://atom.io/docs/api/v1.21.0/AtomEnvironment) class off of this variable, as it is an instance of that class. - -```ts -if (atom.inDevMode()) {} -``` - -#### The Atom Namespace - -All of the types used by or referenced by the Atom public API have been pulled into the Atom namespace, providing a consistent and easy way to access each of them, without having to care about where that type actually lives within the Atom codebase. - -```ts -function example(buffer: Atom.TextBuffer) {} -``` - -#### The AtomCore Namespace - -All classes which are core to Atom itself have been provided under the AtomCore namespace. - -```ts -function example(cursor: AtomCore.Cursor) {} -``` - -### Service Type Definitions - -There are many services provided by other Atom packages that you may want to use within your own Atom package. We bundle type definitions for several of these services with these type definitions. - -```ts -/// -let completionProvider: Atom.Services.Autocomplete.Provider; -``` - -The currently supported services are: -- [Autocomplete](https://github.com/atom/autocomplete-plus) -- [Status Bar](https://github.com/atom/status-bar) diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index 34f19e5f3e..5fc92880f4 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -1,5 +1,8 @@ +import * as Atom from "atom"; + declare let str: string; declare let num: number; +declare let nums: number[]; declare let bool: boolean; declare let strs: string[]; declare let obj: object; @@ -9,2144 +12,3305 @@ declare let regExp: RegExp; declare let element: HTMLElement; declare let elements: HTMLElement[]; declare const div: HTMLDivElement; +declare const event: KeyboardEvent; +declare const mouseEvent: MouseEvent; -declare let grammar: Atom.Grammar; -declare let pos: Atom.Point; -declare let posArr: Atom.Point[]; -declare let range: Atom.Range; -declare let ranges: Atom.Range[]; -declare let marker: Atom.Marker; +declare let buffer: Atom.TextBuffer; +declare const color: Atom.Color; +declare let cursor: Atom.Cursor; +declare let cursors: Atom.Cursor[]; +declare let decoration: Atom.Decoration; +declare let decorations: Atom.Decoration[]; +declare let decorationLayerProps: Atom.DecorationLayerOptions; +declare let dir: Atom.Directory; +declare let dirs: Atom.Directory[]; declare let displayMarker: Atom.DisplayMarker; declare let displayMarkers: Atom.DisplayMarker[]; declare let displayMarkerLayer: Atom.DisplayMarkerLayer; -declare let sub: Atom.Disposable; -declare let dir: Atom.Directory; -declare let dirs: Atom.Directory[]; - -declare let buffer: Atom.TextBuffer; -declare let cursor: Atom.Cursor; -declare let cursors: Atom.Cursor[]; +declare let dock: Atom.Dock; declare let editor: Atom.TextEditor; declare let editors: Atom.TextEditor[]; -declare let decoration: Atom.Decoration; -declare let decorations: Atom.Decoration[]; +declare let emitter: Atom.Emitter; +declare let file: Atom.File; +declare let fileOrDir: Atom.File | Atom.Directory; +declare let grammar: Atom.Grammar; +declare let grammars: Atom.Grammar[]; +declare let gutter: Atom.Gutter; +declare let gutters: Atom.Gutter[]; +declare let historyPaths: Atom.ProjectHistory[]; +declare let layerDecoration: Atom.LayerDecoration; +declare let marker: Atom.Marker; +declare let markers: Atom.Marker[]; +declare let markerLayer: Atom.MarkerLayer; declare let notification: Atom.Notification; declare let notifications: Atom.Notification[]; -declare let scopeDescriptor: Atom.ScopeDescriptor; declare let pack: Atom.Package; declare let packs: Atom.Package[]; declare let pane: Atom.Pane; declare let panes: Atom.Pane[]; +declare let paneContainer: Atom.Dock|Atom.WorkspaceCenter; declare let panel: Atom.Panel; declare let panels: Atom.Panel[]; +declare let pos: Atom.Point; +declare let posArr: Atom.Point[]; declare let project: Atom.Project; +declare let range: Atom.Range; +declare let ranges: Atom.Range[]; +declare let registry: Atom.GrammarRegistry; declare let repository: Atom.GitRepository; declare let repositories: Atom.GitRepository[]; -declare let gutter: Atom.Gutter; -declare let gutters: Atom.Gutter[]; -declare let historyPaths: Atom.HistoryProject[]; -declare let layerDecoration: Atom.LayerDecoration; +declare let scopeDescriptor: Atom.ScopeDescriptor; declare let selection: Atom.Selection; declare let selections: Atom.Selection[]; declare let styleManager: Atom.StyleManager; +declare let subscription: Atom.Disposable; +declare let subscriptions: Atom.CompositeDisposable; declare let tooltips: Atom.Tooltip[]; -declare let dock: Atom.Dock; declare let workspaceCenter: Atom.WorkspaceCenter; -declare let paneContainer: Atom.Dock|Atom.WorkspaceCenter; +declare let pixelPos: Atom.PixelPosition; +declare let textEditorElement: Atom.TextEditorElement; +declare let textEditorComponent: Atom.TextEditorComponent; -// Exports Testing ============================================================ -import { BufferedNodeProcess, BufferedProcess, GitRepository, Notification, - TextBuffer, TextEditor, Point, Range, File, Directory, Emitter, Disposable, - CompositeDisposable, Task, watchPath } from "atom"; +// AtomEnvironment ============================================================ +function testAtomEnvironment() { + // Properties + subscription = atom.commands.add("test", { "execute-command": () => {}}); -const pathWatcher = watchPath("/var/test", {}, (events) => { - for (const event of events) { - str = event.path; - str = event.action; - if (event.oldPath) str = event.oldPath; - } -}); + str = atom.clipboard.read(); -// global "atom" -atom.commands; -atom.config; -atom.clipboard; -atom.contextMenu; -atom.menu; -atom.keymaps; -atom.tooltips; -atom.notifications; -atom.project; -atom.grammars; -atom.history; -atom.packages; -atom.themes; -atom.styles; -atom.deserializers; -atom.views; -atom.workspace; -atom.textEditors; -atom.onDidBeep((): void => {}); -atom.onWillThrowError((): void => {}); -atom.onDidThrowError((): void => {}); -atom.whenShellEnvironmentLoaded((): void => {}); -atom.inDevMode(); -atom.inSafeMode(); -atom.inSpecMode(); -atom.getVersion(); -str = atom.getReleaseChannel(); -atom.isReleasedVersion(); -atom.getWindowLoadTime(); + subscription = atom.contextMenu.add({ + "atom-workspace": [{label: "Help", command: "application:open-documentation"}], + "atom-text-editor": [{ + label: "History", + submenu: [ + { label: "Undo", command: "core:undo" }, + { label: "Redo", command: "core:redo" }, + ], + }], + }); -const loadSettings = atom.getLoadSettings(); -const testValue = loadSettings.env["test"]; -if (testValue) str = testValue; + subscription = atom.menu.add([{ + label: "Hello", + submenu : [{ label: "World!", command: "hello:world" }], + }]); -atom.open({ devMode: false, newWindow: true, pathsToOpen: ["Test.file"], - safeMode: false }); -atom.close(); -atom.getSize(); -atom.setSize(42, 42); -atom.getPosition(); -atom.setPosition(42, 42); -atom.pickFolder((): void => {}); + atom.keymaps.add("Test.Path", { + selector: { + a: "execute-something", + }, + }); -obj = atom.getCurrentWindow(); + subscription = atom.tooltips.add(div, { title: "Tooltip Test" }); -atom.center(); -atom.focus(); -atom.show(); -atom.hide(); -atom.reload(); -atom.restartApplication(); -atom.isMaximized(); -atom.isFullScreen(); -atom.setFullScreen(true); -atom.toggleFullScreen(); -atom.beep(); -atom.confirm({ buttons: ["Test"], detailedMessage: "Test", message: "Test" }); + notification = atom.notifications.addError("Error"); -async function toggleDevTools() { - await atom.openDevTools(); - await atom.toggleDevTools(); + atom.project.addPath("/var/test"); + + grammar = atom.grammars.loadGrammarSync("Test.file"); + + historyPaths = atom.history.getProjects(); + + subscription = atom.packages.onDidActivatePackage((atomPackage) => { + atomPackage.isCompatible(); + }); + + subscription = atom.themes.onDidChangeActiveThemes(() => {}); + + subscription = atom.styles.onDidAddStyleElement((styleElement) => {}); + + const serializer = { + name: "Test", + deserialize: () => ({}), + }; + atom.deserializers.add(serializer); + + subscription = atom.views.addViewProvider(Atom.Range, (range): HTMLElement => { + range.start; + return div; + }); + + subscription = atom.workspace.observeTextEditors((editor) => { + subscription = editor.onDidStopChanging((event) => { + for (const change of event.changes) { + change.newExtent; + } + }); + + const text: string[] = editor.getBuffer().getLines(); + }); + + atom.textEditors.add(editor); + + // Event Subscription + subscription = atom.onDidBeep(() => {}); + subscription = atom.onWillThrowError(event => event.message); + subscription = atom.onDidThrowError(event => event.line); + subscription = atom.whenShellEnvironmentLoaded(() => {}); + + // Atom Details + bool = atom.inDevMode(); + bool = atom.inSafeMode(); + bool = atom.inSpecMode(); + str = atom.getVersion(); + bool = atom.isReleasedVersion(); + num = atom.getWindowLoadTime(); + obj = atom.getLoadSettings(); + + // Managing The Atom Window + let dim: { width: number, height: number }; + let v2: { x: number, y: number }; + + // atom.open(params); + atom.close(); + dim = atom.getSize(); + atom.setSize(42, 42); + v2 = atom.getPosition(); + atom.setPosition(42, 42); + + atom.pickFolder((paths) => { + if (paths) { + paths.length; + } + }); + + atom.getCurrentWindow(); + atom.center(); + atom.focus(); + atom.show(); + atom.hide(); + atom.reload(); + atom.restartApplication(); + bool = atom.isMaximized(); + bool = atom.isFullScreen(); + atom.setFullScreen(true); + atom.toggleFullScreen(); + + // Messaging the User + atom.beep(); + + atom.confirm({ message: "Test" }); + atom.confirm({ message: "Test", buttons: [ "a", "b" ], detailedMessage: "Test" }); + num = atom.confirm({ message: "Test", detailedMessage: "Test", buttons: { + Test: () => { atom.beep(); }, + }}); + + // Managing the Dev Tools + async function manageDevTools() { + await atom.openDevTools(); + await atom.toggleDevTools(); + } + + atom.executeJavaScriptInDevTools("Test"); + + const path: string = atom.getConfigDirPath(); } -atom.executeJavaScriptInDevTools("Test"); +// BufferedNodeProcess ======================================================== +function testBufferedNodeProcess() { + const nodeProcess = new Atom.BufferedNodeProcess({ + command: "File.path", + }); -// Usage Testing ============================================================== -// Some examples taken from the Atom documentation. -// .commands -sub = atom.commands.add("test", { "execute-command": () => {}}); - -// .clipboard -str = atom.clipboard.read(); - -// .contextMenu -sub = atom.contextMenu.add({ - "atom-workspace": [{label: "Help", command: "application:open-documentation"}], - "atom-text-editor": [{ - label: "History", - submenu: [ - { label: "Undo", command: "core:undo" }, - { label: "Redo", command: "core:redo" }, - ], - }], -}); - -// .menu -sub = atom.menu.add([{ - label: "Hello", - submenu : [{ label: "World!", command: "hello:world" }], -}]); - -// .keymaps -atom.keymaps.add("Test.Path", { - selector: { - a: "execute-something", - }, -}); - -// .tooltips -sub = atom.tooltips.add(div, { title: "Tooltip Test" }); - -// .notifications -notification = atom.notifications.addError("Error"); - -// .project -atom.project.addPath("/var/test"); - -// .grammars -grammar = atom.grammars.loadGrammarSync("Test.file"); - -// .history -historyPaths = atom.history.getProjects(); - -// .packages -sub = atom.packages.onDidActivatePackage((atomPackage) => { - atomPackage.isCompatible(); -}); - -// .themes -sub = atom.themes.onDidChangeActiveThemes(() => {}); - -// .styles -sub = atom.styles.onDidAddStyleElement((styleElement) => {}); - -// .deserializers -const serializer = { - name: "Test", - deserialize: () => ({}), -}; -atom.deserializers.add(serializer); - -// .views -sub = atom.views.addViewProvider(Range, (range): HTMLElement => { - range.start; - return div; -}); - -// .workspace -sub = atom.workspace.observeTextEditors((editor) => { - sub = editor.onDidStopChanging((event) => { - for (const change of event.changes) { - change.newExtent; - } - }); - - const text: string[] = editor.getBuffer().getLines(); -}); - -// .textEditors -atom.textEditors.add(editor); - -// Atom API Testing =========================================================== -//// AtomEnvironment ========================================================== -// Event Subscription -sub = atom.onDidBeep(() => {}); -sub = atom.onWillThrowError(event => event.message); -sub = atom.onDidThrowError(event => event.line); -sub = atom.whenShellEnvironmentLoaded(() => {}); - -// Atom Details -bool = atom.inDevMode(); -bool = atom.inSafeMode(); -bool = atom.inSpecMode(); -str = atom.getVersion(); -bool = atom.isReleasedVersion(); -num = atom.getWindowLoadTime(); -obj = atom.getLoadSettings(); - -// Managing The Atom Window -declare let dim: { width: number, height: number }; -declare let v2: { x: number, y: number }; - -// atom.open(params); -atom.close(); -dim = atom.getSize(); -atom.setSize(42, 42); -v2 = atom.getPosition(); -atom.setPosition(42, 42); - -atom.pickFolder((paths) => { - if (paths) { - paths.length; - } -}); - -atom.getCurrentWindow(); -atom.center(); -atom.focus(); -atom.show(); -atom.hide(); -atom.reload(); -atom.restartApplication(); -bool = atom.isMaximized(); -bool = atom.isFullScreen(); -atom.setFullScreen(true); -atom.toggleFullScreen(); - -// Messaging the User -atom.beep(); - -atom.confirm({ message: "Test" }); -atom.confirm({ message: "Test", buttons: [ "a", "b" ], detailedMessage: "Test" }); -num = atom.confirm({ message: "Test", detailedMessage: "Test", buttons: { - Test: () => { atom.beep(); }, -}}); - -// Managing the Dev Tools -async function manageDevTools() { - await atom.openDevTools(); - await atom.toggleDevTools(); + new Atom.BufferedNodeProcess({ + command: "File.path", + args: [], + options: { + cwd: "/var/test", + detached: true, + }, + exit: (): void => {}, + stderr: (): void => {}, + stdout: (): void => {}, + }); } -atom.executeJavaScriptInDevTools("Test"); +// BufferedProcess ============================================================ +function testBufferedProcess() { + const process = new Atom.BufferedProcess({ + command: "File.path", + }); -//// BufferedNodeProcess ====================================================== -const nodeProcess = new BufferedNodeProcess({ - command: "File.path", -}); + new Atom.BufferedProcess({ + command: "File.path", + args: [], + options: {}, + exit: (): void => {}, + stderr: (): void => {}, + stdout: (): void => {}, + }); -new BufferedNodeProcess({ - command: "File.path", - args: [], - options: { - cwd: "/var/test", - detached: true, - }, - exit: (): void => {}, - stderr: (): void => {}, - stdout: (): void => {}, -}); + subscription = process.onWillThrowError((error) => { + error.error; + error.handle(); + }); -//// BufferedProcess ========================================================== -const process = new BufferedProcess({ - command: "File.path", -}); - -new BufferedProcess({ - command: "File.path", - args: [], - options: {}, - exit: (): void => {}, - stderr: (): void => {}, - stdout: (): void => {}, -}); - -sub = process.onWillThrowError((error) => { - error.error; - error.handle(); -}); - -process.kill(); - -//// Clipboard ================================================================ -atom.clipboard.read(); -atom.clipboard.write("Test"); -const clip = atom.clipboard.readWithMetadata(); -str = clip.text; -obj = clip.metadata; - -//// Color ==================================================================== -declare const color: Atom.Color; -str = color.toHexString(); -str = color.toRGBAString(); - -//// CommandRegistry ========================================================== -atom.commands.add("test", "test:function", (event) => {}); -atom.commands.add("test", { - "test-function": (event) => {}, - "test-function2": (event) => {}, -}); -atom.commands.add("test", "test:function", { - didDispatch: (event) => event.stopImmediatePropagation(), - description: "A Command Test", - displayName: "Command: Test", -}); - -const commands = atom.commands.findCommands({ target: element }); -atom.commands.dispatch(element, "test:function"); -sub = atom.commands.onWillDispatch((event) => { event.stopPropagation(); }); -sub = atom.commands.onDidDispatch((event) => { event.cancelable; }); - -//// CompositeDisposable -- See 'event-kit' testing. -//// Config =================================================================== -atom.config.observe("test", (event) => {}); -atom.config.observe("test", { scope: scopeDescriptor }, (value) => {}); - -atom.config.onDidChange((event) => { event.newValue; }); -atom.config.onDidChange("test", (event) => { event.oldValue; }); - -// Managing Settings -atom.config.get("test"); -atom.config.get("test", { scope: scopeDescriptor }); -atom.config.get("test", { excludeSources: ["test.source"] }); -atom.config.get("test", { sources: ["test.source"] }); -atom.config.get("test", { scope: scopeDescriptor, excludeSources: ["a"], - sources: ["b"] }); - -atom.config.set("test", 42); -atom.config.set("test", 42, { scopeSelector: "test-selector" }); -atom.config.set("test", 42, { source: "test" }); -atom.config.set("test", 42, {scopeSelector: "test-selector", source: "test" }); - -atom.config.unset("test"); -atom.config.unset("test", { scopeSelector: "test-selector" }); -atom.config.unset("test", { source: "test" }); -atom.config.unset("test", { scopeSelector: "test-selector", source: "test" }); - -const allConfigValues = atom.config.getAll("test"); -for (const { scopeDescriptor, value } of allConfigValues) { - scopeDescriptor.scopes; -} -atom.config.getAll("test", { scope: scopeDescriptor }); -atom.config.getAll("test", { excludeSources: ["test"] }); -atom.config.getAll("test", { sources: ["test"] }); -atom.config.getAll("test", { scope: scopeDescriptor, excludeSources: ["a"], - sources: ["b"] }); - -strs = atom.config.getSources(); - -atom.config.getSchema("test"); - -str = atom.config.getUserConfigPath(); - -atom.config.transact(() => {}); - -//// ContextMenuManager -- See above. -//// Cursor =================================================================== -// Event Subscription -sub = cursor.onDidChangePosition((event) => { event.newBufferPosition; }); -sub = cursor.onDidDestroy(() => {}); - -// Managing Cursor Position -cursor.setScreenPosition(pos); -cursor.setScreenPosition(pos, {}); -cursor.setScreenPosition(pos, { autoscroll: true }); - -pos = cursor.getScreenPosition(); - -cursor.setBufferPosition(pos); -cursor.setBufferPosition(pos, {}); -cursor.setBufferPosition(pos, { autoscroll: true }); - -pos = cursor.getBufferPosition(); -num = cursor.getScreenRow(); -num = cursor.getScreenColumn(); -num = cursor.getBufferRow(); -num = cursor.getBufferColumn(); -str = cursor.getCurrentBufferLine(); -bool = cursor.isAtBeginningOfLine(); -bool = cursor.isAtEndOfLine(); - -// Cursor Position Details -displayMarker = cursor.getMarker(); -bool = cursor.isSurroundedByWhitespace(); -bool = cursor.isBetweenWordAndNonWord(); - -bool = cursor.isInsideWord(); -bool = cursor.isInsideWord({}); -bool = cursor.isInsideWord({ wordRegex: regExp }); - -num = cursor.getIndentLevel(); -scopeDescriptor = cursor.getScopeDescriptor(); -bool = cursor.hasPrecedingCharactersOnLine(); -bool = cursor.isLastCursor(); - -// Moving the Cursor -cursor.moveUp(); -cursor.moveUp(42); -cursor.moveUp(42, {}); -cursor.moveUp(42, { moveToEndOfSelection: true }); - -cursor.moveDown(); -cursor.moveDown(42); -cursor.moveDown(42, {}); -cursor.moveDown(42, { moveToEndOfSelection: true }); - -cursor.moveLeft(); -cursor.moveLeft(42); -cursor.moveLeft(42, {}); -cursor.moveLeft(42, { moveToEndOfSelection: true }); - -cursor.moveRight(); -cursor.moveRight(42); -cursor.moveRight(42, {}); -cursor.moveRight(42, { moveToEndOfSelection: true }); - -cursor.moveToTop(); -cursor.moveToBottom(); -cursor.moveToBeginningOfScreenLine(); -cursor.moveToBeginningOfLine(); -cursor.moveToFirstCharacterOfLine(); -cursor.moveToEndOfScreenLine(); -cursor.moveToEndOfLine(); -cursor.moveToBeginningOfWord(); -cursor.moveToEndOfWord(); -cursor.moveToBeginningOfNextWord(); -cursor.moveToPreviousWordBoundary(); -cursor.moveToNextWordBoundary(); -cursor.moveToPreviousSubwordBoundary(); -cursor.moveToNextSubwordBoundary(); -cursor.skipLeadingWhitespace(); -cursor.moveToBeginningOfNextParagraph(); -cursor.moveToBeginningOfPreviousParagraph(); - -// Local Positions and Ranges -pos = cursor.getPreviousWordBoundaryBufferPosition(); -pos = cursor.getPreviousWordBoundaryBufferPosition({}); -pos = cursor.getPreviousWordBoundaryBufferPosition({ wordRegex: regExp }); - -cursor.getNextWordBoundaryBufferPosition(); -cursor.getNextWordBoundaryBufferPosition({ wordRegex: regExp }); - -cursor.getBeginningOfCurrentWordBufferPosition(); -cursor.getBeginningOfCurrentWordBufferPosition({}); -cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp }); -cursor.getBeginningOfCurrentWordBufferPosition({ allowPrevious: true }); -cursor.getBeginningOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); -cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp, - allowPrevious: true, includeNonWordCharacters: true }); - -cursor.getEndOfCurrentWordBufferPosition(); -cursor.getEndOfCurrentWordBufferPosition({}); -cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp }); -cursor.getEndOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); -cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp, includeNonWordCharacters: - true }); - -cursor.getBeginningOfNextWordBufferPosition(); -cursor.getBeginningOfNextWordBufferPosition({}); -cursor.getBeginningOfNextWordBufferPosition({ wordRegex: regExp }); - -cursor.getCurrentWordBufferRange(); -cursor.getCurrentWordBufferRange({}); -cursor.getCurrentWordBufferRange({ wordRegex: regExp }); - -cursor.getCurrentLineBufferRange(); -cursor.getCurrentLineBufferRange({}); -cursor.getCurrentLineBufferRange({ includeNewline: true }); - -range = cursor.getCurrentParagraphBufferRange(); -str = cursor.getCurrentWordPrefix(); - -// Comparing to another cursor -num = cursor.compare(cursor); - -// Utilities -cursor.clearSelection(); - -regExp = cursor.wordRegExp(); -regExp = cursor.wordRegExp({}); -regExp = cursor.wordRegExp({ includeNonWordCharacters: true }); - -regExp = cursor.subwordRegExp(); -regExp = cursor.subwordRegExp({}); -regExp = cursor.subwordRegExp({ backwards: true }); - -//// CustomTestRunner ========================================================= -// http://flight-manual.atom.io/hacking-atom/sections/writing-specs/#customizing-your-test-runner -const testRunner: Atom.TestRunner = (params) => { - const delegate = params.buildDefaultApplicationDelegate(); - const environment = params.buildAtomEnvironment({ - applicationDelegate: delegate, - configDirPath: "/var/test", - document, - enablePersistence: false, - window, - }); - const { width, height } = environment.getSize(); - return Promise.resolve(width + height); -}; - -//// Decoration =============================================================== -// Construction and Destruction -decoration.destroy(); - -// Event Subscription -sub = decoration.onDidChangeProperties(event => { event.oldProperties.gutterName; }); -sub = decoration.onDidDestroy(() => {}); - -// Decoration Details -num = decoration.getId(); -displayMarker = decoration.getMarker(); - -// Properties -const decorationProps = decoration.getProperties(); - -decoration.setProperties(decorationProps); - -//// DeserializerManager ====================================================== -class StorableClass { - name: string; - - constructor() {} - deserialize() { return {}; } + process.kill(); } -function isStorableClass(o: object): o is StorableClass { - if (typeof o === "object" && ( o).name && - ( o).name === "test") { - return true; - } else { - return false; - } +// Clipboard ================================================================== +function testClipboard() { + atom.clipboard.read(); + atom.clipboard.write("Test"); + const clip = atom.clipboard.readWithMetadata(); + str = clip.text; + obj = clip.metadata; } -let serializable = new StorableClass(); -atom.deserializers.add(serializable); -const blob = atom.deserializers.deserialize({ name: "test" }); -if (blob && isStorableClass(blob)) serializable = blob; - -//// Directory -- See 'pathwatcher' testing. -//// DisplayMarker -- See 'text-buffer' testing. -//// DisplayMarkerLayer -- See 'text-buffer' testing. -//// Disposable -- See 'event-kit' testing. -//// Dock ===================================================================== -// Methods -dock.activate(); -dock.show(); -dock.hide(); -dock.toggle(); -bool = dock.isVisible(); - -// Event Subscription -sub = dock.observePaneItems(() => {}); -sub = dock.onDidChangeActivePaneItem(() => {}); -sub = dock.onDidStopChangingActivePaneItem(() => {}); -sub = dock.observeActivePaneItem(() => {}); -sub = dock.onDidAddPane(event => event.pane.activate()); -sub = dock.onWillDestroyPane(event => event.pane); -sub = dock.onDidDestroyPane(event => event.pane); -sub = dock.observePanes(pane => pane.activate()); -sub = dock.onDidChangeActivePane(pane => pane.activate()); -sub = dock.observeActivePane(pane => pane.activate()); -sub = dock.onDidAddPaneItem(event => event.index && event.item && event.pane); -sub = dock.onWillDestroyPaneItem(event => event.index && event.item && event.pane); -sub = dock.onDidDestroyPaneItem(event => event.index && event.item && event.pane); - -// Pane Items -objs = dock.getPaneItems(); -obj = dock.getActivePaneItem(); - -// Panes -panes = dock.getPanes(); -pane = dock.getActivePane(); -bool = dock.activateNextPane(); -bool = dock.activatePreviousPane(); - -//// Emitter -- See 'event-kit' testing. -//// File -- See 'pathwatcher' testing. -//// GitRepository ============================================================ -// Construction and Destruction -repository = new GitRepository("Test"); -repository = new GitRepository("Test", {}); -repository = new GitRepository("Test", { refreshOnWindowFocus: true }); -repository = new GitRepository("Test", { config: atom.config }); -repository = new GitRepository("Test", { project: atom.project }); -repository = new GitRepository("Test", { refreshOnWindowFocus: false, config: atom.config, - project: atom.project }); -repository.destroy(); -bool = repository.isDestroyed(); - -// Event Subscription -sub = repository.onDidDestroy(() => {}); -sub = repository.onDidChangeStatus(event => event.path && event.pathStatus); -sub = repository.onDidChangeStatuses(() => {}); - -// Repository Details -repository.getType(); -str = repository.getPath(); -str = repository.getWorkingDirectory(); -bool = repository.isProjectAtRoot(); -str = repository.relativize(); -bool = repository.hasBranch("master"); - -str = repository.getShortHead(); -str = repository.getShortHead("test.path"); - -bool = repository.isSubmodule("test.path"); - -declare var aheadBehindCount: { ahead: number, behind: number }; -aheadBehindCount = repository.getAheadBehindCount("ref"); -aheadBehindCount = repository.getAheadBehindCount("ref", "test.path"); - -aheadBehindCount = repository.getCachedUpstreamAheadBehindCount(); -aheadBehindCount = repository.getCachedUpstreamAheadBehindCount("test.path"); - -str = repository.getConfigValue("username"); -str = repository.getConfigValue("username", "test.path"); - -str = repository.getOriginURL(); -str = repository.getOriginURL("test.path"); - -let upstreamBranch = repository.getUpstreamBranch(); -if (upstreamBranch) { - str = upstreamBranch; +// Color ====================================================================== +function testColor() { + str = color.toHexString(); + str = color.toRGBAString(); } -upstreamBranch = repository.getUpstreamBranch("test.path"); -if (upstreamBranch) { - str = upstreamBranch; +// CommandRegistry ============================================================ +function testCommandRegistry() { + atom.commands.add("test", "test:function", (event) => {}); + atom.commands.add("test", { + "test-function": (event) => {}, + "test-function2": (event) => {}, + }); + atom.commands.add("test", "test:function", { + didDispatch: (event) => event.stopImmediatePropagation(), + description: "A Command Test", + displayName: "Command: Test", + }); + atom.commands.add("atom-text-editor", { + "test-function": (event) => event.currentTarget.getModel(), + "test-function2": (event) => event.currentTarget.getComponent(), + }); + atom.commands.add("atom-workspace", { + "test-command": { + didDispatch: (event) => {}, + hiddenInCommandPalette: true + } + }); + + const commands = atom.commands.findCommands({ target: element }); + atom.commands.dispatch(element, "test:function"); + subscription = atom.commands.onWillDispatch((event) => { event.stopPropagation(); }); + subscription = atom.commands.onDidDispatch((event) => { event.cancelable; }); } -declare var gitReferences: { heads: string[], remotes: string[], tags: string[] }; -gitReferences = repository.getReferences(); -gitReferences = repository.getReferences("test.path"); +// CompositeDisposable ======================================================== +function testCompositeDisposable() { + // Construction and Lifecycle + subscriptions = new Atom.CompositeDisposable(); + new Atom.CompositeDisposable(subscription); + new Atom.CompositeDisposable(subscription, subscription); + new Atom.CompositeDisposable({ dispose() {} }); -str = repository.getReferenceTarget("ref"); -str = repository.getReferenceTarget("ref", "test.path"); + subscriptions.dispose(); -// Reading Status -bool = repository.isPathModified("file.path"); -bool = repository.isPathNew("file.path"); -bool = repository.isPathIgnored("file.path"); -num = repository.getDirectoryStatus("file.path"); -num = repository.getPathStatus("file.path"); + // Managing Disposables + subscriptions.add(subscription); + subscriptions.add( + subscription, + { dispose() {} } + ); -const cachedPathStatus = repository.getCachedPathStatus("file.path"); -if (cachedPathStatus) { - num = cachedPathStatus; + subscriptions.remove(subscription); + subscriptions.remove({ dispose() {} }); + + subscriptions.delete(subscription); + subscriptions.delete({ dispose() {} }); + + subscriptions.clear(); } -bool = repository.isStatusModified(42); -bool = repository.isStatusNew(42); +// Config ===================================================================== +function testConfig() { + atom.config.observe("test", (event) => {}); + atom.config.observe("test", { scope: scopeDescriptor }, (value) => {}); -// Retrieving Diffs -declare var diffStats: { added: number, deleted: number }; -diffStats = repository.getDiffStats("file.path"); + atom.config.onDidChange((event) => { event.newValue; }); + atom.config.onDidChange("test", (event) => { event.oldValue; }); -declare var lineDiffs: Array<{ oldStart: number, newStart: number, oldLines: number, - newLines: number }>; -lineDiffs = repository.getLineDiffs("file.path", "contents"); + // Managing Settings + atom.config.get("test"); + atom.config.get("test", { scope: scopeDescriptor }); + atom.config.get("test", { excludeSources: ["test.source"] }); + atom.config.get("test", { sources: ["test.source"] }); + atom.config.get("test", { scope: scopeDescriptor, excludeSources: ["a"], + sources: ["b"] }); -// Checking Out -bool = repository.checkoutHead("file.path"); -bool = repository.checkoutReference("ref", true); + atom.config.set("test", 42); + atom.config.set("test", 42, { scopeSelector: "test-selector" }); + atom.config.set("test", 42, { source: "test" }); + atom.config.set("test", 42, {scopeSelector: "test-selector", source: "test" }); -//// Grammar -- See 'first-mate' testing. -//// GrammarRegistry -- See 'first-mate' testing. -//// Gutter =================================================================== -// Gutter Destruction -gutter.destroy(); + atom.config.unset("test"); + atom.config.unset("test", { scopeSelector: "test-selector" }); + atom.config.unset("test", { source: "test" }); + atom.config.unset("test", { scopeSelector: "test-selector", source: "test" }); -// Event Subscription -sub = gutter.onDidChangeVisible(gutter => gutter.isVisible()); -sub = gutter.onDidDestroy(() => {}); + const allConfigValues = atom.config.getAll("test"); + for (const { scopeDescriptor, value } of allConfigValues) { + scopeDescriptor.scopes; + } + atom.config.getAll("test", { scope: scopeDescriptor }); + atom.config.getAll("test", { excludeSources: ["test"] }); + atom.config.getAll("test", { sources: ["test"] }); + atom.config.getAll("test", { scope: scopeDescriptor, excludeSources: ["a"], + sources: ["b"] }); -// Visibility -gutter.hide(); -gutter.show(); -bool = gutter.isVisible(); -decoration = gutter.decorateMarker(displayMarker, { type: "line-number" }); + strs = atom.config.getSources(); -//// HistoryManager =========================================================== -historyPaths = atom.history.getProjects(); -atom.history.clearProjects(); -sub = atom.history.onDidChangeProjects(() => {}); + atom.config.getSchema("test"); -//// KeymapManager -- See 'atom-keymap' testing. -//// LayerDecoration ========================================================== -layerDecoration.destroy(); -bool = layerDecoration.isDestroyed(); -layerDecoration.getProperties(); -declare let decorationLayerProps: Atom.Structures.DecorationLayerProps; -layerDecoration.setProperties(decorationLayerProps); -layerDecoration.setPropertiesForMarker(marker, { type: "line", class: "test-class" }); + str = atom.config.getUserConfigPath(); -//// MarkerLayer -- See 'text-buffer' testing. -//// MenuManager ============================================================== -sub = atom.menu.add([ - { - label: "Hello", - submenu : [{ label: "World!", command: "hello:world" }], - }, -]); -atom.menu.update(); - -//// Notification ============================================================= -notification = new Notification("fatal", "Test"); -notification = new Notification("success", "Test", {}); -notification = new Notification("info", "Test", { - buttons: [ - { className: "Test", text: "Test", onDidClick: () => {}}, - ], - description: "Test", - detail: "Test", - dismissable: false, - icon: "Test", -}); - -// Event Subscription -sub = notification.onDidDismiss(notification => notification.dismissed); -sub = notification.onDidDisplay(notification => notification.timestamp); - -// Methods -str = notification.getType(); -str = notification.getMessage(); - -// Extended Methods -notification.dismiss(); - -//// NotificationManager ====================================================== -// Events -atom.notifications.onDidAddNotification(notification => notification.dismiss()); - -// Adding Notifications -atom.notifications.addSuccess("Test"); -atom.notifications.addSuccess("Test", {}); -atom.notifications.addSuccess("Test", { - description: "Desc", - detail: "Details", - dismissable: true, - icon: "Icon", - buttons: [{ - text: "Button", - onDidClick: () => {}, - className: "test-class", - }], -}); - -atom.notifications.addInfo("Test"); -atom.notifications.addInfo("Test", {}); -atom.notifications.addInfo("Test", { description: "Desc" }); - -atom.notifications.addWarning("Test"); -atom.notifications.addWarning("Test", {}); -atom.notifications.addWarning("Test", { description: "Desc" }); - -atom.notifications.addError("Test"); -atom.notifications.addError("Test", {}); -atom.notifications.addError("Test", { stack: "Stack" }); - -atom.notifications.addFatalError("Test"); -atom.notifications.addFatalError("Test", {}); -atom.notifications.addFatalError("Test", { stack: "Stack" }); - -// Getting Notifications -notifications = atom.notifications.getNotifications(); - -//// Package ================================================================== -// Event Subscription -pack.onDidDeactivate(() => {}); - -// Native Module Compatibility -bool = pack.isCompatible(); -declare let exitInfo: Promise<{ code: number, stderr: string, stdout: string }>; -exitInfo = pack.rebuild(); - -const buildFailureOutput = pack.getBuildFailureOutput(); -if (buildFailureOutput) { - str = buildFailureOutput; + atom.config.transact(() => {}); } -//// PackageManager ===========================================================\ -// Event Subscription -sub = atom.packages.onDidLoadInitialPackages(() => {}); -sub = atom.packages.onDidActivateInitialPackages(() => {}); -sub = atom.packages.onDidActivatePackage(pack => pack.name); -sub = atom.packages.onDidDeactivatePackage(pack => pack.path); -sub = atom.packages.onDidLoadPackage(pack => pack.isCompatible()); -sub = atom.packages.onDidUnloadPackage(pack => pack.bundledPackage); +// Cursor ===================================================================== +function testCursor() { + // Event Subscription + subscription = cursor.onDidChangePosition((event) => { event.newBufferPosition; }); + subscription = cursor.onDidDestroy(() => {}); -// Package system data -str = atom.packages.getApmPath(); -strs = atom.packages.getPackageDirPaths(); + // Managing Cursor Position + cursor.setScreenPosition(pos); + cursor.setScreenPosition(pos, {}); + cursor.setScreenPosition(pos, { autoscroll: true }); -// General package data -const packagePath = atom.packages.resolvePackagePath("Test"); -if (packagePath) { - str = packagePath; + pos = cursor.getScreenPosition(); + + cursor.setBufferPosition(pos); + cursor.setBufferPosition(pos, {}); + cursor.setBufferPosition(pos, { autoscroll: true }); + + pos = cursor.getBufferPosition(); + num = cursor.getScreenRow(); + num = cursor.getScreenColumn(); + num = cursor.getBufferRow(); + num = cursor.getBufferColumn(); + str = cursor.getCurrentBufferLine(); + bool = cursor.isAtBeginningOfLine(); + bool = cursor.isAtEndOfLine(); + + // Cursor Position Details + displayMarker = cursor.getMarker(); + bool = cursor.isSurroundedByWhitespace(); + bool = cursor.isBetweenWordAndNonWord(); + + bool = cursor.isInsideWord(); + bool = cursor.isInsideWord({}); + bool = cursor.isInsideWord({ wordRegex: regExp }); + + num = cursor.getIndentLevel(); + scopeDescriptor = cursor.getScopeDescriptor(); + bool = cursor.hasPrecedingCharactersOnLine(); + bool = cursor.isLastCursor(); + + // Moving the Cursor + cursor.moveUp(); + cursor.moveUp(42); + cursor.moveUp(42, {}); + cursor.moveUp(42, { moveToEndOfSelection: true }); + + cursor.moveDown(); + cursor.moveDown(42); + cursor.moveDown(42, {}); + cursor.moveDown(42, { moveToEndOfSelection: true }); + + cursor.moveLeft(); + cursor.moveLeft(42); + cursor.moveLeft(42, {}); + cursor.moveLeft(42, { moveToEndOfSelection: true }); + + cursor.moveRight(); + cursor.moveRight(42); + cursor.moveRight(42, {}); + cursor.moveRight(42, { moveToEndOfSelection: true }); + + cursor.moveToTop(); + cursor.moveToBottom(); + cursor.moveToBeginningOfScreenLine(); + cursor.moveToBeginningOfLine(); + cursor.moveToFirstCharacterOfLine(); + cursor.moveToEndOfScreenLine(); + cursor.moveToEndOfLine(); + cursor.moveToBeginningOfWord(); + cursor.moveToEndOfWord(); + cursor.moveToBeginningOfNextWord(); + cursor.moveToPreviousWordBoundary(); + cursor.moveToNextWordBoundary(); + cursor.moveToPreviousSubwordBoundary(); + cursor.moveToNextSubwordBoundary(); + cursor.skipLeadingWhitespace(); + cursor.moveToBeginningOfNextParagraph(); + cursor.moveToBeginningOfPreviousParagraph(); + + // Local Positions and Ranges + pos = cursor.getPreviousWordBoundaryBufferPosition(); + pos = cursor.getPreviousWordBoundaryBufferPosition({}); + pos = cursor.getPreviousWordBoundaryBufferPosition({ wordRegex: regExp }); + + cursor.getNextWordBoundaryBufferPosition(); + cursor.getNextWordBoundaryBufferPosition({ wordRegex: regExp }); + + cursor.getBeginningOfCurrentWordBufferPosition(); + cursor.getBeginningOfCurrentWordBufferPosition({}); + cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp }); + cursor.getBeginningOfCurrentWordBufferPosition({ allowPrevious: true }); + cursor.getBeginningOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); + cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp, + allowPrevious: true, includeNonWordCharacters: true }); + + cursor.getEndOfCurrentWordBufferPosition(); + cursor.getEndOfCurrentWordBufferPosition({}); + cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp }); + cursor.getEndOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); + cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp, includeNonWordCharacters: + true }); + + cursor.getBeginningOfNextWordBufferPosition(); + cursor.getBeginningOfNextWordBufferPosition({}); + cursor.getBeginningOfNextWordBufferPosition({ wordRegex: regExp }); + + cursor.getCurrentWordBufferRange(); + cursor.getCurrentWordBufferRange({}); + cursor.getCurrentWordBufferRange({ wordRegex: regExp }); + + cursor.getCurrentLineBufferRange(); + cursor.getCurrentLineBufferRange({}); + cursor.getCurrentLineBufferRange({ includeNewline: true }); + + range = cursor.getCurrentParagraphBufferRange(); + str = cursor.getCurrentWordPrefix(); + + // Comparing to another cursor + num = cursor.compare(cursor); + + // Utilities + cursor.clearSelection(); + + regExp = cursor.wordRegExp(); + regExp = cursor.wordRegExp({}); + regExp = cursor.wordRegExp({ includeNonWordCharacters: true }); + + regExp = cursor.subwordRegExp(); + regExp = cursor.subwordRegExp({}); + regExp = cursor.subwordRegExp({ backwards: true }); } -bool = atom.packages.isBundledPackage("Test"); - -// Enabling and disabling packages -let potentialPack = atom.packages.enablePackage("Test"); -if (potentialPack) { - pack = potentialPack; +// TestRunner ================================================================= +function testTestRunner() { + const testRunner: Atom.TestRunner = (params) => { + const delegate = params.buildDefaultApplicationDelegate(); + const environment = params.buildAtomEnvironment({ + applicationDelegate: delegate, + configDirPath: "/var/test", + document, + enablePersistence: false, + window, + }); + const { width, height } = environment.getSize(); + return Promise.resolve(width + height); + }; } -potentialPack = atom.packages.disablePackage("Test"); -if (potentialPack) { - pack = potentialPack; +// Decoration ================================================================= +function testDecoration() { + // Construction and Destruction + decoration.destroy(); + + // Event Subscription + subscription = decoration.onDidChangeProperties(event => { event.oldProperties.gutterName; }); + subscription = decoration.onDidDestroy(() => {}); + + // Decoration Details + num = decoration.getId(); + displayMarker = decoration.getMarker(); + bool = decoration.isType("line-number"); + bool = decoration.isType(["line-number", "line"]); + + // Properties + const decorationProps = decoration.getProperties(); + + decoration.setProperties(decorationProps); } -bool = atom.packages.isPackageDisabled("Test"); +// DeserializerManager ======================================================== +function testDesializerManager() { + class StorableClass { + name: string; -// Accessing active packages -packs = atom.packages.getActivePackages(); + constructor() {} + deserialize() { return {}; } + } -potentialPack = atom.packages.getActivePackage("Test"); -if (potentialPack) { - pack = potentialPack; + function isStorableClass(o: object): o is StorableClass { + if (typeof o === "object" && ( o).name && + ( o).name === "test") { + return true; + } else { + return false; + } + } + + let serializable = new StorableClass(); + atom.deserializers.add(serializable); + const blob = atom.deserializers.deserialize({ name: "test" }); + if (blob && isStorableClass(blob)) serializable = blob; } -bool = atom.packages.isPackageActive("Test"); -bool = atom.packages.hasActivatedInitialPackages(); +// Directory ================================================================== +function testDirectory() { + // Construction + dir = new Atom.Directory("Test.file"); + new Atom.Directory("Test.file", true); -// Accessing loaded packages -packs = atom.packages.getLoadedPackages(); + async function createDirectory() { + bool = await dir.create(); + bool = await dir.create(0o0777); + } -potentialPack = atom.packages.getLoadedPackage("Test"); -if (potentialPack) { - pack = potentialPack; + // Event Subscription + subscription = dir.onDidChange(() => {}); + + // Directory Metadata + bool = dir.isFile(); + bool = dir.isDirectory(); + bool = dir.isSymbolicLink(); + + async function directoryExists() { + bool = await dir.exists(); + } + + bool = dir.existsSync(); + bool = dir.isRoot(); + + // Managing Paths + str = dir.getPath(); + str = dir.getRealPathSync(); + str = dir.getBaseName(); + dir.relativize("Test.file") ; + + // Traversing + dir = dir.getParent(); + file = dir.getFile("Test.file"); + dir = dir.getSubdirectory("Test"); + dir.getEntriesSync(); + dir.getEntries((error, entries) => {}); + bool = dir.contains("Test.file"); } -bool = atom.packages.isPackageLoaded("Test"); -bool = atom.packages.hasLoadedInitialPackages(); +// DisplayMarker ============================================================== +function testDisplayMarker() { + // Construction and Destruction + displayMarker.destroy(); -// Accessing available packages -strs = atom.packages.getAvailablePackagePaths(); -strs = atom.packages.getAvailablePackageNames(); -strs = atom.packages.getAvailablePackageMetadata(); + displayMarker = displayMarker.copy(); + displayMarker = displayMarker.copy({}); + displayMarker = displayMarker.copy({ + tailed: true, + reversed: false, + invalidate: "never", + exclusive: false, + properties: { deprecated: "property" }, + }); -//// Pane ===================================================================== -// Event Subscription -sub = pane.onDidChangeFlexScale(scale => num = scale); -sub = pane.observeFlexScale(scale => num = scale); -sub = pane.onDidActivate(() => {}); -sub = pane.onWillDestroy(() => {}); -sub = pane.onDidDestroy(() => {}); -sub = pane.onDidChangeActive(active => bool = active); -sub = pane.observeActive(active => bool = active); -sub = pane.onDidAddItem(event => event.index && event.item); -sub = pane.onDidRemoveItem(event => event.index && event.item); -sub = pane.onWillRemoveItem(event => event.index && event.item); -sub = pane.onDidMoveItem(event => event.item && event.oldIndex && event.newIndex); -sub = pane.observeItems((item) => {}); -sub = pane.onDidChangeActiveItem((item) => {}); -sub = pane.onChooseNextMRUItem((item) => {}); -sub = pane.onChooseLastMRUItem((item) => {}); -sub = pane.onDoneChoosingMRUItem(() => {}); -sub = pane.observeActiveItem((item) => {}); -sub = pane.onWillDestroyItem(event => event.index && event.item); + // Event Subscription + subscription = displayMarker.onDidChange((event) => { event.hasTail; }); + subscription = displayMarker.onDidDestroy(() => {}); -// Items -objs = pane.getItems(); -obj = pane.getActiveItem(); + // TextEditorMarker Details + bool = displayMarker.isValid(); + bool = displayMarker.isDestroyed(); + bool = displayMarker.isReversed(); + bool = displayMarker.isExclusive(); + str = displayMarker.getInvalidationStrategy(); + obj = displayMarker.getProperties(); + displayMarker.setProperties(obj); -let potentialItem = pane.itemAtIndex(42); -if (potentialItem) { - obj = potentialItem; + bool = displayMarker.matchesProperties({ + startBufferPosition: pos, + endBufferPosition: pos, + startScreenPosition: pos, + endScreenPosition: pos, + startsInBufferRange: range, + endsInBufferRange: range, + startsInScreenRange: range, + endsInScreenRange: range, + startBufferRow: num, + endBufferRow: num, + startScreenRow: num, + endScreenRow: num, + intersectsBufferRowRange: [num, num], + intersectsScreenRowRange: [num, num], + containsBufferRange: range, + containsBufferPosition: pos, + containedInBufferRange: range, + containedInScreenRange: range, + intersectsBufferRange: range, + intersectsScreenRange: range, + }); + bool = displayMarker.matchesProperties({ + intersectsBufferRange: [pos, pos], + }); + bool = displayMarker.matchesProperties({ + intersectsBufferRange: [pos, [0, 0]], + }); + bool = displayMarker.matchesProperties({ + intersectsBufferRange: [[0, 0], pos], + }); + bool = displayMarker.matchesProperties({ + intersectsBufferRange: [[0, 0], [0, 0]], + }); + + // Comparing to other markers + num = displayMarker.compare(displayMarker); + bool = displayMarker.isEqual(displayMarker); + + // Managing the marker's range + range = displayMarker.getBufferRange(); + range = displayMarker.getScreenRange(); + + displayMarker.setBufferRange(range); + displayMarker.setBufferRange([pos, pos]); + displayMarker.setBufferRange([pos, [0, 0]]); + displayMarker.setBufferRange([[0, 0], pos]); + displayMarker.setBufferRange([[0, 0], [0, 0]]); + displayMarker.setBufferRange(range, { reversed: true }); + + displayMarker.setScreenRange(range); + displayMarker.setScreenRange([pos, pos]); + displayMarker.setScreenRange([pos, [0, 0]]); + displayMarker.setScreenRange([[0, 0], pos]); + displayMarker.setScreenRange([[0, 0], [0, 0]]); + displayMarker.setScreenRange(range, { reversed: false }); + + pos = displayMarker.getStartScreenPosition(); + pos = displayMarker.getStartScreenPosition({ clipDirection: "backward" }); + + pos = displayMarker.getEndScreenPosition(); + pos = displayMarker.getEndScreenPosition({ clipDirection: "forward" }); + + // Extended Methods + pos = displayMarker.getHeadBufferPosition(); + displayMarker.setHeadBufferPosition(pos); + + displayMarker.getHeadScreenPosition(); + displayMarker.getHeadScreenPosition({ clipDirection: "closest" }); + + displayMarker.setHeadScreenPosition(pos); + displayMarker.setHeadScreenPosition([0, 0]); + displayMarker.setHeadScreenPosition(pos, { clipDirection: "backward" }); + + pos = displayMarker.getTailBufferPosition(); + + displayMarker.setTailBufferPosition(pos); + displayMarker.setTailBufferPosition([0, 0]); + + pos = displayMarker.getTailScreenPosition(); + pos = displayMarker.getTailScreenPosition({ clipDirection: "forward" }); + + displayMarker.setTailScreenPosition(pos); + displayMarker.setTailScreenPosition([0, 0]); + displayMarker.setTailScreenPosition(pos, { clipDirection: "closest" }); + + pos = displayMarker.getStartBufferPosition(); + pos = displayMarker.getEndBufferPosition(); + bool = displayMarker.hasTail(); + displayMarker.plantTail(); + displayMarker.clearTail(); } -pane.activateNextItem(); -pane.activatePreviousItem(); -pane.moveItemRight(); -pane.moveItemLeft(); -num = pane.getActiveItemIndex(); -pane.activateItemAtIndex(42); +// DisplayMarkerLayer ========================================================= +function testDisplayMarkerLayer() { + // Lifecycle + displayMarkerLayer.destroy(); + displayMarkerLayer.clear(); + bool = displayMarkerLayer.isDestroyed(); -pane.activateItem(element); -pane.activateItem(element, { pending: true }); + // Event Subscription + subscription = displayMarkerLayer.onDidDestroy(() => {}); + subscription = displayMarkerLayer.onDidUpdate(() => {}); + subscription = displayMarkerLayer.onDidCreateMarker((marker) => { marker.isReversed(); }); -obj = pane.addItem(element); -obj = pane.addItem(element, {}); -obj = pane.addItem(element, { pending: true }); -obj = pane.addItem(element, { index: 42 }); -obj = pane.addItem(element, { pending: true, index: 42 }); + // Marker creation + displayMarker = displayMarkerLayer.markScreenRange(range); + displayMarker = displayMarkerLayer.markScreenRange(range, {}); + displayMarker = displayMarkerLayer.markScreenRange(range, { clipDirection: "forward" }); + displayMarker = displayMarkerLayer.markScreenRange(range, { exclusive: true }); + displayMarker = displayMarkerLayer.markScreenRange(range, { invalidate: "never" }); + displayMarker = displayMarkerLayer.markScreenRange(range, { reversed: true }); + displayMarker = displayMarkerLayer.markScreenRange(range, { clipDirection: "backward", + exclusive: false, invalidate: "overlap", reversed: false }); + displayMarker = displayMarkerLayer.markScreenRange([pos, pos]); + displayMarker = displayMarkerLayer.markScreenRange([pos, [0, 0]]); + displayMarker = displayMarkerLayer.markScreenRange([[0, 0], pos]); + displayMarker = displayMarkerLayer.markScreenRange([[0, 0], [0, 0]]); + displayMarker = displayMarkerLayer.markScreenRange([[0, 0], pos], { reversed: true }); -objs = pane.addItems(objs); -objs = pane.addItems(objs, 42); + displayMarker = displayMarkerLayer.markScreenPosition(pos); + displayMarker = displayMarkerLayer.markScreenPosition(pos, {}); + displayMarker = displayMarkerLayer.markScreenPosition(pos, { clipDirection: "forward" }); + displayMarker = displayMarkerLayer.markScreenPosition(pos, { exclusive: true }); + displayMarker = displayMarkerLayer.markScreenPosition(pos, { invalidate: "never" }); + displayMarker = displayMarkerLayer.markScreenPosition(pos, { clipDirection: "backward", + exclusive: false, invalidate: "overlap" }); + displayMarker = displayMarkerLayer.markScreenPosition([0, 0]); + displayMarker = displayMarkerLayer.markScreenPosition([0, 0], { exclusive: false }); -pane.moveItem(element, 42); -pane.moveItemToPane(element, pane, 42); -pane.destroyActiveItem(); + displayMarker = displayMarkerLayer.markBufferRange(range); + displayMarker = displayMarkerLayer.markBufferRange(range, {}); + displayMarker = displayMarkerLayer.markBufferRange(range, { invalidate: "inside" }); + displayMarker = displayMarkerLayer.markBufferRange(range, { exclusive: true }); + displayMarker = displayMarkerLayer.markBufferRange(range, { reversed: true }); + displayMarker = displayMarkerLayer.markBufferRange(range, { exclusive: false, + invalidate: "overlap", reversed: false }); + displayMarker = displayMarkerLayer.markBufferRange([pos, pos]); + displayMarker = displayMarkerLayer.markBufferRange([pos, [0, 0]]); + displayMarker = displayMarkerLayer.markBufferRange([[0, 0], pos]); + displayMarker = displayMarkerLayer.markBufferRange([[0, 0], [0, 0]]); + displayMarker = displayMarkerLayer.markBufferRange([[0, 0], pos], { reversed: true }); -async function destroyAndWait() { - bool = await pane.destroyItem(element); - bool = await pane.destroyItem(element, true); + displayMarker = displayMarkerLayer.markBufferPosition(pos); + displayMarker = displayMarkerLayer.markBufferPosition(pos, {}); + displayMarker = displayMarkerLayer.markBufferPosition(pos, { exclusive: true }); + displayMarker = displayMarkerLayer.markBufferPosition(pos, { invalidate: "never" }); + displayMarker = displayMarkerLayer.markBufferPosition(pos, { exclusive: false, + invalidate: "overlap" }); + displayMarker = displayMarkerLayer.markBufferPosition([0, 0]); + displayMarker = displayMarkerLayer.markBufferPosition([0, 0], { exclusive: false }); + + // Querying + displayMarker = displayMarkerLayer.getMarker(42); + displayMarkers = displayMarkerLayer.getMarkers(); + num = displayMarkerLayer.getMarkerCount(); + + displayMarkers = displayMarkerLayer.findMarkers({ + startBufferPosition: pos, + endBufferPosition: pos, + startScreenPosition: pos, + endScreenPosition: pos, + startsInBufferRange: range, + endsInBufferRange: range, + startsInScreenRange: range, + endsInScreenRange: range, + startBufferRow: num, + endBufferRow: num, + startScreenRow: num, + endScreenRow: num, + intersectsBufferRowRange: [num, num], + intersectsScreenRowRange: [num, num], + containsBufferRange: range, + containsBufferPosition: pos, + containedInBufferRange: range, + containedInScreenRange: range, + intersectsBufferRange: range, + intersectsScreenRange: range, + }); + displayMarkers = displayMarkerLayer.findMarkers({ + intersectsScreenRange: [pos, pos], + }); + displayMarkers = displayMarkerLayer.findMarkers({ + intersectsScreenRange: [pos, [0, 0]], + }); + displayMarkers = displayMarkerLayer.findMarkers({ + intersectsScreenRange: [[0, 0], pos], + }); + displayMarkers = displayMarkerLayer.findMarkers({ + intersectsScreenRange: [[0, 0], [0, 0]], + }); } -pane.destroyItems(); -pane.destroyInactiveItems(); - -async function savePaneItem() { - await pane.saveActiveItem(); - let actionReturn = await pane.saveActiveItem(() => true); - if (actionReturn) bool = actionReturn; - - await pane.saveActiveItemAs(() => {}); - actionReturn = await pane.saveActiveItemAs(() => false); - - await pane.saveItem(element, () => {}); - let altActionReturn = await pane.saveItem(element, () => 42); - if (altActionReturn) num = altActionReturn; - - await pane.saveItemAs(element, () => {}); - altActionReturn = await pane.saveItemAs(element, () => 42); +// Disposable ================================================================= +function testDisposable() { + if (subscription.disposalAction) subscription.disposalAction(); + subscription.dispose(); } -pane.saveItems(); +// Dock ======================================================================= +function testDock() { + // Methods + dock.activate(); + dock.show(); + dock.hide(); + dock.toggle(); + bool = dock.isVisible(); -potentialItem = pane.itemForURI("https://test"); -if (potentialItem) { - obj = potentialItem; + // Event Subscription + subscription = dock.observePaneItems(() => {}); + subscription = dock.onDidChangeActivePaneItem(() => {}); + subscription = dock.onDidStopChangingActivePaneItem(() => {}); + subscription = dock.observeActivePaneItem(() => {}); + subscription = dock.onDidAddPane(event => event.pane.activate()); + subscription = dock.onWillDestroyPane(event => event.pane); + subscription = dock.onDidDestroyPane(event => event.pane); + subscription = dock.observePanes(pane => pane.activate()); + subscription = dock.onDidChangeActivePane(pane => pane.activate()); + subscription = dock.observeActivePane(pane => pane.activate()); + subscription = dock.onDidAddPaneItem(event => event.index && event.item && event.pane); + subscription = dock.onWillDestroyPaneItem(event => { + event.index && event.item && event.pane; + }); + subscription = dock.onDidDestroyPaneItem(event => { + event.index && event.item && event.pane; + }); + + // Pane Items + objs = dock.getPaneItems(); + obj = dock.getActivePaneItem(); + + // Panes + panes = dock.getPanes(); + pane = dock.getActivePane(); + bool = dock.activateNextPane(); + bool = dock.activatePreviousPane(); } -bool = pane.activateItemForURI("https://test"); - -// Lifecycle -bool = pane.isActive(); -pane.activate(); -pane.destroy(); -bool = pane.isDestroyed(); - -// Splitting -pane = pane.splitLeft(); -pane = pane.splitLeft({}); -pane = pane.splitLeft({ copyActiveItem: true }); -pane = pane.splitLeft({ items: elements }); -pane = pane.splitLeft({ copyActiveItem: true, items: elements }); - -pane = pane.splitRight(); -pane = pane.splitRight({}); -pane = pane.splitRight({ copyActiveItem: true }); -pane = pane.splitRight({ items: elements }); -pane = pane.splitRight({ copyActiveItem: true, items: elements }); - -pane = pane.splitUp(); -pane = pane.splitUp({}); -pane = pane.splitUp({ copyActiveItem: true }); -pane = pane.splitUp({ items: elements }); -pane = pane.splitUp({ copyActiveItem: true, items: elements }); - -pane = pane.splitDown(); -pane = pane.splitDown({}); -pane = pane.splitDown({ copyActiveItem: true }); -pane = pane.splitDown({ items: elements }); -pane = pane.splitDown({ copyActiveItem: true, items: elements }); - -//// Panel ==================================================================== -// Methods -panel.destroy(); - -// Event Subscription -sub = panel.onDidChangeVisible(visible => bool = visible); -sub = panel.onDidDestroy(panel => bool = panel.isVisible()); - -// Panel Details -obj = panel.getItem(); -num = panel.getPriority(); -bool = panel.isVisible(); -panel.hide(); -panel.show(); - -//// PathWatcher ============================================================== -pathWatcher.dispose(); -sub = pathWatcher.onDidError((error) => str = error.name); - -async function waitForPathWatcher() { - await pathWatcher.getStartPromise(); +// Emitter ==================================================================== +interface TestEmissions { + "test-event": string; } -//// Point -- See 'text-buffer' testing. -//// Project ================================================================== -// Event Subscription -sub = project.onDidChangePaths(paths => paths.length); +function testEmitter() { + emitter = new Atom.Emitter(); + emitter.clear(); + emitter.dispose(); -sub = project.onDidChangeFiles(events => { - for (const event of events) { - str = event.action; - } -}); + // Event Subscription + subscription = emitter.on("test-event", value => {}); + emitter.once("test-event", value => {}); + subscription = emitter.preempt("test-event", value => {}); -sub = project.onDidAddBuffer(buffer => buffer.id); -sub = project.observeBuffers(buffer => buffer.file); + // Event Emission + emitter.emit("test-event"); + emitter.emit("test-event", 42); -// Accessing the git repository -repositories = project.getRepositories(); + // Optional Value Emitter + const optEmitter = new Atom.Emitter<{ "test-event": string }>(); + optEmitter.emit("test-event"); + optEmitter.emit("test-event", "test"); + optEmitter.on("test-event", value => { + str = value ? value : ""; + }); -async function getDirectoryRepo() { - const potentialRepo = await project.repositoryForDirectory(dir); - if (potentialRepo) repository = potentialRepo; + // Required Value Emitter + const reqEmitter = new Atom.Emitter<{}, TestEmissions>(); + reqEmitter.on("test-event", value => { + str = value; + }); + reqEmitter.emit("test-event", "test"); + + // Mixed Value Emitter + const mixedEmitter = new Atom.Emitter<{ "t1": "test" }, { "t2": "test" }>(); + mixedEmitter.emit("t1"); + mixedEmitter.emit("t1", "test"); + mixedEmitter.emit("t2", "test"); } -// Managing Paths -strs = project.getPaths(); -project.setPaths(["a", "b"]); -project.addPath("Test"); +// File ======================================================================= +function testFile() { + // Construction + file = new Atom.File("Test.file"); + new Atom.File("Test.file", false); -async function initWatcher() { - await project.getWatcherPromise("/var/test"); + async function fileCreation() { + bool = await file.create(); + } + + // Event Subscription + subscription = file.onDidChange(() => {}); + subscription = file.onDidRename(() => {}); + subscription = file.onDidDelete(() => {}); + subscription = file.onWillThrowWatchError(() => {}); + + // File Metadata + bool = file.isFile(); + bool = file.isDirectory(); + bool = file.isSymbolicLink(); + + async function fileExists() { + bool = await file.exists(); + } + + bool = file.existsSync(); + + async function getFileDigest() { + str = await file.getDigest(); + } + + str = file.getDigestSync(); + file.setEncoding("utf8"); + str = file.getEncoding(); + + // Managing Paths + str = file.getPath(); + str = file.getRealPathSync(); + + async function getFileRealPath() { + str = await file.getRealPath(); + } + + str = file.getBaseName(); + + // Traversing + dir = file.getParent(); + + // Reading and Writing + async function readFile() { + str = await file.read(); + } + + const stream = file.createReadStream(); + stream.close(); + + async function writeFile() { + await file.write("Test"); + } + + file.createWriteStream(); + file.writeSync("Test"); } -project.removePath("Test"); -dirs = project.getDirectories(); - -const [projectPath, relativePath] = project.relativizePath("Test"); -if (projectPath) { - str = projectPath; +// File/Directory Type Guarding =============================================== +function testFileDirectoryTypeGuarding() { + if (fileOrDir.isFile()) { + file = fileOrDir; + } + if (fileOrDir.isDirectory()) { + dir = fileOrDir; + } } -str = relativePath; -bool = project.contains("Test"); +// GitRepository ============================================================== +function testGitRepository() { + // Construction and Destruction + repository = new Atom.GitRepository("Test"); + repository = new Atom.GitRepository("Test", {}); + repository = new Atom.GitRepository("Test", { refreshOnWindowFocus: true }); + repository = new Atom.GitRepository("Test", { config: atom.config }); + repository = new Atom.GitRepository("Test", { project: atom.project }); + repository = new Atom.GitRepository("Test", { refreshOnWindowFocus: false, config: atom.config, + project: atom.project }); + repository.destroy(); + bool = repository.isDestroyed(); -//// Range -- See 'text-buffer' testing. -//// ScopeDescriptor ========================================================== + // Event Subscription + subscription = repository.onDidDestroy(() => {}); + subscription = repository.onDidChangeStatus(event => event.path && event.pathStatus); + subscription = repository.onDidChangeStatuses(() => {}); + + // Repository Details + repository.getType(); + str = repository.getPath(); + str = repository.getWorkingDirectory(); + bool = repository.isProjectAtRoot(); + str = repository.relativize(); + bool = repository.hasBranch("master"); + + str = repository.getShortHead(); + str = repository.getShortHead("test.path"); + + bool = repository.isSubmodule("test.path"); + + let aheadBehindCount: { ahead: number, behind: number }; + aheadBehindCount = repository.getAheadBehindCount("ref"); + aheadBehindCount = repository.getAheadBehindCount("ref", "test.path"); + + aheadBehindCount = repository.getCachedUpstreamAheadBehindCount(); + aheadBehindCount = repository.getCachedUpstreamAheadBehindCount("test.path"); + + str = repository.getConfigValue("username"); + str = repository.getConfigValue("username", "test.path"); + + str = repository.getOriginURL(); + str = repository.getOriginURL("test.path"); + + let upstreamBranch = repository.getUpstreamBranch(); + if (upstreamBranch) { + str = upstreamBranch; + } + + upstreamBranch = repository.getUpstreamBranch("test.path"); + if (upstreamBranch) { + str = upstreamBranch; + } + + let gitReferences: { heads: string[], remotes: string[], tags: string[] }; + gitReferences = repository.getReferences(); + gitReferences = repository.getReferences("test.path"); + + str = repository.getReferenceTarget("ref"); + str = repository.getReferenceTarget("ref", "test.path"); + + // Reading Status + bool = repository.isPathModified("file.path"); + bool = repository.isPathNew("file.path"); + bool = repository.isPathIgnored("file.path"); + num = repository.getDirectoryStatus("file.path"); + num = repository.getPathStatus("file.path"); + + const cachedPathStatus = repository.getCachedPathStatus("file.path"); + if (cachedPathStatus) { + num = cachedPathStatus; + } + + bool = repository.isStatusModified(42); + bool = repository.isStatusNew(42); + + // Retrieving Diffs + let diffStats: { added: number, deleted: number }; + diffStats = repository.getDiffStats("file.path"); + + let lineDiffs: Array<{ oldStart: number, newStart: number, oldLines: number, + newLines: number }>; + lineDiffs = repository.getLineDiffs("file.path", "contents"); + + // Checking Out + bool = repository.checkoutHead("file.path"); + bool = repository.checkoutReference("ref", true); +} + +// Grammar ==================================================================== +function testGrammar() { + subscription = grammar.onDidUpdate(() => {}); + + const tokenizeLinesResult = grammar.tokenizeLines("Test String"); + for (const tokenizedLine of tokenizeLinesResult) { + for (const token of tokenizedLine) { + token.scopes; + token.value; + } + } + + grammar.tokenizeLine("Test String"); + const tokenizeLineResult = grammar.tokenizeLine("Test String", null, false); + tokenizeLineResult.line; + tokenizeLineResult.tags; + tokenizeLineResult.tokens; + grammar.tokenizeLine("Test String", tokenizeLineResult.ruleStack); + grammar.tokenizeLine("Test String", tokenizeLineResult.ruleStack, false); + + let str: string; + str = grammar.name; + str = grammar.scopeName; +} + +// GrammarRegistry ============================================================ +function testGrammarRegistry() { + // Event Subscription + subscription = registry.onDidAddGrammar(grammar => grammar.name); + subscription = registry.onDidUpdateGrammar(grammar => grammar.name); + subscription = registry.onDidRemoveGrammar(grammar => grammar.name); + + // Managing Grammars + grammars = registry.getGrammars(); + + let potentialGrammar = registry.grammarForScopeName("scope.test"); + if (potentialGrammar) grammar = potentialGrammar; + + subscription = registry.addGrammar(grammar); + + potentialGrammar = registry.removeGrammarForScopeName("scope.test"); + + grammar = registry.readGrammarSync("/test/path"); + + registry.readGrammar("/test/path", (error, grammar) => { + if (grammar) { + grammar.name; + } else { + if (error) error.name; + } + }); + + grammar = registry.loadGrammarSync("/test/path"); + + registry.loadGrammar("/test/path", (error, grammar) => { + if (grammar) { + grammar.name; + } else { + if (error) error.name; + } + }); +} + +// Gutter ===================================================================== +function testGutter() { + // Gutter Destruction + gutter.destroy(); + + // Event Subscription + subscription = gutter.onDidChangeVisible(gutter => gutter.isVisible()); + subscription = gutter.onDidDestroy(() => {}); + + // Visibility + gutter.hide(); + gutter.show(); + bool = gutter.isVisible(); + decoration = gutter.decorateMarker(displayMarker, { type: "line-number" }); +} + +// HistoryManager ============================================================= +function testHistoryManager() { + historyPaths = atom.history.getProjects(); + atom.history.clearProjects(); + subscription = atom.history.onDidChangeProjects(() => {}); +} + +// KeymapManager ============================================================== +function testKeymapManager() { + const manager = atom.keymaps; + manager.clear(); + manager.destroy(); + + // Event Subscription + subscription = manager.onDidMatchBinding((event): void => { event.keystrokes; }); + subscription = manager.onDidPartiallyMatchBindings((event): void => { + event.partiallyMatchedBindings; }); + subscription = manager.onDidFailToMatchBinding((event): void => { event.keystrokes; }); + subscription = manager.onDidFailToReadFile((event): void => { event.stack; }); + + // Adding and Removing Bindings + subscription = manager.add("a", {}, 0); + + // Accessing Bindings + let bindings: Atom.KeyBinding[] = manager.getKeyBindings(); + bindings = manager.findKeyBindings(); + bindings = manager.findKeyBindings({ command: "a" }); + bindings = manager.findKeyBindings({ keystrokes: "a" }); + bindings = manager.findKeyBindings({ target: element }); + bindings = manager.findKeyBindings({ command: "a", keystrokes: "b"}); + bindings = manager.findKeyBindings({ command: "a", keystrokes: "b", target: element }); + + // Managing Keymap Files + manager.loadKeymap("Test.file"); + manager.loadKeymap("Test.file", { watch: true }); + manager.loadKeymap("Test.file", { watch: true, priority: 0}); + + // Managing Keyboard Events + manager.handleKeyboardEvent(event); + manager.keystrokeForKeyboardEvent(event); + + subscription = manager.addKeystrokeResolver((event): string => { + event.layoutName; + return "Test"; + }); + + const num: number = manager.getPartialMatchTimeout(); +} + +// LayerDecoration ============================================================ +function testLayerDecoration() { + layerDecoration.destroy(); + bool = layerDecoration.isDestroyed(); + layerDecoration.getProperties(); + layerDecoration.setProperties(decorationLayerProps); + layerDecoration.setPropertiesForMarker(marker, { type: "line", class: "test-class" }); +} + +// Marker ===================================================================== +function testMarker() { + // Properties + num = marker.id; + + // Lifecycle + marker = marker.copy({ + tailed: true, + reversed: true, + invalidate: "surround", + exclusive: false, + properties: { custom: "prop" }, + }); + + marker.destroy(); + + // Event Subscription + subscription = marker.onDidDestroy(() => {}); + + subscription = marker.onDidChange(event => { + event.oldHeadPosition; + event.newHeadPosition; + event.oldTailPosition; + event.newTailPosition; + event.wasValid; + event.isValid; + event.hadTail; + event.hasTail; + event.oldProperties; + event.newProperties; + event.textChanged; + }); + + // Marker Details + range = marker.getRange(); + pos = marker.getHeadPosition(); + pos = marker.getTailPosition(); + pos = marker.getStartPosition(); + pos = marker.getEndPosition(); + bool = marker.isReversed(); + bool = marker.hasTail(); + bool = marker.isValid(); + bool = marker.isDestroyed(); + bool = marker.isExclusive(); + str = marker.getInvalidationStrategy(); + + // Mutating Markers + bool = marker.setRange(range); + bool = marker.setRange([pos, pos]); + bool = marker.setRange([pos, [0, 0]]); + bool = marker.setRange([[0, 0], pos]); + bool = marker.setRange([[0, 0], [0, 0]]); + bool = marker.setRange([pos, pos], { exclusive: false }); + bool = marker.setRange(range, { exclusive: true, reversed: false }); + + bool = marker.setHeadPosition(pos); + bool = marker.setHeadPosition([0, 0]); + + bool = marker.setTailPosition(pos); + bool = marker.setTailPosition([0, 0]); + + bool = marker.clearTail(); + bool = marker.plantTail(); + + // Comparison + bool = marker.isEqual(marker); + num = marker.compare(marker); +} + +// MarkerLayer ================================================================ +function testMarkerLayer() { + // Lifecycle + markerLayer = markerLayer.copy(); + bool = markerLayer.destroy(); + markerLayer.clear(); + bool = markerLayer.isDestroyed(); + + // Querying + const potentialMarker = markerLayer.getMarker(42); + if (potentialMarker) marker = potentialMarker; + + markers = markerLayer.getMarkers(); + num = markerLayer.getMarkerCount(); + + markers = markerLayer.findMarkers({ + startPosition: pos, + endPosition: pos, + startsInRange: range, + endsInRange: range, + containsPoint: pos, + containsRange: range, + startRow: num, + endRow: num, + intersectsRow: num, + }); + markers = markerLayer.findMarkers({ containsRange: [pos, pos] }); + markers = markerLayer.findMarkers({ containsRange: [pos, [0, 0]] }); + markers = markerLayer.findMarkers({ containsRange: [[0, 0], pos] }); + markers = markerLayer.findMarkers({ containsRange: [[0, 0], [0, 0]] }); + + // Marker creation + marker = markerLayer.markRange(range); + marker = markerLayer.markRange([pos, pos]); + marker = markerLayer.markRange([pos, [0, 0]]); + marker = markerLayer.markRange([[0, 0], pos]); + marker = markerLayer.markRange([[0, 0], [0, 0]]); + marker = markerLayer.markRange(range, { exclusive: true }); + marker = markerLayer.markRange([pos, pos], { invalidate: "never" }); + marker = markerLayer.markRange(range, { + exclusive: false, invalidate: "surround", reversed: false, + }); + + marker = markerLayer.markPosition(pos); + marker = markerLayer.markPosition([0, 0]); + marker = markerLayer.markPosition(pos, { exclusive: false }); + marker = markerLayer.markPosition([0, 0], { invalidate: "inside" }); + marker = markerLayer.markPosition(pos, { exclusive: true, invalidate: "surround" }); + + // Event subscription + subscription = markerLayer.onDidUpdate(() => {}); + subscription = markerLayer.onDidCreateMarker(marker => marker.id); + subscription = markerLayer.onDidDestroy(() => {}); +} + +// MenuManager ================================================================ +function testMenuManager() { + subscription = atom.menu.add([ + { + label: "Hello", + submenu : [{ label: "World!", command: "hello:world" }], + }, + ]); + atom.menu.update(); +} + +// Notification =============================================================== +function testNotification() { + notification = new Atom.Notification("fatal", "Test"); + notification = new Atom.Notification("success", "Test", {}); + notification = new Atom.Notification("info", "Test", { + buttons: [ + { className: "Test", text: "Test", onDidClick: () => {}}, + ], + description: "Test", + detail: "Test", + dismissable: false, + icon: "Test", + }); + + // Event Subscription + subscription = notification.onDidDismiss(notification => notification.getType()); + subscription = notification.onDidDisplay(notification => notification.getMessage()); + + // Methods + str = notification.getType(); + str = notification.getMessage(); + + // Extended Methods + notification.dismiss(); +} + +// NotificationManager ======================================================== +function testNotificationManager() { + // Events + atom.notifications.onDidAddNotification(notification => notification.dismiss()); + + // Adding Notifications + atom.notifications.addSuccess("Test"); + atom.notifications.addSuccess("Test", {}); + atom.notifications.addSuccess("Test", { + description: "Desc", + detail: "Details", + dismissable: true, + icon: "Icon", + buttons: [{ + text: "Button", + onDidClick: () => {}, + className: "test-class", + }], + }); + + atom.notifications.addInfo("Test"); + atom.notifications.addInfo("Test", {}); + atom.notifications.addInfo("Test", { description: "Desc" }); + + atom.notifications.addWarning("Test"); + atom.notifications.addWarning("Test", {}); + atom.notifications.addWarning("Test", { description: "Desc" }); + + atom.notifications.addError("Test"); + atom.notifications.addError("Test", {}); + atom.notifications.addError("Test", { stack: "Stack" }); + + atom.notifications.addFatalError("Test"); + atom.notifications.addFatalError("Test", {}); + atom.notifications.addFatalError("Test", { stack: "Stack" }); + + // Getting Notifications + notifications = atom.notifications.getNotifications(); +} + +// Package ==================================================================== +function testPackage() { + // Event Subscription + pack.onDidDeactivate(() => {}); + + // Native Module Compatibility + bool = pack.isCompatible(); + + let exitInfo: Promise<{ code: number, stderr: string, stdout: string }>; + exitInfo = pack.rebuild(); + + const buildFailureOutput = pack.getBuildFailureOutput(); + if (buildFailureOutput) { + str = buildFailureOutput; + } +} + +// PackageManager ===========================================================\== +function testPackageManager() { + // Event Subscription + subscription = atom.packages.onDidLoadInitialPackages(() => {}); + subscription = atom.packages.onDidActivateInitialPackages(() => {}); + subscription = atom.packages.onDidActivatePackage(pack => pack.name); + subscription = atom.packages.onDidDeactivatePackage(pack => pack.path); + subscription = atom.packages.onDidLoadPackage(pack => pack.isCompatible()); + subscription = atom.packages.onDidUnloadPackage(pack => pack.name); + subscription = atom.packages.onDidTriggerActivationHook( + 'language-javascript:grammar-used', () => {} + ); + + // Package system data + str = atom.packages.getApmPath(); + strs = atom.packages.getPackageDirPaths(); + + // General package data + const packagePath = atom.packages.resolvePackagePath("Test"); + if (packagePath) { + str = packagePath; + } + + bool = atom.packages.isBundledPackage("Test"); + + // Enabling and disabling packages + let potentialPack = atom.packages.enablePackage("Test"); + if (potentialPack) { + pack = potentialPack; + } + + potentialPack = atom.packages.disablePackage("Test"); + if (potentialPack) { + pack = potentialPack; + } + + bool = atom.packages.isPackageDisabled("Test"); + + // Accessing active packages + packs = atom.packages.getActivePackages(); + + potentialPack = atom.packages.getActivePackage("Test"); + if (potentialPack) { + pack = potentialPack; + } + + bool = atom.packages.isPackageActive("Test"); + bool = atom.packages.hasActivatedInitialPackages(); + + // Accessing loaded packages + packs = atom.packages.getLoadedPackages(); + + potentialPack = atom.packages.getLoadedPackage("Test"); + if (potentialPack) { + pack = potentialPack; + } + + bool = atom.packages.isPackageLoaded("Test"); + bool = atom.packages.hasLoadedInitialPackages(); + + // Accessing available packages + strs = atom.packages.getAvailablePackagePaths(); + strs = atom.packages.getAvailablePackageNames(); + strs = atom.packages.getAvailablePackageMetadata(); +} + +// Pane ======================================================================= +function testPane() { + // Event Subscription + subscription = pane.onDidChangeFlexScale(scale => num = scale); + subscription = pane.observeFlexScale(scale => num = scale); + subscription = pane.onDidActivate(() => {}); + subscription = pane.onWillDestroy(() => {}); + subscription = pane.onDidDestroy(() => {}); + subscription = pane.onDidChangeActive(active => bool = active); + subscription = pane.observeActive(active => bool = active); + subscription = pane.onDidAddItem(event => event.index && event.item); + subscription = pane.onDidRemoveItem(event => event.index && event.item); + subscription = pane.onWillRemoveItem(event => event.index && event.item); + subscription = pane.onDidMoveItem(event => event.item && event.oldIndex && event.newIndex); + subscription = pane.observeItems((item) => {}); + subscription = pane.onDidChangeActiveItem((item) => {}); + subscription = pane.onChooseNextMRUItem((item) => {}); + subscription = pane.onChooseLastMRUItem((item) => {}); + subscription = pane.onDoneChoosingMRUItem(() => {}); + subscription = pane.observeActiveItem((item) => {}); + subscription = pane.onWillDestroyItem(event => event.index && event.item); + + // Items + objs = pane.getItems(); + obj = pane.getActiveItem(); + + let potentialItem = pane.itemAtIndex(42); + if (potentialItem) { + obj = potentialItem; + } + + pane.activateNextItem(); + pane.activatePreviousItem(); + pane.moveItemRight(); + pane.moveItemLeft(); + num = pane.getActiveItemIndex(); + pane.activateItemAtIndex(42); + + pane.activateItem(element); + pane.activateItem(element, { pending: true }); + + obj = pane.addItem(element); + obj = pane.addItem(element, {}); + obj = pane.addItem(element, { pending: true }); + obj = pane.addItem(element, { index: 42 }); + obj = pane.addItem(element, { pending: true, index: 42 }); + + objs = pane.addItems(objs); + objs = pane.addItems(objs, 42); + + pane.moveItem(element, 42); + pane.moveItemToPane(element, pane, 42); + pane.destroyActiveItem(); + + async function destroyAndWait() { + bool = await pane.destroyItem(element); + bool = await pane.destroyItem(element, true); + } + + pane.destroyItems(); + pane.destroyInactiveItems(); + + async function savePaneItem() { + await pane.saveActiveItem(); + let actionReturn = await pane.saveActiveItem(() => true); + if (actionReturn) bool = actionReturn; + + await pane.saveActiveItemAs(() => {}); + actionReturn = await pane.saveActiveItemAs(() => false); + + await pane.saveItem(element, () => {}); + let altActionReturn = await pane.saveItem(element, () => 42); + if (altActionReturn) num = altActionReturn; + + await pane.saveItemAs(element, () => {}); + altActionReturn = await pane.saveItemAs(element, () => 42); + } + + pane.saveItems(); + + potentialItem = pane.itemForURI("https://test"); + if (potentialItem) { + obj = potentialItem; + } + + bool = pane.activateItemForURI("https://test"); + + // Lifecycle + bool = pane.isActive(); + pane.activate(); + pane.destroy(); + bool = pane.isDestroyed(); + + // Splitting + pane = pane.splitLeft(); + pane = pane.splitLeft({}); + pane = pane.splitLeft({ copyActiveItem: true }); + pane = pane.splitLeft({ items: elements }); + pane = pane.splitLeft({ copyActiveItem: true, items: elements }); + + pane = pane.splitRight(); + pane = pane.splitRight({}); + pane = pane.splitRight({ copyActiveItem: true }); + pane = pane.splitRight({ items: elements }); + pane = pane.splitRight({ copyActiveItem: true, items: elements }); + + pane = pane.splitUp(); + pane = pane.splitUp({}); + pane = pane.splitUp({ copyActiveItem: true }); + pane = pane.splitUp({ items: elements }); + pane = pane.splitUp({ copyActiveItem: true, items: elements }); + + pane = pane.splitDown(); + pane = pane.splitDown({}); + pane = pane.splitDown({ copyActiveItem: true }); + pane = pane.splitDown({ items: elements }); + pane = pane.splitDown({ copyActiveItem: true, items: elements }); +} + +// Panel ====================================================================== +function testPanel() { + // Methods + panel.destroy(); + + // Event Subscription + subscription = panel.onDidChangeVisible(visible => bool = visible); + subscription = panel.onDidDestroy(panel => bool = panel.isVisible()); + + // Panel Details + obj = panel.getItem(); + num = panel.getPriority(); + bool = panel.isVisible(); + panel.hide(); + panel.show(); +} + +// PathWatcher ================================================================ +async function testPathWatcher() { + const pathWatcher = await pathWatcherPromise; + pathWatcher.dispose(); + subscription = pathWatcher.onDidError((error) => str = error.name); + + async function waitForPathWatcher() { + await pathWatcher.getStartPromise(); + } +} + +// Point ====================================================================== +function testPoint() { + let point = new Atom.Point(42, 42); + new Atom.Point(); + new Atom.Point(42); + + // Properties + num = point.row; + num = point.column; + + // Construction + point = Atom.Point.fromObject({ row: 42, column: 42 }, true); + point = point.copy(); + point = point.negate(); + + // Comparison + point = Atom.Point.min(point, point); + Atom.Point.min([0, 0], [0, 0]); + Atom.Point.min(point, [0, 0]); + Atom.Point.min([0, 0], point); + + num = point.compare(point); + point.compare([0, 0]); + + bool = point.isEqual(point); + point.isEqual([0, 0]); + + bool = point.isLessThan(point); + point.isLessThan([0, 0]); + + bool = point.isLessThanOrEqual(point); + point.isLessThanOrEqual([0, 0]); + + bool = point.isGreaterThan(point); + point.isGreaterThan([0, 0]); + + bool = point.isGreaterThanOrEqual(point); + point.isGreaterThanOrEqual([0, 0]); + + // Operations + const frozenPoint: Readonly = point.freeze(); + + point = point.translate(point); + point.translate([0, 0]); + + point = point.traverse(point); + point.traverse([0, 0]); + + // Conversion + point.toArray(); + point.serialize(); + str = point.toString(); +} + +// Project ==================================================================== +function testProject() { + // Event Subscription + subscription = project.onDidChangePaths(paths => paths.length); + + subscription = project.onDidChangeFiles(events => { + for (const event of events) { + str = event.action; + } + }); + + subscription = project.onDidAddBuffer(buffer => buffer.id); + subscription = project.observeBuffers(buffer => buffer.getUri()); + + // Accessing the git repository + repositories = project.getRepositories(); + + async function getDirectoryRepo() { + const potentialRepo = await project.repositoryForDirectory(dir); + if (potentialRepo) repository = potentialRepo; + } + + // Managing Paths + strs = project.getPaths(); + project.setPaths(["a", "b"]); + project.addPath("Test"); + + async function initWatcher() { + await project.getWatcherPromise("/var/test"); + } + + project.removePath("Test"); + dirs = project.getDirectories(); + + const [projectPath, relativePath] = project.relativizePath("Test"); + if (projectPath) { + str = projectPath; + } + str = relativePath; + + bool = project.contains("Test"); +} + +// Range ====================================================================== +function testRange() { + let range = new Atom.Range(pos, pos); + new Atom.Range([0, 0], [0, 0]); + new Atom.Range(pos, [0, 0]); + new Atom.Range([0, 0], pos); + + // Properties + range.start; + range.end; + + // Construction + range = Atom.Range.fromObject({ start: pos, end: pos}, true); + Atom.Range.fromObject([pos, pos]); + Atom.Range.fromObject([[0, 0], [0, 0]]); + Atom.Range.fromObject([pos, [0, 0]]); + Atom.Range.fromObject([[0, 0], pos]); + + range = range.copy(); + range = range.negate(); + + // Serialization and Deserialization + range = Atom.Range.deserialize({}); + range.serialize(); + + // TextBuffer.Range Details + bool = range.isEmpty(); + bool = range.isSingleLine(); + num = range.getRowCount(); + nums = range.getRows(); + + // Operations + const frozenRange: Readonly = range.freeze(); + range = range.union(range); + + range = range.translate(pos); + range.translate([0, 0]); + range.translate(pos, pos); + range.translate([0, 0], pos); + range.translate(pos, [0, 0]); + range.translate([0, 0], [0, 0]); + + range = range.traverse(pos); + range.traverse([0, 0]); + + // Comparison + num = range.compare(range); + range.compare([pos, pos]); + range.compare([pos, [0, 0]]); + range.compare([[0, 0], pos]); + range.compare([[0, 0], [0, 0]]); + + bool = range.isEqual(range); + range.isEqual([pos, pos]); + range.isEqual([pos, [0, 0]]); + range.isEqual([[0, 0], pos]); + range.isEqual([[0, 0], [0, 0]]); + + bool = range.coversSameRows(range); + + bool = range.intersectsWith(range); + range.intersectsWith(range, true); + + bool = range.containsRange(range); + range.containsRange([pos, pos]); + range.containsRange([pos, [0, 0]]); + range.containsRange([[0, 0], pos]); + range.containsRange([[0, 0], [0, 0]]); + range.containsRange(range, true); + range.containsRange([pos, pos], false); + range.containsRange([pos, [0, 0]], false); + range.containsRange([[0, 0], pos], false); + range.containsRange([[0, 0], [0, 0]], false); + + bool = range.containsPoint(pos); + range.containsPoint([0, 0]); + range.containsPoint(pos, true); + range.containsPoint([0, 0], false); + + bool = range.intersectsRow(42); + bool = range.intersectsRowRange(42, 42); + + // Conversion + str = range.toString(); +} + +// ScopeDescriptor ============================================================ strs = scopeDescriptor.getScopesArray(); -//// Selection ================================================================ -// Event Subscription -sub = selection.onDidChangeRange(event => event.newBufferRange && event.oldBufferRange && - event.newScreenRange && event.oldScreenRange && event.selection); -sub = selection.onDidDestroy(() => {}); +// Selection ================================================================== +function testSelection() { + // Event Subscription + subscription = selection.onDidChangeRange(event => event.newBufferRange && + event.oldBufferRange && event.newScreenRange && event.oldScreenRange && + event.selection); + subscription = selection.onDidDestroy(() => {}); -// Managing the selection range -range = selection.getScreenRange(); + // Managing the selection range + range = selection.getScreenRange(); -selection.setScreenRange(range); -selection.setScreenRange([pos, pos]); -selection.setScreenRange([pos, [0, 0]]); -selection.setScreenRange([[0, 0], pos]); -selection.setScreenRange([[0, 0], [0, 0]]); -selection.setScreenRange([[0, 0], [0, 0]], {}); -selection.setScreenRange(range, { autoscroll: true, preserveFolds: false }); -selection.setScreenRange([pos, pos], { autoscroll: true }); + selection.setScreenRange(range); + selection.setScreenRange([pos, pos]); + selection.setScreenRange([pos, [0, 0]]); + selection.setScreenRange([[0, 0], pos]); + selection.setScreenRange([[0, 0], [0, 0]]); + selection.setScreenRange([[0, 0], [0, 0]], {}); + selection.setScreenRange(range, { autoscroll: true, preserveFolds: false }); + selection.setScreenRange([pos, pos], { autoscroll: true }); -range = selection.getBufferRange(); + range = selection.getBufferRange(); -selection.setBufferRange(range); -selection.setBufferRange([pos, pos]); -selection.setBufferRange([pos, [0, 0]]); -selection.setBufferRange([[0, 0], pos]); -selection.setBufferRange([[0, 0], [0, 0]]); -selection.setBufferRange([[0, 0], [0, 0]], {}); -selection.setBufferRange(range, { autoscroll: true, preserveFolds: false }); -selection.setBufferRange([pos, pos], { autoscroll: true }); + selection.setBufferRange(range); + selection.setBufferRange([pos, pos]); + selection.setBufferRange([pos, [0, 0]]); + selection.setBufferRange([[0, 0], pos]); + selection.setBufferRange([[0, 0], [0, 0]]); + selection.setBufferRange([[0, 0], [0, 0]], {}); + selection.setBufferRange(range, { autoscroll: true, preserveFolds: false }); + selection.setBufferRange([pos, pos], { autoscroll: true }); -const [startingRow, endingRow ]: [number, number] = selection.getBufferRowRange(); + const [startingRow, endingRow ]: [number, number] = selection.getBufferRowRange(); -// Info about the selection -bool = selection.isEmpty(); -bool = selection.isReversed(); -bool = selection.isSingleScreenLine(); -str = selection.getText(); -bool = selection.intersectsBufferRange(range); // Not range-compatible. -bool = selection.intersectsWith(selection); + // Info about the selection + bool = selection.isEmpty(); + bool = selection.isReversed(); + bool = selection.isSingleScreenLine(); + str = selection.getText(); + bool = selection.intersectsBufferRange(range); // Not range-compatible. + bool = selection.intersectsWith(selection); -// Modifying the selected range -selection.clear(); -selection.clear({}); -selection.clear({ autoscroll: false }); + // Modifying the selected range + selection.clear(); + selection.clear({}); + selection.clear({ autoscroll: false }); -selection.selectToScreenPosition(pos); -selection.selectToScreenPosition([0, 0]); + selection.selectToScreenPosition(pos); + selection.selectToScreenPosition([0, 0]); -selection.selectToBufferPosition(pos); -selection.selectToBufferPosition([0, 0]); + selection.selectToBufferPosition(pos); + selection.selectToBufferPosition([0, 0]); -selection.selectRight(); -selection.selectRight(42); + selection.selectRight(); + selection.selectRight(42); -selection.selectLeft(); -selection.selectLeft(42); + selection.selectLeft(); + selection.selectLeft(42); -selection.selectUp(); -selection.selectUp(42); + selection.selectUp(); + selection.selectUp(42); -selection.selectDown(); -selection.selectDown(42); + selection.selectDown(); + selection.selectDown(42); -selection.selectToTop(); -selection.selectToBottom(); -selection.selectAll(); -selection.selectToBeginningOfLine(); -selection.selectToFirstCharacterOfLine(); -selection.selectToEndOfLine(); -selection.selectToEndOfBufferLine(); -selection.selectToBeginningOfWord(); -selection.selectToEndOfWord(); -selection.selectToBeginningOfNextWord(); -selection.selectToPreviousWordBoundary(); -selection.selectToNextWordBoundary(); -selection.selectToPreviousSubwordBoundary(); -selection.selectToNextSubwordBoundary(); -selection.selectToBeginningOfNextParagraph(); -selection.selectToBeginningOfPreviousParagraph(); -selection.selectWord(); -selection.expandOverWord(); -selection.selectLine(42); -selection.expandOverLine(); + selection.selectToTop(); + selection.selectToBottom(); + selection.selectAll(); + selection.selectToBeginningOfLine(); + selection.selectToFirstCharacterOfLine(); + selection.selectToEndOfLine(); + selection.selectToEndOfBufferLine(); + selection.selectToBeginningOfWord(); + selection.selectToEndOfWord(); + selection.selectToBeginningOfNextWord(); + selection.selectToPreviousWordBoundary(); + selection.selectToNextWordBoundary(); + selection.selectToPreviousSubwordBoundary(); + selection.selectToNextSubwordBoundary(); + selection.selectToBeginningOfNextParagraph(); + selection.selectToBeginningOfPreviousParagraph(); + selection.selectWord(); + selection.expandOverWord(); + selection.selectLine(42); + selection.expandOverLine(); -// Modifying the selected text -selection.insertText("Replacement"); -selection.insertText("Replacement", {}); -selection.insertText("Replacement", { select: true }); -selection.insertText("Replacement", { autoIndent: true }); -selection.insertText("Replacement", { autoIndentNewline: true }); -selection.insertText("Replacement", { autoDecreaseIndent: true }); -selection.insertText("Replacement", { normalizeLineEndings: true }); -selection.insertText("Replacement", { undo: "skip" }); -selection.insertText("Replacement", { select: true, autoIndent: true, - autoIndentNewline: true, autoDecreaseIndent: true, normalizeLineEndings: true, - undo: "skip" }); + // Modifying the selected text + selection.insertText("Replacement"); + selection.insertText("Replacement", {}); + selection.insertText("Replacement", { select: true }); + selection.insertText("Replacement", { autoIndent: true }); + selection.insertText("Replacement", { autoIndentNewline: true }); + selection.insertText("Replacement", { autoDecreaseIndent: true }); + selection.insertText("Replacement", { normalizeLineEndings: true }); + selection.insertText("Replacement", { undo: "skip" }); + selection.insertText("Replacement", { select: true, autoIndent: true, + autoIndentNewline: true, autoDecreaseIndent: true, normalizeLineEndings: true, + undo: "skip", preserveTrailingLineIndentation: false }); -selection.backspace(); -selection.deleteToPreviousWordBoundary(); -selection.deleteToNextWordBoundary(); -selection.deleteToBeginningOfWord(); -selection.deleteToBeginningOfLine(); -selection.delete(); -selection.deleteToEndOfLine(); -selection.deleteToEndOfWord(); -selection.deleteToBeginningOfSubword(); -selection.deleteToEndOfSubword(); -selection.deleteSelectedText(); -selection.deleteLine(); -selection.joinLines(); -selection.outdentSelectedRows(); -selection.autoIndentSelectedRows(); -selection.toggleLineComments(); -selection.cutToEndOfLine(); -selection.cutToEndOfBufferLine(); + selection.backspace(); + selection.deleteToPreviousWordBoundary(); + selection.deleteToNextWordBoundary(); + selection.deleteToBeginningOfWord(); + selection.deleteToBeginningOfLine(); + selection.delete(); + selection.deleteToEndOfLine(); + selection.deleteToEndOfWord(); + selection.deleteToBeginningOfSubword(); + selection.deleteToEndOfSubword(); + selection.deleteSelectedText(); + selection.deleteLine(); + selection.joinLines(); + selection.outdentSelectedRows(); + selection.autoIndentSelectedRows(); + selection.toggleLineComments(); + selection.cutToEndOfLine(); + selection.cutToEndOfBufferLine(); -selection.cut(); -selection.cut(true); -selection.cut(true, true); + selection.cut(); + selection.cut(true); + selection.cut(true, true); -selection.copy(); -selection.copy(true); -selection.copy(true, true); + selection.copy(); + selection.copy(true); + selection.copy(true, true); -selection.fold(); -selection.indentSelectedRows(); + selection.fold(); + selection.indentSelectedRows(); -// Managing multiple selections -selection.addSelectionBelow(); -selection.addSelectionAbove(); + // Managing multiple selections + selection.addSelectionBelow(); + selection.addSelectionAbove(); -selection.merge(selection); -selection.merge(selection, {}); -selection.merge(selection, { preserveFolds: true }); -selection.merge(selection, { autoscroll: true }); -selection.merge(selection, { preserveFolds: true, autoscroll: true }); + selection.merge(selection); + selection.merge(selection, {}); + selection.merge(selection, { preserveFolds: true }); + selection.merge(selection, { autoscroll: true }); + selection.merge(selection, { preserveFolds: true, autoscroll: true }); -// Comparing to other selections -num = selection.compare(selection); + // Comparing to other selections + num = selection.compare(selection); +} -//// StyleManager ============================================================= -// Event Subscription -sub = styleManager.observeStyleElements(styleElement => styleElement.context); -sub = styleManager.onDidAddStyleElement(styleElement => styleElement.sourcePath); -sub = styleManager.onDidRemoveStyleElement(styleElement => styleElement.onkeydown); -sub = styleManager.onDidUpdateStyleElement(styleElement => styleElement.sourcePath); +// StyleManager =============================================================== +function testStyleManager() { + // Event Subscription + subscription = styleManager.observeStyleElements(styleElement => styleElement.context); + subscription = styleManager.onDidAddStyleElement(styleElement => styleElement.sourcePath); + subscription = styleManager.onDidRemoveStyleElement(styleElement => styleElement.onkeydown); + subscription = styleManager.onDidUpdateStyleElement(styleElement => styleElement.sourcePath); -// Reading Style Elements -const styleElements: HTMLStyleElement[] = styleManager.getStyleElements(); + // Reading Style Elements + const styleElements: HTMLStyleElement[] = styleManager.getStyleElements(); -// Paths -str = styleManager.getUserStyleSheetPath(); + // Paths + str = styleManager.getUserStyleSheetPath(); +} -//// Task ===================================================================== -let task: Atom.Task = Task.once("File.path", {}, () => {}); -task = new Task("File.path"); +// Task ======================================================================= +function testTask() { + let task: Atom.Task = Atom.Task.once("File.path", {}, () => {}); + task = new Atom.Task("File.path"); -task.start({}, () => {}); -task.send("test-message"); -sub = task.on("test-message", () => {}); -task.terminate(); -task.cancel(); + task.start({}, () => {}); + task.send("test-message"); + subscription = task.on("test-message", () => {}); + task.terminate(); + task.cancel(); +} -//// TextBuffer -- See 'text-buffer' testing. -//// TextEditor =============================================================== -// Event Subscription -sub = editor.onDidChangeTitle(title => str = title.charAt(0)); -sub = editor.onDidChangePath(path => str = path.charAt(0)); +// TextBuffer ================================================================= +function testTextBuffer() { + const shouldDestroyOnFileDelete = () => false; -sub = editor.onDidChange(changes => { - for (const change of changes) { - change.newExtent; - change.oldExtent; - change.start; - } + buffer = new Atom.TextBuffer("test"); + new Atom.TextBuffer(); + new Atom.TextBuffer({ text: "Test" }); + new Atom.TextBuffer({ shouldDestroyOnFileDelete }); + new Atom.TextBuffer({ text: "Test", shouldDestroyOnFileDelete }); + + async function bufferLoadFile() { + buffer = await Atom.TextBuffer.load("Test.file"); + buffer = await Atom.TextBuffer.load("Test.file", { encoding: "utf8" }); + buffer = await Atom.TextBuffer.load("Test.file", { shouldDestroyOnFileDelete }); + buffer = await Atom.TextBuffer.load("Test.file", { encoding: "utf8", + shouldDestroyOnFileDelete }); + } + + buffer = Atom.TextBuffer.loadSync("Test.file"); + Atom.TextBuffer.loadSync("Test.file", { encoding: "utf8" }); + Atom.TextBuffer.loadSync("Test.file", { shouldDestroyOnFileDelete }); + Atom.TextBuffer.loadSync("Test.file", { encoding: "uft8", shouldDestroyOnFileDelete }); + + async function deserializeBuffer() { + buffer = await Atom.TextBuffer.deserialize({}); + } + + // Event Subscription + subscription = buffer.onWillChange(() => void {}); + + subscription = buffer.onDidChange((event): void => { + range = event.newRange; + for (const change of event.changes) { + range = change.newRange; + } + }); + + subscription = buffer.onDidChangeText(() => void {}); + + subscription = buffer.onDidStopChanging((event): void => { + for (const change of event.changes) { + change.newExtent; + } + }); + + subscription = buffer.onDidConflict(() => void {}); + subscription = buffer.onDidChangeModified(() => void {}); + subscription = buffer.onDidUpdateMarkers(() => void {}); + subscription = buffer.onDidCreateMarker(() => void {}); + + subscription = buffer.onDidChangePath((path): void => { + str = path; + }); + + subscription = buffer.onDidChangeEncoding(() => void {}); + + subscription = buffer.onWillSave(() => void {}); + subscription = buffer.onWillSave(() => Promise.resolve()); + + subscription = buffer.onDidSave(() => void {}); + subscription = buffer.onDidDelete(() => void {}); + subscription = buffer.onWillReload(() => void {}); + subscription = buffer.onDidReload(() => void {}); + subscription = buffer.onDidDestroy(() => void {}); + subscription = buffer.onWillThrowWatchError(() => void {}); + + const stoppedChangingDelay = buffer.getStoppedChangingDelay(); + + // File Details + bool = buffer.isModified(); + bool = buffer.isInConflict(); + + const path = buffer.getPath(); + if (path) { + str = path.substr(0, 42); + } + + buffer.setPath("Test.file"); + buffer.setEncoding("utf8"); + str = buffer.getEncoding(); + str = buffer.getUri(); + + // Reading Text + bool = buffer.isEmpty(); + str = buffer.getText(); + + str = buffer.getTextInRange(range); + str = buffer.getTextInRange([pos, pos]); + str = buffer.getTextInRange([[0, 0], [0, 0]]); + str = buffer.getTextInRange([pos, [0, 0]]); + str = buffer.getTextInRange([[0, 0], pos]); + + strs = buffer.getLines(); + str = buffer.getLastLine(); + + const rowText = buffer.lineForRow(42); + if (rowText) { + str = rowText; + } + + const lineEnding = buffer.lineEndingForRow(42); + if (lineEnding) { + str = lineEnding; + } + + num = buffer.lineLengthForRow(42); + bool = buffer.isRowBlank(42); + + const prevRow = buffer.previousNonBlankRow(42); + if (prevRow) { + num = prevRow; + } + + const nextRow = buffer.nextNonBlankRow(42); + if (nextRow) { + num = nextRow; + } + + // Mutating Text + range = buffer.setText("Test"); + buffer.setTextViaDiff("Test"); + + range = buffer.setTextInRange(range, "Test"); + range = buffer.setTextInRange([pos, pos], "Test"); + range = buffer.setTextInRange([[0, 0], [0, 0]], "Test"); + range = buffer.setTextInRange([pos, [0, 0]], "Test"); + range = buffer.setTextInRange([[0, 0], pos], "Test"); + range = buffer.setTextInRange(range, "Test", { normalizeLineEndings: true }); + range = buffer.setTextInRange(range, "Test", { undo: "skip" }); + range = buffer.setTextInRange(range, "Test", { normalizeLineEndings: true, undo: "skip" }); + range = buffer.setTextInRange([[0, 0], [0, 0]], "Test", { undo: "skip" }); + + range = buffer.insert(pos, "Test"); + buffer.insert([0, 0], "Test"); + buffer.insert(pos, "Test", { normalizeLineEndings: true }); + buffer.insert(pos, "Test", { undo: "skip" }); + buffer.insert(pos, "Test", { normalizeLineEndings: true, undo: "skip" }); + buffer.insert([0, 0], "Test", { undo: "skip" }); + + range = buffer.append("Test"); + buffer.append("Test", { normalizeLineEndings: true }); + buffer.append("Test", { undo: "skip" }); + buffer.append("Test", { normalizeLineEndings: true, undo: "skip" }); + + range = buffer.delete(range); + buffer.delete([pos, pos]); + buffer.delete([[0, 0], [0, 0]]); + buffer.delete([pos, [0, 0]]); + buffer.delete([[0, 0], pos]); + + range = buffer.deleteRow(42); + range = buffer.deleteRows(42, 42); + + // Markers + markerLayer = buffer.addMarkerLayer(); + buffer.addMarkerLayer({ maintainHistory: true }); + buffer.addMarkerLayer({ persistent: true }); + buffer.addMarkerLayer({ maintainHistory: true, persistent: true }); + + const testMarkerLayer = buffer.getMarkerLayer("Test"); + if (testMarkerLayer) { + markerLayer = testMarkerLayer; + } + + markerLayer = buffer.getDefaultMarkerLayer(); + + marker = buffer.markRange(range); + buffer.markRange([pos, pos]); + buffer.markRange([[0, 0], [0, 0]]); + buffer.markRange([pos, [0, 0]]); + buffer.markRange([[0, 0], pos]); + buffer.markRange(range, { exclusive: true}); + buffer.markRange(range, { invalidate: "surround" }); + buffer.markRange(range, { reversed: true }); + buffer.markRange(range, { exclusive: true, invalidate: "surround", reversed: true }); + buffer.markRange([pos, pos], { exclusive: true }); + + marker = buffer.markPosition(pos); + buffer.markPosition([0, 0]); + buffer.markPosition(pos, { exclusive: true }); + buffer.markPosition(pos, { invalidate: "never" }); + buffer.markPosition(pos, { exclusive: true, invalidate: "surround" }); + buffer.markPosition([0, 0], { exclusive: true }); + + markers = buffer.getMarkers(); + marker = buffer.getMarker(42); + + markers = buffer.findMarkers({ + startPosition: pos, + endPosition: pos, + startsInRange: range, + endsInRange: range, + containsPoint: pos, + containsRange: range, + startRow: num, + endRow: num, + intersectsRow: num, + }); + markers = buffer.findMarkers({ startsInRange: [pos, pos] }); + markers = buffer.findMarkers({ startsInRange: [pos, [0, 0]] }); + markers = buffer.findMarkers({ startsInRange: [[0, 0], pos] }); + markers = buffer.findMarkers({ startsInRange: [[0, 0], [0, 0]] }); + + num = buffer.getMarkerCount(); + + // History + bool = buffer.undo(); + bool = buffer.redo(); + + num = buffer.transact(500, (): number => 42); + + buffer.clearUndoStack(); + num = buffer.createCheckpoint(); + bool = buffer.revertToCheckpoint(42); + bool = buffer.groupChangesSinceCheckpoint(42); + buffer.getChangesSinceCheckpoint(42); + + // Search And Replace + buffer.scan(/r^Test/, (): void => {}); + buffer.scan(/r^Test/, (params) => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + buffer.scan(/r^Test/, { + leadingContextLineCount: 5, + trailingContextLineCount: 5, + }, (params) => { + strs = params.leadingContextLines; + strs = params.trailingContextLines; + }); + + buffer.backwardsScan(/r^Test/, (): void => {}); + buffer.backwardsScan(/r^Test/, (params) => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + buffer.backwardsScan(/r^Test/, { + leadingContextLineCount: 5, + trailingContextLineCount: 5, + }, (params) => { + strs = params.leadingContextLines; + strs = params.trailingContextLines; + }); + + buffer.scanInRange(/r^Test/, range, (): void => {}); + buffer.scanInRange(/r^Test/, range, (params) => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + buffer.scanInRange(/r^Test/, range, { + leadingContextLineCount: 5, + trailingContextLineCount: 5, + }, (params) => { + strs = params.leadingContextLines; + strs = params.trailingContextLines; + }); + buffer.scanInRange(/r^Test/, [pos, pos], (): void => {}); + buffer.scanInRange(/r^Test/, [[0, 0], [0, 0]], (): void => {}); + buffer.scanInRange(/r^Test/, [pos, [0, 0]], (): void => {}); + buffer.scanInRange(/r^Test/, [[0, 0], pos], (): void => {}); + buffer.scanInRange(/r^Test/, [[0, 0], [0, 0]], { trailingContextLineCount: 42 }, + (): void => {}); + + buffer.backwardsScanInRange(/r^Test/, range, (): void => {}); + buffer.backwardsScanInRange(/r^Test/, range, (params) => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + buffer.backwardsScanInRange(/r^Test/, range, { + leadingContextLineCount: 5, + trailingContextLineCount: 5, + }, (params) => { + strs = params.leadingContextLines; + strs = params.trailingContextLines; + }); + buffer.backwardsScanInRange(/r^Test/, [pos, pos], (): void => {}); + buffer.backwardsScanInRange(/r^Test/, [[0, 0], [0, 0]], (): void => {}); + buffer.backwardsScanInRange(/r^Test/, [pos, [0, 0]], (): void => {}); + buffer.backwardsScanInRange(/r^Test/, [[0, 0], pos], (): void => {}); + buffer.backwardsScanInRange(/r^Test/, [[0, 0], [0, 0]], { trailingContextLineCount: 42 }, + (): void => {}); + + num = buffer.replace(/r^Test/, "Test"); + + // Buffer TextBuffer.Range Details + range = buffer.getRange(); + num = buffer.getLineCount(); + num = buffer.getLastRow(); + pos = buffer.getFirstPosition(); + pos = buffer.getEndPosition(); + num = buffer.getMaxCharacterIndex(); + range = buffer.rangeForRow(42, true); + num = buffer.characterIndexForPosition(pos); + pos = buffer.positionForCharacterIndex(42); + + range = buffer.clipRange(range); + range = buffer.clipRange([pos, pos]); + range = buffer.clipRange([pos, [0, 0]]); + range = buffer.clipRange([[0, 0], pos]); + range = buffer.clipRange([[0, 0], [0, 0]]); + + pos = buffer.clipPosition(pos); + pos = buffer.clipPosition([0, 0]); + + // Buffer Operations + async function saveBuffer() { + await buffer.save(); + await buffer.saveAs("Test.file"); + } + + buffer.reload(); +} + +// TextEditor ================================================================= +function testTextEditor() { + // Event Subscription + subscription = editor.onDidChangeTitle(title => str = title.charAt(0)); + subscription = editor.onDidChangePath(path => str = path.charAt(0)); + + subscription = editor.onDidChange(changes => { + for (const change of changes) { + change.newExtent; + change.oldExtent; + change.start; + } + }); + + subscription = editor.onDidStopChanging(event => { + for (const change of event.changes) { + change.newExtent && change.oldExtent && change.newRange && change.oldRange && + change.newText && change.oldText && change.start; + } + }); + + subscription = editor.onDidChangeCursorPosition(event => event.newBufferPosition); + subscription = editor.onDidChangeSelectionRange(event => event.selection); + subscription = editor.onDidSave(event => event.path); + subscription = editor.onDidDestroy(() => {}); + subscription = editor.observeGutters(gutter => gutter.show()); + subscription = editor.onDidAddGutter(gutter => gutter.hide()); + subscription = editor.onDidRemoveGutter(name => name.length); + subscription = editor.onDidChangeSoftWrapped(softWrapped => {}); + subscription = editor.onDidChangeEncoding(encoding => {}); + subscription = editor.observeGrammar(grammar => grammar.name); + subscription = editor.onDidChangeGrammar(grammar => grammar.name); + subscription = editor.onDidChangeModified(modified => {}); + subscription = editor.onDidConflict(() => {}); + subscription = editor.onWillInsertText(event => event.cancel && event.text); + subscription = editor.onDidInsertText(event => event.text); + subscription = editor.observeCursors(cursor => cursor.moveToBottom()); + subscription = editor.onDidAddCursor(cursor => cursor.getMarker()); + subscription = editor.onDidRemoveCursor(cursor => cursor.compare(cursor)); + subscription = editor.observeSelections(selection => selection.cutToEndOfBufferLine()); + subscription = editor.onDidAddSelection(selection => selection.selectWord()); + subscription = editor.onDidRemoveSelection(selection => selection.toggleLineComments()); + subscription = editor.observeDecorations(decoration => decoration.getId()); + subscription = editor.onDidAddDecoration(decoration => decoration.id); + subscription = editor.onDidRemoveDecoration(decoration => decoration.getId()); + subscription = editor.onDidChangePlaceholderText(placeholderText => + placeholderText.toLowerCase()); + buffer = editor.getBuffer(); + + // File Details + str = editor.getTitle(); + str = editor.getLongTitle(); + + const filePath = editor.getPath(); + if (filePath) { + str = filePath; + } + + bool = editor.isModified(); + bool = editor.isEmpty(); + str = editor.getEncoding(); + editor.setEncoding("utf8"); + + // File Operations + async function saveEditor() { + await editor.save(); + await editor.saveAs("test.file"); + } + + // Reading Text + str = editor.getText(); + str = editor.getTextInBufferRange(range); + num = editor.getLineCount(); + num = editor.getScreenLineCount(); + num = editor.getLastBufferRow(); + num = editor.getLastScreenRow(); + str = editor.lineTextForBufferRow(42); + str = editor.lineTextForScreenRow(42); + range = editor.getCurrentParagraphBufferRange(); + + // Mutating Text + editor.setText("Test"); + + range = editor.setTextInBufferRange(range, "Test"); + range = editor.setTextInBufferRange([pos, pos], "Test"); + range = editor.setTextInBufferRange([pos, [0, 0]], "Test"); + range = editor.setTextInBufferRange([[0, 0], pos], "Test"); + range = editor.setTextInBufferRange([[0, 0], [0, 0]], "Test"); + range = editor.setTextInBufferRange(range, "Test", {}); + range = editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true }); + range = editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true, + undo: "skip" }); + + editor.insertText("Test"); + editor.insertText("Test", {}); + editor.insertText("Test", { autoDecreaseIndent: true }); + editor.insertText("Test", { autoIndent: true }); + editor.insertText("Test", { autoIndentNewline: true }); + editor.insertText("Test", { normalizeLineEndings: true }); + editor.insertText("Test", { select: true }); + editor.insertText("Test", { undo: "skip" }); + editor.insertText("Text", { autoDecreaseIndent: false, autoIndent: false, + autoIndentNewline: false, normalizeLineEndings: false, select: false, + undo: "skip", preserveTrailingLineIndentation: true }); + + editor.insertNewline(); + editor.delete(); + editor.backspace(); + editor.mutateSelectedText((selection, index) => { selection.clear(); }); + editor.transpose(); + editor.upperCase(); + editor.lowerCase(); + editor.toggleLineCommentsInSelection(); + editor.insertNewlineBelow(); + editor.insertNewlineAbove(); + editor.deleteToBeginningOfWord(); + editor.deleteToPreviousWordBoundary(); + editor.deleteToNextWordBoundary(); + editor.deleteToBeginningOfSubword(); + editor.deleteToEndOfSubword(); + editor.deleteToBeginningOfLine(); + editor.deleteToEndOfLine(); + editor.deleteToEndOfWord(); + editor.deleteLine(); + + // History + editor.undo(); + editor.redo(); + + editor.transact(() => {}); + editor.transact(42, () => {}); + + editor.abortTransaction(); + num = editor.createCheckpoint(); + bool = editor.revertToCheckpoint(42); + bool = editor.groupChangesSinceCheckpoint(42); + + // TextEditor Coordinates + pos = editor.screenPositionForBufferPosition(pos); + pos = editor.screenPositionForBufferPosition([0, 0]); + pos = editor.screenPositionForBufferPosition(pos, {}); + pos = editor.screenPositionForBufferPosition(pos, { clipDirection: "backward" }); + pos = editor.screenPositionForBufferPosition([0, 0], { clipDirection: "forward" }); + + pos = editor.bufferPositionForScreenPosition(pos); + pos = editor.bufferPositionForScreenPosition([0, 0]); + pos = editor.bufferPositionForScreenPosition(pos, {}); + pos = editor.bufferPositionForScreenPosition(pos, { clipDirection: "backward" }); + pos = editor.bufferPositionForScreenPosition([0, 0], { clipDirection: "forward" }); + + range = editor.screenRangeForBufferRange(range); + range = editor.screenRangeForBufferRange([pos, pos]); + range = editor.screenRangeForBufferRange([pos, [0, 0]]); + range = editor.screenRangeForBufferRange([[0, 0], pos]); + range = editor.screenRangeForBufferRange([[0, 0], [0, 0]]); + + range = editor.bufferRangeForScreenRange(range); + range = editor.bufferRangeForScreenRange([pos, pos]); + range = editor.bufferRangeForScreenRange([pos, [0, 0]]); + range = editor.bufferRangeForScreenRange([[0, 0], pos]); + range = editor.bufferRangeForScreenRange([[0, 0], [0, 0]]); + + pos = editor.clipBufferPosition(pos); + pos = editor.clipBufferPosition([0, 0]); + + range = editor.clipBufferRange(range); + range = editor.clipBufferRange([pos, pos]); + range = editor.clipBufferRange([pos, [0, 0]]); + range = editor.clipBufferRange([[0, 0], pos]); + range = editor.clipBufferRange([[0, 0], [0, 0]]); + + pos = editor.clipScreenPosition(pos); + pos = editor.clipScreenPosition([0, 0]); + pos = editor.clipScreenPosition(pos, {}); + pos = editor.clipScreenPosition(pos, { clipDirection: "closest" }); + pos = editor.clipScreenPosition([0, 0], { clipDirection: "closest" }); + + range = editor.clipScreenRange(range); + range = editor.clipScreenRange([pos, pos]); + range = editor.clipScreenRange([pos, [0, 0]]); + range = editor.clipScreenRange([[0, 0], pos]); + range = editor.clipScreenRange([[0, 0], [0, 0]]); + range = editor.clipScreenRange(range, {}); + range = editor.clipScreenRange(range, { clipDirection: "closest" }); + range = editor.clipScreenRange([pos, pos], { clipDirection: "closest" }); + + // Decorations + decoration = editor.decorateMarker(displayMarker, { type: "line" }); + decoration = editor.decorateMarker(displayMarker, { type: "line", avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + + layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number" }); + layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number", + avoidOverflow: false, class: "test-class", item: element, onlyEmpty: false, onlyHead: false, + onlyNonEmpty: false, position: "after" }); + + decorations = editor.getDecorations(); + decorations = editor.getDecorations({}); + decorations = editor.getDecorations({ type: "line-number" }); + decorations = editor.getDecorations({ type: "line", avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + + decorations = editor.getLineDecorations(); + decorations = editor.getLineDecorations({}); + decorations = editor.getLineDecorations({ avoidOverflow: true }); + decorations = editor.getLineDecorations({ avoidOverflow: true, class: "test-class", + item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + + decorations = editor.getLineNumberDecorations(); + decorations = editor.getLineNumberDecorations({}); + decorations = editor.getLineNumberDecorations({ onlyHead: true }); + decorations = editor.getLineNumberDecorations({ avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + + decorations = editor.getHighlightDecorations(); + decorations = editor.getHighlightDecorations({}); + decorations = editor.getHighlightDecorations({ onlyHead: true }); + decorations = editor.getHighlightDecorations({ avoidOverflow: true, + class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + + decorations = editor.getOverlayDecorations(); + decorations = editor.getOverlayDecorations({}); + decorations = editor.getOverlayDecorations({ onlyHead: true }); + decorations = editor.getOverlayDecorations({ avoidOverflow: true, + class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + + // Markers + displayMarker = editor.markBufferRange(range); + displayMarker = editor.markBufferRange([pos, pos]); + displayMarker = editor.markBufferRange([pos, [0, 0]]); + displayMarker = editor.markBufferRange([[0, 0], pos]); + displayMarker = editor.markBufferRange([[0, 0], [0, 0]]); + displayMarker = editor.markBufferRange(range, {}); + displayMarker = editor.markBufferRange(range, { invalidate: "surround" }); + displayMarker = editor.markBufferRange(range, { maintainHistory: true }); + displayMarker = editor.markBufferRange(range, { reversed: true }); + displayMarker = editor.markBufferRange([[0, 0], [0, 0]], { invalidate: "overlap" }); + displayMarker = editor.markBufferRange(range, { invalidate: "surround", + maintainHistory: false, reversed: false }); + + displayMarker = editor.markBufferPosition(pos); + displayMarker = editor.markBufferPosition([0, 0]); + displayMarker = editor.markBufferPosition(pos, {}); + displayMarker = editor.markBufferPosition(pos, { invalidate: "never" }); + displayMarker = editor.markBufferPosition([0, 0], { invalidate: "surround" }); + + displayMarker = editor.markScreenPosition(pos); + displayMarker = editor.markScreenPosition([0, 0]); + displayMarker = editor.markScreenPosition(pos, {}); + displayMarker = editor.markScreenPosition(pos, { invalidate: "never" }); + displayMarker = editor.markScreenPosition(pos, { clipDirection: "forward" }); + displayMarker = editor.markScreenPosition([0, 0], { invalidate: "surround", + clipDirection: "backward" }); + + displayMarkers = editor.findMarkers({ startBufferRow: 42 }); + displayMarkers = editor.findMarkers({ endBufferRow: 42 }); + displayMarkers = editor.findMarkers({ containsBufferRange: range }); + displayMarkers = editor.findMarkers({ containsBufferRange: [pos, pos] }); + displayMarkers = editor.findMarkers({ containsBufferRange: [pos, [0, 0]] }); + displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], pos] }); + displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], [0, 0]] }); + displayMarkers = editor.findMarkers({ containsBufferPosition: pos }); + displayMarkers = editor.findMarkers({ containsBufferPosition: [42, 42] }); + displayMarkers = editor.findMarkers({ + startBufferPosition: pos, + endBufferPosition: pos, + startScreenPosition: pos, + endScreenPosition: pos, + startsInBufferRange: range, + endsInBufferRange: range, + startsInScreenRange: range, + endsInScreenRange: range, + startBufferRow: 42, + endBufferRow: 42, + startScreenRow: 42, + endScreenRow: 42, + intersectsBufferRowRange: [42, 42], + intersectsScreenRowRange: [42, 42], + containsBufferRange: range, + containsBufferPosition: pos, + containedInBufferRange: range, + containedInScreenRange: range, + intersectsBufferRange: range, + intersectsScreenRange: range, + }); + + displayMarkerLayer = editor.addMarkerLayer(); + displayMarkerLayer = editor.addMarkerLayer({}); + displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true }); + displayMarkerLayer = editor.addMarkerLayer({ persistent: true }); + displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true, persistent: true }); + + const potentialMarkerLayer = editor.getMarkerLayer(42); + if (potentialMarkerLayer) { + displayMarkerLayer = potentialMarkerLayer; + } + + displayMarkerLayer = editor.getDefaultMarkerLayer(); + displayMarker = editor.getMarker(42); + displayMarkers = editor.getMarkers(); + num = editor.getMarkerCount(); + + // Cursors + pos = editor.getCursorBufferPosition(); + posArr = editor.getCursorBufferPositions(); + + editor.setCursorBufferPosition(pos); + editor.setCursorBufferPosition(pos, {}); + editor.setCursorBufferPosition(pos, { autoscroll: true }); + editor.setCursorBufferPosition([0, 0], { autoscroll: true }); + + let potentialCursor = editor.getCursorAtScreenPosition(pos); + if (potentialCursor) { + cursor = potentialCursor; + } + + potentialCursor = editor.getCursorAtScreenPosition([0, 0]); + if (potentialCursor) { + cursor = potentialCursor; + } + + pos = editor.getCursorScreenPosition(); + posArr = editor.getCursorScreenPositions(); + + editor.setCursorScreenPosition(pos); + editor.setCursorScreenPosition([0, 0]); + editor.setCursorScreenPosition(pos, {}); + editor.setCursorBufferPosition(pos, { autoscroll: true }); + + cursor = editor.addCursorAtBufferPosition(pos); + cursor = editor.addCursorAtBufferPosition([0, 0]); + + cursor = editor.addCursorAtScreenPosition(pos); + cursor = editor.addCursorAtScreenPosition([0, 0]); + + bool = editor.hasMultipleCursors(); + + editor.moveUp(); + editor.moveUp(42); + + editor.moveDown(); + editor.moveDown(42); + + editor.moveLeft(); + editor.moveLeft(42); + + editor.moveRight(); + editor.moveRight(42); + + editor.moveToBeginningOfLine(); + editor.moveToBeginningOfScreenLine(); + editor.moveToFirstCharacterOfLine(); + editor.moveToEndOfLine(); + editor.moveToEndOfScreenLine(); + editor.moveToBeginningOfWord(); + editor.moveToEndOfWord(); + editor.moveToTop(); + editor.moveToBottom(); + editor.moveToBeginningOfNextWord(); + editor.moveToPreviousWordBoundary(); + editor.moveToNextWordBoundary(); + editor.moveToPreviousSubwordBoundary(); + editor.moveToNextSubwordBoundary(); + editor.moveToBeginningOfNextParagraph(); + editor.moveToBeginningOfPreviousParagraph(); + cursor = editor.getLastCursor(); + + str = editor.getWordUnderCursor(); + str = editor.getWordUnderCursor({}); + str = editor.getWordUnderCursor({ allowPrevious: true }); + str = editor.getWordUnderCursor({ includeNonWordCharacters: true }); + str = editor.getWordUnderCursor({ wordRegex: /r/ }); + str = editor.getWordUnderCursor({ allowPrevious: true, includeNonWordCharacters: true, + wordRegex: /r/ }); + + cursors = editor.getCursors(); + cursors = editor.getCursorsOrderedByBufferPosition(); + + // Selections + str = editor.getSelectedText(); + range = editor.getSelectedBufferRange(); + ranges = editor.getSelectedBufferRanges(); + + editor.setSelectedBufferRange(range); + editor.setSelectedBufferRange(range, {}); + editor.setSelectedBufferRange(range, { preserveFolds: true }); + editor.setSelectedBufferRange(range, { reversed: true }); + editor.setSelectedBufferRange(range, { preserveFolds: true, reversed: true }); + editor.setSelectedBufferRange([pos, pos]); + editor.setSelectedBufferRange([pos, [0, 0]]); + editor.setSelectedBufferRange([[0, 0], pos]); + editor.setSelectedBufferRange([[0, 0], [0, 0]]); + + editor.setSelectedBufferRanges(ranges); + editor.setSelectedBufferRanges([[pos, pos]]); + editor.setSelectedBufferRanges([[pos, [0, 0]]]); + editor.setSelectedBufferRanges([[[0, 0], pos]]); + editor.setSelectedBufferRanges([[[0, 0], [0, 0]]]); + editor.setSelectedBufferRanges(ranges, {}); + editor.setSelectedBufferRanges([[pos, pos]], {}); + editor.setSelectedBufferRanges(ranges, { reversed: true }); + editor.setSelectedBufferRanges([[pos, pos]], { preserveFolds: true }); + editor.setSelectedBufferRanges([[pos, pos]], { reversed: true, preserveFolds: true }); + + range = editor.getSelectedScreenRange(); + ranges = editor.getSelectedScreenRanges(); + + editor.setSelectedScreenRange(range); + editor.setSelectedScreenRange([pos, pos]); + editor.setSelectedScreenRange([pos, [0, 0]]); + editor.setSelectedScreenRange([[0, 0], pos]); + editor.setSelectedScreenRange([[0, 0], [0, 0]]); + editor.setSelectedScreenRange(range, {}); + editor.setSelectedScreenRange([pos, pos], {}); + editor.setSelectedScreenRange(range, { reversed: true }); + editor.setSelectedScreenRange([pos, pos], { reversed: true }); + + editor.setSelectedScreenRanges(ranges); + editor.setSelectedScreenRanges([[pos, pos]]); + editor.setSelectedScreenRanges([[pos, [0, 0]]]); + editor.setSelectedScreenRanges([[[0, 0], pos]]); + editor.setSelectedScreenRanges([[[0, 0], [0, 0]]]); + editor.setSelectedScreenRanges(ranges, {}); + editor.setSelectedScreenRanges([[pos, pos]], {}); + editor.setSelectedScreenRanges(ranges, { reversed: true }); + editor.setSelectedScreenRanges([[pos, pos]], { reversed: true }); + + selection = editor.addSelectionForBufferRange(range); + selection = editor.addSelectionForBufferRange([pos, pos]); + selection = editor.addSelectionForBufferRange([pos, [0, 0]]); + selection = editor.addSelectionForBufferRange([[0, 0], pos]); + selection = editor.addSelectionForBufferRange([[0, 0], [0, 0]]); + selection = editor.addSelectionForBufferRange(range, {}); + selection = editor.addSelectionForBufferRange(range, { preserveFolds: true }); + selection = editor.addSelectionForBufferRange(range, { reversed: true }); + selection = editor.addSelectionForBufferRange(range, { preserveFolds: false, + reversed: false }); + selection = editor.addSelectionForBufferRange([pos, pos], { preserveFolds: false }); + + selection = editor.addSelectionForScreenRange(range); + selection = editor.addSelectionForScreenRange([pos, pos]); + selection = editor.addSelectionForScreenRange([pos, [0, 0]]); + selection = editor.addSelectionForScreenRange([[0, 0], pos]); + selection = editor.addSelectionForScreenRange([[0, 0], [0, 0]]); + selection = editor.addSelectionForScreenRange(range, {}); + selection = editor.addSelectionForScreenRange(range, { preserveFolds: true }); + selection = editor.addSelectionForScreenRange(range, { reversed: true }); + selection = editor.addSelectionForScreenRange(range, { preserveFolds: false, + reversed: false }); + selection = editor.addSelectionForScreenRange([pos, pos], { preserveFolds: false }); + + editor.selectToBufferPosition(pos); + editor.selectToScreenPosition(pos); + + editor.selectUp(); + editor.selectUp(42); + + editor.selectDown(); + editor.selectDown(42); + + editor.selectLeft(); + editor.selectLeft(42); + + editor.selectRight(); + editor.selectRight(42); + + editor.selectToTop(); + editor.selectToBottom(); + editor.selectAll(); + editor.selectToBeginningOfLine(); + editor.selectToFirstCharacterOfLine(); + editor.selectToEndOfLine(); + editor.selectToBeginningOfWord(); + editor.selectToEndOfWord(); + editor.selectLinesContainingCursors(); + editor.selectWordsContainingCursors(); + editor.selectToPreviousSubwordBoundary(); + editor.selectToNextSubwordBoundary(); + editor.selectToPreviousWordBoundary(); + editor.selectToNextWordBoundary(); + editor.selectToBeginningOfNextWord(); + editor.selectToBeginningOfNextParagraph(); + editor.selectToBeginningOfPreviousParagraph(); + + const potentialRange = editor.selectMarker(displayMarker); + if (potentialRange) { + range = potentialRange; + } + + selection = editor.getLastSelection(); + selections = editor.getSelections(); + selections = editor.getSelectionsOrderedByBufferPosition(); + bool = editor.selectionIntersectsBufferRange(range); // not range-compatible + + // Searching and Replacing + editor.scan(/r/, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + + editor.scan(/r/, {}, () => {}); + editor.scan(/r/, { leadingContextLineCount: 42 }, () => {}); + editor.scan(/r/, { trailingContextLineCount: 42 }, () => {}); + editor.scan(/r/, { leadingContextLineCount: 42, trailingContextLineCount: 42 }, + () => {}); + + editor.scanInBufferRange(/r/, range, () => {}); + editor.scanInBufferRange(/r/, [pos, pos], () => {}); + editor.scanInBufferRange(/r/, [pos, [0, 0]], () => {}); + editor.scanInBufferRange(/r/, [[0, 0], pos], () => {}); + editor.scanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); + editor.scanInBufferRange(/r/, range, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + + editor.backwardsScanInBufferRange(/r/, range, () => {}); + editor.backwardsScanInBufferRange(/r/, [pos, pos], () => {}); + editor.backwardsScanInBufferRange(/r/, [pos, [0, 0]], () => {}); + editor.backwardsScanInBufferRange(/r/, [[0, 0], pos], () => {}); + editor.backwardsScanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); + editor.backwardsScanInBufferRange(/r/, range, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + + // Tab Behavior + bool = editor.getSoftTabs(); + editor.setSoftTabs(true); + bool = editor.toggleSoftTabs(); + num = editor.getTabLength(); + editor.setTabLength(42); + + const potentialBool = editor.usesSoftTabs(); + if (potentialBool) { + bool = potentialBool; + } + + str = editor.getTabText(); + + // Soft Wrap Behavior + bool = editor.isSoftWrapped(); + editor.setSoftWrapped(true); + bool = editor.toggleSoftWrapped(); + num = editor.getSoftWrapColumn(); + + // Indentation + num = editor.indentationForBufferRow(42); + + editor.setIndentationForBufferRow(42, 42); + editor.setIndentationForBufferRow(42, 42, {}); + editor.setIndentationForBufferRow(42, 42, { preserveLeadingWhitespace: true }); + + editor.indentSelectedRows(); + editor.outdentSelectedRows(); + num = editor.indentLevelForLine("Test"); + editor.autoIndentSelectedRows(); + + // Grammars + grammar = editor.getGrammar(); + editor.setGrammar(grammar); + + // Managing Syntax Scopes + scopeDescriptor = editor.getRootScopeDescriptor(); + + scopeDescriptor = editor.scopeDescriptorForBufferPosition(pos); + scopeDescriptor = editor.scopeDescriptorForBufferPosition([0, 0]); + + range = editor.bufferRangeForScopeAtCursor("selector"); + bool = editor.isBufferRowCommented(42); + + // Clipboard Operations + editor.copySelectedText(); + editor.cutSelectedText(); + + editor.pasteText(); + editor.pasteText({}); + editor.pasteText({ autoIndentNewline: true }); + editor.pasteText({ autoIndent: true }); + editor.pasteText({ autoDecreaseIndent: true }); + editor.pasteText({ normalizeLineEndings: true }); + editor.pasteText({ select: true }); + editor.pasteText({ undo: "skip" }); + editor.pasteText({ autoIndentNewline: true, autoIndent: true, autoDecreaseIndent: true, + normalizeLineEndings: true, select: true, undo: "skip" }); + + editor.cutToEndOfLine(); + editor.cutToEndOfBufferLine(); + + // Folds + editor.foldCurrentRow(); + editor.unfoldCurrentRow(); + editor.foldBufferRow(42); + editor.unfoldBufferRow(42); + editor.foldSelectedLines(); + editor.foldAll(); + editor.unfoldAll(); + editor.foldAllAtIndentLevel(42); + editor.isFoldableAtBufferRow(42); + editor.isFoldableAtScreenRow(42); + editor.toggleFoldAtBufferRow(42); + editor.isFoldedAtCursorRow(); + editor.isFoldedAtBufferRow(42); + editor.isFoldedAtScreenRow(42); + + // Gutters + editor.addGutter({ name: "Test" }); + editor.addGutter({ name: "Test", priority: 42 }); + editor.addGutter({ name: "Test", visible: true }); + editor.addGutter({ name: "Test", priority: 42, visible: true }); + + gutters = editor.getGutters(); + + const potentialGutter = editor.gutterWithName("test-gutter"); + if (potentialGutter) { + gutter = potentialGutter; + } + + editor.scrollToCursorPosition(); + editor.scrollToCursorPosition({}); + editor.scrollToCursorPosition({ center: true }); + + editor.scrollToBufferPosition(pos); + editor.scrollToBufferPosition([0, 0]); + editor.scrollToBufferPosition(pos, {}); + editor.scrollToBufferPosition([0, 0], {}); + editor.scrollToBufferPosition(pos, { center: true }); + editor.scrollToBufferPosition([0, 0], { center: true }); + + editor.scrollToScreenPosition(pos); + editor.scrollToScreenPosition([0, 0]); + editor.scrollToScreenPosition(pos, {}); + editor.scrollToScreenPosition([0, 0], {}); + editor.scrollToScreenPosition(pos, { center: true }); + editor.scrollToScreenPosition([0, 0], { center: true }); + + // TextEditor Rendering + str = editor.getPlaceholderText(); + editor.setPlaceholderText("Test"); + + range = editor.bufferRangeForScopeAtPosition('source.js', [0, 0]); + range = editor.bufferRangeForScopeAtPosition('source.js', {row: 10, column: 11}); + range = editor.bufferRangeForScopeAtPosition('source.js', pos); + + let token: {value: string, scopes: string[]}; + token = editor.tokenForBufferPosition([5, 6]); + token = editor.tokenForBufferPosition({row: 0, column: 1}); + token = editor.tokenForBufferPosition(pos); +} + +// ThemeManager =============================================================== +function testThemeManager() { + // Event Subscription + subscription = atom.themes.onDidChangeActiveThemes(() => {}); + + // Accessing Loaded Themes + let potentialStrs = atom.themes.getLoadedThemeNames(); + if (potentialStrs) { + strs = potentialStrs; + } + + let potentialPacks = atom.themes.getLoadedThemes(); + if (potentialPacks) { + packs = potentialPacks; + } + + // Accessing Active Themes + potentialStrs = atom.themes.getActiveThemeNames(); + if (potentialStrs) { + strs = potentialStrs; + } + + potentialPacks = atom.themes.getActiveThemes(); + if (potentialPacks) { + packs = potentialPacks; + } + + // Managing Enabled Themes + strs = atom.themes.getEnabledThemeNames(); +} + +// TooltipManager ============================================================= +function testTooltipManager() { + subscription = atom.tooltips.add(element, { title: "Test"}); + subscription = atom.tooltips.add(element, { title: "

Test

", html: true }); + subscription = atom.tooltips.add(element, { item: element}); + subscription = atom.tooltips.add(element, { class: "test-class" }); + subscription = atom.tooltips.add(element, { placement: "top" }); + + subscription = atom.tooltips.add(element, { placement: () => "auto left" }); + + subscription = atom.tooltips.add(element, { trigger: "click" }); + subscription = atom.tooltips.add(element, { delay: { hide: 42, show: 42 }}); + subscription = atom.tooltips.add(element, { keyBindingCommand: "test-command", + keyBindingTarget: element }); + + tooltips = atom.tooltips.findTooltips(element); +} + +// ViewRegistry =============================================================== +function testViewRegistry() { + atom.views.addViewProvider(Atom.Point, (point) => { + point.column; + return element; + }); + + element = atom.views.getView(element); + textEditorElement = atom.views.getView(editor); +} + +// Workspace ================================================================== +function testWorkspace() { + // Event Subscription + subscription = atom.workspace.observeTextEditors(editor => editor.id); + subscription = atom.workspace.observePaneItems((item) => {}); + subscription = atom.workspace.onDidChangeActivePaneItem((item) => {}); + subscription = atom.workspace.onDidStopChangingActivePaneItem((item) => {}); + + subscription = atom.workspace.onDidChangeActiveTextEditor(editor => { + if (editor) { + editor.id; + } + }); + + subscription = atom.workspace.observeActivePaneItem((item) => {}); + + subscription = atom.workspace.observeActiveTextEditor(editor => { + if (editor) { + editor.id; + } + }); + + subscription = atom.workspace.onDidOpen(event => event.index && event.item && + event.pane && event.uri); + subscription = atom.workspace.onDidAddPane(event => event.pane); + subscription = atom.workspace.onWillDestroyPane(event => event.pane); + subscription = atom.workspace.onDidDestroyPane(event => event.pane); + subscription = atom.workspace.observePanes(pane => pane.activate()); + subscription = atom.workspace.onDidChangeActivePane(pane => pane.activate()); + subscription = atom.workspace.observeActivePane(pane => pane.activate()); + subscription = atom.workspace.onDidAddPaneItem(event => event.index && event.item && + event.pane); + subscription = atom.workspace.onWillDestroyPaneItem(event => { + event.index && event.item && event.pane; + }); + subscription = atom.workspace.onDidDestroyPaneItem(event => event.index && + event.item && event.pane); + subscription = atom.workspace.onDidAddTextEditor(event => event.index && event.pane && + event.textEditor); + + // Opening + async function workspaceOpen() { + obj = await atom.workspace.open(); + obj = await atom.workspace.open("https://test"); + obj = await atom.workspace.open("https://test", { activateItem: true }); + obj = await atom.workspace.open("https://test", { activatePane: true }); + obj = await atom.workspace.open("https://test", { initialColumn: 42 }); + obj = await atom.workspace.open("https://test", { initialLine: 42 }); + obj = await atom.workspace.open("https://test", { location: "right" }); + obj = await atom.workspace.open("https://test", { split: "up" }); + obj = await atom.workspace.open("https://test", { pending: true }); + obj = await atom.workspace.open("https://test", { searchAllPanes: true }); + obj = await atom.workspace.open("https://test", { + activateItem: true, + activatePane: true, + initialColumn: 42, + initialLine: 42, + location: "left", + split: "left", + pending: true, + searchAllPanes: true, + }); + } + + bool = atom.workspace.hide("https://test"); + bool = atom.workspace.hide(element); + + async function workspaceToggle() { + await atom.workspace.toggle("https://test"); + await atom.workspace.toggle(element); + } + + obj = atom.workspace.createItemForURI("https://test"); + + if (atom.workspace.isTextEditor(obj)) { + const textEditor: Atom.TextEditor = obj; + } + + async function workspaceReopen() { + const result = await atom.workspace.reopenItem(); + if (result) obj = result; + } + + atom.workspace.addOpener((uri) => { + if (uri === "test://") { + return { + getTitle: () => "Test Title", + }; + } + }); + + atom.workspace.buildTextEditor(obj); + + // Pane Items + objs = atom.workspace.getPaneItems(); + obj = atom.workspace.getActivePaneItem(); + editors = atom.workspace.getTextEditors(); + + const potentialEditor = atom.workspace.getActiveTextEditor(); + if (potentialEditor) { + editor = potentialEditor; + } + + // Panes + paneContainer = atom.workspace.getActivePaneContainer(); + panes = atom.workspace.getPanes(); + pane = atom.workspace.getActivePane(); + bool = atom.workspace.activateNextPane(); + bool = atom.workspace.activatePreviousPane(); + + let potentialPaneContainer = atom.workspace.paneContainerForURI("https://test"); + if (potentialPaneContainer) { + paneContainer = potentialPaneContainer; + } + + potentialPaneContainer = atom.workspace.paneContainerForItem(element); + if (potentialPaneContainer) { + paneContainer = potentialPaneContainer; + } + + let potentialPane = atom.workspace.paneForURI("https://test"); + if (potentialPane) { + pane = potentialPane; + } + + potentialPane = atom.workspace.paneForItem(element); + if (potentialPane) { + pane = potentialPane; + } + + // Pane Locations + workspaceCenter = atom.workspace.getCenter(); + dock = atom.workspace.getLeftDock(); + dock = atom.workspace.getRightDock(); + dock = atom.workspace.getBottomDock(); + + // Panels + panels = atom.workspace.getBottomPanels(); + + panel = atom.workspace.addBottomPanel({ item: element }); + panel = atom.workspace.addBottomPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getLeftPanels(); + + panel = atom.workspace.addLeftPanel({ item: element }); + panel = atom.workspace.addLeftPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getRightPanels(); + + panel = atom.workspace.addRightPanel({ item: element }); + panel = atom.workspace.addRightPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getTopPanels(); + + panel = atom.workspace.addTopPanel({ item: element }); + panel = atom.workspace.addTopPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getHeaderPanels(); + + panel = atom.workspace.addHeaderPanel({ item: element }); + panel = atom.workspace.addHeaderPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getFooterPanels(); + + panel = atom.workspace.addFooterPanel({ item: element }); + panel = atom.workspace.addFooterPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getModalPanels(); + + panel = atom.workspace.addModalPanel({ item: element }); + panel = atom.workspace.addModalPanel({ item: element, priority: 100, visible: true }); + + const potentialPanel = atom.workspace.panelForItem(element); + if (potentialPanel) { + panel = potentialPanel; + } + + const scanResults = atom.workspace.scan(/r/, () => {}); + scanResults.cancel(); + + // Searching and Replacing + async function workspaceScan() { + await scanResults; + + const scanOptions = { + onPathsSearched: (pathsSearched: number) => {}, + leadingContextLineCount: 5, + trailingContextLineCount: 5, + paths: ["a"], + }; + await atom.workspace.scan(/r/, scanOptions, (results) => { + str = results.filePath; + for (const match of results.matches) { + range = Atom.Range.fromObject(match.range); + strs = match.leadingContextLines; + strs = match.trailingContextLines; + } + }); + } + + async function workspaceReplace() { + await atom.workspace.replace(/r/, "Test", ["a"], (options) => {}); + } +} + +// WorkspaceCenter ============================================================ +function testWorkspaceCenter() { + // Event Subscription + subscription = workspaceCenter.observeTextEditors(editor => editor.id); + subscription = workspaceCenter.observePaneItems(item => {}); + subscription = workspaceCenter.onDidChangeActivePaneItem(item => {}); + subscription = workspaceCenter.onDidStopChangingActivePaneItem(item => {}); + subscription = workspaceCenter.observeActivePaneItem(item => {}); + + // Pane Items + objs = workspaceCenter.getPaneItems(); + workspaceCenter.getActivePaneItem(); + editors = workspaceCenter.getTextEditors(); + + const potentialEditor = workspaceCenter.getActiveTextEditor(); + if (potentialEditor) { + editor = potentialEditor; + } + + // Panes + panes = workspaceCenter.getPanes(); + pane = workspaceCenter.getActivePane(); + workspaceCenter.activateNextPane(); + workspaceCenter.activatePreviousPane(); +} + +// watchPath ================================================================== +const pathWatcherPromise = Atom.watchPath("/var/test", {}, (events) => { + for (const event of events) { + str = event.path; + str = event.action; + if (event.oldPath) str = event.oldPath; + } }); -sub = editor.onDidStopChanging(event => { - for (const change of event.changes) { - change.newExtent && change.oldExtent && change.newRange && change.oldRange && - change.newText && change.oldText && change.start; - } -}); +// TextEditorElement ========================================================== +function testTextEditorElement() { + textEditorComponent = textEditorElement.getComponent(); + editor = textEditorElement.getModel(); -sub = editor.onDidChangeCursorPosition(event => event.newBufferPosition); -sub = editor.onDidChangeSelectionRange(event => event.selection); -sub = editor.onDidSave(event => event.path); -sub = editor.onDidDestroy(() => {}); -sub = editor.observeGutters(gutter => gutter.show()); -sub = editor.onDidAddGutter(gutter => gutter.hide()); -sub = editor.onDidRemoveGutter(name => name.length); -sub = editor.onDidChangeSoftWrapped(softWrapped => {}); -sub = editor.onDidChangeEncoding(encoding => {}); -sub = editor.observeGrammar(grammar => grammar.name); -sub = editor.onDidChangeGrammar(grammar => grammar.scopeName); -sub = editor.onDidChangeModified(modified => {}); -sub = editor.onDidConflict(() => {}); -sub = editor.onWillInsertText(event => event.cancel && event.text); -sub = editor.onDidInsertText(event => event.text); -sub = editor.observeCursors(cursor => cursor.moveToBottom()); -sub = editor.onDidAddCursor(cursor => cursor.getMarker()); -sub = editor.onDidRemoveCursor(cursor => cursor.compare(cursor)); -sub = editor.observeSelections(selection => selection.cutToEndOfBufferLine()); -sub = editor.onDidAddSelection(selection => selection.selectWord()); -sub = editor.onDidRemoveSelection(selection => selection.toggleLineComments()); -sub = editor.observeDecorations(decoration => decoration.getId()); -sub = editor.onDidAddDecoration(decoration => decoration.id); -sub = editor.onDidRemoveDecoration(decoration => decoration.getId()); -sub = editor.onDidChangePlaceholderText(placeholderText => - placeholderText.toLowerCase()); -buffer = editor.getBuffer(); + textEditorElement.getNextUpdatePromise().then(() => {}); + let num: number = textEditorElement.getBaseCharacterWidth(); -// File Details -str = editor.getTitle(); -str = editor.getLongTitle(); + textEditorElement.scrollToTop(); + textEditorElement.scrollToBottom(); + textEditorElement.setScrollTop(num); + num = textEditorElement.getScrollTop(); + textEditorElement.setScrollLeft(num); + num = textEditorElement.getScrollLeft(); + num = textEditorElement.getScrollHeight(); -const filePath = editor.getPath(); -if (filePath) { - str = filePath; + pixelPos = textEditorElement.pixelPositionForBufferPosition(pos); + pixelPos = textEditorElement.pixelPositionForScreenPosition({row: 1, column: 2}); + pixelPos = textEditorElement.pixelPositionForScreenPosition(pos); + + subscription = textEditorElement.onDidChangeScrollTop((scrollTop: number) => {}); + subscription = textEditorElement.onDidChangeScrollLeft((scrollLeft: number) => {}); + subscription = textEditorElement.onDidAttach(() => {}); + subscription = textEditorElement.onDidDetach(() => {}); + + textEditorElement = document.createElement('atom-text-editor'); } -bool = editor.isModified(); -bool = editor.isEmpty(); -str = editor.getEncoding(); -editor.setEncoding("utf8"); - -// File Operations -async function saveEditor() { - await editor.save(); - await editor.saveAs("test.file"); +// TextEditorComponent ======================================================== +function testTextEditorComponent() { + pixelPos = textEditorComponent.pixelPositionForMouseEvent(mouseEvent); + pixelPos = textEditorComponent.pixelPositionForScreenPosition(pos); + pos = textEditorComponent.screenPositionForMouseEvent(mouseEvent); + pos = textEditorComponent.screenPositionForPixelPosition(pixelPos); } - -// Reading Text -str = editor.getText(); -str = editor.getTextInBufferRange(range); -num = editor.getLineCount(); -num = editor.getScreenLineCount(); -num = editor.getLastBufferRow(); -num = editor.getLastScreenRow(); -str = editor.lineTextForBufferRow(42); -str = editor.lineTextForScreenRow(42); -range = editor.getCurrentParagraphBufferRange(); - -// Mutating Text -editor.setText("Test"); - -editor.setTextInBufferRange(range, "Test"); -editor.setTextInBufferRange([pos, pos], "Test"); -editor.setTextInBufferRange([pos, [0, 0]], "Test"); -editor.setTextInBufferRange([[0, 0], pos], "Test"); -editor.setTextInBufferRange([[0, 0], [0, 0]], "Test"); -editor.setTextInBufferRange(range, "Test", {}); -editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true }); -editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true, - undo: "skip" }); - -editor.insertText("Test"); -editor.insertText("Test", {}); -editor.insertText("Test", { autoDecreaseIndent: true }); -editor.insertText("Test", { autoIndent: true }); -editor.insertText("Test", { autoIndentNewline: true }); -editor.insertText("Test", { normalizeLineEndings: true }); -editor.insertText("Test", { select: true }); -editor.insertText("Test", { undo: "skip" }); -editor.insertText("Text", { autoDecreaseIndent: false, autoIndent: false, - autoIndentNewline: false, normalizeLineEndings: false, select: false, undo: "skip" }); - -editor.insertNewline(); -editor.delete(); -editor.backspace(); -editor.mutateSelectedText((selection, index) => { selection.clear(); }); -editor.transpose(); -editor.upperCase(); -editor.lowerCase(); -editor.toggleLineCommentsInSelection(); -editor.insertNewlineBelow(); -editor.insertNewlineAbove(); -editor.deleteToBeginningOfWord(); -editor.deleteToPreviousWordBoundary(); -editor.deleteToNextWordBoundary(); -editor.deleteToBeginningOfSubword(); -editor.deleteToEndOfSubword(); -editor.deleteToBeginningOfLine(); -editor.deleteToEndOfLine(); -editor.deleteToEndOfWord(); -editor.deleteLine(); - -// History -editor.undo(); -editor.redo(); - -editor.transact(() => {}); -editor.transact(42, () => {}); - -editor.abortTransaction(); -num = editor.createCheckpoint(); -bool = editor.revertToCheckpoint(42); -bool = editor.groupChangesSinceCheckpoint(42); - -// TextEditor Coordinates -pos = editor.screenPositionForBufferPosition(pos); -pos = editor.screenPositionForBufferPosition([0, 0]); -pos = editor.screenPositionForBufferPosition(pos, {}); -pos = editor.screenPositionForBufferPosition(pos, { clipDirection: "backward" }); -pos = editor.screenPositionForBufferPosition([0, 0], { clipDirection: "forward" }); - -pos = editor.bufferPositionForScreenPosition(pos); -pos = editor.bufferPositionForScreenPosition([0, 0]); -pos = editor.bufferPositionForScreenPosition(pos, {}); -pos = editor.bufferPositionForScreenPosition(pos, { clipDirection: "backward" }); -pos = editor.bufferPositionForScreenPosition([0, 0], { clipDirection: "forward" }); - -range = editor.screenRangeForBufferRange(range); -range = editor.screenRangeForBufferRange([pos, pos]); -range = editor.screenRangeForBufferRange([pos, [0, 0]]); -range = editor.screenRangeForBufferRange([[0, 0], pos]); -range = editor.screenRangeForBufferRange([[0, 0], [0, 0]]); - -range = editor.bufferRangeForScreenRange(range); -range = editor.bufferRangeForScreenRange([pos, pos]); -range = editor.bufferRangeForScreenRange([pos, [0, 0]]); -range = editor.bufferRangeForScreenRange([[0, 0], pos]); -range = editor.bufferRangeForScreenRange([[0, 0], [0, 0]]); - -pos = editor.clipBufferPosition(pos); -pos = editor.clipBufferPosition([0, 0]); - -range = editor.clipBufferRange(range); -range = editor.clipBufferRange([pos, pos]); -range = editor.clipBufferRange([pos, [0, 0]]); -range = editor.clipBufferRange([[0, 0], pos]); -range = editor.clipBufferRange([[0, 0], [0, 0]]); - -pos = editor.clipScreenPosition(pos); -pos = editor.clipScreenPosition([0, 0]); -pos = editor.clipScreenPosition(pos, {}); -pos = editor.clipScreenPosition(pos, { clipDirection: "closest" }); -pos = editor.clipScreenPosition([0, 0], { clipDirection: "closest" }); - -range = editor.clipScreenRange(range); -range = editor.clipScreenRange([pos, pos]); -range = editor.clipScreenRange([pos, [0, 0]]); -range = editor.clipScreenRange([[0, 0], pos]); -range = editor.clipScreenRange([[0, 0], [0, 0]]); -range = editor.clipScreenRange(range, {}); -range = editor.clipScreenRange(range, { clipDirection: "closest" }); -range = editor.clipScreenRange([pos, pos], { clipDirection: "closest" }); - -// Decorations -decoration = editor.decorateMarker(displayMarker, { type: "line" }); -decoration = editor.decorateMarker(displayMarker, { type: "line", avoidOverflow: true, - class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, - onlyHead: true, onlyNonEmpty: true, position: "before" }); - -layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number" }); -layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number", - avoidOverflow: false, class: "test-class", item: element, onlyEmpty: false, onlyHead: false, - onlyNonEmpty: false, position: "after" }); - -decorations = editor.getDecorations(); -decorations = editor.getDecorations({}); -decorations = editor.getDecorations({ type: "line-number" }); -decorations = editor.getDecorations({ type: "line", avoidOverflow: true, - class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, - onlyHead: true, onlyNonEmpty: true, position: "before" }); - -decorations = editor.getLineDecorations(); -decorations = editor.getLineDecorations({}); -decorations = editor.getLineDecorations({ avoidOverflow: true }); -decorations = editor.getLineDecorations({ avoidOverflow: true, class: "test-class", - item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, - position: "before" }); - -decorations = editor.getLineNumberDecorations(); -decorations = editor.getLineNumberDecorations({}); -decorations = editor.getLineNumberDecorations({ onlyHead: true }); -decorations = editor.getLineNumberDecorations({ avoidOverflow: true, - class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, - onlyHead: true, onlyNonEmpty: true, position: "before" }); - -decorations = editor.getHighlightDecorations(); -decorations = editor.getHighlightDecorations({}); -decorations = editor.getHighlightDecorations({ onlyHead: true }); -decorations = editor.getHighlightDecorations({ avoidOverflow: true, - class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, - position: "before" }); - -decorations = editor.getOverlayDecorations(); -decorations = editor.getOverlayDecorations({}); -decorations = editor.getOverlayDecorations({ onlyHead: true }); -decorations = editor.getOverlayDecorations({ avoidOverflow: true, - class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, - position: "before" }); - -// Markers -displayMarker = editor.markBufferRange(range); -displayMarker = editor.markBufferRange([pos, pos]); -displayMarker = editor.markBufferRange([pos, [0, 0]]); -displayMarker = editor.markBufferRange([[0, 0], pos]); -displayMarker = editor.markBufferRange([[0, 0], [0, 0]]); -displayMarker = editor.markBufferRange(range, {}); -displayMarker = editor.markBufferRange(range, { invalidate: "surround" }); -displayMarker = editor.markBufferRange(range, { maintainHistory: true }); -displayMarker = editor.markBufferRange(range, { reversed: true }); -displayMarker = editor.markBufferRange([[0, 0], [0, 0]], { invalidate: "overlap" }); -displayMarker = editor.markBufferRange(range, { invalidate: "surround", - maintainHistory: false, reversed: false }); - -displayMarker = editor.markBufferPosition(pos); -displayMarker = editor.markBufferPosition([0, 0]); -displayMarker = editor.markBufferPosition(pos, {}); -displayMarker = editor.markBufferPosition(pos, { invalidate: "never" }); -displayMarker = editor.markBufferPosition([0, 0], { invalidate: "surround" }); - -displayMarker = editor.markScreenPosition(pos); -displayMarker = editor.markScreenPosition([0, 0]); -displayMarker = editor.markScreenPosition(pos, {}); -displayMarker = editor.markScreenPosition(pos, { invalidate: "never" }); -displayMarker = editor.markScreenPosition(pos, { clipDirection: "forward" }); -displayMarker = editor.markScreenPosition([0, 0], { invalidate: "surround", - clipDirection: "backward" }); - -displayMarkers = editor.findMarkers({ startBufferRow: 42 }); -displayMarkers = editor.findMarkers({ endBufferRow: 42 }); -displayMarkers = editor.findMarkers({ containsBufferRange: range }); -displayMarkers = editor.findMarkers({ containsBufferRange: [pos, pos] }); -displayMarkers = editor.findMarkers({ containsBufferRange: [pos, [0, 0]] }); -displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], pos] }); -displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], [0, 0]] }); -displayMarkers = editor.findMarkers({ containsBufferPosition: pos }); -displayMarkers = editor.findMarkers({ containsBufferPosition: [42, 42] }); -displayMarkers = editor.findMarkers({ - startBufferPosition: pos, - endBufferPosition: pos, - startScreenPosition: pos, - endScreenPosition: pos, - startsInBufferRange: range, - endsInBufferRange: range, - startsInScreenRange: range, - endsInScreenRange: range, - startBufferRow: 42, - endBufferRow: 42, - startScreenRow: 42, - endScreenRow: 42, - intersectsBufferRowRange: [42, 42], - intersectsScreenRowRange: [42, 42], - containsBufferRange: range, - containsBufferPosition: pos, - containedInBufferRange: range, - containedInScreenRange: range, - intersectsBufferRange: range, - intersectsScreenRange: range, -}); - -displayMarkerLayer = editor.addMarkerLayer(); -displayMarkerLayer = editor.addMarkerLayer({}); -displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true }); -displayMarkerLayer = editor.addMarkerLayer({ persistent: true }); -displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true, persistent: true }); - -const potentialMarkerLayer = editor.getMarkerLayer(42); -if (potentialMarkerLayer) { - displayMarkerLayer = potentialMarkerLayer; -} - -displayMarkerLayer = editor.getDefaultMarkerLayer(); -displayMarker = editor.getMarker(42); -displayMarkers = editor.getMarkers(); -num = editor.getMarkerCount(); - -// Cursors -pos = editor.getCursorBufferPosition(); -posArr = editor.getCursorBufferPositions(); - -editor.setCursorBufferPosition(pos); -editor.setCursorBufferPosition(pos, {}); -editor.setCursorBufferPosition(pos, { autoscroll: true }); -editor.setCursorBufferPosition([0, 0], { autoscroll: true }); - -let potentialCursor = editor.getCursorAtScreenPosition(pos); -if (potentialCursor) { - cursor = potentialCursor; -} - -potentialCursor = editor.getCursorAtScreenPosition([0, 0]); -if (potentialCursor) { - cursor = potentialCursor; -} - -pos = editor.getCursorScreenPosition(); -posArr = editor.getCursorScreenPositions(); - -editor.setCursorScreenPosition(pos); -editor.setCursorScreenPosition([0, 0]); -editor.setCursorScreenPosition(pos, {}); -editor.setCursorBufferPosition(pos, { autoscroll: true }); - -cursor = editor.addCursorAtBufferPosition(pos); -cursor = editor.addCursorAtBufferPosition([0, 0]); - -cursor = editor.addCursorAtScreenPosition(pos); -cursor = editor.addCursorAtScreenPosition([0, 0]); - -bool = editor.hasMultipleCursors(); - -editor.moveUp(); -editor.moveUp(42); - -editor.moveDown(); -editor.moveDown(42); - -editor.moveLeft(); -editor.moveLeft(42); - -editor.moveRight(); -editor.moveRight(42); - -editor.moveToBeginningOfLine(); -editor.moveToBeginningOfScreenLine(); -editor.moveToFirstCharacterOfLine(); -editor.moveToEndOfLine(); -editor.moveToEndOfScreenLine(); -editor.moveToBeginningOfWord(); -editor.moveToEndOfWord(); -editor.moveToTop(); -editor.moveToBottom(); -editor.moveToBeginningOfNextWord(); -editor.moveToPreviousWordBoundary(); -editor.moveToNextWordBoundary(); -editor.moveToPreviousSubwordBoundary(); -editor.moveToNextSubwordBoundary(); -editor.moveToBeginningOfNextParagraph(); -editor.moveToBeginningOfPreviousParagraph(); -cursor = editor.getLastCursor(); - -str = editor.getWordUnderCursor(); -str = editor.getWordUnderCursor({}); -str = editor.getWordUnderCursor({ allowPrevious: true }); -str = editor.getWordUnderCursor({ includeNonWordCharacters: true }); -str = editor.getWordUnderCursor({ wordRegex: /r/ }); -str = editor.getWordUnderCursor({ allowPrevious: true, includeNonWordCharacters: true, - wordRegex: /r/ }); - -cursors = editor.getCursors(); -cursors = editor.getCursorsOrderedByBufferPosition(); - -// Selections -str = editor.getSelectedText(); -range = editor.getSelectedBufferRange(); -ranges = editor.getSelectedBufferRanges(); - -editor.setSelectedBufferRange(range); -editor.setSelectedBufferRange(range, {}); -editor.setSelectedBufferRange(range, { preserveFolds: true }); -editor.setSelectedBufferRange(range, { reversed: true }); -editor.setSelectedBufferRange(range, { preserveFolds: true, reversed: true }); -editor.setSelectedBufferRange([pos, pos]); -editor.setSelectedBufferRange([pos, [0, 0]]); -editor.setSelectedBufferRange([[0, 0], pos]); -editor.setSelectedBufferRange([[0, 0], [0, 0]]); - -editor.setSelectedBufferRanges(ranges); -editor.setSelectedBufferRanges([[pos, pos]]); -editor.setSelectedBufferRanges([[pos, [0, 0]]]); -editor.setSelectedBufferRanges([[[0, 0], pos]]); -editor.setSelectedBufferRanges([[[0, 0], [0, 0]]]); -editor.setSelectedBufferRanges(ranges, {}); -editor.setSelectedBufferRanges([[pos, pos]], {}); -editor.setSelectedBufferRanges(ranges, { reversed: true }); -editor.setSelectedBufferRanges([[pos, pos]], { preserveFolds: true }); -editor.setSelectedBufferRanges([[pos, pos]], { reversed: true, preserveFolds: true }); - -range = editor.getSelectedScreenRange(); -ranges = editor.getSelectedScreenRanges(); - -editor.setSelectedScreenRange(range); -editor.setSelectedScreenRange([pos, pos]); -editor.setSelectedScreenRange([pos, [0, 0]]); -editor.setSelectedScreenRange([[0, 0], pos]); -editor.setSelectedScreenRange([[0, 0], [0, 0]]); -editor.setSelectedScreenRange(range, {}); -editor.setSelectedScreenRange([pos, pos], {}); -editor.setSelectedScreenRange(range, { reversed: true }); -editor.setSelectedScreenRange([pos, pos], { reversed: true }); - -editor.setSelectedScreenRanges(ranges); -editor.setSelectedScreenRanges([[pos, pos]]); -editor.setSelectedScreenRanges([[pos, [0, 0]]]); -editor.setSelectedScreenRanges([[[0, 0], pos]]); -editor.setSelectedScreenRanges([[[0, 0], [0, 0]]]); -editor.setSelectedScreenRanges(ranges, {}); -editor.setSelectedScreenRanges([[pos, pos]], {}); -editor.setSelectedScreenRanges(ranges, { reversed: true }); -editor.setSelectedScreenRanges([[pos, pos]], { reversed: true }); - -selection = editor.addSelectionForBufferRange(range); -selection = editor.addSelectionForBufferRange([pos, pos]); -selection = editor.addSelectionForBufferRange([pos, [0, 0]]); -selection = editor.addSelectionForBufferRange([[0, 0], pos]); -selection = editor.addSelectionForBufferRange([[0, 0], [0, 0]]); -selection = editor.addSelectionForBufferRange(range, {}); -selection = editor.addSelectionForBufferRange(range, { preserveFolds: true }); -selection = editor.addSelectionForBufferRange(range, { reversed: true }); -selection = editor.addSelectionForBufferRange(range, { preserveFolds: false, - reversed: false }); -selection = editor.addSelectionForBufferRange([pos, pos], { preserveFolds: false }); - -selection = editor.addSelectionForScreenRange(range); -selection = editor.addSelectionForScreenRange([pos, pos]); -selection = editor.addSelectionForScreenRange([pos, [0, 0]]); -selection = editor.addSelectionForScreenRange([[0, 0], pos]); -selection = editor.addSelectionForScreenRange([[0, 0], [0, 0]]); -selection = editor.addSelectionForScreenRange(range, {}); -selection = editor.addSelectionForScreenRange(range, { preserveFolds: true }); -selection = editor.addSelectionForScreenRange(range, { reversed: true }); -selection = editor.addSelectionForScreenRange(range, { preserveFolds: false, - reversed: false }); -selection = editor.addSelectionForScreenRange([pos, pos], { preserveFolds: false }); - -editor.selectToBufferPosition(pos); -editor.selectToScreenPosition(pos); - -editor.selectUp(); -editor.selectUp(42); - -editor.selectDown(); -editor.selectDown(42); - -editor.selectLeft(); -editor.selectLeft(42); - -editor.selectRight(); -editor.selectRight(42); - -editor.selectToTop(); -editor.selectToBottom(); -editor.selectAll(); -editor.selectToBeginningOfLine(); -editor.selectToFirstCharacterOfLine(); -editor.selectToEndOfLine(); -editor.selectToBeginningOfWord(); -editor.selectToEndOfWord(); -editor.selectLinesContainingCursors(); -editor.selectWordsContainingCursors(); -editor.selectToPreviousSubwordBoundary(); -editor.selectToNextSubwordBoundary(); -editor.selectToPreviousWordBoundary(); -editor.selectToNextWordBoundary(); -editor.selectToBeginningOfNextWord(); -editor.selectToBeginningOfNextParagraph(); -editor.selectToBeginningOfPreviousParagraph(); - -const potentialRange = editor.selectMarker(displayMarker); -if (potentialRange) { - range = potentialRange; -} - -selection = editor.getLastSelection(); -selections = editor.getSelections(); -selections = editor.getSelectionsOrderedByBufferPosition(); -bool = editor.selectionIntersectsBufferRange(range); // not range-compatible - -// Searching and Replacing -editor.scan(/r/, params => { - num = params.match.index; - str = params.matchText; - range = params.range; - params.replace("Test"); - params.stop(); -}); - -editor.scan(/r/, {}, () => {}); -editor.scan(/r/, { leadingContextLineCount: 42 }, () => {}); -editor.scan(/r/, { trailingContextLineCount: 42 }, () => {}); -editor.scan(/r/, { leadingContextLineCount: 42, trailingContextLineCount: 42 }, - () => {}); - -editor.scanInBufferRange(/r/, range, () => {}); -editor.scanInBufferRange(/r/, [pos, pos], () => {}); -editor.scanInBufferRange(/r/, [pos, [0, 0]], () => {}); -editor.scanInBufferRange(/r/, [[0, 0], pos], () => {}); -editor.scanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); -editor.scanInBufferRange(/r/, range, params => { - num = params.match.index; - str = params.matchText; - range = params.range; - params.replace("Test"); - params.stop(); -}); - -editor.backwardsScanInBufferRange(/r/, range, () => {}); -editor.backwardsScanInBufferRange(/r/, [pos, pos], () => {}); -editor.backwardsScanInBufferRange(/r/, [pos, [0, 0]], () => {}); -editor.backwardsScanInBufferRange(/r/, [[0, 0], pos], () => {}); -editor.backwardsScanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); -editor.backwardsScanInBufferRange(/r/, range, params => { - num = params.match.index; - str = params.matchText; - range = params.range; - params.replace("Test"); - params.stop(); -}); - -// Tab Behavior -bool = editor.getSoftTabs(); -editor.setSoftTabs(true); -bool = editor.toggleSoftTabs(); -num = editor.getTabLength(); -editor.setTabLength(42); - -const potentialBool = editor.usesSoftTabs(); -if (potentialBool) { - bool = potentialBool; -} - -str = editor.getTabText(); - -// Soft Wrap Behavior -bool = editor.isSoftWrapped(); -editor.setSoftWrapped(true); -bool = editor.toggleSoftWrapped(); -num = editor.getSoftWrapColumn(); - -// Indentation -num = editor.indentationForBufferRow(42); - -editor.setIndentationForBufferRow(42, 42); -editor.setIndentationForBufferRow(42, 42, {}); -editor.setIndentationForBufferRow(42, 42, { preserveLeadingWhitespace: true }); - -editor.indentSelectedRows(); -editor.outdentSelectedRows(); -num = editor.indentLevelForLine("Test"); -editor.autoIndentSelectedRows(); - -// Grammars -grammar = editor.getGrammar(); -editor.setGrammar(grammar); - -// Managing Syntax Scopes -scopeDescriptor = editor.getRootScopeDescriptor(); - -scopeDescriptor = editor.scopeDescriptorForBufferPosition(pos); -scopeDescriptor = editor.scopeDescriptorForBufferPosition([0, 0]); - -range = editor.bufferRangeForScopeAtCursor("selector"); -bool = editor.isBufferRowCommented(42); - -// Clipboard Operations -editor.copySelectedText(); -editor.cutSelectedText(); - -editor.pasteText(); -editor.pasteText({}); -editor.pasteText({ autoIndentNewline: true }); -editor.pasteText({ autoIndent: true }); -editor.pasteText({ autoDecreaseIndent: true }); -editor.pasteText({ normalizeLineEndings: true }); -editor.pasteText({ select: true }); -editor.pasteText({ undo: "skip" }); -editor.pasteText({ autoIndentNewline: true, autoIndent: true, autoDecreaseIndent: true, - normalizeLineEndings: true, select: true, undo: "skip" }); - -editor.cutToEndOfLine(); -editor.cutToEndOfBufferLine(); - -// Folds -editor.foldCurrentRow(); -editor.unfoldCurrentRow(); -editor.foldBufferRow(42); -editor.unfoldBufferRow(42); -editor.foldSelectedLines(); -editor.foldAll(); -editor.unfoldAll(); -editor.foldAllAtIndentLevel(42); -editor.isFoldableAtBufferRow(42); -editor.isFoldableAtScreenRow(42); -editor.toggleFoldAtBufferRow(42); -editor.isFoldedAtCursorRow(); -editor.isFoldedAtBufferRow(42); -editor.isFoldedAtScreenRow(42); - -// Gutters -editor.addGutter({ name: "Test" }); -editor.addGutter({ name: "Test", priority: 42 }); -editor.addGutter({ name: "Test", visible: true }); -editor.addGutter({ name: "Test", priority: 42, visible: true }); - -gutters = editor.getGutters(); - -const potentialGutter = editor.gutterWithName("test-gutter"); -if (potentialGutter) { - gutter = potentialGutter; -} - -editor.scrollToCursorPosition(); -editor.scrollToCursorPosition({}); -editor.scrollToCursorPosition({ center: true }); - -editor.scrollToBufferPosition(pos); -editor.scrollToBufferPosition([0, 0]); -editor.scrollToBufferPosition(pos, {}); -editor.scrollToBufferPosition([0, 0], {}); -editor.scrollToBufferPosition(pos, { center: true }); -editor.scrollToBufferPosition([0, 0], { center: true }); - -editor.scrollToScreenPosition(pos); -editor.scrollToScreenPosition([0, 0]); -editor.scrollToScreenPosition(pos, {}); -editor.scrollToScreenPosition([0, 0], {}); -editor.scrollToScreenPosition(pos, { center: true }); -editor.scrollToScreenPosition([0, 0], { center: true }); - -// TextEditor Rendering -str = editor.getPlaceholderText(); -editor.setPlaceholderText("Test"); - -//// ThemeManager ============================================================= -// Event Subscription -sub = atom.themes.onDidChangeActiveThemes(() => {}); - -// Accessing Loaded Themes -let potentialStrs = atom.themes.getLoadedThemeNames(); -if (potentialStrs) { - strs = potentialStrs; -} - -let potentialPacks = atom.themes.getLoadedThemes(); -if (potentialPacks) { - packs = potentialPacks; -} - -// Accessing Active Themes -potentialStrs = atom.themes.getActiveThemeNames(); -if (potentialStrs) { - strs = potentialStrs; -} - -potentialPacks = atom.themes.getActiveThemes(); -if (potentialPacks) { - packs = potentialPacks; -} - -// Managing Enabled Themes -strs = atom.themes.getEnabledThemeNames(); - -//// TooltipManager =========================================================== -sub = atom.tooltips.add(element, { title: "Test"}); -sub = atom.tooltips.add(element, { title: "

Test

", html: true }); -sub = atom.tooltips.add(element, { item: element}); -sub = atom.tooltips.add(element, { class: "test-class" }); -sub = atom.tooltips.add(element, { placement: "top" }); - -sub = atom.tooltips.add(element, { placement: () => "left" }); - -sub = atom.tooltips.add(element, { trigger: "click" }); -sub = atom.tooltips.add(element, { delay: { hide: 42, show: 42 }}); -sub = atom.tooltips.add(element, { keyBindingCommand: "test-command", - keyBindingTarget: element }); - -tooltips = atom.tooltips.findTooltips(element); - -//// ViewRegistry ============================================================= -atom.views.addViewProvider(Point, (point) => { - point.column; - return element; -}); - -element = atom.views.getView(element); - -//// Workspace ================================================================ -// Event Subscription -sub = atom.workspace.observeTextEditors(editor => editor.id); -sub = atom.workspace.observePaneItems((item) => {}); -sub = atom.workspace.onDidChangeActivePaneItem((item) => {}); -sub = atom.workspace.onDidStopChangingActivePaneItem((item) => {}); - -sub = atom.workspace.onDidChangeActiveTextEditor(editor => { - if (editor) { - editor.id; - } -}); - -sub = atom.workspace.observeActivePaneItem((item) => {}); - -sub = atom.workspace.observeActiveTextEditor(editor => { - if (editor) { - editor.id; - } -}); - -sub = atom.workspace.onDidOpen(event => event.index && event.item && event.pane && - event.uri); -sub = atom.workspace.onDidAddPane(event => event.pane); -sub = atom.workspace.onWillDestroyPane(event => event.pane); -sub = atom.workspace.onDidDestroyPane(event => event.pane); -sub = atom.workspace.observePanes(pane => pane.activate()); -sub = atom.workspace.onDidChangeActivePane(pane => pane.activate()); -sub = atom.workspace.observeActivePane(pane => pane.activate()); -sub = atom.workspace.onDidAddPaneItem(event => event.index && event.item && event.pane); -sub = atom.workspace.onWillDestroyPaneItem(event => event.index && event.item && event.pane); -sub = atom.workspace.onDidDestroyPaneItem(event => event.index && event.item && event.pane); -sub = atom.workspace.onDidAddTextEditor(event => event.index && event.pane && - event.textEditor); - -// Opening -async function workspaceOpen() { - obj = await atom.workspace.open(); - obj = await atom.workspace.open("https://test"); - obj = await atom.workspace.open("https://test", { activateItem: true }); - obj = await atom.workspace.open("https://test", { activatePane: true }); - obj = await atom.workspace.open("https://test", { initialColumn: 42 }); - obj = await atom.workspace.open("https://test", { initialLine: 42 }); - obj = await atom.workspace.open("https://test", { location: "right" }); - obj = await atom.workspace.open("https://test", { split: "up" }); - obj = await atom.workspace.open("https://test", { pending: true }); - obj = await atom.workspace.open("https://test", { searchAllPanes: true }); - obj = await atom.workspace.open("https://test", { - activateItem: true, - activatePane: true, - initialColumn: 42, - initialLine: 42, - location: "left", - split: "left", - pending: true, - searchAllPanes: true, - }); -} - -bool = atom.workspace.hide("https://test"); -bool = atom.workspace.hide(element); - -async function workspaceToggle() { - await atom.workspace.toggle("https://test"); - await atom.workspace.toggle(element); -} - -obj = atom.workspace.createItemForURI("https://test"); - -bool = atom.workspace.isTextEditor(obj); - -async function workspaceReopen() { - const result = await atom.workspace.reopenItem(); - if (result) obj = result; -} - -atom.workspace.addOpener(() => element); - -atom.workspace.buildTextEditor(obj); - -// Pane Items -objs = atom.workspace.getPaneItems(); -obj = atom.workspace.getActivePaneItem(); -editors = atom.workspace.getTextEditors(); - -let potentialEditor = atom.workspace.getActiveTextEditor(); -if (potentialEditor) { - editor = potentialEditor; -} - -// Panes -paneContainer = atom.workspace.getActivePaneContainer(); -panes = atom.workspace.getPanes(); -pane = atom.workspace.getActivePane(); -bool = atom.workspace.activateNextPane(); -bool = atom.workspace.activatePreviousPane(); - -let potentialPaneContainer = atom.workspace.paneContainerForURI("https://test"); -if (potentialPaneContainer) { - paneContainer = potentialPaneContainer; -} - -potentialPaneContainer = atom.workspace.paneContainerForItem(element); -if (potentialPaneContainer) { - paneContainer = potentialPaneContainer; -} - -let potentialPane = atom.workspace.paneForURI("https://test"); -if (potentialPane) { - pane = potentialPane; -} - -potentialPane = atom.workspace.paneForItem(element); -if (potentialPane) { - pane = potentialPane; -} - -// Pane Locations -workspaceCenter = atom.workspace.getCenter(); -dock = atom.workspace.getLeftDock(); -dock = atom.workspace.getRightDock(); -dock = atom.workspace.getBottomDock(); - -// Panels -panels = atom.workspace.getBottomPanels(); - -panel = atom.workspace.addBottomPanel({ item: element }); -panel = atom.workspace.addBottomPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getLeftPanels(); - -panel = atom.workspace.addLeftPanel({ item: element }); -panel = atom.workspace.addLeftPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getRightPanels(); - -panel = atom.workspace.addRightPanel({ item: element }); -panel = atom.workspace.addRightPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getTopPanels(); - -panel = atom.workspace.addTopPanel({ item: element }); -panel = atom.workspace.addTopPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getHeaderPanels(); - -panel = atom.workspace.addHeaderPanel({ item: element }); -panel = atom.workspace.addHeaderPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getFooterPanels(); - -panel = atom.workspace.addFooterPanel({ item: element }); -panel = atom.workspace.addFooterPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getModalPanels(); - -panel = atom.workspace.addModalPanel({ item: element }); -panel = atom.workspace.addModalPanel({ item: element, priority: 100, visible: true }); - -const potentialPanel = atom.workspace.panelForItem(element); -if (potentialPanel) { - panel = potentialPanel; -} - -const scanResults = atom.workspace.scan(/r/, () => {}); -scanResults.cancel(); - -// Searching and Replacing -async function workspaceScan() { - await scanResults; - - const scanOptions = { - onPathsSearched: (pathsSearched: number) => {}, - leadingContextLineCount: 5, - trailingContextLineCount: 5, - paths: ["a"], - }; - await atom.workspace.scan(/r/, scanOptions, (results) => { - str = results.filePath; - for (const match of results.matches) { - range = Range.fromObject(match.range); - strs = match.leadingContextLines; - strs = match.trailingContextLines; - } - }); -} - -async function workspaceReplace() { - await atom.workspace.replace(/r/, "Test", ["a"], (options) => {}); -} - -//// WorkspaceCenter ========================================================== -// Event Subscription -sub = workspaceCenter.observeTextEditors(editor => editor.id); -sub = workspaceCenter.observePaneItems(item => {}); -sub = workspaceCenter.onDidChangeActivePaneItem(item => {}); -sub = workspaceCenter.onDidStopChangingActivePaneItem(item => {}); -sub = workspaceCenter.observeActivePaneItem(item => {}); - -// Pane Items -objs = workspaceCenter.getPaneItems(); -workspaceCenter.getActivePaneItem(); -editors = workspaceCenter.getTextEditors(); - -potentialEditor = workspaceCenter.getActiveTextEditor(); -if (potentialEditor) { - editor = potentialEditor; -} - -// Panes -panes = workspaceCenter.getPanes(); -pane = workspaceCenter.getActivePane(); -workspaceCenter.activateNextPane(); -workspaceCenter.activatePreviousPane(); diff --git a/types/atom/autocomplete-plus/config.d.ts b/types/atom/autocomplete-plus/config.d.ts new file mode 100644 index 0000000000..e4c9f3a2d4 --- /dev/null +++ b/types/atom/autocomplete-plus/config.d.ts @@ -0,0 +1,128 @@ +import "../index"; + +declare module "atom" { + interface ConfigValues { + /** + * Suggestions will show as you type if this preference is enabled. If it is + * disabled, you can still see suggestions by using the keymapping for + * 'autocomplete-plus:activate' (shown below). + */ + "autocomplete-plus.enableAutoActivation": boolean; + + /** + * If you are experiencing performance issues when typing, you should try + * increasing this value to a non-zero number (e.g. 100). + */ + "autocomplete-plus.autoActivationDelay": number; + + /** The suggestion list will only show this many suggestions. */ + "autocomplete-plus.maxVisibleSuggestions": number; + + /** + * You should use the key(s) indicated here to confirm a suggestion from the + * suggestion list and have it inserted into the file. + */ + "autocomplete-plus.confirmCompletion": + | "tab" + | "enter" + | "tab and enter" + | "tab always, enter when suggestion explicitly selected"; + + /** + * Disable this if you want to bind your own keystrokes to move around the + * suggestion list. You will also need to add definitions to your keymap. + */ + "autocomplete-plus.useCoreMovementCommands": boolean; + + /** + * Suggestions will not be provided for files matching this list, e.g. *.md + * for Markdown files. To blacklist more than one file extension, use comma + * as a separator, e.g. ["*.md", "*.txt"] (both Markdown and text files). + */ + "autocomplete-plus.fileBlacklist": string[]; + + /** Suggestions will not be provided for scopes matching this list. */ + "autocomplete-plus.scopeBlacklist": string[]; + + /** + * For grammars with no registered provider(s), the default provider will + * include completions from all buffers, instead of just the buffer you are + * currently editing. + */ + "autocomplete-plus.includeCompletionsFromAllBuffers": boolean; + + /** + * Fuzzy searching is performed if this is disabled; if it is enabled, suggestions + * must begin with the prefix from the current word. + */ + "autocomplete-plus.strictMatching": boolean; + + /** + * Only autocomplete when you've typed at least this many characters. + * Note: May not affect external providers. + */ + "autocomplete-plus.minimumWordLength": number; + + /** + * The package comes with a built-in provider that will provide suggestions + * using the words in your current buffer or all open buffers. You will get + * better suggestions by installing additional autocomplete+ providers. + * To stop using the built-in provider, disable this option. + */ + "autocomplete-plus.enableBuiltinProvider": boolean; + + /** Don't use the built-in provider for these selector(s). */ + "autocomplete-plus.builtinProviderBlacklist": string; + + /** + * If enabled, typing `backspace` will show the suggestion list if suggestions + * are available. If disabled, suggestions will not be shown while backspacing. + */ + "autocomplete-plus.backspaceTriggersAutocomplete": boolean; + + /** + * If enabled, automatically insert suggestion on manual activation with + * 'autocomplete-plus:activate' when there is only one match. + */ + "autocomplete-plus.enableAutoConfirmSingleSuggestion": boolean; + + /** + * With 'Cursor' the suggestion list appears at the cursor's position. + * With 'Word' it appears at the beginning of the word that's being completed. + */ + "autocomplete-plus.suggestionListFollows": "Word"|"Cursor"; + + /** + * If you're having trouble with autocomplete, you may consider falling back + * to the Symbol provider and filing an issue. + */ + "autocomplete-plus.defaultProvider": "Subsequence"|"Symbol"; + + /** Don't auto-activate when any of these classes are present in the editor. */ + "autocomplete-plus.suppressActivationForEditorClasses": string[]; + + /** + * Completing a suggestion consumes text following the cursor matching the + * suffix of the chosen suggestion. + */ + "autocomplete-plus.consumeSuffix": boolean; + + /** + * -EXPERIMENTAL- Prefers runs of consecutive characters, acronyms and start + * of words. + */ + "autocomplete-plus.useAlternateScoring": boolean; + + /** Gives words near the cursor position a higher score than those far away. */ + "autocomplete-plus.useLocalityBonus": boolean; + + /** Identifies non-latin alphabet characters as letters. */ + "autocomplete-plus.enableExtendedUnicodeSupport": boolean; + + /** + * Should similar suggestions be removed from the list? If so how to determine + * they are similar. + */ + "autocomplete-plus.similarSuggestionRemoval": "none"|"textOrSnippet"; + } +} diff --git a/types/atom/autocomplete-plus/index.d.ts b/types/atom/autocomplete-plus/index.d.ts new file mode 100644 index 0000000000..2e91a81262 --- /dev/null +++ b/types/atom/autocomplete-plus/index.d.ts @@ -0,0 +1,157 @@ +// Autocomplete Plus 2.x +// https://atom.io/packages/autocomplete-plus + +/// + +import { Point, ScopeDescriptor, TextEditor } from "../index"; + +/** The parameters passed into getSuggestions by Autocomplete+. */ +export interface SuggestionsRequestedEvent { + /** The current TextEditor. */ + editor: TextEditor; + + /** The position of the cursor. */ + bufferPosition: Point; + + /** The scope descriptor for the current cursor position. */ + scopeDescriptor: ScopeDescriptor; + + /** The prefix for the word immediately preceding the current cursor position. */ + prefix: string; + + /** Whether the autocomplete request was initiated by the user. */ + activatedManually: boolean; +} + +/** The parameters passed into onDidInsertSuggestion by Autocomplete+. */ +export interface SuggestionInsertedEvent { + editor: TextEditor; + triggerPosition: Point; + suggestion: TextSuggestion|SnippetSuggestion; +} + +/** + * An autocompletion suggestion for the user. + * Primary data type for the Atom Autocomplete+ service. + */ +export interface Suggestion { + /** + * A string that will show in the UI for this suggestion. + * When not set, snippet || text is displayed. + */ + displayText?: string; + + /** + * The text immediately preceding the cursor, which will be replaced by the text. + * If not provided, the prefix passed into getSuggestions will be used. + */ + replacementPrefix?: string; + + /** + * The suggestion type. It will be converted into an icon shown against the + * suggestion. + */ + type?: string; + + /** This is shown before the suggestion. Useful for return values. */ + leftLabel?: string; + + /** Use this instead of leftLabel if you want to use html for the left label. */ + leftLabelHTML?: string; + + /** + * An indicator (e.g. function, variable) denoting the "kind" of suggestion this + * represents. + */ + rightLabel?: string; + + /** Use this instead of rightLabel if you want to use html for the right label. */ + rightLabelHTML?: string; + + /** + * Class name for the suggestion in the suggestion list. Allows you to style your + * suggestion via CSS, if desired. + */ + className?: string; + + /** + * If you want complete control over the icon shown against the suggestion. + * e.g. iconHTML: + */ + iconHTML?: string; + + /** + * A doc-string summary or short description of the suggestion. When specified, it + * will be displayed at the bottom of the suggestions list. + */ + description?: string; + + /** + * A url to the documentation or more information about this suggestion. + * When specified, a More.. link will be displayed in the description area. + */ + descriptionMoreURL?: string; +} + +export interface TextSuggestion extends Suggestion { + /** The text which will be inserted into the editor, in place of the prefix. */ + text: string; +} + +export interface SnippetSuggestion extends Suggestion { + /** + * A snippet string. This will allow users to tab through function arguments + * or other options. + */ + snippet: string; +} + +export type Suggestions = Array; + +/** The interface that all Autocomplete+ providers must implement. */ +export interface AutocompleteProvider { + /** + * Defines the scope selector(s) (can be comma-separated) for which your provider + * should receive suggestion requests. + */ + selector: string; + + /** + * Is called when a suggestion request has been dispatched by autocomplete+ to + * your provider. Return an array of suggestions (if any) in the order you would + * like them displayed to the user. Returning a Promise of an array of suggestions + * is also supported. + */ + getSuggestions(params: SuggestionsRequestedEvent): Suggestions|Promise; + + /** + * Defines the scope selector(s) (can be comma-separated) for which your provider + * should not be used. + */ + disableForSelector?: string; + + /** + * A number to indicate its priority to be included in a suggestions request. + * The default provider has an inclusion priority of 0. Higher priority providers + * can suppress lower priority providers with excludeLowerPriority. + */ + inclusionPriority?: number; + + /** Will not use lower priority providers when this provider is used. */ + excludeLowerPriority?: boolean; + + /** + * A number to determine the sort order of suggestions. The default provider has + * an suggestion priority of 1. + */ + suggestionPriority?: number; + + /** + * Function that is called when a suggestion from your provider was inserted + * into the buffer. + */ + onDidInsertSuggestion?(params: SuggestionInsertedEvent): void; + + /** Will be called if your provider is being destroyed by autocomplete+ */ + dispose?(): void; +} diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 4a7f23cf60..53fa8d5749 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1,4262 +1,6722 @@ -// Type definitions for Atom 1.21 +// Type definitions for Atom 1.23 // Project: https://github.com/atom/atom // Definitions by: GlenCFL +// smhxx +// lierdakil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// +// NOTE: only those classes exported within this file should be retain that status below. +// https://github.com/atom/atom/blob/v1.23.0/exports/atom.js + /// -/// -/// -/// -/// +/// + +import { ReadStream, WriteStream } from "fs"; +import { ChildProcess } from "child_process"; declare global { - /** The core classes for the Atom Text Editor. */ - namespace AtomCore { - /** Objects that appear as parameters to callbacks. */ - namespace Events { - interface ExceptionThrown { - originalError: Error; - message: string; - url: string; - line: number; - column: number; - } + const atom: AtomEnvironment; - interface PreventableExceptionThrown extends ExceptionThrown { - preventDefault(): void; - } - - interface SelectionChanged { - oldBufferRange: TextBuffer.Range; - oldScreenRange: TextBuffer.Range; - newBufferRange: TextBuffer.Range; - newScreenRange: TextBuffer.Range; - selection: Selection; - } - - interface PaneItemObserved { - item: object; - pane: Pane; - index: number; - } - - interface PaneItemOpened extends PaneItemObserved { - uri: string; - } - - interface EditorChanged { - /** A Point representing where the change started. */ - start: TextBuffer.Point; - - /** A Point representing the replaced extent. */ - oldExtent: TextBuffer.Point; - - /** A Point representing the replacement extent. */ - newExtent: TextBuffer.Point; - } - - interface StyleElementObserved extends HTMLStyleElement { - sourcePath: string; - context: string; - } - - interface TextEditorObserved { - textEditor: TextEditor; - pane: Pane; - index: number; - } - - interface RepoStatusChanged { - path: string; - - /** This value can be passed to ::isStatusModified or ::isStatusNew to get more - * information. - */ - pathStatus: number; - } - - interface PaneListItemShifted { - /** The pane item that was added or removed. */ - item: object; - - /** A number indicating where the item is located. */ - index: number; - } - - interface PaneItemMoved { - /** The removed pane item. */ - item: object; - - /** A number indicating where the item was located. */ - oldIndex: number; - - /** A number indicating where the item is now located. */ - newIndex: number; - } - - interface CursorPositionChanged { - oldBufferPosition: TextBuffer.Point; - oldScreenPosition: TextBuffer.Point; - newBufferPosition: TextBuffer.Point; - newScreenPosition: TextBuffer.Point; - textChanged: boolean; - Cursor: Cursor; - } - - interface DecorationPropsChanged { - /** Object the old parameters the decoration used to have. */ - oldProperties: Structures.DecorationProps; - - /** Object the new parameters the decoration now has */ - newProperties: Structures.DecorationProps; - } - - type FilesystemChange = Array<{ - /** A string describing the filesystem action that occurred. */ - action: "created"|"modified"|"deleted"|"renamed"; - - /** The absolute path to the filesystem entry that was acted upon. */ - path: string; - - /** For rename events, a string containing the filesystem entry's former - * absolute path. - */ - oldPath?: string; - }>; - } - - /** Objects that appear as parameters to functions. */ - namespace Options { - interface TextInsertion { - select?: boolean; - autoIndent?: boolean; - autoIndentNewline?: boolean; - autoDecreaseIndent?: boolean; - normalizeLineEndings?: boolean; - undo?: "skip"; - } - - interface Menu { - /** The menu itme's label. */ - label: string; - - /** An array of sub menus. */ - submenu?: ReadonlyArray; - - /** The command to trigger when the item is clicked. */ - command?: string; - } - - interface ContextMenu { - /** The menu item's label. */ - label?: string; - - /** The command to invoke on the target of the right click that invoked the - * context menu. - */ - command?: string; - - /** Whether the menu item should be clickable. Disabled menu items typically - * appear grayed out. Defaults to true. - */ - enabled?: boolean; - - /** An array of additional items. */ - submenu?: ReadonlyArray; - - /** If you want to create a separator, provide an item with type: 'separator' - * and no other keys. - */ - type?: "separator"; - - /** Whether the menu item should appear in the menu. Defaults to true. */ - visible?: boolean; - - /** A function that is called on the item each time a context menu is created - * via a right click. - */ - created?(event: Event): void; - - /** A function that is called to determine whether to display this item on a - * given context menu deployment. - */ - shouldDisplay?(event: Event): void; - } - - interface SpawnProcess { - /** Current working directory of the child process. */ - cwd?: string; - - /** Environment key-value pairs. */ - env?: { [key: string]: string }; - - /** The child's stdio configuration. */ - stdio?: string|Array; - - /** Prepare child to run independently of its parent process. */ - detached?: boolean; - - /** Sets the user identity of the process. */ - uid?: number; - - /** Sets the group identity of the process. */ - gid?: number; - - /** If true, runs command inside of a shell. Uses "/bin/sh" on UNIX, and process.env.ComSpec - * on Windows. A different shell can be specified as a string. - */ - shell?: boolean | string; - } - - interface NodeProcess { - /** The command to execute. */ - command: string; - - /** The array of arguments to pass to the command. */ - args?: ReadonlyArray; - - /** The options object to pass to Node's ChildProcess.spawn method. */ - options?: SpawnProcess; - - /** The callback that receives a single argument which contains the standard - * output from the command. - */ - stdout?(data: string): void; - - /** The callback that receives a single argument which contains the standard - * error output from the command. - */ - stderr?(data: string): void; - - /** The callback which receives a single argument containing the exit status. */ - exit?(code: number): void; - } - - interface Process extends NodeProcess { - /** Whether the command will automatically start when this BufferedProcess is - * created. - */ - autoStart?: boolean; - } - - interface Notification { - buttons?: Array<{ - className?: string; - onDidClick?(event: MouseEvent): void; - text?: string; - }>; - description?: string; - detail?: string; - dismissable?: boolean; - icon?: string; - } - - interface ErrorNotification extends Notification { - stack?: string; - } - - /** The options for a Bootstrap 3 Tooltip class, which Atom uses a variant of. */ - interface Tooltip { - /** Apply a CSS fade transition to the tooltip. */ - animation?: boolean; - - /** Appends the tooltip to a specific element. */ - container?: string|HTMLElement|false; - - /** Delay showing and hiding the tooltip (ms) - does not apply to manual - * trigger type. - */ - delay?: number|{ show: number, hide: number }; - - /** Allow HTML in the tooltip. */ - html?: boolean; - - /** How to position the tooltip. */ - placement?: "top"|"bottom"|"left"|"right"|"auto"; - - /** If a selector is provided, tooltip objects will be delegated to the - * specified targets. - */ - selector?: string; - - /** Base HTML to use when creating the tooltip. */ - template?: string; - - /** Default title value if title attribute isn't present. - * If a function is given, it will be called with its this reference set to - * the element that the tooltip is attached to. - */ - title?: string|HTMLElement|(() => string); - - /** How tooltip is triggered - click | hover | focus | manual. - * You may pass multiple triggers; separate them with a space. - */ - trigger?: string; - } - - interface WorkspaceScan { - /** An array of glob patterns to search within. */ - paths?: ReadonlyArray; - - /** A function to be periodically called with the number of paths searched. */ - onPathsSearched?(pathsSearched: number): void; - - /** The number of lines before the matched line to include in the results object. */ - leadingContextLineCount?: number; - - /** The number of lines after the matched line to include in the results object. */ - trailingContextLineCount?: number; - } - - interface BuildEnvironment { - /** An object responsible for Atom's interaction with the browser process and host OS. - * Use buildDefaultApplicationDelegate for a default instance. - */ - applicationDelegate?: object; - - /** A window global. */ - window?: Window; - - /** A document global. */ - document?: Document; - - /** A path to the configuration directory (usually ~/.atom). */ - configDirPath?: string; - - /** A boolean indicating whether the Atom environment should save or load state - * from the file system. You probably want this to be false. - */ - enablePersistence?: boolean; - } - } - - /** The static side to each exported class. Should generally only be used internally. */ - namespace Statics { - /* tslint:disable:no-unnecessary-qualifier */ - /** The static side to the BufferedProcess class. */ - interface BufferedProcess { - new (options: AtomCore.Options.Process): AtomCore.BufferedProcess; - } - - /** The static side to the BufferedNodeProcess class. */ - interface BufferedNodeProcess { - /** Runs the given Node script by spawning a new child process. */ - new (options: AtomCore.Options.NodeProcess): AtomCore.BufferedNodeProcess; - } - - /** The static side to the GitRepository class. */ - interface GitRepository { - /** Creates a new GitRepository instance. */ - open(path: string, options?: { refreshOnWindowFocus?: boolean }): AtomCore.GitRepository; - - new (path: string, options?: { refreshOnWindowFocus?: boolean, config?: AtomCore.Config, - project?: AtomCore.Project }): AtomCore.GitRepository; - } - - /** The static side to the Notification class. */ - interface Notification { - new (type: "warning"|"info"|"success", message: string, options?: - AtomCore.Options.Notification): AtomCore.Notification; - new (type: "fatal"|"error", message: string, options?: - AtomCore.Options.ErrorNotification): AtomCore.Notification; - } - - /** The static side to the Task class. */ - interface Task { - // NOTE: this is actually the best we can do here with the REST parameter for - // this appearing in the middle of the parameter list, which isn't aligned with - // the ES6 spec. Maybe when they rewrite it in JavaScript this will change. - /** A helper method to easily launch and run a task once. */ - // tslint:disable-next-line:no-any - once(taskPath: string, ...args: any[]): AtomCore.Task; - - /** Creates a task. You should probably use .once */ - new (taskPath: string): AtomCore.Task; - } - - /** The static side to the TextEditor class. */ - type TextEditor = object; - /* tslint:enable:no-unnecessary-qualifier */ - } - - /** Data structures that are used within classes. */ - namespace Structures { - interface SharedDecorationProps { - /** This CSS class will be applied to the decorated line number, line, highlight, - * or overlay. - */ - class?: string; - - /** An HTMLElement or a model Object with a corresponding view registered. Only - * applicable to the gutter, overlay and block types. - */ - item?: HTMLElement; - - /** If true, the decoration will only be applied to the head of the DisplayMarker. - * Only applicable to the line and line-number types. - */ - onlyHead?: boolean; - - /** If true, the decoration will only be applied if the associated DisplayMarker - * is empty. Only applicable to the gutter, line, and line-number types. - */ - onlyEmpty?: boolean; - - /** If true, the decoration will only be applied if the associated DisplayMarker - * is non-empty. Only applicable to the gutter, line, and line-number types. - */ - onlyNonEmpty?: boolean; - - /** Only applicable to decorations of type overlay and block. Controls where the - * view is positioned relative to the TextEditorMarker. Values can be - * 'head' (the default) or 'tail' for overlay decorations, and 'before' (the default) - * or 'after' for block decorations. - */ - position?: "head"|"tail"|"before"|"after"; - - /** Only applicable to decorations of type overlay. Determines whether the decoration - * adjusts its horizontal or vertical position to remain fully visible when it would - * otherwise overflow the editor. Defaults to true. - */ - avoidOverflow?: boolean; - } - - interface DecorationProps extends SharedDecorationProps { - /** One of several supported decoration types. */ - type?: "line"|"line-number"|"highlight"|"overlay"|"gutter"|"block"; - - /** The name of the gutter we're decorating, if type is "gutter". */ - gutterName?: string; - } - - interface DecorationLayerProps extends SharedDecorationProps { - /** One of several supported decoration types. */ - type?: "line"|"line-number"|"highlight"|"block"; - } - - interface Invisibles { - tab?: string|false; - cr?: string|false; - eol?: string|false; - space?: string|false; - } - - interface CancellablePromise extends Promise { - cancel(): void; - } - - interface ScandalResult { - filePath: string; - matches: Array<{ - matchText: string; - lineText: string; - lineTextOffset: number; - range: [[number, number], [number, number]]; - leadingContextLines: string[]; - trailingContextLines: string[]; - }>; - } - - interface WindowLoadSettings { - appVersion: string; - atomHome: string; - devMode: boolean; - env: { [key: string]: string|undefined }; - profileStartup: boolean; - resourcePath: string; - safeMode: boolean; - } - - interface TestRunnerArgs { - /** An array of paths to tests to run. Could be paths to files or directories. */ - testPaths: string[]; - - /** A function that can be called to construct an instance of the atom global. - * No atom global will be explicitly assigned, but you can assign one in your - * runner if desired. - */ - buildAtomEnvironment(options: Options.BuildEnvironment): AtomEnvironment; - - /** A function that builds a default instance of the application delegate, suitable - * to be passed as the applicationDelegate parameter to buildAtomEnvironment. - */ - buildDefaultApplicationDelegate(): object; - - /** An optional path to a log file to which test output should be logged. */ - logFile: string; - - /** A boolean indicating whether or not the tests are being run from the command - * line via atom --test. - */ - headless: boolean; - } - } - - /** Atom global for dealing with packages, themes, menus, and the window. - * An instance of this class is always available as the atom global. - */ - interface AtomEnvironment { - // Properties - /** A CommandRegistry instance. */ - commands: CommandRegistry; - - /** A Config instance. */ - config: Config; - - /** A Clipboard instance. */ - clipboard: Clipboard; - - /** A ContextMenuManager instance. */ - contextMenu: ContextMenuManager; - - /** A MenuManager instance. */ - menu: MenuManager; - - /** A KeymapManager instance. */ - keymaps: AtomKeymap.KeymapManager; - - /** A TooltipManager instance. */ - tooltips: TooltipManager; - - /** A NotificationManager instance. */ - notifications: NotificationManager; - - /** A Project instance. */ - project: Project; - - /** A GrammarRegistry instance. */ - grammars: FirstMate.GrammarRegistry; - - /** A HistoryManager instance. */ - history: HistoryManager; - - /** A PackageManager instance. */ - packages: PackageManager; - - /** A ThemeManager instance. */ - themes: ThemeManager; - - /** A StyleManager instance. */ - styles: StyleManager; - - /** A DeserializerManager instance. */ - deserializers: DeserializerManager; - - /** A ViewRegistry instance. */ - views: ViewRegistry; - - /** A Workspace instance. */ - workspace: Workspace; - - /** A TextEditorRegistry instance. */ - textEditors: TextEditorRegistry; - - // Event Subscription - /** Invoke the given callback whenever ::beep is called. */ - onDidBeep(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when there is an unhandled error, but before - * the devtools pop open. - */ - onWillThrowError(callback: (event: Events.PreventableExceptionThrown) => - void): EventKit.Disposable; - - /** Invoke the given callback whenever there is an unhandled error. */ - onDidThrowError(callback: (event: Events.ExceptionThrown) => void): - EventKit.Disposable; - - /** Invoke the given callback as soon as the shell environment is loaded (or - * immediately if it was already loaded). - */ - whenShellEnvironmentLoaded(callback: () => void): EventKit.Disposable; - - // Atom Details - /** Returns a boolean that is true if the current window is in development mode. */ - inDevMode(): boolean; - - /** Returns a boolean that is true if the current window is in safe mode. */ - inSafeMode(): boolean; - - /** Returns a boolean that is true if the current window is running specs. */ - inSpecMode(): boolean; - - /** Get the version of the Atom application. */ - getVersion(): string; - - /** Gets the release channel of the Atom application. - * Returns the release channel, which can be 'dev', 'beta', or 'stable'. - */ - getReleaseChannel(): "dev"|"beta"|"stable"; - - /** Returns a boolean that is true if the current version is an official release. */ - isReleasedVersion(): boolean; - - /** Get the time taken to completely load the current window. */ - getWindowLoadTime(): number; - - /** Get the load settings for the current window. */ - getLoadSettings(): Structures.WindowLoadSettings; - - // Managing the Atom Window - /** Open a new Atom window using the given options. */ - open(params: { - pathsToOpen: ReadonlyArray, - newWindow: boolean, - devMode: boolean, - safeMode: boolean, - }): void; - - /** Close the current window. */ - close(): void; - - /** Get the size of current window. */ - getSize(): { width: number, height: number }; - - /** Set the size of current window. */ - setSize(width: number, height: number): void; - - /** Get the position of current window. */ - getPosition(): { x: number, y: number }; - - /** Set the position of current window. */ - setPosition(x: number, y: number): void; - - /** Prompt the user to select one or more folders. */ - pickFolder(callback: (paths: string[]|null) => void): void; - - /** Get the current window. */ - getCurrentWindow(): object; // Electron's BrowserWindow class. - - /** Move current window to the center of the screen. */ - center(): void; - - /** Focus the current window. */ - focus(): void; - - /** Show the current window. */ - show(): void; - - /** Hide the current window. */ - hide(): void; - - /** Reload the current window. */ - reload(): void; - - /** Relaunch the entire application. */ - restartApplication(): void; - - /** Returns a boolean that is true if the current window is maximized. */ - isMaximized(): boolean; - - /** Returns a boolean that is true if the current window is in full screen mode. */ - isFullScreen(): boolean; - - /** Set the full screen state of the current window. */ - setFullScreen(fullScreen: boolean): void; - - /** Toggle the full screen state of the current window. */ - toggleFullScreen(): void; - - // Messaging the User - /** Visually and audibly trigger a beep. */ - beep(): void; - - /** A flexible way to open a dialog akin to an alert dialog. - * Returns the chosen button index number if the buttons option was an array. - */ - confirm(options: { - message: string, - detailedMessage?: string, - buttons?: ReadonlyArray, - }): void; - - /** A flexible way to open a dialog akin to an alert dialog. - * Returns the chosen button index number if the buttons option was an array. - */ - confirm(options: { - message: string, - detailedMessage?: string, - buttons?: { - [key: string]: () => void - }, - }): number; - - // Managing the Dev Tools - /** Open the dev tools for the current window. */ - openDevTools(): Promise; - - /** Toggle the visibility of the dev tools for the current window. */ - toggleDevTools(): Promise; - - /** Execute code in dev tools. */ - executeJavaScriptInDevTools(code: string): void; - } - - /** A wrapper which provides standard error/output line buffering for - * Node's ChildProcess. - */ - interface BufferedProcess { - // Properties - process: NodeJS.EventEmitter; - - // Event Subscription - /** Will call your callback when an error will be raised by the process. Usually - * this is due to the command not being available or not on the PATH. You can - * call handle() on the object passed to your callback to indicate that you - * have handled this error. - */ - onWillThrowError(callback: (errorObject: { error: Error, handle(): void }) => - void): EventKit.Disposable; - - // Helper Methods - /** Terminate the process. */ - kill(): void; - - /** Runs the process. */ - start(): void; - } - - /** Like BufferedProcess, but accepts a Node script as the command to run. - * This is necessary on Windows since it doesn't support shebang #! lines. - */ - type BufferedNodeProcess = BufferedProcess; - - /** Represents the clipboard used for copying and pasting in Atom. */ - interface Clipboard { - /** Write the given text to the clipboard. */ - write(text: string, metadata?: object): void; - - /** Read the text from the clipboard. */ - read(): string; - - /** Read the text from the clipboard and return both the text and the associated - * metadata. - */ - readWithMetadata(): { text: string, metadata: object }; - } - - /** A simple color class returned from Config::get when the value at the key path is - * of type 'color'. - */ - interface Color { - /** Returns a string in the form '#abcdef'. */ - toHexString(): string; - - /** Returns a string in the form 'rgba(25, 50, 75, .9)'. */ - toRGBAString(): string; - } - - /** Used to access all of Atom's configuration details. */ - interface Config { - // Config Subscription - /** Add a listener for changes to a given key path. This is different than ::onDidChange in - * that it will immediately call your callback with the current value of the config entry. - */ - // tslint:disable-next-line:no-any - observe(keyPath: string, callback: (value: any) => void): - EventKit.Disposable; - /** Add a listener for changes to a given key path. This is different than ::onDidChange in - * that it will immediately call your callback with the current value of the config entry. - */ - // tslint:disable:no-any - observe(keyPath: string, options: { scope: string[]|ScopeDescriptor }, - callback: (value: any) => void): EventKit.Disposable; - // tslint:enable:no-any - - /** Add a listener for changes to a given key path. If keyPath is not specified, your - * callback will be called on changes to any key. - */ - // tslint:disable-next-line:no-any - onDidChange(callback: (values: { newValue: T, oldValue: T }) => void): - EventKit.Disposable; - /** Add a listener for changes to a given key path. If keyPath is not specified, your - * callback will be called on changes to any key. - */ - // tslint:disable-next-line:no-any - onDidChange(keyPath: string, callback: (values: { newValue: T, - oldValue: T }) => void): EventKit.Disposable; - /** Add a listener for changes to a given key path. If keyPath is not specified, your - * callback will be called on changes to any key. - */ - // tslint:disable-next-line:no-any - onDidChange(keyPath: string, options: { scope: string[]|ScopeDescriptor }, - callback: (values: { newValue: T, oldValue: T }) => void): EventKit.Disposable; - - // Managing Settings - /** Retrieves the setting for the given key. */ - // tslint:disable:no-any - get(keyPath: string, options?: { sources?: string[], excludeSources?: string[], - scope?: string[]|ScopeDescriptor }): any; - // tslint:enable:no-any - - /** Sets the value for a configuration setting. - * This value is stored in Atom's internal configuration file. - */ - // tslint:disable-next-line:no-any - set(keyPath: string, value: any, options?: { scopeSelector?: string, source?: - string }): void; - - /** Restore the setting at keyPath to its default value. */ - unset(keyPath: string, options?: { scopeSelector?: string, source?: string }): void; - - /** Get all of the values for the given key-path, along with their associated - * scope selector. - */ - // tslint:disable:no-any - getAll(keyPath: string, options?: { sources?: string[], excludeSources?: string[], - scope?: ScopeDescriptor }): Array<{ scopeDescriptor: ScopeDescriptor, value: any}>; - // tslint:enable:no-any - - /** Get an Array of all of the source Strings with which settings have been added - * via ::set. - */ - getSources(): string[]; - - /** Retrieve the schema for a specific key path. The schema will tell you what type - * the keyPath expects, and other metadata about the config option. - */ - getSchema(keyPath: string): object|null; - - /** Get the string path to the config file being used. */ - getUserConfigPath(): string; - - /** Suppress calls to handler functions registered with ::onDidChange and ::observe - * for the duration of callback. After callback executes, handlers will be called - * once if the value for their key-path has changed. - */ - transact(callback: () => void): void; - } - - /** Provides a registry for commands that you'd like to appear in the context menu. */ - interface ContextMenuManager { - /** Add context menu items scoped by CSS selectors. */ - add(itemsBySelector: { - [key: string]: ReadonlyArray - }): EventKit.Disposable; - } - - /** Associates listener functions with commands in a context-sensitive way - * using CSS selectors. - */ - interface CommandRegistry { - /** Register a single command. */ - add(target: string|Node, commandName: string, listener: { - didDispatch(event: AtomKeymap.CommandEvent): void, - displayName?: string, - description?: string, - } | ((event: AtomKeymap.CommandEvent) => void)): EventKit.Disposable; - - /** Register multiple commands. */ - add(target: string|Node, commands: { [key: string]: (event: - AtomKeymap.CommandEvent) => void }): EventKit.CompositeDisposable; - - /** Find all registered commands matching a query. */ - findCommands(params: { target: Node }): Array<{ - name: string, - displayName: string, - description?: string, - tags?: string[], - }>; - - /** Simulate the dispatch of a command on a DOM node. */ - dispatch(target: Node, commandName: string): void; - - /** Invoke the given callback before dispatching a command event. */ - onWillDispatch(callback: (event: AtomKeymap.CommandEvent) => void): EventKit.Disposable; - - /** Invoke the given callback after dispatching a command event. */ - onDidDispatch(callback: (event: AtomKeymap.CommandEvent) => void): EventKit.Disposable; - } - - /** The Cursor class represents the little blinking line identifying where text - * can be inserted. - */ - interface Cursor { - // Event Subscription - /** Calls your callback when the cursor has been moved. */ - onDidChangePosition(callback: (event: Events.CursorPositionChanged) => void): - EventKit.Disposable; - - /** Calls your callback when the cursor is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - /** Calls your callback when the cursor's visibility has changed. */ - onDidChangeVisibility(callback: (visibility: boolean) => void): - EventKit.Disposable; - - // Managing Cursor Position - /** Moves a cursor to a given screen position. */ - setScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], - options?: { autoscroll?: boolean }): void; - - /** Returns the screen position of the cursor as a Point. */ - getScreenPosition(): TextBuffer.Point; - - /** Moves a cursor to a given buffer position. */ - setBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], - options?: { autoscroll?: boolean }): void; - - /** Returns the current buffer position as an Array. */ - getBufferPosition(): TextBuffer.Point; - - /** Returns the cursor's current screen row. */ - getScreenRow(): number; - - /** Returns the cursor's current screen column. */ - getScreenColumn(): number; - - /** Retrieves the cursor's current buffer row. */ - getBufferRow(): number; - - /** Returns the cursor's current buffer column. */ - getBufferColumn(): number; - - /** Returns the cursor's current buffer row of text excluding its line ending. */ - getCurrentBufferLine(): string; - - /** Returns whether the cursor is at the start of a line. */ - isAtBeginningOfLine(): boolean; - - /** Returns whether the cursor is on the line return character. */ - isAtEndOfLine(): boolean; - - // Cursor Position Details - /** Returns the underlying DisplayMarker for the cursor. Useful with overlay - * Decorations. - */ - getMarker(): TextBuffer.DisplayMarker; - - /** Identifies if the cursor is surrounded by whitespace. - * "Surrounded" here means that the character directly before and after the cursor - * are both whitespace. - */ - isSurroundedByWhitespace(): boolean; - - /** This method returns false if the character before or after the cursor is whitespace. */ - isBetweenWordAndNonWord(): boolean; - - /** Returns whether this cursor is between a word's start and end. */ - isInsideWord(options?: { wordRegex?: RegExp }): boolean; - - /** Returns the indentation level of the current line. */ - getIndentLevel(): number; - - /** Retrieves the scope descriptor for the cursor's current position. */ - getScopeDescriptor(): ScopeDescriptor; - - /** Returns true if this cursor has no non-whitespace characters before its - * current position. - */ - hasPrecedingCharactersOnLine(): boolean; - - /** Identifies if this cursor is the last in the TextEditor. - * "Last" is defined as the most recently added cursor. - */ - isLastCursor(): boolean; - - // Moving the Cursor - /** Moves the cursor up one screen row. */ - moveUp(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - - /** Moves the cursor down one screen row. */ - moveDown(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - - /** Moves the cursor left one screen column. */ - moveLeft(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - - /** Moves the cursor right one screen column. */ - moveRight(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - - /** Moves the cursor to the top of the buffer. */ - moveToTop(): void; - - /** Moves the cursor to the bottom of the buffer. */ - moveToBottom(): void; - - /** Moves the cursor to the beginning of the line. */ - moveToBeginningOfScreenLine(): void; - - /** Moves the cursor to the beginning of the buffer line. */ - moveToBeginningOfLine(): void; - - /** Moves the cursor to the beginning of the first character in the line. */ - moveToFirstCharacterOfLine(): void; - - /** Moves the cursor to the end of the line. */ - moveToEndOfScreenLine(): void; - - /** Moves the cursor to the end of the buffer line. */ - moveToEndOfLine(): void; - - /** Moves the cursor to the beginning of the word. */ - moveToBeginningOfWord(): void; - - /** Moves the cursor to the end of the word. */ - moveToEndOfWord(): void; - - /** Moves the cursor to the beginning of the next word. */ - moveToBeginningOfNextWord(): void; - - /** Moves the cursor to the previous word boundary. */ - moveToPreviousWordBoundary(): void; - - /** Moves the cursor to the next word boundary. */ - moveToNextWordBoundary(): void; - - /** Moves the cursor to the previous subword boundary. */ - moveToPreviousSubwordBoundary(): void; - - /** Moves the cursor to the next subword boundary. */ - moveToNextSubwordBoundary(): void; - - /** Moves the cursor to the beginning of the buffer line, skipping all whitespace. */ - skipLeadingWhitespace(): void; - - /** Moves the cursor to the beginning of the next paragraph. */ - moveToBeginningOfNextParagraph(): void; - - /** Moves the cursor to the beginning of the previous paragraph. */ - moveToBeginningOfPreviousParagraph(): void; - - // Local Positions and Ranges - /** Returns buffer position of previous word boundary. It might be on the current - * word, or the previous word. - */ - getPreviousWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): - TextBuffer.Point; - - /** Returns buffer position of the next word boundary. It might be on the current - * word, or the previous word. - */ - getNextWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): - TextBuffer.Point; - - /** Retrieves the buffer position of where the current word starts. */ - getBeginningOfCurrentWordBufferPosition(options?: { - wordRegex?: RegExp, - includeNonWordCharacters?: boolean, - allowPrevious?: boolean - }): TextBuffer.Point; - - /** Retrieves the buffer position of where the current word ends. */ - getEndOfCurrentWordBufferPosition(options?: { - wordRegex?: RegExp, - includeNonWordCharacters?: boolean - }): TextBuffer.Point; - - /** Retrieves the buffer position of where the next word starts. */ - getBeginningOfNextWordBufferPosition(options?: { wordRegex?: RegExp }): TextBuffer.Point; - - /** Returns the buffer Range occupied by the word located under the cursor. */ - getCurrentWordBufferRange(options?: { wordRegex?: RegExp }): TextBuffer.Range; - - /** Returns the buffer Range for the current line. */ - getCurrentLineBufferRange(options?: { includeNewline?: boolean }): TextBuffer.Range; - - /** Retrieves the range for the current paragraph. - * A paragraph is defined as a block of text surrounded by empty lines or comments. - */ - getCurrentParagraphBufferRange(): TextBuffer.Range; - - /** Returns the characters preceding the cursor in the current word. */ - getCurrentWordPrefix(): string; - - // Visibility - /** Sets whether the cursor is visible. */ - setVisible(visible: boolean): void; - - /** Returns the visibility of the cursor. */ - isVisible(): boolean; - - // Comparing to another cursor - /** Compare this cursor's buffer position to another cursor's buffer position. - * See Point::compare for more details. - */ - compare(otherCursor: Cursor): number; - - // Utilities - /** Prevents this cursor from causing scrolling. */ - clearAutoscroll(): void; - - /** Deselects the current selection. */ - clearSelection(): void; - - /** Get the RegExp used by the cursor to determine what a "word" is. */ - wordRegExp(options?: { includeNonWordCharacters?: boolean }): RegExp; - - /** Get the RegExp used by the cursor to determine what a "subword" is. */ - subwordRegExp(options?: { backwards?: boolean }): RegExp; - } - - /** Represents a decoration that follows a DisplayMarker. A decoration is basically - * a visual representation of a marker. It allows you to add CSS classes to line - * numbers in the gutter, lines, and add selection-line regions around marked ranges - * of text. - */ - interface Decoration { - id: number; - - // Construction and Destruction - /** Destroy this marker decoration. - * You can also destroy the marker if you own it, which will destroy this decoration. - */ - destroy(): void; - - // Event Subscription - /** When the Decoration is updated via Decoration::setProperties. */ - onDidChangeProperties(callback: (event: Events.DecorationPropsChanged) => void): - EventKit.Disposable; - - /** Invoke the given callback when the Decoration is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - // Decoration Details - /** An id unique across all Decoration objects. */ - getId(): number; - - /** Returns the marker associated with this Decoration. */ - getMarker(): TextBuffer.DisplayMarker; - - // Properties - /** Returns the Decoration's properties. */ - getProperties(): Structures.DecorationProps; - - /** Update the marker with new Properties. Allows you to change the decoration's - * class. - */ - setProperties(newProperties: Structures.DecorationProps): void; - } - - interface Deserializer { - name: string; - deserialize(state: object): object; - } - - /** Manages the deserializers used for serialized state. */ - interface DeserializerManager { - /** Register the given class(es) as deserializers. */ - add(...deserializers: Deserializer[]): EventKit.Disposable; - - /** Deserialize the state and params. */ - deserialize(state: object): object|undefined; - } - - /** A container at the edges of the editor window capable of holding items. */ - interface Dock { - // Methods - /** Show the dock and focus its active Pane. */ - activate(): void; - - /** Show the dock without focusing it. */ - show(): void; - - /** Hide the dock and activate the WorkspaceCenter if the dock was was previously focused. */ - hide(): void; - - /** Toggle the dock's visibility without changing the Workspace's active pane container. */ - toggle(): void; - - /** Check if the dock is visible. */ - isVisible(): boolean; - - // Event Subscription - /** Invoke the given callback when the visibility of the dock changes. */ - onDidChangeVisible(callback: (visible: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback with the current and all future visibilities of the dock. */ - observeVisible(callback: (visible: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes items in the dock. */ - observePaneItems(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item changes. - * - * Because observers are invoked synchronously, it's important not to perform any expensive - * operations via this method. Consider ::onDidStopChangingActivePaneItem to delay operations - * until after changes stop occurring. - */ - onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item stops changing. */ - onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane item and with all future - * active pane items in the dock. - */ - observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is added to the dock. */ - onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback before a pane is destroyed in the dock. */ - onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is destroyed in the dock. */ - onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes in the dock. */ - observePanes(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane changes. */ - onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane and when the active pane changes. */ - observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane item is added to the dock. */ - onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is about to be destroyed, before the user is - * prompted to save it. - */ - onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is destroyed. */ - onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - // Pane Items - /** Get all pane items in the dock. */ - getPaneItems(): object[]; - - /** Get the active Pane's active item. */ - getActivePaneItem(): object; - - // Panes - /** Returns an Array of Panes. */ - getPanes(): Pane[]; - - /** Get the active Pane. */ - getActivePane(): Pane; - - /** Make the next pane active. */ - activateNextPane(): boolean; - - /** Make the previous pane active. */ - activatePreviousPane(): boolean; - } - - /** Represents the underlying git operations performed by Atom. */ - interface GitRepository { - // Lifecycle - /** Destroy this GitRepository object. */ - destroy(): void; - - /** Returns a boolean indicating if this repository has been destroyed. */ - isDestroyed(): boolean; - - // Event Subscription - /** Invoke the given callback when this GitRepository's destroy() method is - * invoked. - */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when a specific file's status has changed. When - * a file is updated, reloaded, etc, and the status changes, this will be fired. - */ - onDidChangeStatus(callback: (event: Events.RepoStatusChanged) => void): - EventKit.Disposable; - - /** Invoke the given callback when a multiple files' statuses have changed. */ - onDidChangeStatuses(callback: () => void): EventKit.Disposable; - - // Repository Details - /** A string indicating the type of version control system used by this repository. */ - getType(): "git"; - - /** Returns the string path of the repository. */ - getPath(): string; - - /** Returns the string working directory path of the repository. */ - getWorkingDirectory(): string; - - /** Returns true if at the root, false if in a subfolder of the repository. */ - isProjectAtRoot(): boolean; - - /** Makes a path relative to the repository's working directory. */ - relativize(): string; - - /** Returns true if the given branch exists. */ - hasBranch(branch: string): boolean; - - /** Retrieves a shortened version of the HEAD reference value. */ - getShortHead(path?: string): string; - - /** Is the given path a submodule in the repository? */ - isSubmodule(path: string): boolean; - - /** Returns the number of commits behind the current branch is from the its - * upstream remote branch. The default reference is the HEAD. - * @param reference The branch reference name. - * @param path The path in the repository to get this ifnromation for, only - * needed if the repository contains submodules. - * @return Returns the number of commits behind the current branch is from its - * upstream remote branch. - */ - getAheadBehindCount(reference: string, path?: string): { ahead: number, behind: number }; - - /** Get the cached ahead/behind commit counts for the current branch's - * upstream branch. - */ - getCachedUpstreamAheadBehindCount(path?: string): { ahead: number, behind: number }; - - /** Returns the git configuration value specified by the key. */ - getConfigValue(key: string, path?: string): string; - - /** Returns the origin url of the repository. */ - getOriginURL(path?: string): string; - - /** Returns the upstream branch for the current HEAD, or null if there is no - * upstream branch for the current HEAD. - */ - getUpstreamBranch(path?: string): string|null; - - /** Gets all the local and remote references. */ - getReferences(path?: string): { heads: string[], remotes: string[], tags: string[] }; - - /** Returns the current string SHA for the given reference. */ - getReferenceTarget(reference: string, path?: string): string; - - // Reading Status - /** Returns true if the given path is modified. */ - isPathModified(path: string): boolean; - - /** Returns true if the given path is new. */ - isPathNew(path: string): boolean; - - /** Is the given path ignored? */ - isPathIgnored(path: string): boolean; - - /** Get the status of a directory in the repository's working directory. */ - getDirectoryStatus(path: string): number; - - /** Get the status of a single path in the repository. */ - getPathStatus(path: string): number; - - /** Get the cached status for the given path. */ - getCachedPathStatus(path: string): number|null; - - /** Returns true if the given status indicates modification. */ - isStatusModified(status: number): boolean; - - /** Returns true if the given status indicates a new path. */ - isStatusNew(status: number): boolean; - - // Retrieving Diffs - /** Retrieves the number of lines added and removed to a path. - * This compares the working directory contents of the path to the HEAD version. - */ - getDiffStats(path: string): { added: number, deleted: number }; - - /** Retrieves the line diffs comparing the HEAD version of the given path - * and the given text. - */ - getLineDiffs(path: string, text: string): Array<{ oldStart: number, - newStart: number, oldLines: number, newLines: number }>; - - // Checking Out - /** Restore the contents of a path in the working directory and index to the - * version at HEAD. - */ - checkoutHead(path: string): boolean; - - /** Checks out a branch in your repository. */ - checkoutReference(reference: string, create: boolean): boolean; - } - - /** Represents a gutter within a TextEditor. */ - interface Gutter { - // Gutter Destruction - /** Destroys the gutter. */ - destroy(): void; - - // Event Subscription - /** Calls your callback when the gutter's visibility changes. */ - onDidChangeVisible(callback: (gutter: Gutter) => void): EventKit.Disposable; - - /** Calls your callback when the gutter is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - // Visibility - /** Hide the gutter. */ - hide(): void; - - /** Show the gutter. */ - show(): void; - - /** Determine whether the gutter is visible. */ - isVisible(): boolean; - - /** Add a decoration that tracks a DisplayMarker. When the marker moves, is - * invalidated, or is destroyed, the decoration will be updated to reflect - * the marker's state. - */ - decorateMarker(marker: TextBuffer.DisplayMarker, decorationParams: - Structures.DecorationProps): Decoration; - } - - /** History manager for remembering which projects have been opened. - * An instance of this class is always available as the atom.history global. - * The project history is used to enable the 'Reopen Project' menu. - */ - interface HistoryManager { - /** Obtain a list of previously opened projects. */ - getProjects(): HistoryProject[]; - - /** Clear all projects from the history. - * Note: This is not a privacy function - other traces will still exist, e.g. - * window state. - */ - clearProjects(): void; - - /** Invoke the given callback when the list of projects changes. */ - onDidChangeProjects(callback: (args: { reloaded: boolean }) => void): EventKit.Disposable; - } - - interface HistoryProject { - paths: string[]; - lastOpened: Date; - } - - /** Represents a decoration that applies to every marker on a given layer. Created via - * TextEditor::decorateMarkerLayer. - */ - interface LayerDecoration { - /** Destroys the decoration. */ - destroy(): void; - - /** Determine whether this decoration is destroyed. */ - isDestroyed(): boolean; - - /** Get this decoration's properties. */ - getProperties(): Structures.DecorationLayerProps; - - /** Set this decoration's properties. */ - setProperties(newProperties: Structures.DecorationLayerProps): void; - - /** Override the decoration properties for a specific marker. */ - setPropertiesForMarker(marker: TextBuffer.DisplayMarker|TextBuffer.Marker, - properties: Structures.DecorationLayerProps): void; - } - - /** Provides a registry for menu items that you'd like to appear in the application menu. */ - interface MenuManager { - /** Adds the given items to the application menu. */ - add(items: ReadonlyArray): EventKit.Disposable; - - /** Refreshes the currently visible menu. */ - update(): void; - } - - /** A notification to the user containing a message and type. */ - interface Notification { - // Properties - dismissed: boolean; - displayed: boolean; - timestamp: Date; - - // Event Subscription - /** Invoke the given callback when the notification is dismissed. */ - onDidDismiss(callback: (notification: Notification) => void): EventKit.Disposable; - - /** Invoke the given callback when the notification is displayed. */ - onDidDisplay(callback: (notification: Notification) => void): EventKit.Disposable; - - // Methods - /** Returns the Notification's type. */ - getType(): string; - - /** Returns the Notification's message. */ - getMessage(): string; - - /** Dismisses the notification, removing it from the UI. Calling this - * programmatically will call all callbacks added via onDidDismiss. - */ - dismiss(): void; - } - - /** A notification manager used to create Notifications to be shown to the user. */ - interface NotificationManager { - // Properties - notifications: Notification[]; - - // Events - /** Invoke the given callback after a notification has been added. */ - onDidAddNotification(callback: (notification: Notification) => void): - EventKit.Disposable; - - // Adding Notifications - /** Add a success notification. */ - addSuccess(message: string, options?: Options.Notification): Notification; - - /** Add an informational notification. */ - addInfo(message: string, options?: Options.Notification): Notification; - - /** Add a warning notification. */ - addWarning(message: string, options?: Options.Notification): Notification; - - /** Add an error notification. */ - addError(message: string, options?: Options.ErrorNotification): Notification; - - /** Add a fatal error notification. */ - addFatalError(message: string, options?: Options.ErrorNotification): Notification; - - // Getting Notifications - /** Get all the notifications. */ - getNotifications(): Notification[]; - } - - /** Loads and activates a package's main module and resources such as stylesheets, - * keymaps, grammar, editor properties, and menus. - */ - interface Package { - // Properties - name: string; - bundledPackage: boolean; - path: string; - - // Event Subscription - /** Invoke the given callback when all packages have been activated. */ - onDidDeactivate(callback: () => void): EventKit.Disposable; - - // Native Module Compatibility - /** Are all native modules depended on by this package correctly compiled - * against the current version of Atom? - */ - isCompatible(): boolean; - - /** Rebuild native modules in this package's dependencies for the current - * version of Atom. - */ - rebuild(): Promise<{ code: number, stdout: string, stderr: string }>; - - /** If a previous rebuild failed, get the contents of stderr. */ - getBuildFailureOutput(): string|null; - } - - /** Package manager for coordinating the lifecycle of Atom packages. */ - interface PackageManager { - // Event Subscription - /** Invoke the given callback when all packages have been loaded. */ - onDidLoadInitialPackages(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when all packages have been activated. */ - onDidActivateInitialPackages(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when a package is activated. */ - onDidActivatePackage(callback: (package: Package) => void): EventKit.Disposable; - - /** Invoke the given callback when a package is deactivated. */ - onDidDeactivatePackage(callback: (package: Package) => void): EventKit.Disposable; - - /** Invoke the given callback when a package is loaded. */ - onDidLoadPackage(callback: (package: Package) => void): EventKit.Disposable; - - /** Invoke the given callback when a package is unloaded. */ - onDidUnloadPackage(callback: (package: Package) => void): EventKit.Disposable; - - // Package System Data - /** Get the path to the apm command. */ - getApmPath(): string; - - /** Get the paths being used to look for packages. */ - getPackageDirPaths(): string[]; - - // General Package Data - /** Resolve the given package name to a path on disk. */ - resolvePackagePath(name: string): string|undefined; - - /** Is the package with the given name bundled with Atom? */ - isBundledPackage(name: string): boolean; - - // Enabling and Disabling Packages - /** Enable the package with the given name. */ - enablePackage(name: string): Package|undefined; - - /** Disable the package with the given name. */ - disablePackage(name: string): Package|undefined; - - /** Is the package with the given name disabled? */ - isPackageDisabled(name: string): boolean; - - // Accessing Active Packages - /** Get an Array of all the active Packages. */ - getActivePackages(): Package[]; - - /** Get the active Package with the given name. */ - getActivePackage(name: string): Package|undefined; - - /** Is the Package with the given name active? */ - isPackageActive(name: string): boolean; - - /** Returns a boolean indicating whether package activation has occurred. */ - hasActivatedInitialPackages(): boolean; - - // Accessing Loaded Packages - /** Get an Array of all the loaded Packages. */ - getLoadedPackages(): Package[]; - - /** Get the loaded Package with the given name. */ - getLoadedPackage(name: string): Package|undefined; - - /** Is the package with the given name loaded? */ - isPackageLoaded(name: string): boolean; - - /** Returns a boolean indicating whether package loading has occurred. */ - hasLoadedInitialPackages(): boolean; - - // Accessing Available Packages - /** Returns an Array of strings of all the available package paths. */ - getAvailablePackagePaths(): string[]; - - /** Returns an Array of strings of all the available package names. */ - getAvailablePackageNames(): string[]; - - /** Returns an Array of strings of all the available package metadata. */ - getAvailablePackageMetadata(): string[]; - } - - /** A container for presenting content in the center of the workspace. */ - interface Pane { - // Event Subscription - /** Invoke the given callback when the pane resizes. */ - onDidChangeFlexScale(callback: (flexScale: number) => void): EventKit.Disposable; - - /** Invoke the given callback with the current and future values of ::getFlexScale. */ - observeFlexScale(callback: (flexScale: number) => void): EventKit.Disposable; - - /** Invoke the given callback when the pane is activated. */ - onDidActivate(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback before the pane is destroyed. */ - onWillDestroy(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when the pane is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when the value of the ::isActive property changes. */ - onDidChangeActive(callback: (active: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback with the current and future values of the ::isActive - * property. - */ - observeActive(callback: (active: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback when an item is added to the pane. */ - onDidAddItem(callback: (event: Events.PaneListItemShifted) => void): - EventKit.Disposable; - - /** Invoke the given callback when an item is removed from the pane. */ - onDidRemoveItem(callback: (event: Events.PaneListItemShifted) => void): - EventKit.Disposable; - - /** Invoke the given callback before an item is removed from the pane. */ - onWillRemoveItem(callback: (event: Events.PaneListItemShifted) => void): - EventKit.Disposable; - - /** Invoke the given callback when an item is moved within the pane. */ - onDidMoveItem(callback: (event: Events.PaneItemMoved) => void): - EventKit.Disposable; - - /** Invoke the given callback with all current and future items. */ - observeItems(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the value of ::getActiveItem changes. */ - onDidChangeActiveItem(callback: (activeItem: object) => void): EventKit.Disposable; - - /** Invoke the given callback when ::activateNextRecentlyUsedItem has been called, - * either initiating or continuing a forward MRU traversal of pane items. - */ - onChooseNextMRUItem(callback: (nextRecentlyUsedItem: object) => void): EventKit.Disposable; - - /** Invoke the given callback when ::activatePreviousRecentlyUsedItem has been called, - * either initiating or continuing a reverse MRU traversal of pane items. - */ - onChooseLastMRUItem(callback: (previousRecentlyUsedItem: object) => void): - EventKit.Disposable; - - /** Invoke the given callback when ::moveActiveItemToTopOfStack has been called, - * terminating an MRU traversal of pane items and moving the current active item - * to the top of the stack. Typically bound to a modifier (e.g. CTRL) key up event. - */ - onDoneChoosingMRUItem(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback with the current and future values of ::getActiveItem. */ - observeActiveItem(callback: (activeItem: object) => void): EventKit.Disposable; - - /** Invoke the given callback before items are destroyed. */ - onWillDestroyItem(callback: (event: Events.PaneListItemShifted) => void): - EventKit.Disposable; - - // Items - /** Get the items in this pane. */ - getItems(): object[]; - - /** Get the active pane item in this pane. */ - getActiveItem(): object; - - /** Return the item at the given index. */ - itemAtIndex(index: number): object|undefined; - - /** Makes the next item active. */ - activateNextItem(): void; - - /** Makes the previous item active. */ - activatePreviousItem(): void; - - /** Move the active tab to the right. */ - moveItemRight(): void; - - /** Move the active tab to the left. */ - moveItemLeft(): void; - - /** Get the index of the active item. */ - getActiveItemIndex(): number; - - /** Activate the item at the given index. */ - activateItemAtIndex(index: number): void; - - /** Make the given item active, causing it to be displayed by the pane's view. */ - activateItem(item: object, options?: { pending: boolean }): void; - - /** Add the given item to the pane. */ - addItem(item: object, options?: { index?: number, pending?: boolean }): object; - - /** Add the given items to the pane. */ - addItems(items: object[], index?: number): object[]; - - /** Move the given item to the given index. */ - moveItem(item: object, index: number): void; - - /** Move the given item to the given index on another pane. */ - moveItemToPane(item: object, pane: Pane, index: number): void; - - /** Destroy the active item and activate the next item. */ - destroyActiveItem(): void; - - /** Destroy the given item. */ - destroyItem(item: object, force?: boolean): Promise; - - /** Destroy all items. */ - destroyItems(): void; - - /** Destroy all items except for the active item. */ - destroyInactiveItems(): void; - - /** Save the active item. */ - saveActiveItem(nextAction?: (error?: Error) => T): - Promise|undefined; - - /** Prompt the user for a location and save the active item with the path - * they select. - */ - saveActiveItemAs(nextAction?: (error?: Error) => T): - Promise|undefined; - - /** Save the given item. */ - saveItem(item: object, nextAction?: (error?: Error) => T): - Promise|undefined; - - /** Prompt the user for a location and save the active item with the path - * they select. - */ - saveItemAs(item: object, nextAction?: (error?: Error) => T): - Promise|undefined; - - /** Save all items. */ - saveItems(): void; - - /** Return the first item that matches the given URI or undefined if none exists. */ - itemForURI(uri: string): object|undefined; - - /** Activate the first item that matches the given URI. */ - activateItemForURI(uri: string): boolean; - - // Lifecycle - /** Determine whether the pane is active. */ - isActive(): boolean; - - /** Makes this pane the active pane, causing it to gain focus. */ - activate(): void; - - /** Close the pane and destroy all its items. */ - destroy(): void; - - /** Determine whether this pane has been destroyed. */ - isDestroyed(): boolean; - - // Splitting - /** Create a new pane to the left of this pane. */ - splitLeft(params?: { - items?: object[], - copyActiveItem?: boolean, - }): Pane; - - /** Create a new pane to the right of this pane. */ - splitRight(params?: { - items?: object[], - copyActiveItem?: boolean, - }): Pane; - - /** Creates a new pane above the receiver. */ - splitUp(params?: { - items?: object[], - copyActiveItem?: boolean, - }): Pane; - - /** Creates a new pane below the receiver. */ - splitDown(params?: { - items?: object[], - copyActiveItem?: boolean, - }): Pane; - } - - /** A container representing a panel on the edges of the editor window. You - * should not create a Panel directly, instead use Workspace::addTopPanel and - * friends to add panels. - */ - interface Panel { - visible: boolean; - - // Construction and Destruction - /** Destroy and remove this panel from the UI. */ - destroy(): void; - - // Event Subscription - /** Invoke the given callback when the pane hidden or shown. */ - onDidChangeVisible(callback: (visible: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback when the pane is destroyed. */ - onDidDestroy(callback: (panel: Panel) => void): EventKit.Disposable; - - // Panel Details - /** Returns the panel's item. */ - getItem(): object; - - /** Returns a number indicating this panel's priority. */ - getPriority(): number; - - /** Returns a boolean true when the panel is visible. */ - isVisible(): boolean; - - /** Hide this panel. */ - hide(): void; - - /** Show this panel. */ - show(): void; - } - - /** Manage a subscription to filesystem events that occur beneath a root directory. */ - interface PathWatcher extends EventKit.DisposableLike { - /** Return a Promise that will resolve when the underlying native watcher is - * ready to begin sending events. - */ - getStartPromise(): Promise; - - /** Invokes a function when any errors related to this watcher are reported. */ - onDidError(callback: (error: Error) => void): EventKit.Disposable; - - /** Unsubscribe all subscribers from filesystem events. Native resources will be - * release asynchronously, but this watcher will stop broadcasting events - * immediately. - */ - dispose(): void; - } - - /** Represents a project that's opened in Atom. */ - interface Project { - // Event Subscription - /** Invoke the given callback when the project paths change. */ - onDidChangePaths(callback: (projectPaths: string[]) => void): EventKit.Disposable; - - /** Invoke the given callback when a text buffer is added to the project. */ - onDidAddBuffer(callback: (buffer: TextBuffer.TextBuffer) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future text buffers in - * the project. - */ - observeBuffers(callback: (buffer: TextBuffer.TextBuffer) => void): EventKit.Disposable; - - /** Invoke a callback when a filesystem change occurs within any open project path. */ - onDidChangeFiles(callback: (events: Events.FilesystemChange) => void): EventKit.Disposable; - - // Accessing the Git Repository - /** Get an Array of GitRepositorys associated with the project's directories. */ - getRepositories(): GitRepository[]; - - /** Get the repository for a given directory asynchronously. */ - repositoryForDirectory(directory: PathWatcher.Directory): Promise; - - // Managing Paths - /** Get an Array of strings containing the paths of the project's directories. */ - getPaths(): string[]; - - /** Set the paths of the project's directories. */ - setPaths(projectPaths: string[]): void; - - /** Add a path to the project's list of root paths. */ - addPath(projectPath: string): void; - - /** Access a promise that resolves when the filesystem watcher associated with a - * project root directory is ready to begin receiving events. - */ - getWatcherPromise(projectPath: string): Promise; - - /** Remove a path from the project's list of root paths. */ - removePath(projectPath: string): void; - - /** Get an Array of Directorys associated with this project. */ - getDirectories(): PathWatcher.Directory[]; - - /** Get the relative path from the project directory to the given path. */ - relativize(fullPath: string): string; - - /** Get the path to the project directory that contains the given path, and - * the relative path from that project directory to the given path. - */ - relativizePath(fullPath: string): [string|null, string]; - - /** Determines whether the given path (real or symbolic) is inside the - * project's directory. - */ - contains(pathToCheck: string): boolean; - } - - /** Wraps an Array of Strings. The Array describes a path from the root of the - * syntax tree to a token including all scope names for the entire path. - */ - interface ScopeDescriptor { - scopes: string[]; - - /** Returns all scopes for this descriptor. */ - getScopesArray(): string[]; - } - - /** Represents a selection in the TextEditor. */ - interface Selection { - // Event Subscription - /** Calls your callback when the selection was moved. */ - onDidChangeRange(callback: (event: Events.SelectionChanged) => void): - EventKit.Disposable; - - /** Calls your callback when the selection was destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - // Managing the selection range - /** Returns the screen Range for the selection. */ - getScreenRange(): TextBuffer.Range; - - /** Modifies the screen range for the selection. */ - setScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { preserveFolds?: boolean, autoscroll?: boolean }): void; - - /** Returns the buffer Range for the selection. */ - getBufferRange(): TextBuffer.Range; - - /** Modifies the buffer Range for the selection. */ - setBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { preserveFolds?: boolean, autoscroll?: boolean }): void; - - /** Returns the starting and ending buffer rows the selection is highlighting. */ - getBufferRowRange(): [number, number]; - - // Info about the selection - /** Determines if the selection contains anything. */ - isEmpty(): boolean; - - /** Determines if the ending position of a marker is greater than the starting position. - * This can happen when, for example, you highlight text "up" in a TextBuffer. - */ - isReversed(): boolean; - - /** Returns whether the selection is a single line or not. */ - isSingleScreenLine(): boolean; - - /** Returns the text in the selection. */ - getText(): string; - - // NOTE: this calls into Range.intersectsWith(), which is one of the few functions - // that doesn't take a range-compatible range, despite what the API says. - /** Identifies if a selection intersects with a given buffer range. */ - intersectsBufferRange(bufferRange: TextBuffer.RangeLike): boolean; - - /** Identifies if a selection intersects with another selection. */ - intersectsWith(otherSelection: Selection): boolean; - - // Modifying the selected range - /** Clears the selection, moving the marker to the head. */ - clear(options?: { autoscroll?: boolean }): void; - - /** Selects the text from the current cursor position to a given screen position. */ - selectToScreenPosition(position: TextBuffer.PointLike|[number, number]): void; - - /** Selects the text from the current cursor position to a given buffer position. */ - selectToBufferPosition(position: TextBuffer.PointLike|[number, number]): void; - - /** Selects the text one position right of the cursor. */ - selectRight(columnCount?: number): void; - - /** Selects the text one position left of the cursor. */ - selectLeft(columnCount?: number): void; - - /** Selects all the text one position above the cursor. */ - selectUp(rowCount?: number): void; - - /** Selects all the text one position below the cursor. */ - selectDown(rowCount?: number): void; - - /** Selects all the text from the current cursor position to the top of the - * buffer. - */ - selectToTop(): void; - - /** Selects all the text from the current cursor position to the bottom of - * the buffer. - */ - selectToBottom(): void; - - /** Selects all the text in the buffer. */ - selectAll(): void; - - /** Selects all the text from the current cursor position to the beginning of - * the line. - */ - selectToBeginningOfLine(): void; - - /** Selects all the text from the current cursor position to the first character - * of the line. - */ - selectToFirstCharacterOfLine(): void; - - /** Selects all the text from the current cursor position to the end of the - * screen line. - */ - selectToEndOfLine(): void; - - /** Selects all the text from the current cursor position to the end of the - * buffer line. - */ - selectToEndOfBufferLine(): void; - - /** Selects all the text from the current cursor position to the beginning - * of the word. - */ - selectToBeginningOfWord(): void; - - /** Selects all the text from the current cursor position to the end of the word. */ - selectToEndOfWord(): void; - - /** Selects all the text from the current cursor position to the beginning of - * the next word. - */ - selectToBeginningOfNextWord(): void; - - /** Selects text to the previous word boundary. */ - selectToPreviousWordBoundary(): void; - - /** Selects text to the next word boundary. */ - selectToNextWordBoundary(): void; - - /** Selects text to the previous subword boundary. */ - selectToPreviousSubwordBoundary(): void; - - /** Selects text to the next subword boundary. */ - selectToNextSubwordBoundary(): void; - - /** Selects all the text from the current cursor position to the beginning of - * the next paragraph. - */ - selectToBeginningOfNextParagraph(): void; - - /** Selects all the text from the current cursor position to the beginning of - * the previous paragraph. - */ - selectToBeginningOfPreviousParagraph(): void; - - /** Modifies the selection to encompass the current word. */ - selectWord(): void; - - /** Expands the newest selection to include the entire word on which the - * cursors rests. - */ - expandOverWord(): void; - - /** Selects an entire line in the buffer. */ - selectLine(row: number): void; - - /** Expands the newest selection to include the entire line on which the cursor - * currently rests. - * It also includes the newline character. - */ - expandOverLine(): void; - - // Modifying the selected text - /** Replaces text at the current selection. */ - insertText(text: string, options?: Options.TextInsertion): void; - - /** Removes the first character before the selection if the selection is empty - * otherwise it deletes the selection. - */ - backspace(): void; - - /** Removes the selection or, if nothing is selected, then all characters from - * the start of the selection back to the previous word boundary. - */ - deleteToPreviousWordBoundary(): void; - - /** Removes the selection or, if nothing is selected, then all characters from - * the start of the selection up to the next word boundary. - */ - deleteToNextWordBoundary(): void; - - /** Removes from the start of the selection to the beginning of the current - * word if the selection is empty otherwise it deletes the selection. - */ - deleteToBeginningOfWord(): void; - - /** Removes from the beginning of the line which the selection begins on all - * the way through to the end of the selection. - */ - deleteToBeginningOfLine(): void; - - /** Removes the selection or the next character after the start of the selection - * if the selection is empty. - */ - delete(): void; - - /** If the selection is empty, removes all text from the cursor to the end of - * the line. If the cursor is already at the end of the line, it removes the following - * newline. If the selection isn't empty, only deletes the contents of the selection. - */ - deleteToEndOfLine(): void; - - /** Removes the selection or all characters from the start of the selection to - * the end of the current word if nothing is selected. - */ - deleteToEndOfWord(): void; - - /** Removes the selection or all characters from the start of the selection to - * the end of the current word if nothing is selected. - */ - deleteToBeginningOfSubword(): void; - - /** Removes the selection or all characters from the start of the selection to - * the end of the current word if nothing is selected. - */ - deleteToEndOfSubword(): void; - - /** Removes only the selected text. */ - deleteSelectedText(): void; - - /** Removes the line at the beginning of the selection if the selection is empty - * unless the selection spans multiple lines in which case all lines are removed. - */ - deleteLine(): void; - - /** Joins the current line with the one below it. Lines will be separated by a single space. - * If there selection spans more than one line, all the lines are joined together. - */ - joinLines(): void; - - /** Removes one level of indent from the currently selected rows. */ - outdentSelectedRows(): void; - - /** Sets the indentation level of all selected rows to values suggested by the - * relevant grammars. - */ - autoIndentSelectedRows(): void; - - /** Wraps the selected lines in comments if they aren't currently part of a comment. - * Removes the comment if they are currently wrapped in a comment. - */ - toggleLineComments(): void; - - /** Cuts the selection until the end of the screen line. */ - cutToEndOfLine(): void; - - /** Cuts the selection until the end of the buffer line. */ - cutToEndOfBufferLine(): void; - - /** Copies the selection to the clipboard and then deletes it. */ - cut(maintainClipboard?: boolean, fullLine?: boolean): void; - - /** Copies the current selection to the clipboard. */ - copy(maintainClipboard?: boolean, fullLine?: boolean): void; - - /** Creates a fold containing the current selection. */ - fold(): void; - - /** If the selection spans multiple rows, indent all of them. */ - indentSelectedRows(): void; - - // Managing multiple selections - /** Moves the selection down one row. */ - addSelectionBelow(): void; - - /** Moves the selection up one row. */ - addSelectionAbove(): void; - - /** Combines the given selection into this selection and then destroys the - * given selection. - */ - merge(otherSelection: Selection, options?: { preserveFolds?: boolean, - autoscroll?: boolean }): void; - - // Comparing to other selections - /** Compare this selection's buffer range to another selection's buffer range. - * See Range::compare for more details. - */ - compare(otherSelection: Selection): number; - } - - /** A singleton instance of this class available via atom.styles, which you can - * use to globally query and observe the set of active style sheets. - */ - interface StyleManager { - // Event Subscription - /** Invoke callback for all current and future style elements. */ - observeStyleElements(callback: (styleElement: Events.StyleElementObserved) => - void): EventKit.Disposable; - - /** Invoke callback when a style element is added. */ - onDidAddStyleElement(callback: (styleElement: Events.StyleElementObserved) => - void): EventKit.Disposable; - - /** Invoke callback when a style element is removed. */ - onDidRemoveStyleElement(callback: (styleElement: HTMLStyleElement) => void): - EventKit.Disposable; - - /** Invoke callback when an existing style element is updated. */ - onDidUpdateStyleElement(callback: (styleElement: Events.StyleElementObserved) => - void): EventKit.Disposable; - - // Reading Style Elements - /** Get all loaded style elements. */ - getStyleElements(): HTMLStyleElement[]; - - // Paths - /** Get the path of the user style sheet in ~/.atom. */ - getUserStyleSheetPath(): string; - } - - /** Run a node script in a separate process. */ - interface Task { - // NOTE: this is actually the best we can do here with the REST parameter - // for this appearing in the beginning of the parameter list, which isn't - // aligned with the ES6 spec. - /** Starts the task. - * Throws an error if this task has already been terminated or if sending a - * message to the child process fails. - */ - // tslint:disable-next-line:no-any - start(...args: any[]): void; - - /** Send message to the task. - * Throws an error if this task has already been terminated or if sending a - * message to the child process fails. - */ - send(message: string): void; - - /** Call a function when an event is emitted by the child process. */ - // tslint:disable-next-line:no-any - on(eventName: string, callback: (param: any) => void): EventKit.Disposable; - - /** Forcefully stop the running task. - * No more events are emitted once this method is called. - */ - terminate(): void; - - /** Cancel the running task and emit an event if it was canceled. */ - cancel(): boolean; - } - - /** An interface which all custom test runners should implement. */ - type TestRunner = (params: Structures.TestRunnerArgs) => Promise; - - /** This class represents all essential editing state for a single TextBuffer, - * including cursor and selection positions, folds, and soft wraps. - */ - interface TextEditor { - // Properties - id: number; - buffer: TextBuffer.TextBuffer; - element: HTMLElement; - - // Event Subscription - /** Calls your callback when the buffer's title has changed. */ - onDidChangeTitle(callback: (title: string) => void): EventKit.Disposable; - - /** Calls your callback when the buffer's path, and therefore title, has changed. */ - onDidChangePath(callback: (path: string) => void): EventKit.Disposable; - - /** Invoke the given callback synchronously when the content of the buffer - * changes. - */ - onDidChange(callback: (event: Events.EditorChanged[]) => void): - EventKit.Disposable; - - /** Invoke callback when the buffer's contents change. It is emit - * asynchronously 300ms after the last buffer change. This is a good place - * to handle changes to the buffer without compromising typing performance. - */ - onDidStopChanging(callback: (event: TextBuffer.Events.BufferStoppedChanging) => void): - EventKit.Disposable; - - /** Calls your callback when a Cursor is moved. If there are multiple cursors, - * your callback will be called for each cursor. - */ - onDidChangeCursorPosition(callback: (event: Events.CursorPositionChanged) => void): - EventKit.Disposable; - - /** Calls your callback when a selection's screen range changes. */ - onDidChangeSelectionRange(callback: (event: Events.SelectionChanged) => void): - EventKit.Disposable; - - /** Invoke the given callback after the buffer is saved to disk. */ - onDidSave(callback: (event: { path: string }) => void): EventKit.Disposable; - - /** Invoke the given callback when the editor is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - /** Retrieves the current TextBuffer. */ - getBuffer(): TextBuffer.TextBuffer; - - /** Calls your callback when a Gutter is added to the editor. Immediately calls - * your callback for each existing gutter. - */ - observeGutters(callback: (gutter: Gutter) => void): EventKit.Disposable; - - /** Calls your callback when a Gutter is added to the editor. */ - onDidAddGutter(callback: (gutter: Gutter) => void): EventKit.Disposable; - - /** Calls your callback when a Gutter is removed from the editor. */ - onDidRemoveGutter(callback: (name: string) => void): EventKit.Disposable; - - /** Calls your callback when soft wrap was enabled or disabled. */ - onDidChangeSoftWrapped(callback: (softWrapped: boolean) => void): EventKit.Disposable; - - /** Calls your callback when the buffer's encoding has changed. */ - onDidChangeEncoding(callback: (encoding: string) => void): EventKit.Disposable; - - /** Calls your callback when the grammar that interprets and colorizes the text - * has been changed. Immediately calls your callback with the current grammar. - */ - observeGrammar(callback: (grammar: FirstMate.Grammar) => void): EventKit.Disposable; - - /** Calls your callback when the grammar that interprets and colorizes the text - * has been changed. - */ - onDidChangeGrammar(callback: (grammar: FirstMate.Grammar) => void): EventKit.Disposable; - - /** Calls your callback when the result of ::isModified changes. */ - onDidChangeModified(callback: (modified: boolean) => void): EventKit.Disposable; - - /** Calls your callback when the buffer's underlying file changes on disk at a - * moment when the result of ::isModified is true. - */ - onDidConflict(callback: () => void): EventKit.Disposable; - - /** Calls your callback before text has been inserted. */ - onWillInsertText(callback: (event: { text: string, cancel(): void }) => void): - EventKit.Disposable; - - /** Calls your callback after text has been inserted. */ - onDidInsertText(callback: (event: { text: string }) => void): EventKit.Disposable; - - /** Calls your callback when a Cursor is added to the editor. Immediately calls - * your callback for each existing cursor. - */ - observeCursors(callback: (cursor: Cursor) => void): EventKit.Disposable; - - /** Calls your callback when a Cursor is added to the editor. */ - onDidAddCursor(callback: (cursor: Cursor) => void): EventKit.Disposable; - - /** Calls your callback when a Cursor is removed from the editor. */ - onDidRemoveCursor(callback: (cursor: Cursor) => void): EventKit.Disposable; - - /** Calls your callback when a Selection is added to the editor. Immediately - * calls your callback for each existing selection. - */ - observeSelections(callback: (selection: Selection) => void): EventKit.Disposable; - - /** Calls your callback when a Selection is added to the editor. */ - onDidAddSelection(callback: (selection: Selection) => void): EventKit.Disposable; - - /** Calls your callback when a Selection is removed from the editor. */ - onDidRemoveSelection(callback: (selection: Selection) => void): EventKit.Disposable; - - /** Calls your callback with each Decoration added to the editor. Calls your - * callback immediately for any existing decorations. - */ - observeDecorations(callback: (decoration: Decoration) => void): EventKit.Disposable; - - /** Calls your callback when a Decoration is added to the editor. */ - onDidAddDecoration(callback: (decoration: Decoration) => void): EventKit.Disposable; - - /** Calls your callback when a Decoration is removed from the editor. */ - onDidRemoveDecoration(callback: (decoration: Decoration) => void): EventKit.Disposable; - - /** Calls your callback when the placeholder text is changed. */ - onDidChangePlaceholderText(callback: (placeholderText: string) => void): EventKit.Disposable; - - // File Details - /** Get the editor's title for display in other parts of the UI such as the tabs. - * If the editor's buffer is saved, its title is the file name. If it is unsaved, - * its title is "untitled". - */ - getTitle(): string; - - /** Get unique title for display in other parts of the UI, such as the window title. - * If the editor's buffer is unsaved, its title is "untitled" If the editor's - * buffer is saved, its unique title is formatted as one of the following, - * - * "" when it is the only editing buffer with this file name. - * " — " when other buffers have this file name. - */ - getLongTitle(): string; - - /** Returns the string path of this editor's text buffer. */ - getPath(): string|undefined; - - /** Returns boolean true if this editor has been modified. */ - isModified(): boolean; - - /** Returns boolean true if this editor has no content. */ - isEmpty(): boolean; - - /** Returns the string character set encoding of this editor's text buffer. */ - getEncoding(): string; - - /** Set the character set encoding to use in this editor's text buffer. */ - setEncoding(encoding: string): void; - - // File Operations - /** Saves the editor's text buffer. - * See TextBuffer::save for more details. - */ - save(): Promise; - - /** Saves the editor's text buffer as the given path. - * See TextBuffer::saveAs for more details. - */ - saveAs(filePath: string): Promise; - - // Reading Text - /** Returns a string representing the entire contents of the editor. */ - getText(): string; - - /** Get the text in the given range in buffer coordinates. */ - getTextInBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]]): string; - - /** Returns a number representing the number of lines in the buffer. */ - getLineCount(): number; - - /** Returns a number representing the number of screen lines in the editor. - * This accounts for folds. - */ - getScreenLineCount(): number; - - /** Returns a number representing the last zero-indexed buffer row number of - * the editor. - */ - getLastBufferRow(): number; - - /** Returns a number representing the last zero-indexed screen row number of - * the editor. - */ - getLastScreenRow(): number; - - /** Returns a string representing the contents of the line at the given - * buffer row. - */ - lineTextForBufferRow(bufferRow: number): string; - - /** Returns a string representing the contents of the line at the given - * screen row. - */ - lineTextForScreenRow(screenRow: number): string; - - /** Get the range of the paragraph surrounding the most recently added cursor. */ - getCurrentParagraphBufferRange(): TextBuffer.Range; - - // Mutating Text - /** Replaces the entire contents of the buffer with the given string. */ - setText(text: string): void; - - /** Set the text in the given Range in buffer coordinates. */ - setTextInBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], text: string, - options?: { normalizeLineEndings?: boolean, undo?: "skip" }): void; - - /* For each selection, replace the selected text with the given text. */ - insertText(text: string, options?: { select?: boolean, autoIndent?: boolean, - autoIndentNewline?: boolean, autoDecreaseIndent?: boolean, - normalizeLineEndings?: boolean, undo?: "skip" }): TextBuffer.Range|boolean; - - /** For each selection, replace the selected text with a newline. */ - insertNewline(): void; - - /** For each selection, if the selection is empty, delete the character following - * the cursor. Otherwise delete the selected text. - */ - delete(): void; - - /** For each selection, if the selection is empty, delete the character preceding - * the cursor. Otherwise delete the selected text. - */ - backspace(): void; - - /** Mutate the text of all the selections in a single transaction. - * All the changes made inside the given function can be reverted with a single - * call to ::undo. - */ - mutateSelectedText(fn: (selection: Selection, index: number) => void): void; - - /** For each selection, transpose the selected text. - * If the selection is empty, the characters preceding and following the cursor - * are swapped. Otherwise, the selected characters are reversed. - */ - transpose(): void; - - /** Convert the selected text to upper case. - * For each selection, if the selection is empty, converts the containing word - * to upper case. Otherwise convert the selected text to upper case. - */ - upperCase(): void; - - /** Convert the selected text to lower case. - * For each selection, if the selection is empty, converts the containing word - * to upper case. Otherwise convert the selected text to upper case. - */ - lowerCase(): void; - - /** Toggle line comments for rows intersecting selections. - * If the current grammar doesn't support comments, does nothing. - */ - toggleLineCommentsInSelection(): void; - - /** For each cursor, insert a newline at beginning the following line. */ - insertNewlineBelow(): void; - - /** For each cursor, insert a newline at the end of the preceding line. */ - insertNewlineAbove(): void; - - /** For each selection, if the selection is empty, delete all characters of the - * containing word that precede the cursor. Otherwise delete the selected text. - */ - deleteToBeginningOfWord(): void; - - /** Similar to ::deleteToBeginningOfWord, but deletes only back to the previous - * word boundary. - */ - deleteToPreviousWordBoundary(): void; - - /** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */ - deleteToNextWordBoundary(): void; - - /** For each selection, if the selection is empty, delete all characters of the - * containing subword following the cursor. Otherwise delete the selected text. - */ - deleteToBeginningOfSubword(): void; - - /** For each selection, if the selection is empty, delete all characters of the - * containing subword following the cursor. Otherwise delete the selected text. - */ - deleteToEndOfSubword(): void; - - /** For each selection, if the selection is empty, delete all characters of the - * containing line that precede the cursor. Otherwise delete the selected text. - */ - deleteToBeginningOfLine(): void; - - /** For each selection, if the selection is not empty, deletes the selection - * otherwise, deletes all characters of the containing line following the cursor. - * If the cursor is already at the end of the line, deletes the following newline. - */ - deleteToEndOfLine(): void; - - /** For each selection, if the selection is empty, delete all characters of the - * containing word following the cursor. Otherwise delete the selected text. - */ - deleteToEndOfWord(): void; - - /** Delete all lines intersecting selections. */ - deleteLine(): void; - - // History - /** Undo the last change. */ - undo(): void; - - /** Redo the last change. */ - redo(): void; - - /** Batch multiple operations as a single undo/redo step. - * Any group of operations that are logically grouped from the perspective of undoing - * and redoing should be performed in a transaction. If you want to abort the transaction, - * call ::abortTransaction to terminate the function's execution and revert any changes - * performed up to the abortion. - */ - transact(fn: () => void): void; - /** Batch multiple operations as a single undo/redo step. - * Any group of operations that are logically grouped from the perspective of undoing - * and redoing should be performed in a transaction. If you want to abort the transaction, - * call ::abortTransaction to terminate the function's execution and revert any changes - * performed up to the abortion. - */ - transact(groupingInterval: number, fn: () => void): void; - - /** Abort an open transaction, undoing any operations performed so far within the transaction. */ - abortTransaction(): void; - - /** Create a pointer to the current state of the buffer for use with ::revertToCheckpoint - * and ::groupChangesSinceCheckpoint. - */ - createCheckpoint(): number; - - /** Revert the buffer to the state it was in when the given checkpoint was created. - * The redo stack will be empty following this operation, so changes since the checkpoint - * will be lost. If the given checkpoint is no longer present in the undo history, no - * changes will be made to the buffer and this method will return false. - */ - revertToCheckpoint(checkpoint: number): boolean; - - /** Group all changes since the given checkpoint into a single transaction for purposes - * of undo/redo. - * If the given checkpoint is no longer present in the undo history, no grouping will be - * performed and this method will return false. - */ - groupChangesSinceCheckpoint(checkpoint: number): boolean; - - // TextEditor Coordinates - /** Convert a position in buffer-coordinates to screen-coordinates. */ - screenPositionForBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], - options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; - - /** Convert a position in screen-coordinates to buffer-coordinates. */ - bufferPositionForScreenPosition(bufferPosition: TextBuffer.PointLike|[number, number], - options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; - - /** Convert a range in buffer-coordinates to screen-coordinates. */ - screenRangeForBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]]): TextBuffer.Range; - - /** Convert a range in screen-coordinates to buffer-coordinates. */ - bufferRangeForScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]]): TextBuffer.Range; - - /** Clip the given Point to a valid position in the buffer. */ - clipBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): - TextBuffer.Point; - - /** Clip the start and end of the given range to valid positions in the buffer. - * See ::clipBufferPosition for more information. - */ - clipBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| - [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| - [[number, number], [number, number]]): TextBuffer.Range; - - /** Clip the given Point to a valid position on screen. */ - clipScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], - options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; - - /** Clip the start and end of the given range to valid positions on screen. - * See ::clipScreenPosition for more information. - */ - clipScreenRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| - [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| - [[number, number], [number, number]], options?: { clipDirection?: - "backward"|"forward"|"closest"}): TextBuffer.Range; - - // Decorations - /** Add a decoration that tracks a DisplayMarker. When the marker moves, is - * invalidated, or is destroyed, the decoration will be updated to reflect - * the marker's state. - */ - decorateMarker(marker: TextBuffer.DisplayMarker, decorationParams: - Structures.DecorationProps): Decoration; - - /** Add a decoration to every marker in the given marker layer. Can be used to - * decorate a large number of markers without having to create and manage many - * individual decorations. - */ - decorateMarkerLayer(markerLayer: TextBuffer.MarkerLayer|TextBuffer.DisplayMarkerLayer, - decorationParams: Structures.DecorationLayerProps): LayerDecoration; - - /** Get all decorations. */ - getDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - /** Get all decorations of type 'line'. */ - getLineDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - /** Get all decorations of type 'line-number'. */ - getLineNumberDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - /** Get all decorations of type 'highlight'. */ - getHighlightDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - /** Get all decorations of type 'overlay'. */ - getOverlayDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - // Markers - /** Create a marker on the default marker layer with the given range in buffer coordinates. - * This marker will maintain its logical location as the buffer is changed, so if you mark - * a particular word, the marker will remain over that word even if the word's location - * in the buffer changes. - */ - markBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| - [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| - [[number, number], [number, number]], properties?: { maintainHistory?: boolean, - reversed?: boolean, invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): - TextBuffer.DisplayMarker; - - /** Create a marker on the default marker layer with the given range in screen coordinates. - * This marker will maintain its logical location as the buffer is changed, so if you mark - * a particular word, the marker will remain over that word even if the word's location in - * the buffer changes. - */ - markScreenRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| - [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| - [[number, number], [number, number]], properties?: { maintainHistory?: boolean, - reversed?: boolean, invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): - TextBuffer.DisplayMarker; - - /** Create a marker on the default marker layer with the given buffer position and no tail. - * To group multiple markers together in their own private layer, see ::addMarkerLayer. - */ - markBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], options?: - { invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): - TextBuffer.DisplayMarker; - - /** Create a marker on the default marker layer with the given screen position and no tail. - * To group multiple markers together in their own private layer, see ::addMarkerLayer. - */ - markScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], options?: - { invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", clipDirection?: - "backward"|"forward"|"closest" }): TextBuffer.DisplayMarker; - - /** Find all DisplayMarkers on the default marker layer that match the given properties. - * - * This method finds markers based on the given properties. Markers can be associated - * with custom properties that will be compared with basic equality. In addition, there - * are several special properties that will be compared with the range of the markers - * rather than their properties. - */ - findMarkers(properties: TextBuffer.Options.FindDisplayMarker): TextBuffer.DisplayMarker[]; - - /** Create a marker layer to group related markers. */ - addMarkerLayer(options?: { - maintainHistory?: boolean, - persistent?: boolean, - }): TextBuffer.DisplayMarkerLayer; - - /** Get a DisplayMarkerLayer by id. */ - getMarkerLayer(id: number): TextBuffer.DisplayMarkerLayer|undefined; - - /** Get the default DisplayMarkerLayer. - * All marker APIs not tied to an explicit layer interact with this default layer. - */ - getDefaultMarkerLayer(): TextBuffer.DisplayMarkerLayer; - - /** Get the DisplayMarker on the default layer for the given marker id. */ - getMarker(id: number): TextBuffer.DisplayMarker; - - /** Get all DisplayMarkers on the default marker layer. Consider using ::findMarkers. */ - getMarkers(): TextBuffer.DisplayMarker[]; - - /** Get the number of markers in the default marker layer. */ - getMarkerCount(): number; - - // Cursors - /** Get the position of the most recently added cursor in buffer coordinates. */ - getCursorBufferPosition(): TextBuffer.Point; - - /** Get the position of all the cursor positions in buffer coordinates. */ - getCursorBufferPositions(): TextBuffer.Point[]; - - /** Move the cursor to the given position in buffer coordinates. - * If there are multiple cursors, they will be consolidated to a single cursor. - */ - setCursorBufferPosition(position: TextBuffer.PointLike|[number, number], options?: - { autoscroll?: boolean }): void; - - /** Get a Cursor at given screen coordinates Point. */ - getCursorAtScreenPosition(position: TextBuffer.PointLike|[number, number]): - Cursor|undefined; - - /** Get the position of the most recently added cursor in screen coordinates. */ - getCursorScreenPosition(): TextBuffer.Point; - - /** Get the position of all the cursor positions in screen coordinates. */ - getCursorScreenPositions(): TextBuffer.Point[]; - - /** Move the cursor to the given position in screen coordinates. - * If there are multiple cursors, they will be consolidated to a single cursor. - */ - setCursorScreenPosition(position: TextBuffer.PointLike|[number, number], - options?: { autoscroll?: boolean }): void; - - /** Add a cursor at the given position in buffer coordinates. */ - addCursorAtBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): Cursor; - - /** Add a cursor at the position in screen coordinates. */ - addCursorAtScreenPosition(screenPosition: TextBuffer.PointLike|[number, number]): Cursor; - - /** Returns a boolean indicating whether or not there are multiple cursors. */ - hasMultipleCursors(): boolean; - - /** Move every cursor up one row in screen coordinates. */ - moveUp(lineCount?: number): void; - - /** Move every cursor down one row in screen coordinates. */ - moveDown(lineCount?: number): void; - - /** Move every cursor left one column. */ - moveLeft(columnCount?: number): void; - - /** Move every cursor right one column. */ - moveRight(columnCount?: number): void; - - /** Move every cursor to the beginning of its line in buffer coordinates. */ - moveToBeginningOfLine(): void; - - /** Move every cursor to the beginning of its line in screen coordinates. */ - moveToBeginningOfScreenLine(): void; - - /** Move every cursor to the first non-whitespace character of its line. */ - moveToFirstCharacterOfLine(): void; - - /** Move every cursor to the end of its line in buffer coordinates. */ - moveToEndOfLine(): void; - - /** Move every cursor to the end of its line in screen coordinates. */ - moveToEndOfScreenLine(): void; - - /** Move every cursor to the beginning of its surrounding word. */ - moveToBeginningOfWord(): void; - - /** Move every cursor to the end of its surrounding word. */ - moveToEndOfWord(): void; - - /** Move every cursor to the top of the buffer. - * If there are multiple cursors, they will be merged into a single cursor. - */ - moveToTop(): void; - - /** Move every cursor to the bottom of the buffer. - * If there are multiple cursors, they will be merged into a single cursor. - */ - moveToBottom(): void; - - /** Move every cursor to the beginning of the next word. */ - moveToBeginningOfNextWord(): void; - - /** Move every cursor to the previous word boundary. */ - moveToPreviousWordBoundary(): void; - - /** Move every cursor to the next word boundary. */ - moveToNextWordBoundary(): void; - - /** Move every cursor to the previous subword boundary. */ - moveToPreviousSubwordBoundary(): void; - - /** Move every cursor to the next subword boundary. */ - moveToNextSubwordBoundary(): void; - - /** Move every cursor to the beginning of the next paragraph. */ - moveToBeginningOfNextParagraph(): void; - - /** Move every cursor to the beginning of the previous paragraph. */ - moveToBeginningOfPreviousParagraph(): void; - - /** Returns the most recently added Cursor. */ - getLastCursor(): Cursor; - - /** Returns the word surrounding the most recently added cursor. */ - getWordUnderCursor(options?: { - wordRegex?: RegExp, - includeNonWordCharacters?: boolean, - allowPrevious?: boolean, - }): string; - - /** Get an Array of all Cursors. */ - getCursors(): Cursor[]; - - /** Get all Cursorss, ordered by their position in the buffer instead of the - * order in which they were added. - */ - getCursorsOrderedByBufferPosition(): Cursor[]; - - // Selections - /** Get the selected text of the most recently added selection. */ - getSelectedText(): string; - - /** Get the Range of the most recently added selection in buffer coordinates. */ - getSelectedBufferRange(): TextBuffer.Range; - - /** Get the Ranges of all selections in buffer coordinates. - * The ranges are sorted by when the selections were added. Most recent at the end. - */ - getSelectedBufferRanges(): TextBuffer.Range[]; - - /** Set the selected range in buffer coordinates. If there are multiple selections, - * they are reduced to a single selection with the given range. - */ - setSelectedBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { reversed?: boolean, preserveFolds?: boolean}): void; - - /** Set the selected ranges in buffer coordinates. If there are multiple selections, - * they are replaced by new selections with the given ranges. - */ - setSelectedBufferRanges(bufferRanges: ReadonlyArray, - options?: { reversed?: boolean, preserveFolds?: boolean}): void; - - /** Get the Range of the most recently added selection in screen coordinates. */ - getSelectedScreenRange(): TextBuffer.Range; - - /** Get the Ranges of all selections in screen coordinates. - * The ranges are sorted by when the selections were added. Most recent at the end. - */ - getSelectedScreenRanges(): TextBuffer.Range[]; - - /** Set the selected range in screen coordinates. If there are multiple selections, - * they are reduced to a single selection with the given range. - */ - setSelectedScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { reversed?: boolean }): void; - - /** Set the selected ranges in screen coordinates. If there are multiple selections, - * they are replaced by new selections with the given ranges. - */ - setSelectedScreenRanges(screenRanges: ReadonlyArray, options?: { reversed?: boolean }): void; - - /** Add a selection for the given range in buffer coordinates. */ - addSelectionForBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { reversed?: boolean, preserveFolds?: boolean }): Selection; - - /** Add a selection for the given range in screen coordinates. */ - addSelectionForScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { reversed?: boolean, preserveFolds?: boolean }): Selection; - - /** Select from the current cursor position to the given position in buffer coordinates. - * This method may merge selections that end up intersecting. - */ - selectToBufferPosition(position: TextBuffer.PointLike|[number, number]): void; - - /** Select from the current cursor position to the given position in screen coordinates. - * This method may merge selections that end up intersecting. - */ - selectToScreenPosition(position: TextBuffer.PointLike|[number, number]): void; - - /** Move the cursor of each selection one character upward while preserving the - * selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectUp(rowCount?: number): void; - - /** Move the cursor of each selection one character downward while preserving - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectDown(rowCount?: number): void; - - /** Move the cursor of each selection one character leftward while preserving - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectLeft(columnCount?: number): void; - - /** Move the cursor of each selection one character rightward while preserving - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectRight(columnCount?: number): void; - - /** Select from the top of the buffer to the end of the last selection in the buffer. - * This method merges multiple selections into a single selection. - */ - selectToTop(): void; - - /** Selects from the top of the first selection in the buffer to the end of the buffer. - * This method merges multiple selections into a single selection. - */ - selectToBottom(): void; - - /** Select all text in the buffer. - * This method merges multiple selections into a single selection. - */ - selectAll(): void; - - /** Move the cursor of each selection to the beginning of its line while preserving - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToBeginningOfLine(): void; - - /** Move the cursor of each selection to the first non-whitespace character of its - * line while preserving the selection's tail position. If the cursor is already - * on the first character of the line, move it to the beginning of the line. - * This method may merge selections that end up intersecting. - */ - selectToFirstCharacterOfLine(): void; - - /** Move the cursor of each selection to the end of its line while preserving the - * selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToEndOfLine(): void; - - /** Expand selections to the beginning of their containing word. - * Operates on all selections. Moves the cursor to the beginning of the containing - * word while preserving the selection's tail position. - */ - selectToBeginningOfWord(): void; - - /** Expand selections to the end of their containing word. - * Operates on all selections. Moves the cursor to the end of the containing word - * while preserving the selection's tail position. - */ - selectToEndOfWord(): void; - - /** For each cursor, select the containing line. - * This method merges selections on successive lines. - */ - selectLinesContainingCursors(): void; - - /** Select the word surrounding each cursor. */ - selectWordsContainingCursors(): void; - - /** For each selection, move its cursor to the preceding subword boundary while - * maintaining the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToPreviousSubwordBoundary(): void; - - /** For each selection, move its cursor to the next subword boundary while maintaining - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToNextSubwordBoundary(): void; - - /** For each selection, move its cursor to the preceding word boundary while - * maintaining the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToPreviousWordBoundary(): void; - - /** For each selection, move its cursor to the next word boundary while maintaining - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToNextWordBoundary(): void; - - /** Expand selections to the beginning of the next word. - * Operates on all selections. Moves the cursor to the beginning of the next word - * while preserving the selection's tail position. - */ - selectToBeginningOfNextWord(): void; - - /** Expand selections to the beginning of the next paragraph. - * Operates on all selections. Moves the cursor to the beginning of the next - * paragraph while preserving the selection's tail position. - */ - selectToBeginningOfNextParagraph(): void; - - /** Expand selections to the beginning of the next paragraph. - * Operates on all selections. Moves the cursor to the beginning of the next - * paragraph while preserving the selection's tail position. - */ - selectToBeginningOfPreviousParagraph(): void; - - /** Select the range of the given marker if it is valid. */ - selectMarker(marker: TextBuffer.DisplayMarker): TextBuffer.Range|undefined; - - /** Get the most recently added Selection. */ - getLastSelection(): Selection; - - /** Get current Selections. */ - getSelections(): Selection[]; - - /** Get all Selections, ordered by their position in the buffer instead of the - * order in which they were added. - */ - getSelectionsOrderedByBufferPosition(): Selection[]; - - // NOTE: this calls into Selection::intersectsBufferRange, which itself calls - // into Range::intersectsWith. Range::intersectsWith is one of the few functions - // which does NOT take a range-compatible array. - /** Determine if a given range in buffer coordinates intersects a selection. */ - selectionIntersectsBufferRange(bufferRange: TextBuffer.RangeLike): boolean; - - // Searching and Replacing - /** Scan regular expression matches in the entire buffer, calling the given - * iterator function on each match. - * - * ::scan functions as the replace method as well via the replace. - */ - scan(regex: RegExp, options: TextBuffer.Options.ScanContext, iterator: (params: - TextBuffer.Structures.ContextualBufferScanResult) => void): void; - /** Scan regular expression matches in the entire buffer, calling the given - * iterator function on each match. - * - * ::scan functions as the replace method as well via the replace. - */ - scan(regex: RegExp, iterator: (params: TextBuffer.Structures.BufferScanResult) => void): - void; - - /** Scan regular expression matches in a given range, calling the given iterator. - * function on each match. - */ - scanInBufferRange(regex: RegExp, range: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], iterator: (params: - TextBuffer.Structures.BufferScanResult) => void): void; - - /** Scan regular expression matches in a given range in reverse order, calling the - * given iterator function on each match. - */ - backwardsScanInBufferRange(regex: RegExp, range: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], iterator: (params: - TextBuffer.Structures.BufferScanResult) => void): void; - - // Tab Behavior - /** Returns a boolean indicating whether softTabs are enabled for this editor. */ - getSoftTabs(): boolean; - - /** Enable or disable soft tabs for this editor. */ - setSoftTabs(softTabs: boolean): void; - - /** Toggle soft tabs for this editor. */ - toggleSoftTabs(): boolean; - - /** Get the on-screen length of tab characters. */ - getTabLength(): number; - - /** Set the on-screen length of tab characters. Setting this to a number will - * override the editor.tabLength setting. - */ - setTabLength(tabLength: number): void; - - /** Determine if the buffer uses hard or soft tabs. */ - usesSoftTabs(): boolean|undefined; - - /** Get the text representing a single level of indent. - * If soft tabs are enabled, the text is composed of N spaces, where N is the - * tab length. Otherwise the text is a tab character (\t). - */ - getTabText(): string; - - // Soft Wrap Behavior - /** Determine whether lines in this editor are soft-wrapped. */ - isSoftWrapped(): boolean; - - /** Enable or disable soft wrapping for this editor. */ - setSoftWrapped(softWrapped: boolean): boolean; - - /** Toggle soft wrapping for this editor. */ - toggleSoftWrapped(): boolean; - - /** Gets the column at which column will soft wrap. */ - getSoftWrapColumn(): number; - - // Indentation - /** Get the indentation level of the given buffer row. - * Determines how deeply the given row is indented based on the soft tabs and tab - * length settings of this editor. Note that if soft tabs are enabled and the tab - * length is 2, a row with 4 leading spaces would have an indentation level of 2. - */ - indentationForBufferRow(bufferRow: number): number; - - /** Set the indentation level for the given buffer row. - * Inserts or removes hard tabs or spaces based on the soft tabs and tab length settings - * of this editor in order to bring it to the given indentation level. Note that if soft - * tabs are enabled and the tab length is 2, a row with 4 leading spaces would have an - * indentation level of 2. - */ - setIndentationForBufferRow(bufferRow: number, newLevel: number, options?: - { preserveLeadingWhitespace?: boolean }): void; - - /** Indent rows intersecting selections by one level. */ - indentSelectedRows(): void; - - /** Outdent rows intersecting selections by one level. */ - outdentSelectedRows(): void; - - /** Get the indentation level of the given line of text. - * Determines how deeply the given line is indented based on the soft tabs and tab length - * settings of this editor. Note that if soft tabs are enabled and the tab length is 2, - * a row with 4 leading spaces would have an indentation level of 2. - */ - indentLevelForLine(line: string): number; - - /** Indent rows intersecting selections based on the grammar's suggested indent level. */ - autoIndentSelectedRows(): void; - - // Grammars - /** Get the current Grammar of this editor. */ - getGrammar(): FirstMate.Grammar; - - /** Set the current Grammar of this editor. - * Assigning a grammar will cause the editor to re-tokenize based on the new grammar. - */ - setGrammar(grammar: FirstMate.Grammar): void; - - // Managing Syntax Scopes - /** Returns a ScopeDescriptor that includes this editor's language. - * e.g. [".source.ruby"], or [".source.coffee"]. - */ - getRootScopeDescriptor(): ScopeDescriptor; - - /** Get the syntactic scopeDescriptor for the given position in buffer coordinates. */ - scopeDescriptorForBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): - ScopeDescriptor; - - /** Get the range in buffer coordinates of all tokens surrounding the cursor - * that match the given scope selector. - */ - bufferRangeForScopeAtCursor(scopeSelector: string): TextBuffer.Range; - - /** Determine if the given row is entirely a comment. */ - isBufferRowCommented(bufferRow: number): boolean; - - // Clipboard Operations - /** For each selection, copy the selected text. */ - copySelectedText(): void; - - /** For each selection, cut the selected text. */ - cutSelectedText(): void; - - /** For each selection, replace the selected text with the contents of the clipboard. - * If the clipboard contains the same number of selections as the current editor, - * each selection will be replaced with the content of the corresponding clipboard - * selection text. - */ - pasteText(options?: Options.TextInsertion): void; - - /** For each selection, if the selection is empty, cut all characters of the - * containing screen line following the cursor. Otherwise cut the selected text. - */ - cutToEndOfLine(): void; - - /** For each selection, if the selection is empty, cut all characters of the - * containing buffer line following the cursor. Otherwise cut the selected text. - */ - cutToEndOfBufferLine(): void; - - // Folds - /** Fold the most recent cursor's row based on its indentation level. - * The fold will extend from the nearest preceding line with a lower indentation - * level up to the nearest following row with a lower indentation level. - */ - foldCurrentRow(): void; - - /** Unfold the most recent cursor's row by one level. */ - unfoldCurrentRow(): void; - - /** Fold the given row in buffer coordinates based on its indentation level. - * If the given row is foldable, the fold will begin there. Otherwise, it will - * begin at the first foldable row preceding the given row. - */ - foldBufferRow(bufferRow: number): void; - - /** Unfold all folds containing the given row in buffer coordinates. */ - unfoldBufferRow(bufferRow: number): void; - - /** For each selection, fold the rows it intersects. */ - foldSelectedLines(): void; - - /** Fold all foldable lines. */ - foldAll(): void; - - /** Unfold all existing folds. */ - unfoldAll(): void; - - /** Fold all foldable lines at the given indent level. */ - foldAllAtIndentLevel(level: number): void; - - /** Determine whether the given row in buffer coordinates is foldable. - * A foldable row is a row that starts a row range that can be folded. - */ - isFoldableAtBufferRow(bufferRow: number): boolean; - - /** Determine whether the given row in screen coordinates is foldable. - * A foldable row is a row that starts a row range that can be folded. - */ - isFoldableAtScreenRow(bufferRow: number): boolean; - - /** Fold the given buffer row if it isn't currently folded, and unfold it otherwise. */ - toggleFoldAtBufferRow(bufferRow: number): void; - - /** Determine whether the most recently added cursor's row is folded. */ - isFoldedAtCursorRow(): boolean; - - /** Determine whether the given row in buffer coordinates is folded. */ - isFoldedAtBufferRow(bufferRow: number): boolean; - - /** Determine whether the given row in screen coordinates is folded. */ - isFoldedAtScreenRow(screenRow: number): boolean; - - // Gutters - /** Add a custom Gutter. */ - addGutter(options: { - name: string, - priority?: number, - visible?: boolean, - }): Gutter; - - /** Get this editor's gutters. */ - getGutters(): Gutter[]; - - /** Get the gutter with the given name. */ - gutterWithName(name: string): Gutter|null; - - // Scrolling the TextEditor - /** Scroll the editor to reveal the most recently added cursor if it is off-screen. */ - scrollToCursorPosition(options?: { center?: boolean }): void; - - /** Scrolls the editor to the given buffer position. */ - scrollToBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], - options?: { center?: boolean }): void; - - /** Scrolls the editor to the given screen position. */ - scrollToScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], - options?: { center?: boolean }): void; - - // TextEditor Rendering - /** Retrieves the rendered line height in pixels. */ - getLineHeightInPixels(): number; - - /** Retrieves the greyed out placeholder of a mini editor. */ - getPlaceholderText(): string; - - /** Set the greyed out placeholder of a mini editor. Placeholder text will be - * displayed when the editor has no content. - */ - setPlaceholderText(placeholderText: string): void; - } - - /** Experimental: This global registry tracks registered TextEditors. */ - interface TextEditorRegistry { - // Managing Text Editors - /** Remove all editors from the registry. */ - clear(): void; - - /** Register a TextEditor. */ - add(editor: TextEditor): EventKit.Disposable; - - /** Remove the given TextEditor from the registry. */ - remove(editor: TextEditor): boolean; - - /** Keep a TextEditor's configuration in sync with Atom's settings. */ - maintainConfig(editor: TextEditor): EventKit.Disposable; - - /** Set a TextEditor's grammar based on its path and content, and continue - * to update its grammar as gramamrs are added or updated, or the editor's - * file path changes. - */ - maintainGrammar(editor: TextEditor): EventKit.Disposable; - - /** Force a TextEditor to use a different grammar than the one that would - * otherwise be selected for it. - */ - setGrammarOverride(editor: TextEditor, scopeName: string): void; - - /** Retrieve the grammar scope name that has been set as a grammar override - * for the given TextEditor. - */ - getGrammarOverride(editor: TextEditor): string|null; - - /** Remove any grammar override that has been set for the given {TextEditor}. */ - clearGrammarOverride(editor: TextEditor): void; - - // Event Subscription - /** Invoke the given callback with all the current and future registered TextEditors. */ - observe(callback: (editor: TextEditor) => void): EventKit.Disposable; - } - - /** Handles loading and activating available themes. */ - interface ThemeManager { - // Event Subscription - /** Invoke callback when style sheet changes associated with updating the - * list of active themes have completed. - */ - onDidChangeActiveThemes(callback: () => void): EventKit.Disposable; - - // Accessing Loaded Themes - /** Returns an Array of strings of all the loaded theme names. */ - getLoadedThemeNames(): string[]|undefined; - - /** Returns an Array of all the loaded themes. */ - getLoadedThemes(): Package[]|undefined; - - // Accessing Active Themes - /** Returns an Array of strings all the active theme names. */ - getActiveThemeNames(): string[]|undefined; - - /** Returns an Array of all the active themes. */ - getActiveThemes(): Package[]|undefined; - - // Managing Enabled Themes - /** Get the enabled theme names from the config. */ - getEnabledThemeNames(): string[]; - } - - /** This tooltip class is derived from Bootstrap 3, but modified to not require - * jQuery, which is an expensive dependency we want to eliminate. - */ - interface Tooltip { - options: Options.Tooltip; - enabled: boolean; - timeout: number; - hoverState: "in"|"out"|null; - element: JQuery|HTMLElement; - - getTitle(): string; - getTooltipElement(): HTMLElement; - getArrowElement(): HTMLElement; - enable(): void; - disable(): void; - toggleEnabled(): void; - toggle(): void; - recalculatePosition(): void; - } - - /** Associates tooltips with HTML elements or selectors. */ - interface TooltipManager { - /** Add a tooltip to the given element. */ - add(target: JQuery|HTMLElement, options: { - title?: string, - html?: boolean, - item?: HTMLElement|{ element: HTMLElement }, - class?: string, - placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string), - trigger?: "click"|"hover"|"focus"|"manual", - delay?: { show: number, hide: number }, - keyBindingCommand?: string, - keyBindingTarget?: HTMLElement - } | { - title?: string|(() => string), - html?: boolean, - item?: HTMLElement|{ element: HTMLElement }, - class?: string, - placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string), - trigger?: "click"|"hover"|"focus"|"manual", - delay?: { show: number, hide: number }, - }): EventKit.Disposable; - - /** Find the tooltips that have been applied to the given element. */ - findTooltips(target: HTMLElement): Tooltip[]; - } - - /** ViewRegistry handles the association between model and view types in Atom. - * We call this association a View Provider. As in, for a given model, this class - * can provide a view via ::getView, as long as the model/view association was - * registered via ::addViewProvider. - */ - interface ViewRegistry { - /** Add a provider that will be used to construct views in the workspace's view - * layer based on model objects in its model layer. - */ - addViewProvider(createView: (model: object) => HTMLElement|undefined): EventKit.Disposable; - /** Add a provider that will be used to construct views in the workspace's view - * layer based on model objects in its model layer. - */ - // tslint:disable-next-line:no-any - addViewProvider(modelConstructor: { new (...args: any[]): T }, createView: - (instance: T) => HTMLElement|undefined): EventKit.Disposable; - - /** Get the view associated with an object in the workspace. */ - getView(obj: object): HTMLElement; - } - - /** Represents the state of the user interface for the entire window. */ - interface Workspace { - // Event Subscription - /** Invoke the given callback with all current and future text editors in - * the workspace. - */ - observeTextEditors(callback: (editor: TextEditor) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes items in the - * workspace. - */ - observePaneItems(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item changes. */ - onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item stops changing. */ - onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when a text editor becomes the active text editor and - * when there is no longer an active text editor. - */ - onDidChangeActiveTextEditor(callback: (editor?: TextEditor) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane item and with all - * future active pane items in the workspace. - */ - observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active text editor (if any), with all - * future active text editors, and when there is no longer an active text editor. - */ - observeActiveTextEditor(callback: (editor?: TextEditor) => void): EventKit.Disposable; - - /** Invoke the given callback whenever an item is opened. Unlike ::onDidAddPaneItem, - * observers will be notified for items that are already present in the workspace - * when they are reopened. - */ - onDidOpen(callback: (event: Events.PaneItemOpened) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is added to the workspace. */ - onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback before a pane is destroyed in the workspace. */ - onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is destroyed in the workspace. */ - onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes in the workspace. */ - observePanes(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane changes. */ - onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane and when the - * active pane changes. - */ - observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane item is added to the workspace. */ - onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is about to be destroyed, - * before the user is prompted to save it. - */ - onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is destroyed. */ - onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a text editor is added to the workspace. */ - onDidAddTextEditor(callback: (event: Events.TextEditorObserved) => void): - EventKit.Disposable; - - // Opening - /** Opens the given URI in Atom asynchronously. If the URI is already open, - * the existing item for that URI will be activated. If no URI is given, or - * no registered opener can open the URI, a new empty TextEditor will be created. - */ - open(uri: string, options?: { - initialLine?: number, - initialColumn?: number, - split?: "left"|"right"|"up"|"down", - activatePane?: boolean, - activateItem?: boolean, - pending?: boolean, - searchAllPanes?: boolean, - location?: "left"|"right"|"bottom"|"center", - }): Promise; - /** Opens the given URI in Atom asynchronously. If the URI is already open, - * the existing item for that URI will be activated. If no URI is given, or - * no registered opener can open the URI, a new empty TextEditor will be created. - */ - open(): Promise; - - /** Search the workspace for items matching the given URI and hide them. - * Returns a boolean indicating whether any items were found (and hidden). - */ - hide(itemOrURI: object|string): boolean; - - /** Search the workspace for items matching the given URI. If any are found, - * hide them. Otherwise, open the URL. - * Returns a Promise that resolves when the item is shown or hidden. - */ - toggle(itemOrURI: object|string): Promise; - - /** Creates a new item that corresponds to the provided URI. - * If no URI is given, or no registered opener can open the URI, a new empty TextEditor - * will be created. - */ - createItemForURI(uri: string): Promise; - - /** Returns a boolean that is true if object is a TextEditor. */ - isTextEditor(object: object): boolean; - - /** Asynchronously reopens the last-closed item's URI if it hasn't already - * been reopened. - */ - reopenItem(): Promise; - - /** Register an opener for a URI. */ - addOpener(opener: (uri: string) => HTMLElement|{ getTitle(): string }|undefined): - EventKit.Disposable; - - /** Create a new text editor. */ - buildTextEditor(params: object): TextEditor; - - // Pane Items - /** Get all pane items in the workspace. */ - getPaneItems(): object[]; - - /** Get the active Pane's active item. */ - getActivePaneItem(): object; - - /** Get all text editors in the workspace. */ - getTextEditors(): TextEditor[]; - - /** Get the workspace center's active item if it is a TextEditor. */ - getActiveTextEditor(): TextEditor|undefined; - - // Panes - /** Get the most recently focused pane container. */ - getActivePaneContainer(): Dock|WorkspaceCenter; - - /** Get all panes in the workspace. */ - getPanes(): Pane[]; - - /** Get the active Pane. */ - getActivePane(): Pane; - - /** Make the next pane active. */ - activateNextPane(): boolean; - - /** Make the previous pane active. */ - activatePreviousPane(): boolean; - - /** Get the first pane container that contains an item with the given URI. */ - paneContainerForURI(uri: string): Dock|WorkspaceCenter|undefined; - - /** Get the first pane container that contains the given item. */ - paneContainerForItem(item: object): Dock|WorkspaceCenter|undefined; - - /** Get the first Pane with an item for the given URI. */ - paneForURI(uri: string): Pane|undefined; - - /** Get the Pane containing the given item. */ - paneForItem(item: object): Pane|undefined; - - // Pane Locations - /** Get the WorkspaceCenter at the center of the editor window. */ - getCenter(): WorkspaceCenter; - - /** Get the Dock to the left of the editor window. */ - getLeftDock(): Dock; - - /** Get the Dock to the right of the editor window. */ - getRightDock(): Dock; - - /** Get the Dock below the editor window. */ - getBottomDock(): Dock; - - /** Returns all Pane containers. */ - getPaneContainers(): [WorkspaceCenter, Dock, Dock, Dock]; - - // Panels - /** Get an Array of all the panel items at the bottom of the editor window. */ - getBottomPanels(): Panel[]; - - /** Adds a panel item to the bottom of the editor window. */ - addBottomPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the panel items to the left of the editor window. */ - getLeftPanels(): Panel[]; - - /** Adds a panel item to the left of the editor window. */ - addLeftPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the panel items to the right of the editor window. */ - getRightPanels(): Panel[]; - - /** Adds a panel item to the right of the editor window. */ - addRightPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the panel items at the top of the editor window. */ - getTopPanels(): Panel[]; - - /** Adds a panel item to the top of the editor window above the tabs. */ - addTopPanel(options: { - item: object, - visible?: boolean, - priority?: number - }): Panel; - - /** Get an Array of all the panel items in the header. */ - getHeaderPanels(): Panel[]; - - /** Adds a panel item to the header. */ - addHeaderPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the panel items in the footer. */ - getFooterPanels(): Panel[]; - - /** Adds a panel item to the footer. */ - addFooterPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the modal panel items. */ - getModalPanels(): Panel[]; - - /** Adds a panel item as a modal dialog. */ - addModalPanel(options: { - item: object, - visible?: boolean, - priority?: number, - autoFocus?: boolean, - }): Panel; - - /** Returns the Panel associated with the given item or null when the item - * has no panel. - */ - panelForItem(item: object): Panel|null; - - // Searching and Replacing - /** Performs a search across all files in the workspace. */ - scan(regex: RegExp, iterator: (result: Structures.ScandalResult) => void): - Structures.CancellablePromise; - /** Performs a search across all files in the workspace. */ - scan(regex: RegExp, options: Options.WorkspaceScan, iterator: - (result: Structures.ScandalResult) => void): Structures.CancellablePromise; - - /** Performs a replace across all the specified files in the project. */ - replace(regex: RegExp, replacementText: string, filePaths: ReadonlyArray, - iterator: (result: { filePath: string|undefined, replacements: number }) => void): - Promise; - } - - // https://github.com/atom/atom/blob/master/src/workspace-center.js - /** The central container for the editor window capable of holding items. */ - interface WorkspaceCenter { - // Event Subscription - /** Invoke the given callback with all current and future text editors in the - * workspace center. - */ - observeTextEditors(callback: (editor: TextEditor) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes items in the - * workspace center. - */ - observePaneItems(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item changes. */ - onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item stops changing. */ - onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane item and with all future - * active pane items in the workspace center. - */ - observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is added to the workspace center. */ - onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback before a pane is destroyed in the workspace center. */ - onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is destroyed in the workspace center. */ - onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes in the workspace center. */ - observePanes(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane changes. */ - onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane and when the active pane changes. */ - observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane item is added to the workspace center. */ - onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is about to be destroyed, before the user - * is prompted to save it. - */ - onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is destroyed. */ - onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a text editor is added to the workspace center. */ - onDidAddTextEditor(callback: (event: Events.TextEditorObserved) => void): - EventKit.Disposable; - - // Pane Items - /** Get all pane items in the workspace center. */ - getPaneItems(): object[]; - - /** Get the active Pane's active item. */ - getActivePaneItem(): object|undefined; - - /** Get all text editors in the workspace center. */ - getTextEditors(): TextEditor[]; - - /** Get the active item if it is an TextEditor. */ - getActiveTextEditor(): TextEditor|undefined; - - /** Save all pane items. */ - saveAll(): void; - - // Panes - /** Get all panes in the workspace center. */ - getPanes(): Pane[]; - - /** Get the active Pane. */ - getActivePane(): Pane; - - /** Make the next pane active. */ - activateNextPane(): void; - - /** Make the previous pane active. */ - activatePreviousPane(): void; - - /** Retrieve the Pane associated with the given URI. */ - paneForURI(uri: string): Pane|undefined; - - /** Retrieve the Pane associated with the given item. */ - paneForItem(item: object): Pane|undefined; - - /** Destroy (close) the active pane. */ - destroyActivePane(): void; - } - } - - /** An amalgamation of all types used within the public Atom API. */ - namespace Atom { - /** Objects that appear as parameters to callbacks. */ - namespace Events { - // Atom Keymap ========================================================== - type FullKeybindingMatch = AtomKeymap.Events.FullKeybindingMatch; - type PartialKeybindingMatch = AtomKeymap.Events.PartialKeybindingMatch; - type FailedKeybindingMatch = AtomKeymap.Events.FailedKeybindingMatch; - type FailedKeymapFileRead = AtomKeymap.Events.FailedKeymapFileRead; - type KeymapLoaded = AtomKeymap.Events.KeymapLoaded; - type AddedKeystrokeResolver = AtomKeymap.Events.AddedKeystrokeResolver; - - // Path Watcher ========================================================= - type PathWatchErrorThrown = PathWatcher.Events.PathWatchErrorThrown; - type WatchedFilePathChanged = PathWatcher.Events.WatchedFilePathChanged; - - // Text Buffer ========================================================== - type BufferWatchError = TextBuffer.Events.BufferWatchError; - type FileSaved = TextBuffer.Events.FileSaved; - type MarkerChanged = TextBuffer.Events.MarkerChanged; - type BufferChanging = TextBuffer.Events.BufferChanging; - type BufferChanged = TextBuffer.Events.BufferChanged; - type BufferStoppedChanging = TextBuffer.Events.BufferStoppedChanging; - type DisplayMarkerChanged = TextBuffer.Events.DisplayMarkerChanged; - - // Core ================================================================= - type ExceptionThrown = AtomCore.Events.ExceptionThrown; - type PreventableExceptionThrown = AtomCore.Events.PreventableExceptionThrown; - type SelectionChanged = AtomCore.Events.SelectionChanged; - type PaneItemObserved = AtomCore.Events.PaneItemObserved; - type PaneItemOpened = AtomCore.Events.PaneItemOpened; - type EditorChanged = AtomCore.Events.EditorChanged; - type StyleElementObserved = AtomCore.Events.StyleElementObserved; - type TextEditorObserved = AtomCore.Events.TextEditorObserved; - type RepoStatusChanged = AtomCore.Events.RepoStatusChanged; - type PaneListItemShifted = AtomCore.Events.PaneListItemShifted; - type PaneItemMoved = AtomCore.Events.PaneItemMoved; - type CursorPositionChanged = AtomCore.Events.CursorPositionChanged; - type DecorationPropsChanged = AtomCore.Events.DecorationPropsChanged; - type FilesystemChange = AtomCore.Events.FilesystemChange; - } - - /** Objects that appear as parameters to functions. */ - namespace Options { - // Atom Keymap ========================================================== - type BuildKeyEvent = AtomKeymap.Options.BuildKeyEvent; - - // First Mate =========================================================== - type Grammar = FirstMate.Options.Grammar; - - // Text Buffer ========================================================== - type BufferLoad = TextBuffer.Options.BufferLoad; - type CopyMarker = TextBuffer.Options.CopyMarker; - type FindMarker = TextBuffer.Options.FindMarker; - type FindDisplayMarker = TextBuffer.Options.FindDisplayMarker; - type ScanContext = TextBuffer.Options.ScanContext; - - // Core ================================================================= - type TextInsertion = AtomCore.Options.TextInsertion; - type Menu = AtomCore.Options.Menu; - type ContextMenu = AtomCore.Options.ContextMenu; - type SpawnProcess = AtomCore.Options.SpawnProcess; - type Process = AtomCore.Options.Process; - type NodeProcess = AtomCore.Options.NodeProcess; - type Notification = AtomCore.Options.Notification; - type ErrorNotification = AtomCore.Options.ErrorNotification; - type Tooltip = AtomCore.Options.Tooltip; - type WorkspaceScan = AtomCore.Options.WorkspaceScan; - type BuildEnvironment = AtomCore.Options.BuildEnvironment; - } - - /** Data structures that are used within classes. */ - namespace Structures { - // First Mate =========================================================== - type GrammarToken = FirstMate.Structures.GrammarToken; - type TokenizeLineResult = FirstMate.Structures.TokenizeLineResult; - type GrammarRule = FirstMate.Structures.GrammarRule; - - // Text Buffer ========================================================== - type TextChange = TextBuffer.Structures.TextChange; - type BufferScanResult = TextBuffer.Structures.BufferScanResult; - type ContextualBufferScanResult = TextBuffer.Structures.ContextualBufferScanResult; - - // Core ================================================================= - type SharedDecorationProps = AtomCore.Structures.SharedDecorationProps; - type DecorationProps = AtomCore.Structures.DecorationProps; - type DecorationLayerProps = AtomCore.Structures.DecorationLayerProps; - type Invisibles = AtomCore.Structures.Invisibles; - type CancellablePromise = AtomCore.Structures.CancellablePromise; - type ScandalResult = AtomCore.Structures.ScandalResult; - type WindowLoadSettings = AtomCore.Structures.WindowLoadSettings; - type TestRunnerArgs = AtomCore.Structures.TestRunnerArgs; - } - - // Atom Keymap ============================================================ - /** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding - * method, as well as versions of the ::stopPropagation methods that record the - * intent to stop propagation so event bubbling can be properly simulated for - * detached elements. - */ - type CommandEvent = AtomKeymap.CommandEvent; - - type KeyBinding = AtomKeymap.KeyBinding; - - /** Allows commands to be associated with keystrokes in a context-sensitive way. - * In Atom, you can access a global instance of this object via `atom.keymaps`. - */ - type KeymapManager = AtomKeymap.KeymapManager; - - // Event Kit ============================================================== - /** An object that aggregates multiple Disposable instances together into a - * single disposable, so they can all be disposed as a group. - */ - type CompositeDisposable = EventKit.CompositeDisposable; - - type DisposableLike = EventKit.DisposableLike; - - /** A handle to a resource that can be disposed. */ - type Disposable = EventKit.Disposable; - - /** Utility class to be used when implementing event-based APIs that allows - * for handlers registered via ::on to be invoked with calls to ::emit. - */ - type Emitter = EventKit.Emitter; - - // First Mate ============================================================= - /** Grammar that tokenizes lines of text. */ - type Grammar = FirstMate.Grammar; - - /** Instance side of GrammarRegistry class. */ - type GrammarRegistry = FirstMate.GrammarRegistry; - - type ScopeSelector = FirstMate.ScopeSelector; - - // Path Watcher =========================================================== - /** Represents a directory on disk that can be watched for changes. */ - type Directory = PathWatcher.Directory; - - /** Represents an individual file that can be watched, read from, and written to. */ - type File = PathWatcher.File; - - // Text Buffer ============================================================ - /** The interface that should be implemented for all "point-compatible" objects. */ - /** Represents a buffer annotation that remains logically stationary even as the - * buffer changes. This is used to represent cursors, folds, snippet targets, - * misspelled words, and anything else that needs to track a logical location - * in the buffer over time. - */ - type DisplayMarker = TextBuffer.DisplayMarker; - - /** Experimental: A container for a related set of markers at the DisplayLayer level. - * Wraps an underlying MarkerLayer on the TextBuffer. - * - * This API is experimental and subject to change on any release. - */ - type DisplayMarkerLayer = TextBuffer.DisplayMarkerLayer; - - /** Represents a buffer annotation that remains logically stationary even as - * the buffer changes. - */ - type Marker = TextBuffer.Marker; - - /** Experimental: A container for a related set of markers. */ - type MarkerLayer = TextBuffer.MarkerLayer; - - /** The interface that should be implemented for all "point-compatible" objects. */ - type PointLike = TextBuffer.PointLike; - - /** Represents a point in a buffer in row/column coordinates. */ - type Point = TextBuffer.Point; - - /** The interface that should be implemented for all "range-compatible" objects. */ - type RangeLike = TextBuffer.RangeLike; - - /** Represents a region in a buffer in row/column coordinates. */ - type Range = TextBuffer.Range; - - /** A mutable text container with undo/redo support and the ability to - * annotate logical regions in the text. - */ - type TextBuffer = TextBuffer.TextBuffer; - - // Atom =================================================================== - /** Atom global for dealing with packages, themes, menus, and the window. - * An instance of this class is always available as the atom global. - */ - type AtomEnvironment = AtomCore.AtomEnvironment; - - /** A wrapper which provides standard error/output line buffering for - * Node's ChildProcess. - */ - type BufferedProcess = AtomCore.BufferedProcess; - - /** Like BufferedProcess, but accepts a Node script as the command to run. - * This is necessary on Windows since it doesn't support shebang #! lines. - */ - type BufferedNodeProcess = AtomCore.BufferedNodeProcess; - - /** Represents the clipboard used for copying and pasting in Atom. */ - type Clipboard = AtomCore.Clipboard; - - /** A simple color class returned from Config::get when the value at the key path is - * of type 'color'. - */ - type Color = AtomCore.Color; - - /** Used to access all of Atom's configuration details. */ - type Config = AtomCore.Config; - - /** Provides a registry for commands that you'd like to appear in the context menu. */ - type ContextMenuManager = AtomCore.ContextMenuManager; - - /** Associates listener functions with commands in a context-sensitive way - * using CSS selectors. - */ - type CommandRegistry = AtomCore.CommandRegistry; - - /** The Cursor class represents the little blinking line identifying where text - * can be inserted. - */ - type Cursor = AtomCore.Cursor; - - /** Represents a decoration that follows a DisplayMarker. A decoration is basically - * a visual representation of a marker. It allows you to add CSS classes to line - * numbers in the gutter, lines, and add selection-line regions around marked ranges - * of text. - */ - type Decoration = AtomCore.Decoration; - - type Deserializer = AtomCore.Deserializer; - - /** Manages the deserializers used for serialized state. */ - type DeserializerManager = AtomCore.DeserializerManager; - - /** A container at the edges of the editor window capable of holding items. */ - type Dock = AtomCore.Dock; - - /** Represents the underlying git operations performed by Atom. */ - type GitRepository = AtomCore.GitRepository; - - /** Represents a gutter within a TextEditor. */ - type Gutter = AtomCore.Gutter; - - /** History manager for remembering which projects have been opened. - * An instance of this class is always available as the atom.history global. - * The project history is used to enable the 'Reopen Project' menu. - */ - type HistoryManager = AtomCore.HistoryManager; - - type HistoryProject = AtomCore.HistoryProject; - - /** Represents a decoration that applies to every marker on a given layer. Created via - * TextEditor::decorateMarkerLayer. - */ - type LayerDecoration = AtomCore.LayerDecoration; - - /** Provides a registry for menu items that you'd like to appear in the application menu. */ - type MenuManager = AtomCore.MenuManager; - - /** A notification to the user containing a message and type. */ - type Notification = AtomCore.Notification; - - /** A notification manager used to create Notifications to be shown to the user. */ - type NotificationManager = AtomCore.NotificationManager; - - /** Loads and activates a package's main module and resources such as stylesheets, - * keymaps, grammar, editor properties, and menus. - */ - type Package = AtomCore.Package; - - /** Package manager for coordinating the lifecycle of Atom packages. */ - type PackageManager = AtomCore.PackageManager; - - /** A container for presenting content in the center of the workspace. */ - type Pane = AtomCore.Pane; - - /** A container representing a panel on the edges of the editor window. You - * should not create a Panel directly, instead use Workspace::addTopPanel and - * friends to add panels. - */ - type Panel = AtomCore.Panel; - - /** Manage a subscription to filesystem events that occur beneath a root directory. */ - type PathWatcher = AtomCore.PathWatcher; - - /** Represents a project that's opened in Atom. */ - type Project = AtomCore.Project; - - /** Wraps an Array of Strings. The Array describes a path from the root of the - * syntax tree to a token including all scope names for the entire path. - */ - type ScopeDescriptor = AtomCore.ScopeDescriptor; - - /** Represents a selection in the TextEditor. */ - type Selection = AtomCore.Selection; - - /** A singleton instance of this class available via atom.styles, which you can - * use to globally query and observe the set of active style sheets. - */ - type StyleManager = AtomCore.StyleManager; - - /** Run a node script in a separate process. */ - type Task = AtomCore.Task; - - /** An interface which all custom test runners should implement. */ - type TestRunner = AtomCore.TestRunner; - - /** This class represents all essential editing state for a single TextBuffer, - * including cursor and selection positions, folds, and soft wraps. - */ - type TextEditor = AtomCore.TextEditor; - - /** Experimental: This global registry tracks registered TextEditors. */ - type TextEditorRegistry = AtomCore.TextEditorRegistry; - - /** Handles loading and activating available themes. */ - type ThemeManager = AtomCore.ThemeManager; - - type Tooltip = AtomCore.Tooltip; - - /** Associates tooltips with HTML elements or selectors. */ - type TooltipManager = AtomCore.TooltipManager; - - /** ViewRegistry handles the association between model and view types in Atom. - * We call this association a View Provider. As in, for a given model, this class - * can provide a view via ::getView, as long as the model/view association was - * registered via ::addViewProvider. - */ - type ViewRegistry = AtomCore.ViewRegistry; - - /** Represents the state of the user interface for the entire window. */ - type Workspace = AtomCore.Workspace; - - // https://github.com/atom/atom/blob/master/src/workspace-center.js - /** The central container for the editor window capable of holding items. */ - type WorkspaceCenter = AtomCore.WorkspaceCenter; - } - - var atom: AtomCore.AtomEnvironment; + interface HTMLElementTagNameMap { + "atom-text-editor": TextEditorElement; + } } -export { CompositeDisposable, Disposable, Emitter } from "event-kit"; -export { File, Directory } from "pathwatcher"; - -/** A wrapper which provides standard error/output line buffering for - * Node's ChildProcess. - */ -export const BufferedProcess: AtomCore.Statics.BufferedProcess; - -/** Like BufferedProcess, but accepts a Node script as the command to run. - * This is necessary on Windows since it doesn't support shebang #! lines. - */ -export const BufferedNodeProcess: AtomCore.Statics.BufferedNodeProcess; - -/** Represents the underlying git operations performed by Atom. */ -export const GitRepository: AtomCore.Statics.GitRepository; - -/** A notification to the user containing a message and type. */ -export const Notification: AtomCore.Statics.Notification; - -/** Represents a point in a buffer in row/column coordinates. */ -export const Point: TextBuffer.Statics.Point; - -/** Represents a region in a buffer in row/column coordinates. */ -export const Range: TextBuffer.Statics.Range; - -/** Run a node script in a separate process. */ -export const Task: AtomCore.Statics.Task; - -/** A mutable text container with undo/redo support and the ability to annotate - * logical regions in the text. - */ -export const TextBuffer: TextBuffer.Statics.TextBuffer; - -/** This class represents all essential editing state for a single TextBuffer, - * including cursor and selection positions, folds, and soft wraps. - */ -export const TextEditor: AtomCore.Statics.TextEditor; - -/** Invoke a callback with each filesystem event that occurs beneath a specified path. +/** + * Invoke a callback with each filesystem event that occurs beneath a specified path. * If you only need to watch events within the project's root paths, use * Project::onDidChangeFiles instead. */ export function watchPath(rootPath: string, options: {}, eventCallback: (events: - AtomCore.Events.FilesystemChange) => void): AtomCore.PathWatcher; + FilesystemChangeEvent) => void): Promise; + +// Essential Classes ========================================================== + +/** + * Atom global for dealing with packages, themes, menus, and the window. + * An instance of this class is always available as the atom global. + */ +export interface AtomEnvironment { + // Properties + /** A CommandRegistry instance. */ + commands: CommandRegistry; + + /** A Config instance. */ + config: Config; + + /** A Clipboard instance. */ + clipboard: Clipboard; + + /** A ContextMenuManager instance. */ + contextMenu: ContextMenuManager; + + /** A MenuManager instance. */ + menu: MenuManager; + + /** A KeymapManager instance. */ + keymaps: KeymapManager; + + /** A TooltipManager instance. */ + tooltips: TooltipManager; + + /** A NotificationManager instance. */ + notifications: NotificationManager; + + /** A Project instance. */ + project: Project; + + /** A GrammarRegistry instance. */ + grammars: GrammarRegistry; + + /** A HistoryManager instance. */ + history: HistoryManager; + + /** A PackageManager instance. */ + packages: PackageManager; + + /** A ThemeManager instance. */ + themes: ThemeManager; + + /** A StyleManager instance. */ + styles: StyleManager; + + /** A DeserializerManager instance. */ + deserializers: DeserializerManager; + + /** A ViewRegistry instance. */ + views: ViewRegistry; + + /** A Workspace instance. */ + workspace: Workspace; + + /** A TextEditorRegistry instance. */ + textEditors: TextEditorRegistry; + + // Event Subscription + /** Invoke the given callback whenever ::beep is called. */ + onDidBeep(callback: () => void): Disposable; + + /** + * Invoke the given callback when there is an unhandled error, but before + * the devtools pop open. + */ + onWillThrowError(callback: (event: PreventableExceptionThrownEvent) => void): Disposable; + + /** Invoke the given callback whenever there is an unhandled error. */ + onDidThrowError(callback: (event: ExceptionThrownEvent) => void): Disposable; + + /** + * Invoke the given callback as soon as the shell environment is loaded (or + * immediately if it was already loaded). + */ + whenShellEnvironmentLoaded(callback: () => void): Disposable; + + // Atom Details + /** Returns a boolean that is true if the current window is in development mode. */ + inDevMode(): boolean; + + /** Returns a boolean that is true if the current window is in safe mode. */ + inSafeMode(): boolean; + + /** Returns a boolean that is true if the current window is running specs. */ + inSpecMode(): boolean; + + /** Get the version of the Atom application. */ + getVersion(): string; + + /** + * Gets the release channel of the Atom application. + * Returns the release channel, which can be 'dev', 'beta', or 'stable'. + */ + getReleaseChannel(): "dev"|"beta"|"stable"; + + /** Returns a boolean that is true if the current version is an official release. */ + isReleasedVersion(): boolean; + + /** Get the time taken to completely load the current window. */ + getWindowLoadTime(): number; + + /** Get the load settings for the current window. */ + getLoadSettings(): WindowLoadSettings; + + // Managing the Atom Window + /** Open a new Atom window using the given options. */ + open(params?: { + pathsToOpen: ReadonlyArray, + newWindow?: boolean, + devMode?: boolean, + safeMode?: boolean, + }): void; + + /** Close the current window. */ + close(): void; + + /** Get the size of current window. */ + getSize(): { width: number, height: number }; + + /** Set the size of current window. */ + setSize(width: number, height: number): void; + + /** Get the position of current window. */ + getPosition(): { x: number, y: number }; + + /** Set the position of current window. */ + setPosition(x: number, y: number): void; + + /** Prompt the user to select one or more folders. */ + pickFolder(callback: (paths: string[]|null) => void): void; + + /** Get the current window. */ + getCurrentWindow(): object; + + /** Move current window to the center of the screen. */ + center(): void; + + /** Focus the current window. */ + focus(): void; + + /** Show the current window. */ + show(): void; + + /** Hide the current window. */ + hide(): void; + + /** Reload the current window. */ + reload(): void; + + /** Relaunch the entire application. */ + restartApplication(): void; + + /** Returns a boolean that is true if the current window is maximized. */ + isMaximized(): boolean; + + /** Returns a boolean that is true if the current window is in full screen mode. */ + isFullScreen(): boolean; + + /** Set the full screen state of the current window. */ + setFullScreen(fullScreen: boolean): void; + + /** Toggle the full screen state of the current window. */ + toggleFullScreen(): void; + + // Messaging the User + /** Visually and audibly trigger a beep. */ + beep(): void; + + /** + * A flexible way to open a dialog akin to an alert dialog. + * If the dialog is closed (via `Esc` key or `X` in the top corner) without + * selecting a button the first button will be clicked unless a "Cancel" or "No" + * button is provided. + * + * Returns the chosen button index number if the buttons option was an array. + */ + confirm(options: { + message: string, + detailedMessage?: string, + buttons?: ReadonlyArray, + }): void; + + /** + * A flexible way to open a dialog akin to an alert dialog. + * If the dialog is closed (via `Esc` key or `X` in the top corner) without + * selecting a button the first button will be clicked unless a "Cancel" or "No" + * button is provided. + * + * Returns the chosen button index number if the buttons option was an array. + */ + confirm(options: { + message: string, + detailedMessage?: string, + buttons?: { + [key: string]: () => void + }, + }): number; + + // Managing the Dev Tools + /** Open the dev tools for the current window. */ + openDevTools(): Promise; + + /** Toggle the visibility of the dev tools for the current window. */ + toggleDevTools(): Promise; + + /** Execute code in dev tools. */ + executeJavaScriptInDevTools(code: string): void; + + /** Undocumented: get Atom config directory path */ + getConfigDirPath(): string; +} + +/** + * A simple color class returned from Config::get when the value at the key path is + * of type 'color'. + */ +export interface Color { + /** Returns a string in the form '#abcdef'. */ + toHexString(): string; + + /** Returns a string in the form 'rgba(25, 50, 75, .9)'. */ + toRGBAString(): string; +} + +export interface CommandRegistryTargetMap extends HTMLElementTagNameMap { + [key: string]: EventTarget; +} + +export type CommandRegistryListener = { + didDispatch(event: CommandEvent): void, + displayName?: string, + description?: string, + hiddenInCommandPalette?: boolean, +} | ((event: CommandEvent) => void); + +/** + * Associates listener functions with commands in a context-sensitive way + * using CSS selectors. + */ +export interface CommandRegistry { + /** Register a single command. */ + add( + target: T, commandName: string, + listener: CommandRegistryListener + ): Disposable; + /** Register a single command. */ + add( + target: T, commandName: string, + listener: CommandRegistryListener + ): Disposable; + + /** Register multiple commands. */ + add(target: T, commands: { + [key: string]: CommandRegistryListener + }): CompositeDisposable; + /** Register multiple commands. */ + add(target: T, commands: { + [key: string]: CommandRegistryListener + }): CompositeDisposable; + + /** Find all registered commands matching a query. */ + findCommands(params: { target: string|Node }): Array<{ + name: string, + displayName: string, + description?: string, + tags?: string[], + }>; + + /** + * Simulate the dispatch of a command on a DOM node. + * @return Whether or not there was a matching command for the target. + */ + dispatch(target: Node, commandName: string): boolean; + + /** Invoke the given callback before dispatching a command event. */ + onWillDispatch(callback: (event: CommandEvent) => void): Disposable; + + /** Invoke the given callback after dispatching a command event. */ + onDidDispatch(callback: (event: CommandEvent) => void): Disposable; +} + +/** + * An object that aggregates multiple Disposable instances together into a + * single disposable, so they can all be disposed as a group. + */ +export class CompositeDisposable implements DisposableLike { + /** Construct an instance, optionally with one or more disposables. */ + constructor(...disposables: DisposableLike[]); + + /** + * Dispose all disposables added to this composite disposable. + * If this object has already been disposed, this method has no effect. + */ + dispose(): void; + + // Managing Disposables + /** + * Add disposables to be disposed when the composite is disposed. + * If this object has already been disposed, this method has no effect. + */ + add(...disposables: DisposableLike[]): void; + + /** Remove a previously added disposable. */ + remove(disposable: DisposableLike): void; + + /** Alias to CompositeDisposable::remove. */ + delete(disposable: DisposableLike): void; + + /** + * Clear all disposables. They will not be disposed by the next call to + * dispose. + */ + clear(): void; +} + +/** Used to access all of Atom's configuration details. */ +export interface Config { + // Config Subscription + /** + * Add a listener for changes to a given key path. This is different than ::onDidChange in + * that it will immediately call your callback with the current value of the config entry. + */ + observe(keyPath: T, callback: + (value: ConfigValues[T]) => void): Disposable; + /** + * Add a listener for changes to a given key path. This is different than ::onDidChange in + * that it will immediately call your callback with the current value of the config entry. + */ + observe(keyPath: T, options: + { scope: string[]|ScopeDescriptor }, callback: (value: ConfigValues[T]) => void): + Disposable; + + /** + * Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + // tslint:disable-next-line:no-any + onDidChange(callback: (values: { newValue: T, oldValue: T }) => void): + Disposable; + /** + * Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + onDidChange(keyPath: T, callback: (values: { + newValue: ConfigValues[T], + oldValue?: ConfigValues[T], + }) => void): Disposable; + /** + * Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + onDidChange(keyPath: T, options: + { scope: string[]|ScopeDescriptor }, callback: + (values: { newValue: ConfigValues[T], oldValue?: ConfigValues[T] }) => void): + Disposable; + + // Managing Settings + /** Retrieves the setting for the given key. */ + get(keyPath: T, options?: { sources?: string[], + excludeSources?: string[], scope?: string[]|ScopeDescriptor }): + ConfigValues[T]; + + /** + * Sets the value for a configuration setting. + * This value is stored in Atom's internal configuration file. + */ + set(keyPath: T, value: ConfigValues[T], options?: + { scopeSelector?: string, source?: string }): void; + + /** Restore the setting at keyPath to its default value. */ + unset(keyPath: string, options?: { scopeSelector?: string, source?: string }): void; + + /** + * Get all of the values for the given key-path, along with their associated + * scope selector. + */ + getAll(keyPath: T, options?: { sources?: string[], + excludeSources?: string[], scope?: ScopeDescriptor }): + Array<{ scopeDescriptor: ScopeDescriptor, value: ConfigValues[T] }>; + + /** + * Get an Array of all of the source Strings with which settings have been added + * via ::set. + */ + getSources(): string[]; + + /** + * Retrieve the schema for a specific key path. The schema will tell you what type + * the keyPath expects, and other metadata about the config option. + */ + getSchema(keyPath: string): object|null; + + /** Get the string path to the config file being used. */ + getUserConfigPath(): string; + + /** + * Suppress calls to handler functions registered with ::onDidChange and ::observe + * for the duration of callback. After callback executes, handlers will be called + * once if the value for their key-path has changed. + */ + transact(callback: () => void): void; +} + +/** + * Represents a decoration that follows a DisplayMarker. A decoration is basically + * a visual representation of a marker. It allows you to add CSS classes to line + * numbers in the gutter, lines, and add selection-line regions around marked ranges + * of text. + */ +export interface Decoration { + /** The identifier for this Decoration. */ + id: number; + + // Construction and Destruction + /** + * Destroy this marker decoration. + * You can also destroy the marker if you own it, which will destroy this decoration. + */ + destroy(): void; + + // Event Subscription + /** When the Decoration is updated via Decoration::setProperties. */ + onDidChangeProperties(callback: (event: DecorationPropsChangedEvent) => void): Disposable; + + /** Invoke the given callback when the Decoration is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + // Decoration Details + /** An id unique across all Decoration objects. */ + getId(): number; + + /** Returns the marker associated with this Decoration. */ + getMarker(): DisplayMarker; + + /** + * Check if this decoration is of the given type. + * @param type A decoration type, such as `line-number` or `line`. This may also + * be an array of decoration types, with isType returning true if the decoration's + * type matches any in the array. + */ + isType(type: string|string[]): boolean; + + // Properties + /** Returns the Decoration's properties. */ + getProperties(): DecorationOptions; + + /** + * Update the marker with new Properties. Allows you to change the decoration's + * class. + */ + setProperties(newProperties: DecorationOptions): void; +} + +/** + * Represents a buffer annotation that remains logically stationary even as the + * buffer changes. This is used to represent cursors, folds, snippet targets, + * misspelled words, and anything else that needs to track a logical location + * in the buffer over time. + */ +export interface DisplayMarker { + // Construction and Destruction + /** + * Destroys the marker, causing it to emit the 'destroyed' event. Once destroyed, + * a marker cannot be restored by undo/redo operations. + */ + destroy(): void; + + /** Creates and returns a new DisplayMarker with the same properties as this marker. */ + copy(options?: CopyMarkerOptions): DisplayMarker; + + // Event Subscription + /** Invoke the given callback when the state of the marker changes. */ + onDidChange(callback: (event: DisplayMarkerChangedEvent) => void): Disposable; + + /** Invoke the given callback when the marker is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + // TextEditorMarker Details + /** + * Returns a boolean indicating whether the marker is valid. Markers can be + * invalidated when a region surrounding them in the buffer is changed. + */ + isValid(): boolean; + + /** + * Returns a boolean indicating whether the marker has been destroyed. A marker + * can be invalid without being destroyed, in which case undoing the invalidating + * operation would restore the marker. + */ + isDestroyed(): boolean; + + /** Returns a boolean indicating whether the head precedes the tail. */ + isReversed(): boolean; + + /** + * Returns a boolean indicating whether changes that occur exactly at the marker's + * head or tail cause it to move. + */ + isExclusive(): boolean; + + /** + * Get the invalidation strategy for this marker. + * Valid values include: never, surround, overlap, inside, and touch. + */ + getInvalidationStrategy(): string; + + /** Returns an Object containing any custom properties associated with the marker. */ + getProperties(): object; + + /** Merges an Object containing new properties into the marker's existing properties. */ + setProperties(properties: object): void; + + /** Returns whether this marker matches the given parameters. */ + matchesProperties(attributes: FindDisplayMarkerOptions): boolean; + + // Comparing to other markers + /** Compares this marker to another based on their ranges. */ + compare(other: DisplayMarker): number; + + /** + * Returns a boolean indicating whether this marker is equivalent to another + * marker, meaning they have the same range and options. + */ + isEqual(other: DisplayMarker): boolean; + + // Managing the marker's range + /** Gets the buffer range of this marker. */ + getBufferRange(): Range; + + /** Gets the screen range of this marker. */ + getScreenRange(): Range; + + /** Modifies the buffer range of this marker. */ + setBufferRange(bufferRange: RangeCompatible, properties?: { reversed: boolean }): + void; + + /** Modifies the screen range of this marker. */ + setScreenRange(screenRange: RangeCompatible, options?: { reversed?: boolean, + clipDirection?: "backward"|"forward"|"closest" }): void; + + /** + * Retrieves the screen position of the marker's start. This will always be + * less than or equal to the result of DisplayMarker::getEndScreenPosition. + */ + getStartScreenPosition(options?: { clipDirection: "backward"|"forward"|"closest" }): + Point; + + /** + * Retrieves the screen position of the marker's end. This will always be + * greater than or equal to the result of DisplayMarker::getStartScreenPosition. + */ + getEndScreenPosition(options?: { clipDirection: "backward"|"forward"|"closest" }): + Point; + + /** Retrieves the buffer position of the marker's head. */ + getHeadBufferPosition(): Point; + + /** Sets the buffer position of the marker's head. */ + setHeadBufferPosition(bufferPosition: PointCompatible): void; + + /** Retrieves the screen position of the marker's head. */ + getHeadScreenPosition(options?: { clipDirection: "backward"|"forward"|"closest" }): + Point; + + /** Sets the screen position of the marker's head. */ + setHeadScreenPosition(screenPosition: PointCompatible, + options?: { clipDirection: "backward"|"forward"|"closest" }): void; + + /** Retrieves the buffer position of the marker's tail. */ + getTailBufferPosition(): Point; + + /** Sets the buffer position of the marker's tail. */ + setTailBufferPosition(bufferPosition: PointCompatible): void; + + /** Retrieves the screen position of the marker's tail. */ + getTailScreenPosition(options?: { clipDirection: "backward"|"forward"|"closest" }): + Point; + + /** Sets the screen position of the marker's tail. */ + setTailScreenPosition(screenPosition: PointCompatible, + options?: { clipDirection: "backward"|"forward"|"closest" }): void; + + /** + * Retrieves the buffer position of the marker's start. This will always be less + * than or equal to the result of DisplayMarker::getEndBufferPosition. + */ + getStartBufferPosition(): Point; + + /** + * Retrieves the buffer position of the marker's end. This will always be greater + * than or equal to the result of DisplayMarker::getStartBufferPosition. + */ + getEndBufferPosition(): Point; + + /** Returns a boolean indicating whether the marker has a tail. */ + hasTail(): boolean; + + /** + * Plants the marker's tail at the current head position. After calling the + * marker's tail position will be its head position at the time of the call, + * regardless of where the marker's head is moved. + */ + plantTail(): void; + + /** + * Removes the marker's tail. After calling the marker's head position will be + * reported as its current tail position until the tail is planted again. + */ + clearTail(): void; +} + +/** + * Experimental: A container for a related set of markers at the DisplayLayer level. + * Wraps an underlying MarkerLayer on the TextBuffer. + * + * This API is experimental and subject to change on any release. + */ +export interface DisplayMarkerLayer { + // Lifecycle + /** Destroy this layer. */ + destroy(): void; + + /** Destroy all markers in this layer. */ + clear(): void; + + /** Determine whether this layer has been destroyed. */ + isDestroyed(): boolean; + + // Event Subscription + /** Subscribe to be notified synchronously when this layer is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** + * Subscribe to be notified asynchronously whenever markers are created, updated, + * or destroyed on this layer. Prefer this method for optimal performance when + * interacting with layers that could contain large numbers of markers. + */ + onDidUpdate(callback: () => void): Disposable; + + /** + * Subscribe to be notified synchronously whenever markers are created on this + * layer. Avoid this method for optimal performance when interacting with layers + * that could contain large numbers of markers. + */ + onDidCreateMarker(callback: (marker: DisplayMarker|Marker) => void): Disposable; + + // Marker creation + /** Create a marker with the given screen range. */ + markScreenRange(range: RangeCompatible, options?: { reversed?: boolean, + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", exclusive?: + boolean, clipDirection?: "backward"|"forward"|"closest" }): DisplayMarker; + + /** + * Create a marker on this layer with its head at the given screen position + * and no tail. + */ + markScreenPosition(screenPosition: PointCompatible, options?: { invalidate?: + "never"|"surround"|"overlap"|"inside"|"touch", exclusive?: boolean, + clipDirection?: "backward"|"forward"|"closest" }): DisplayMarker; + + /** Create a marker with the given buffer range. */ + markBufferRange(range: RangeCompatible, options?: { + reversed?: boolean, invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + exclusive?: boolean }): DisplayMarker; + + /** + * Create a marker on this layer with its head at the given buffer position + * and no tail. + */ + markBufferPosition(bufferPosition: PointCompatible, options?: { invalidate?: + "never"|"surround"|"overlap"|"inside"|"touch", exclusive?: boolean }): + DisplayMarker; + + // Querying + /** Get an existing marker by its id. */ + getMarker(id: number): DisplayMarker; + + /** Get all markers in the layer. */ + getMarkers(): DisplayMarker[]; + + /** Get the number of markers in the marker layer. */ + getMarkerCount(): number; + + /** + * Find markers in the layer conforming to the given parameters. + * + * This method finds markers based on the given properties. Markers can be associated + * with custom properties that will be compared with basic equality. In addition, + * there are several special properties that will be compared with the range of the + * markers rather than their properties. + */ + findMarkers(properties: FindDisplayMarkerOptions): DisplayMarker[]; +} + +/** A handle to a resource that can be disposed. */ +export class Disposable implements DisposableLike { + /** Ensure that Object correctly implements the Disposable contract. */ + static isDisposable(object: object): boolean; + + /** Construct a Disposable. */ + constructor(disposableAction?: () => void); + + /** A callback which will be called within dispose(). */ + disposalAction?(): void; + + /** + * Perform the disposal action, indicating that the resource associated + * with this disposable is no longer needed. + */ + dispose(): void; +} + +/** + * Utility class to be used when implementing event-based APIs that allows + * for handlers registered via ::on to be invoked with calls to ::emit. + */ +// tslint:disable-next-line:no-any +export class Emitter + implements DisposableLike { + /** Construct an emitter. */ + constructor(); + + /** Clear out any existing subscribers. */ + clear(): void; + + /** Unsubscribe all handlers. */ + dispose(): boolean; + + // Event Subscription + /** Registers a handler to be invoked whenever the given event is emitted. */ + on(eventName: T, handler: (value?: + OptionalEmissions[T]) => void): Disposable; + /** Registers a handler to be invoked whenever the given event is emitted. */ + on(eventName: T, handler: (value: + RequiredEmissions[T]) => void): Disposable; + + /** + * Register the given handler function to be invoked the next time an event + * with the given name is emitted via ::emit. + */ + once(eventName: T, handler: (value?: + OptionalEmissions[T]) => void): Disposable; + /** + * Register the given handler function to be invoked the next time an event + * with the given name is emitted via ::emit. + */ + once(eventName: T, handler: (value: + RequiredEmissions[T]) => void): Disposable; + + /** + * Register the given handler function to be invoked before all other + * handlers existing at the time of subscription whenever events by the + * given name are emitted via ::emit. + */ + preempt(eventName: T, handler: (value?: + OptionalEmissions[T]) => void): Disposable; + /** + * Register the given handler function to be invoked before all other + * handlers existing at the time of subscription whenever events by the + * given name are emitted via ::emit. + */ + preempt(eventName: T, handler: (value: + RequiredEmissions[T]) => void): Disposable; + + // Event Emission + /** Invoke the handlers registered via ::on for the given event name. */ + emit(eventName: T, value?: + OptionalEmissions[T]): void; + /** Invoke the handlers registered via ::on for the given event name. */ + emit(eventName: T, value: + RequiredEmissions[T]): void; +} + +/** + * Represents a decoration that applies to every marker on a given layer. Created via + * TextEditor::decorateMarkerLayer. + */ +export interface LayerDecoration { + /** Destroys the decoration. */ + destroy(): void; + + /** Determine whether this decoration is destroyed. */ + isDestroyed(): boolean; + + /** Get this decoration's properties. */ + getProperties(): DecorationLayerOptions; + + /** Set this decoration's properties. */ + setProperties(newProperties: DecorationLayerOptions): void; + + /** Override the decoration properties for a specific marker. */ + setPropertiesForMarker(marker: DisplayMarker|Marker, properties: DecorationLayerOptions): + void; +} + +/** + * Represents a buffer annotation that remains logically stationary even as + * the buffer changes. + */ +export interface Marker { + /** The identifier for this Marker. */ + id: number; + + // Lifecycle + /** + * Creates and returns a new Marker with the same properties as this + * marker. + */ + copy(options?: CopyMarkerOptions): Marker; + + /** Destroys the marker, causing it to emit the "destroyed" event. */ + destroy(): void; + + // Event Subscription + /** Invoke the given callback when the marker is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Invoke the given callback when the state of the marker changes. */ + onDidChange(callback: (event: MarkerChangedEvent) => void): Disposable; + + // Marker Details + /** Returns the current range of the marker. The range is immutable. */ + getRange(): Range; + + /** Returns a point representing the marker's current head position. */ + getHeadPosition(): Point; + + /** Returns a point representing the marker's current tail position. */ + getTailPosition(): Point; + + /** + * Returns a point representing the start position of the marker, which + * could be the head or tail position, depending on its orientation. + */ + getStartPosition(): Point; + + /** + * Returns a point representing the end position of the marker, which + * could be the head or tail position, depending on its orientation. + */ + getEndPosition(): Point; + + /** Returns a boolean indicating whether the head precedes the tail. */ + isReversed(): boolean; + + /** Returns a boolean indicating whether the marker has a tail. */ + hasTail(): boolean; + + /** Is the marker valid? */ + isValid(): boolean; + + /** Is the marker destroyed? */ + isDestroyed(): boolean; + + /** + * Returns a boolean indicating whether changes that occur exactly at + * the marker's head or tail cause it to move. + */ + isExclusive(): boolean; + + /** Get the invalidation strategy for this marker. */ + getInvalidationStrategy(): string; + + // Mutating Markers + /** + * Sets the range of the marker. + * Returns a boolean indicating whether or not the marker was updated. + */ + setRange(range: RangeCompatible, params?: { reversed?: boolean, exclusive?: + boolean }): boolean; + + /** + * Sets the head position of the marker. + * Returns a boolean indicating whether or not the marker was updated. + */ + setHeadPosition(position: PointCompatible): boolean; + + /** + * Sets the tail position of the marker. + * Returns a boolean indicating whether or not the marker was updated. + */ + setTailPosition(position: PointCompatible): boolean; + + /** + * Removes the marker's tail. + * Returns a boolean indicating whether or not the marker was updated. + */ + clearTail(): boolean; + + /** + * Plants the marker's tail at the current head position. + * Returns a boolean indicating whether or not the marker was updated. + */ + plantTail(): boolean; + + // Comparison + /** + * Returns a boolean indicating whether this marker is equivalent to + * another marker, meaning they have the same range and options. + */ + isEqual(other: Marker): boolean; + + /** + * Compares this marker to another based on their ranges. + * Returns "-1" if this marker precedes the argument. + * Returns "0" if this marker is equivalent to the argument. + * Returns "1" if this marker follows the argument. + */ + compare(other: Marker): number; +} + +/** Experimental: A container for a related set of markers. */ +export interface MarkerLayer { + // Lifecycle + /** Create a copy of this layer with markers in the same state and locations. */ + copy(): MarkerLayer; + + /** Destroy this layer. */ + destroy(): boolean; + + /** Remove all markers from this layer. */ + clear(): void; + + /** Determine whether this layer has been destroyed. */ + isDestroyed(): boolean; + + // Querying + /** Get an existing marker by its id. */ + getMarker(id: number): Marker|undefined; + + /** Get all existing markers on the marker layer. */ + getMarkers(): Marker[]; + + /** Get the number of markers in the marker layer. */ + getMarkerCount(): number; + + /** Find markers in the layer conforming to the given parameters. */ + findMarkers(params: FindMarkerOptions): Marker[]; + + // Marker Creation + /** Create a marker with the given range. */ + markRange(range: RangeCompatible, options?: { reversed?: boolean, invalidate?: + "never"|"surround"|"overlap"|"inside"|"touch", exclusive?: boolean }): Marker; + + /** Create a marker at with its head at the given position with no tail. */ + markPosition(position: PointCompatible, options?: { invalidate?: "never"|"surround" + |"overlap"|"inside"|"touch", exclusive?: boolean }): Marker; + + // Event Subscription + /** + * Subscribe to be notified asynchronously whenever markers are created, + * updated, or destroyed on this layer. + */ + onDidUpdate(callback: () => void): Disposable; + + /** + * Subscribe to be notified synchronously whenever markers are created on + * this layer. + */ + onDidCreateMarker(callback: (marker: Marker) => void): Disposable; + + /** Subscribe to be notified synchronously when this layer is destroyed. */ + onDidDestroy(callback: () => void): Disposable; +} + +/** A notification to the user containing a message and type. */ +export class Notification { + constructor(type: "warning"|"info"|"success", message: string, + options?: NotificationOptions); + constructor(type: "fatal"|"error", message: string, options?: ErrorNotificationOptions); + + // Event Subscription + /** Invoke the given callback when the notification is dismissed. */ + onDidDismiss(callback: (notification: Notification) => void): Disposable; + + /** Invoke the given callback when the notification is displayed. */ + onDidDisplay(callback: (notification: Notification) => void): Disposable; + + // Methods + /** Returns the Notification's type. */ + getType(): string; + + /** Returns the Notification's message. */ + getMessage(): string; + + /** + * Dismisses the notification, removing it from the UI. Calling this + * programmatically will call all callbacks added via onDidDismiss. + */ + dismiss(): void; +} + +/** A notification manager used to create Notifications to be shown to the user. */ +export interface NotificationManager { + // Properties + notifications: Notification[]; + + // Events + /** Invoke the given callback after a notification has been added. */ + onDidAddNotification(callback: (notification: Notification) => void): Disposable; + + // Adding Notifications + /** Add a success notification. */ + addSuccess(message: string, options?: NotificationOptions): Notification; + + /** Add an informational notification. */ + addInfo(message: string, options?: NotificationOptions): Notification; + + /** Add a warning notification. */ + addWarning(message: string, options?: NotificationOptions): Notification; + + /** Add an error notification. */ + addError(message: string, options?: ErrorNotificationOptions): Notification; + + /** Add a fatal error notification. */ + addFatalError(message: string, options?: ErrorNotificationOptions): Notification; + + // Getting Notifications + /** Get all the notifications. */ + getNotifications(): Notification[]; +} + +/** Represents a point in a buffer in row/column coordinates. */ +export class Point { + // Properties + /** A zero-indexed number representing the row of the Point. */ + row: number; + + /** A zero-indexed number representing the column of the Point. */ + column: number; + + // Construction + /** + * Create a Point from an array containing two numbers representing the + * row and column. + */ + static fromObject(object: PointCompatible, copy?: boolean): Point; + + /** Construct a Point object */ + constructor(row?: number, column?: number); + + /** Returns a new Point with the same row and column. */ + copy(): Point; + + /** Returns a new Point with the row and column negated. */ + negate(): Point; + + // Comparison + /** Returns the given Point that is earlier in the buffer. */ + static min(point1: PointCompatible, point2: PointCompatible): Point; + + /** + * Compare another Point to this Point instance. + * Returns -1 if this point precedes the argument. + * Returns 0 if this point is equivalent to the argument. + * Returns 1 if this point follows the argument. + */ + compare(other: PointCompatible): number; + + /** + * Returns a boolean indicating whether this point has the same row and + * column as the given Point. + */ + isEqual(other: PointCompatible): boolean; + + /** Returns a Boolean indicating whether this point precedes the given Point. */ + isLessThan(other: PointCompatible): boolean; + + /** + * Returns a Boolean indicating whether this point precedes or is equal to + * the given Point. + */ + isLessThanOrEqual(other: PointCompatible): boolean; + + /** Returns a Boolean indicating whether this point follows the given Point. */ + isGreaterThan(other: PointCompatible): boolean; + + /** + * Returns a Boolean indicating whether this point follows or is equal to + * the given Point. + */ + isGreaterThanOrEqual(other: PointCompatible): boolean; + + // Operations + /** Makes this point immutable and returns itself. */ + freeze(): Readonly; + + /** + * Build and return a new point by adding the rows and columns of the + * given point. + */ + translate(other: PointCompatible): Point; + + /** + * Build and return a new Point by traversing the rows and columns + * specified by the given point. + */ + traverse(other: PointCompatible): Point; + + /** Returns an array of this point's row and column. */ + toArray(): [number, number]; + + /** Returns an array of this point's row and column. */ + serialize(): [number, number]; + + /** Returns a string representation of the point. */ + toString(): string; +} + +/** Represents a region in a buffer in row/column coordinates. */ +export class Range { + // Properties + /** A Point representing the start of the Range. */ + start: Point; + + /** A Point representing the end of the Range. */ + end: Point; + + // Construction + /** Convert any range-compatible object to a Range. */ + static fromObject(object: RangeCompatible, copy?: boolean): Range; + + /** Construct a Range object. */ + constructor(pointA?: PointCompatible, pointB?: PointCompatible); + + /** Call this with the result of Range::serialize to construct a new Range. */ + static deserialize(array: object): Range; + + /** Returns a new range with the same start and end positions. */ + copy(): Range; + + /** Returns a new range with the start and end positions negated. */ + negate(): Range; + + // Serialization and Deserialization + /** Returns a plain javascript object representation of the Range. */ + serialize(): number[][]; + + // Range Details + /** Is the start position of this range equal to the end position? */ + isEmpty(): boolean; + + /** + * Returns a boolean indicating whether this range starts and ends on the + * same row. + */ + isSingleLine(): boolean; + + /** Get the number of rows in this range. */ + getRowCount(): number; + + /** Returns an array of all rows in the range. */ + getRows(): number[]; + + // Operations + /** + * Freezes the range and its start and end point so it becomes immutable + * and returns itself. + */ + freeze(): Readonly; + + // NOTE: this function doesn't actually take a range-compatible parameter. + /** Returns a new range that contains this range and the given range. */ + union(other: RangeLike): Range; + + /** + * Build and return a new range by translating this range's start and end + * points by the given delta(s). + */ + translate(startDelta: PointCompatible, endDelta?: PointCompatible): Range; + + /** + * Build and return a new range by traversing this range's start and end + * points by the given delta. + */ + traverse(delta: PointCompatible): Range; + + // Comparison + /** + * Compare two Ranges. + * Returns -1 if this range starts before the argument or contains it. + * Returns 0 if this range is equivalent to the argument. + * Returns 1 if this range starts after the argument or is contained by it. + */ + compare(otherRange: RangeCompatible): number; + + /** + * Returns a Boolean indicating whether this range has the same start and + * end points as the given Range. + */ + isEqual(otherRange: RangeCompatible): boolean; + + // NOTE: this function doesn't actually take a range-compatible parameter. + /** + * Returns a Boolean indicating whether this range starts and ends on the + * same row as the argument. + */ + coversSameRows(otherRange: RangeLike): boolean; + + // NOTE: this function doesn't actually take a range-compatible parameter. + /** Determines whether this range intersects with the argument. */ + intersectsWith(otherRange: RangeLike, exclusive?: boolean): boolean; + + /** Returns a boolean indicating whether this range contains the given range. */ + containsRange(otherRange: RangeCompatible, exclusive?: boolean): boolean; + + /** Returns a boolean indicating whether this range contains the given point. */ + containsPoint(point: PointCompatible, exclusive?: boolean): boolean; + + /** + * Returns a boolean indicating whether this range intersects the given + * row number. + */ + intersectsRow(row: number): boolean; + + /** + * Returns a boolean indicating whether this range intersects the row range + * indicated by the given startRow and endRow numbers. + */ + intersectsRowRange(startRow: number, endRow: number): boolean; + + // Conversion + /** Returns a string representation of the range. */ + toString(): string; +} + +/** + * This class represents all essential editing state for a single TextBuffer, + * including cursor and selection positions, folds, and soft wraps. + */ +export class TextEditor { + id: number; + buffer: TextBuffer; + + // NOTE: undocumented within the public API. Don't go down the rabbit hole. + constructor(options?: object); + + // Event Subscription + /** Calls your callback when the buffer's title has changed. */ + onDidChangeTitle(callback: (title: string) => void): Disposable; + + /** Calls your callback when the buffer's path, and therefore title, has changed. */ + onDidChangePath(callback: (path: string) => void): Disposable; + + /** + * Invoke the given callback synchronously when the content of the buffer + * changes. + */ + onDidChange(callback: (event: EditorChangedEvent[]) => void): Disposable; + + /** + * Invoke callback when the buffer's contents change. It is emit + * asynchronously 300ms after the last buffer change. This is a good place + * to handle changes to the buffer without compromising typing performance. + */ + onDidStopChanging(callback: (event: BufferStoppedChangingEvent) => void): Disposable; + + /** + * Calls your callback when a Cursor is moved. If there are multiple cursors, + * your callback will be called for each cursor. + */ + onDidChangeCursorPosition(callback: (event: CursorPositionChangedEvent) => void): + Disposable; + + /** Calls your callback when a selection's screen range changes. */ + onDidChangeSelectionRange(callback: (event: SelectionChangedEvent) => void): Disposable; + + /** Invoke the given callback after the buffer is saved to disk. */ + onDidSave(callback: (event: { path: string }) => void): Disposable; + + /** Invoke the given callback when the editor is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Retrieves the current TextBuffer. */ + getBuffer(): TextBuffer; + + /** + * Calls your callback when a Gutter is added to the editor. Immediately calls + * your callback for each existing gutter. + */ + observeGutters(callback: (gutter: Gutter) => void): Disposable; + + /** Calls your callback when a Gutter is added to the editor. */ + onDidAddGutter(callback: (gutter: Gutter) => void): Disposable; + + /** Calls your callback when a Gutter is removed from the editor. */ + onDidRemoveGutter(callback: (name: string) => void): Disposable; + + /** Calls your callback when soft wrap was enabled or disabled. */ + onDidChangeSoftWrapped(callback: (softWrapped: boolean) => void): Disposable; + + /** Calls your callback when the buffer's encoding has changed. */ + onDidChangeEncoding(callback: (encoding: string) => void): Disposable; + + /** + * Calls your callback when the grammar that interprets and colorizes the text + * has been changed. Immediately calls your callback with the current grammar. + */ + observeGrammar(callback: (grammar: Grammar) => void): Disposable; + + /** + * Calls your callback when the grammar that interprets and colorizes the text + * has been changed. + */ + onDidChangeGrammar(callback: (grammar: Grammar) => void): Disposable; + + /** Calls your callback when the result of ::isModified changes. */ + onDidChangeModified(callback: (modified: boolean) => void): Disposable; + + /** + * Calls your callback when the buffer's underlying file changes on disk at a + * moment when the result of ::isModified is true. + */ + onDidConflict(callback: () => void): Disposable; + + /** Calls your callback before text has been inserted. */ + onWillInsertText(callback: (event: { text: string, cancel(): void }) => void): Disposable; + + /** Calls your callback after text has been inserted. */ + onDidInsertText(callback: (event: { text: string }) => void): Disposable; + + /** + * Calls your callback when a Cursor is added to the editor. Immediately calls + * your callback for each existing cursor. + */ + observeCursors(callback: (cursor: Cursor) => void): Disposable; + + /** Calls your callback when a Cursor is added to the editor. */ + onDidAddCursor(callback: (cursor: Cursor) => void): Disposable; + + /** Calls your callback when a Cursor is removed from the editor. */ + onDidRemoveCursor(callback: (cursor: Cursor) => void): Disposable; + + /** + * Calls your callback when a Selection is added to the editor. Immediately + * calls your callback for each existing selection. + */ + observeSelections(callback: (selection: Selection) => void): Disposable; + + /** Calls your callback when a Selection is added to the editor. */ + onDidAddSelection(callback: (selection: Selection) => void): Disposable; + + /** Calls your callback when a Selection is removed from the editor. */ + onDidRemoveSelection(callback: (selection: Selection) => void): Disposable; + + /** + * Calls your callback with each Decoration added to the editor. Calls your + * callback immediately for any existing decorations. + */ + observeDecorations(callback: (decoration: Decoration) => void): Disposable; + + /** Calls your callback when a Decoration is added to the editor. */ + onDidAddDecoration(callback: (decoration: Decoration) => void): Disposable; + + /** Calls your callback when a Decoration is removed from the editor. */ + onDidRemoveDecoration(callback: (decoration: Decoration) => void): Disposable; + + /** Calls your callback when the placeholder text is changed. */ + onDidChangePlaceholderText(callback: (placeholderText: string) => void): Disposable; + + // File Details + /** + * Get the editor's title for display in other parts of the UI such as the tabs. + * If the editor's buffer is saved, its title is the file name. If it is unsaved, + * its title is "untitled". + */ + getTitle(): string; + + /** + * Get unique title for display in other parts of the UI, such as the window title. + * If the editor's buffer is unsaved, its title is "untitled" If the editor's + * buffer is saved, its unique title is formatted as one of the following, + * + * "" when it is the only editing buffer with this file name. + * " — " when other buffers have this file name. + */ + getLongTitle(): string; + + /** Returns the string path of this editor's text buffer. */ + getPath(): string|undefined; + + /** Returns boolean true if this editor has been modified. */ + isModified(): boolean; + + /** Returns boolean true if this editor has no content. */ + isEmpty(): boolean; + + /** Returns the string character set encoding of this editor's text buffer. */ + getEncoding(): string; + + /** Set the character set encoding to use in this editor's text buffer. */ + setEncoding(encoding: string): void; + + // File Operations + /** + * Saves the editor's text buffer. + * See TextBuffer::save for more details. + */ + save(): Promise; + + /** + * Saves the editor's text buffer as the given path. + * See TextBuffer::saveAs for more details. + */ + saveAs(filePath: string): Promise; + + // Reading Text + /** Returns a string representing the entire contents of the editor. */ + getText(): string; + + /** Get the text in the given range in buffer coordinates. */ + getTextInBufferRange(range: RangeCompatible): string; + + /** Returns a number representing the number of lines in the buffer. */ + getLineCount(): number; + + /** + * Returns a number representing the number of screen lines in the editor. + * This accounts for folds. + */ + getScreenLineCount(): number; + + /** + * Returns a number representing the last zero-indexed buffer row number of + * the editor. + */ + getLastBufferRow(): number; + + /** + * Returns a number representing the last zero-indexed screen row number of + * the editor. + */ + getLastScreenRow(): number; + + /** + * Returns a string representing the contents of the line at the given + * buffer row. + */ + lineTextForBufferRow(bufferRow: number): string; + + /** + * Returns a string representing the contents of the line at the given + * screen row. + */ + lineTextForScreenRow(screenRow: number): string; + + /** Get the range of the paragraph surrounding the most recently added cursor. */ + getCurrentParagraphBufferRange(): Range; + + // Mutating Text + /** Replaces the entire contents of the buffer with the given string. */ + setText(text: string): void; + + /** Set the text in the given Range in buffer coordinates. */ + setTextInBufferRange(range: RangeCompatible, text: string, options?: + { normalizeLineEndings?: boolean, undo?: "skip" }): Range; + + /* For each selection, replace the selected text with the given text. */ + insertText(text: string, options?: TextInsertionOptions): Range|false; + + /** For each selection, replace the selected text with a newline. */ + insertNewline(): void; + + /** + * For each selection, if the selection is empty, delete the character following + * the cursor. Otherwise delete the selected text. + */ + delete(): void; + + /** + * For each selection, if the selection is empty, delete the character preceding + * the cursor. Otherwise delete the selected text. + */ + backspace(): void; + + /** + * Mutate the text of all the selections in a single transaction. + * All the changes made inside the given function can be reverted with a single + * call to ::undo. + */ + mutateSelectedText(fn: (selection: Selection, index: number) => void): void; + + /** + * For each selection, transpose the selected text. + * If the selection is empty, the characters preceding and following the cursor + * are swapped. Otherwise, the selected characters are reversed. + */ + transpose(): void; + + /** + * Convert the selected text to upper case. + * For each selection, if the selection is empty, converts the containing word + * to upper case. Otherwise convert the selected text to upper case. + */ + upperCase(): void; + + /** + * Convert the selected text to lower case. + * For each selection, if the selection is empty, converts the containing word + * to upper case. Otherwise convert the selected text to upper case. + */ + lowerCase(): void; + + /** + * Toggle line comments for rows intersecting selections. + * If the current grammar doesn't support comments, does nothing. + */ + toggleLineCommentsInSelection(): void; + + /** For each cursor, insert a newline at beginning the following line. */ + insertNewlineBelow(): void; + + /** For each cursor, insert a newline at the end of the preceding line. */ + insertNewlineAbove(): void; + + /** + * For each selection, if the selection is empty, delete all characters of the + * containing word that precede the cursor. Otherwise delete the selected text. + */ + deleteToBeginningOfWord(): void; + + /** + * Similar to ::deleteToBeginningOfWord, but deletes only back to the previous + * word boundary. + */ + deleteToPreviousWordBoundary(): void; + + /** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */ + deleteToNextWordBoundary(): void; + + /** + * For each selection, if the selection is empty, delete all characters of the + * containing subword following the cursor. Otherwise delete the selected text. + */ + deleteToBeginningOfSubword(): void; + + /** + * For each selection, if the selection is empty, delete all characters of the + * containing subword following the cursor. Otherwise delete the selected text. + */ + deleteToEndOfSubword(): void; + + /** + * For each selection, if the selection is empty, delete all characters of the + * containing line that precede the cursor. Otherwise delete the selected text. + */ + deleteToBeginningOfLine(): void; + + /** + * For each selection, if the selection is not empty, deletes the selection + * otherwise, deletes all characters of the containing line following the cursor. + * If the cursor is already at the end of the line, deletes the following newline. + */ + deleteToEndOfLine(): void; + + /** + * For each selection, if the selection is empty, delete all characters of the + * containing word following the cursor. Otherwise delete the selected text. + */ + deleteToEndOfWord(): void; + + /** Delete all lines intersecting selections. */ + deleteLine(): void; + + // History + /** Undo the last change. */ + undo(): void; + + /** Redo the last change. */ + redo(): void; + + /** + * Batch multiple operations as a single undo/redo step. + * Any group of operations that are logically grouped from the perspective of undoing + * and redoing should be performed in a transaction. If you want to abort the transaction, + * call ::abortTransaction to terminate the function's execution and revert any changes + * performed up to the abortion. + */ + transact(fn: () => void): void; + /** + * Batch multiple operations as a single undo/redo step. + * Any group of operations that are logically grouped from the perspective of undoing + * and redoing should be performed in a transaction. If you want to abort the transaction, + * call ::abortTransaction to terminate the function's execution and revert any changes + * performed up to the abortion. + */ + transact(groupingInterval: number, fn: () => void): void; + + /** + * Abort an open transaction, undoing any operations performed so far within the + * transaction. + */ + abortTransaction(): void; + + /** + * Create a pointer to the current state of the buffer for use with ::revertToCheckpoint + * and ::groupChangesSinceCheckpoint. + */ + createCheckpoint(): number; + + /** + * Revert the buffer to the state it was in when the given checkpoint was created. + * The redo stack will be empty following this operation, so changes since the checkpoint + * will be lost. If the given checkpoint is no longer present in the undo history, no + * changes will be made to the buffer and this method will return false. + */ + revertToCheckpoint(checkpoint: number): boolean; + + /** + * Group all changes since the given checkpoint into a single transaction for purposes + * of undo/redo. + * If the given checkpoint is no longer present in the undo history, no grouping will be + * performed and this method will return false. + */ + groupChangesSinceCheckpoint(checkpoint: number): boolean; + + // TextEditor Coordinates + /** Convert a position in buffer-coordinates to screen-coordinates. */ + screenPositionForBufferPosition(bufferPosition: PointCompatible, options?: + { clipDirection?: "backward"|"forward"|"closest"}): Point; + + /** Convert a position in screen-coordinates to buffer-coordinates. */ + bufferPositionForScreenPosition(bufferPosition: PointCompatible, options?: + { clipDirection?: "backward"|"forward"|"closest"}): Point; + + /** Convert a range in buffer-coordinates to screen-coordinates. */ + screenRangeForBufferRange(bufferRange: RangeCompatible): Range; + + /** Convert a range in screen-coordinates to buffer-coordinates. */ + bufferRangeForScreenRange(screenRange: RangeCompatible): Range; + + /** Clip the given Point to a valid position in the buffer. */ + clipBufferPosition(bufferPosition: PointCompatible): Point; + + /** + * Clip the start and end of the given range to valid positions in the buffer. + * See ::clipBufferPosition for more information. + */ + clipBufferRange(range: RangeCompatible): Range; + + /** Clip the given Point to a valid position on screen. */ + clipScreenPosition(screenPosition: PointCompatible, options?: + { clipDirection?: "backward"|"forward"|"closest"}): Point; + + /** + * Clip the start and end of the given range to valid positions on screen. + * See ::clipScreenPosition for more information. + */ + clipScreenRange(range: RangeCompatible, options?: { clipDirection?: + "backward"|"forward"|"closest"}): Range; + + // Decorations + /** + * Add a decoration that tracks a DisplayMarker. When the marker moves, is + * invalidated, or is destroyed, the decoration will be updated to reflect + * the marker's state. + */ + decorateMarker(marker: DisplayMarker, decorationParams: DecorationOptions): Decoration; + + /** + * Add a decoration to every marker in the given marker layer. Can be used to + * decorate a large number of markers without having to create and manage many + * individual decorations. + */ + decorateMarkerLayer(markerLayer: MarkerLayer|DisplayMarkerLayer, + decorationParams: DecorationLayerOptions): LayerDecoration; + + /** Get all decorations. */ + getDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + /** Get all decorations of type 'line'. */ + getLineDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + /** Get all decorations of type 'line-number'. */ + getLineNumberDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + /** Get all decorations of type 'highlight'. */ + getHighlightDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + /** Get all decorations of type 'overlay'. */ + getOverlayDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + // Markers + /** + * Create a marker on the default marker layer with the given range in buffer coordinates. + * This marker will maintain its logical location as the buffer is changed, so if you mark + * a particular word, the marker will remain over that word even if the word's location + * in the buffer changes. + */ + markBufferRange(range: RangeCompatible, properties?: { + maintainHistory?: boolean, + reversed?: boolean, + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + }): DisplayMarker; + + /** + * Create a marker on the default marker layer with the given range in screen coordinates. + * This marker will maintain its logical location as the buffer is changed, so if you mark + * a particular word, the marker will remain over that word even if the word's location in + * the buffer changes. + */ + markScreenRange(range: RangeCompatible, properties?: { + maintainHistory?: boolean, reversed?: boolean, + invalidate?: "never"|"surround"|"overlap"|"inside" |"touch", + }): DisplayMarker; + + /** + * Create a marker on the default marker layer with the given buffer position and no tail. + * To group multiple markers together in their own private layer, see ::addMarkerLayer. + */ + markBufferPosition(bufferPosition: PointCompatible, options?: { + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + }): DisplayMarker; + + /** + * Create a marker on the default marker layer with the given screen position and no tail. + * To group multiple markers together in their own private layer, see ::addMarkerLayer. + */ + markScreenPosition(screenPosition: PointCompatible, options?: { + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + clipDirection?: "backward"|"forward"|"closest", + }): DisplayMarker; + + /** + * Find all DisplayMarkers on the default marker layer that match the given properties. + * + * This method finds markers based on the given properties. Markers can be associated + * with custom properties that will be compared with basic equality. In addition, there + * are several special properties that will be compared with the range of the markers + * rather than their properties. + */ + findMarkers(properties: FindDisplayMarkerOptions): DisplayMarker[]; + + /** Create a marker layer to group related markers. */ + addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean }): + DisplayMarkerLayer; + + /** Get a DisplayMarkerLayer by id. */ + getMarkerLayer(id: number): DisplayMarkerLayer|undefined; + + /** + * Get the default DisplayMarkerLayer. + * All marker APIs not tied to an explicit layer interact with this default layer. + */ + getDefaultMarkerLayer(): DisplayMarkerLayer; + + /** Get the DisplayMarker on the default layer for the given marker id. */ + getMarker(id: number): DisplayMarker; + + /** Get all DisplayMarkers on the default marker layer. Consider using ::findMarkers. */ + getMarkers(): DisplayMarker[]; + + /** Get the number of markers in the default marker layer. */ + getMarkerCount(): number; + + // Cursors + /** Get the position of the most recently added cursor in buffer coordinates. */ + getCursorBufferPosition(): Point; + + /** Get the position of all the cursor positions in buffer coordinates. */ + getCursorBufferPositions(): Point[]; + + /** + * Move the cursor to the given position in buffer coordinates. + * If there are multiple cursors, they will be consolidated to a single cursor. + */ + setCursorBufferPosition(position: PointCompatible, options?: { autoscroll?: boolean }): + void; + + /** Get a Cursor at given screen coordinates Point. */ + getCursorAtScreenPosition(position: PointCompatible): Cursor|undefined; + + /** Get the position of the most recently added cursor in screen coordinates. */ + getCursorScreenPosition(): Point; + + /** Get the position of all the cursor positions in screen coordinates. */ + getCursorScreenPositions(): Point[]; + + /** + * Move the cursor to the given position in screen coordinates. + * If there are multiple cursors, they will be consolidated to a single cursor. + */ + setCursorScreenPosition(position: PointCompatible, options?: { autoscroll?: boolean }): + void; + + /** Add a cursor at the given position in buffer coordinates. */ + addCursorAtBufferPosition(bufferPosition: PointCompatible, options?: + { autoscroll?: boolean }): Cursor; + + /** Add a cursor at the position in screen coordinates. */ + addCursorAtScreenPosition(screenPosition: PointCompatible): Cursor; + + /** Returns a boolean indicating whether or not there are multiple cursors. */ + hasMultipleCursors(): boolean; + + /** Move every cursor up one row in screen coordinates. */ + moveUp(lineCount?: number): void; + + /** Move every cursor down one row in screen coordinates. */ + moveDown(lineCount?: number): void; + + /** Move every cursor left one column. */ + moveLeft(columnCount?: number): void; + + /** Move every cursor right one column. */ + moveRight(columnCount?: number): void; + + /** Move every cursor to the beginning of its line in buffer coordinates. */ + moveToBeginningOfLine(): void; + + /** Move every cursor to the beginning of its line in screen coordinates. */ + moveToBeginningOfScreenLine(): void; + + /** Move every cursor to the first non-whitespace character of its line. */ + moveToFirstCharacterOfLine(): void; + + /** Move every cursor to the end of its line in buffer coordinates. */ + moveToEndOfLine(): void; + + /** Move every cursor to the end of its line in screen coordinates. */ + moveToEndOfScreenLine(): void; + + /** Move every cursor to the beginning of its surrounding word. */ + moveToBeginningOfWord(): void; + + /** Move every cursor to the end of its surrounding word. */ + moveToEndOfWord(): void; + + /** + * Move every cursor to the top of the buffer. + * If there are multiple cursors, they will be merged into a single cursor. + */ + moveToTop(): void; + + /** + * Move every cursor to the bottom of the buffer. + * If there are multiple cursors, they will be merged into a single cursor. + */ + moveToBottom(): void; + + /** Move every cursor to the beginning of the next word. */ + moveToBeginningOfNextWord(): void; + + /** Move every cursor to the previous word boundary. */ + moveToPreviousWordBoundary(): void; + + /** Move every cursor to the next word boundary. */ + moveToNextWordBoundary(): void; + + /** Move every cursor to the previous subword boundary. */ + moveToPreviousSubwordBoundary(): void; + + /** Move every cursor to the next subword boundary. */ + moveToNextSubwordBoundary(): void; + + /** Move every cursor to the beginning of the next paragraph. */ + moveToBeginningOfNextParagraph(): void; + + /** Move every cursor to the beginning of the previous paragraph. */ + moveToBeginningOfPreviousParagraph(): void; + + /** Returns the most recently added Cursor. */ + getLastCursor(): Cursor; + + /** Returns the word surrounding the most recently added cursor. */ + getWordUnderCursor(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean, + allowPrevious?: boolean, + }): string; + + /** Get an Array of all Cursors. */ + getCursors(): Cursor[]; + + /** + * Get all Cursorss, ordered by their position in the buffer instead of the + * order in which they were added. + */ + getCursorsOrderedByBufferPosition(): Cursor[]; + + // Selections + /** Get the selected text of the most recently added selection. */ + getSelectedText(): string; + + /** Get the Range of the most recently added selection in buffer coordinates. */ + getSelectedBufferRange(): Range; + + /** + * Get the Ranges of all selections in buffer coordinates. + * The ranges are sorted by when the selections were added. Most recent at the end. + */ + getSelectedBufferRanges(): Range[]; + + /** + * Set the selected range in buffer coordinates. If there are multiple selections, + * they are reduced to a single selection with the given range. + */ + setSelectedBufferRange(bufferRange: RangeCompatible, options?: + { reversed?: boolean, preserveFolds?: boolean}): void; + + /** + * Set the selected ranges in buffer coordinates. If there are multiple selections, + * they are replaced by new selections with the given ranges. + */ + setSelectedBufferRanges(bufferRanges: ReadonlyArray, options?: + { reversed?: boolean, preserveFolds?: boolean}): void; + + /** Get the Range of the most recently added selection in screen coordinates. */ + getSelectedScreenRange(): Range; + + /** + * Get the Ranges of all selections in screen coordinates. + * The ranges are sorted by when the selections were added. Most recent at the end. + */ + getSelectedScreenRanges(): Range[]; + + /** + * Set the selected range in screen coordinates. If there are multiple selections, + * they are reduced to a single selection with the given range. + */ + setSelectedScreenRange(screenRange: RangeCompatible, options?: { reversed?: boolean }): + void; + + /** + * Set the selected ranges in screen coordinates. If there are multiple selections, + * they are replaced by new selections with the given ranges. + */ + setSelectedScreenRanges(screenRanges: ReadonlyArray, options?: + { reversed?: boolean }): void; + + /** Add a selection for the given range in buffer coordinates. */ + addSelectionForBufferRange(bufferRange: RangeCompatible, options?: + { reversed?: boolean, preserveFolds?: boolean }): Selection; + + /** Add a selection for the given range in screen coordinates. */ + addSelectionForScreenRange(screenRange: RangeCompatible, options?: + { reversed?: boolean, preserveFolds?: boolean }): Selection; + + /** + * Select from the current cursor position to the given position in buffer coordinates. + * This method may merge selections that end up intersecting. + */ + selectToBufferPosition(position: PointCompatible): void; + + /** + * Select from the current cursor position to the given position in screen coordinates. + * This method may merge selections that end up intersecting. + */ + selectToScreenPosition(position: PointCompatible): void; + + /** + * Move the cursor of each selection one character upward while preserving the + * selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectUp(rowCount?: number): void; + + /** + * Move the cursor of each selection one character downward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectDown(rowCount?: number): void; + + /** + * Move the cursor of each selection one character leftward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectLeft(columnCount?: number): void; + + /** + * Move the cursor of each selection one character rightward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectRight(columnCount?: number): void; + + /** + * Select from the top of the buffer to the end of the last selection in the buffer. + * This method merges multiple selections into a single selection. + */ + selectToTop(): void; + + /** + * Selects from the top of the first selection in the buffer to the end of the buffer. + * This method merges multiple selections into a single selection. + */ + selectToBottom(): void; + + /** + * Select all text in the buffer. + * This method merges multiple selections into a single selection. + */ + selectAll(): void; + + /** + * Move the cursor of each selection to the beginning of its line while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToBeginningOfLine(): void; + + /** + * Move the cursor of each selection to the first non-whitespace character of its + * line while preserving the selection's tail position. If the cursor is already + * on the first character of the line, move it to the beginning of the line. + * This method may merge selections that end up intersecting. + */ + selectToFirstCharacterOfLine(): void; + + /** + * Move the cursor of each selection to the end of its line while preserving the + * selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToEndOfLine(): void; + + /** + * Expand selections to the beginning of their containing word. + * Operates on all selections. Moves the cursor to the beginning of the containing + * word while preserving the selection's tail position. + */ + selectToBeginningOfWord(): void; + + /** + * Expand selections to the end of their containing word. + * Operates on all selections. Moves the cursor to the end of the containing word + * while preserving the selection's tail position. + */ + selectToEndOfWord(): void; + + /** + * For each cursor, select the containing line. + * This method merges selections on successive lines. + */ + selectLinesContainingCursors(): void; + + /** Select the word surrounding each cursor. */ + selectWordsContainingCursors(): void; + + /** + * For each selection, move its cursor to the preceding subword boundary while + * maintaining the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToPreviousSubwordBoundary(): void; + + /** + * For each selection, move its cursor to the next subword boundary while maintaining + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToNextSubwordBoundary(): void; + + /** + * For each selection, move its cursor to the preceding word boundary while + * maintaining the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToPreviousWordBoundary(): void; + + /** + * For each selection, move its cursor to the next word boundary while maintaining + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToNextWordBoundary(): void; + + /** + * Expand selections to the beginning of the next word. + * Operates on all selections. Moves the cursor to the beginning of the next word + * while preserving the selection's tail position. + */ + selectToBeginningOfNextWord(): void; + + /** + * Expand selections to the beginning of the next paragraph. + * Operates on all selections. Moves the cursor to the beginning of the next + * paragraph while preserving the selection's tail position. + */ + selectToBeginningOfNextParagraph(): void; + + /** + * Expand selections to the beginning of the next paragraph. + * Operates on all selections. Moves the cursor to the beginning of the next + * paragraph while preserving the selection's tail position. + */ + selectToBeginningOfPreviousParagraph(): void; + + /** Select the range of the given marker if it is valid. */ + selectMarker(marker: DisplayMarker): Range|undefined; + + /** Get the most recently added Selection. */ + getLastSelection(): Selection; + + /** Get current Selections. */ + getSelections(): Selection[]; + + /** + * Get all Selections, ordered by their position in the buffer instead of the + * order in which they were added. + */ + getSelectionsOrderedByBufferPosition(): Selection[]; + + // NOTE: this calls into Selection::intersectsBufferRange, which itself calls + // into Range::intersectsWith. Range::intersectsWith is one of the few functions + // which does NOT take a range-compatible array. + /** Determine if a given range in buffer coordinates intersects a selection. */ + selectionIntersectsBufferRange(bufferRange: RangeLike): boolean; + + // Searching and Replacing + /** + * Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + * + * ::scan functions as the replace method as well via the replace. + */ + scan(regex: RegExp, options: ScanContextOptions, iterator: (params: + ContextualBufferScanResult) => void): void; + /** + * Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + * + * ::scan functions as the replace method as well via the replace. + */ + scan(regex: RegExp, iterator: (params: BufferScanResult) => void): void; + + /** + * Scan regular expression matches in a given range, calling the given iterator. + * function on each match. + */ + scanInBufferRange(regex: RegExp, range: RangeCompatible, iterator: + (params: BufferScanResult) => void): void; + + /** + * Scan regular expression matches in a given range in reverse order, calling the + * given iterator function on each match. + */ + backwardsScanInBufferRange(regex: RegExp, range: RangeCompatible, + iterator: (params: BufferScanResult) => void): void; + + // Tab Behavior + /** Returns a boolean indicating whether softTabs are enabled for this editor. */ + getSoftTabs(): boolean; + + /** Enable or disable soft tabs for this editor. */ + setSoftTabs(softTabs: boolean): void; + + /** Toggle soft tabs for this editor. */ + toggleSoftTabs(): boolean; + + /** Get the on-screen length of tab characters. */ + getTabLength(): number; + + /** + * Set the on-screen length of tab characters. Setting this to a number will + * override the editor.tabLength setting. + */ + setTabLength(tabLength: number): void; + + /** Determine if the buffer uses hard or soft tabs. */ + usesSoftTabs(): boolean|undefined; + + /** + * Get the text representing a single level of indent. + * If soft tabs are enabled, the text is composed of N spaces, where N is the + * tab length. Otherwise the text is a tab character (\t). + */ + getTabText(): string; + + // Soft Wrap Behavior + /** Determine whether lines in this editor are soft-wrapped. */ + isSoftWrapped(): boolean; + + /** Enable or disable soft wrapping for this editor. */ + setSoftWrapped(softWrapped: boolean): boolean; + + /** Toggle soft wrapping for this editor. */ + toggleSoftWrapped(): boolean; + + /** Gets the column at which column will soft wrap. */ + getSoftWrapColumn(): number; + + // Indentation + /** + * Get the indentation level of the given buffer row. + * Determines how deeply the given row is indented based on the soft tabs and tab + * length settings of this editor. Note that if soft tabs are enabled and the tab + * length is 2, a row with 4 leading spaces would have an indentation level of 2. + */ + indentationForBufferRow(bufferRow: number): number; + + /** + * Set the indentation level for the given buffer row. + * Inserts or removes hard tabs or spaces based on the soft tabs and tab length settings + * of this editor in order to bring it to the given indentation level. Note that if soft + * tabs are enabled and the tab length is 2, a row with 4 leading spaces would have an + * indentation level of 2. + */ + setIndentationForBufferRow(bufferRow: number, newLevel: number, options?: + { preserveLeadingWhitespace?: boolean }): void; + + /** Indent rows intersecting selections by one level. */ + indentSelectedRows(): void; + + /** Outdent rows intersecting selections by one level. */ + outdentSelectedRows(): void; + + /** + * Get the indentation level of the given line of text. + * Determines how deeply the given line is indented based on the soft tabs and tab length + * settings of this editor. Note that if soft tabs are enabled and the tab length is 2, + * a row with 4 leading spaces would have an indentation level of 2. + */ + indentLevelForLine(line: string): number; + + /** Indent rows intersecting selections based on the grammar's suggested indent level. */ + autoIndentSelectedRows(): void; + + // Grammars + /** Get the current Grammar of this editor. */ + getGrammar(): Grammar; + + /** + * Set the current Grammar of this editor. + * Assigning a grammar will cause the editor to re-tokenize based on the new grammar. + */ + setGrammar(grammar: Grammar): void; + + // Managing Syntax Scopes + /** + * Returns a ScopeDescriptor that includes this editor's language. + * e.g. [".source.ruby"], or [".source.coffee"]. + */ + getRootScopeDescriptor(): ScopeDescriptor; + + /** Get the syntactic scopeDescriptor for the given position in buffer coordinates. */ + scopeDescriptorForBufferPosition(bufferPosition: PointCompatible): ScopeDescriptor; + + /** + * Get the range in buffer coordinates of all tokens surrounding the cursor + * that match the given scope selector. + */ + bufferRangeForScopeAtCursor(scopeSelector: string): Range; + + /** Determine if the given row is entirely a comment. */ + isBufferRowCommented(bufferRow: number): boolean; + + // Clipboard Operations + /** For each selection, copy the selected text. */ + copySelectedText(): void; + + /** For each selection, cut the selected text. */ + cutSelectedText(): void; + + /** + * For each selection, replace the selected text with the contents of the clipboard. + * If the clipboard contains the same number of selections as the current editor, + * each selection will be replaced with the content of the corresponding clipboard + * selection text. + */ + pasteText(options?: TextInsertionOptions): void; + + /** + * For each selection, if the selection is empty, cut all characters of the + * containing screen line following the cursor. Otherwise cut the selected text. + */ + cutToEndOfLine(): void; + + /** + * For each selection, if the selection is empty, cut all characters of the + * containing buffer line following the cursor. Otherwise cut the selected text. + */ + cutToEndOfBufferLine(): void; + + // Folds + /** + * Fold the most recent cursor's row based on its indentation level. + * The fold will extend from the nearest preceding line with a lower indentation + * level up to the nearest following row with a lower indentation level. + */ + foldCurrentRow(): void; + + /** Unfold the most recent cursor's row by one level. */ + unfoldCurrentRow(): void; + + /** + * Fold the given row in buffer coordinates based on its indentation level. + * If the given row is foldable, the fold will begin there. Otherwise, it will + * begin at the first foldable row preceding the given row. + */ + foldBufferRow(bufferRow: number): void; + + /** Unfold all folds containing the given row in buffer coordinates. */ + unfoldBufferRow(bufferRow: number): void; + + /** For each selection, fold the rows it intersects. */ + foldSelectedLines(): void; + + /** Fold all foldable lines. */ + foldAll(): void; + + /** Unfold all existing folds. */ + unfoldAll(): void; + + /** Fold all foldable lines at the given indent level. */ + foldAllAtIndentLevel(level: number): void; + + /** + * Determine whether the given row in buffer coordinates is foldable. + * A foldable row is a row that starts a row range that can be folded. + */ + isFoldableAtBufferRow(bufferRow: number): boolean; + + /** + * Determine whether the given row in screen coordinates is foldable. + * A foldable row is a row that starts a row range that can be folded. + */ + isFoldableAtScreenRow(bufferRow: number): boolean; + + /** Fold the given buffer row if it isn't currently folded, and unfold it otherwise. */ + toggleFoldAtBufferRow(bufferRow: number): void; + + /** Determine whether the most recently added cursor's row is folded. */ + isFoldedAtCursorRow(): boolean; + + /** Determine whether the given row in buffer coordinates is folded. */ + isFoldedAtBufferRow(bufferRow: number): boolean; + + /** Determine whether the given row in screen coordinates is folded. */ + isFoldedAtScreenRow(screenRow: number): boolean; + + // Gutters + /** Add a custom Gutter. */ + addGutter(options: { + name: string, + priority?: number, + visible?: boolean, + }): Gutter; + + /** Get this editor's gutters. */ + getGutters(): Gutter[]; + + /** Get the gutter with the given name. */ + gutterWithName(name: string): Gutter|null; + + // Scrolling the TextEditor + /** Scroll the editor to reveal the most recently added cursor if it is off-screen. */ + scrollToCursorPosition(options?: { center?: boolean }): void; + + /** Scrolls the editor to the given buffer position. */ + scrollToBufferPosition(bufferPosition: PointCompatible, options?: { center?: boolean }): + void; + + /** Scrolls the editor to the given screen position. */ + scrollToScreenPosition(screenPosition: PointCompatible, options?: { center?: boolean }): + void; + + // TextEditor Rendering + /** Retrieves the rendered line height in pixels. */ + getLineHeightInPixels(): number; + + /** Retrieves the greyed out placeholder of a mini editor. */ + getPlaceholderText(): string; + + /** + * Set the greyed out placeholder of a mini editor. Placeholder text will be + * displayed when the editor has no content. + */ + setPlaceholderText(placeholderText: string): void; + + /** Undocumented: Buffer range for syntax scope at position */ + bufferRangeForScopeAtPosition(scope: string, point: PointCompatible): Range; + + /** Undocumented: Get syntax token at buffer position */ + tokenForBufferPosition(pos: PointCompatible): {value: string, scopes: string[]}; +} + +export interface PixelPosition { + left: number; + top: number; +} + +/** + * Undocumented: Rendering component for TextEditor + */ +export interface TextEditorComponent { + /** Does not clip screenPosition, unlike similar method on TextEditorElement */ + pixelPositionForScreenPosition(screenPosition: PointLike): PixelPosition; + screenPositionForPixelPosition(pos: PixelPosition): Point; + pixelPositionForMouseEvent(event: { + clientX: number, clientY: number + }): PixelPosition; + screenPositionForMouseEvent(event: {clientX: number, clientY: number}): Point; +} + +/** + * Undocumented: Custom HTML elemnent for TextEditor, atom-text-editor + */ +export interface TextEditorElement extends HTMLElement { + getModel(): TextEditor; + getComponent(): TextEditorComponent; + /** + * Extended: Get a promise that resolves the next time the element's + * DOM is updated in any way. + */ + getNextUpdatePromise(): Promise; + + /** Extended: get the width of an `x` character displayed in this element. */ + getBaseCharacterWidth(): number; + + /** Essential: Scrolls the editor to the top. */ + scrollToTop(): void; + + /** Essential: Scrolls the editor to the bottom. */ + scrollToBottom(): void; + + setScrollTop(scrollTop: number): void; + getScrollTop(): number; + + setScrollLeft(scrollLeft: number): void; + getScrollLeft(): number; + + getScrollHeight(): number; + + /** Extended: Converts a buffer position to a pixel position. */ + pixelPositionForBufferPosition(bufferPosition: PointLike): PixelPosition; + + /** Extended: Converts a screen position to a pixel position. */ + pixelPositionForScreenPosition(screenPosition: PointLike): PixelPosition; + + // Event subscription + onDidChangeScrollTop(callback: (scrollTop: number) => void): Disposable; + onDidChangeScrollLeft(callback: (scrollLeft: number) => void): Disposable; + /** Called when the editor is attached to the DOM. */ + onDidAttach(callback: () => void): Disposable; + /** Called when the editor is detached from the DOM. */ + onDidDetach(callback: () => void): Disposable; +} + +/** Experimental: This global registry tracks registered TextEditors. */ +export interface TextEditorRegistry { + // Managing Text Editors + /** Remove all editors from the registry. */ + clear(): void; + + /** Register a TextEditor. */ + add(editor: TextEditor): Disposable; + + /** Remove the given TextEditor from the registry. */ + remove(editor: TextEditor): boolean; + + /** Keep a TextEditor's configuration in sync with Atom's settings. */ + maintainConfig(editor: TextEditor): Disposable; + + /** + * Set a TextEditor's grammar based on its path and content, and continue + * to update its grammar as gramamrs are added or updated, or the editor's + * file path changes. + */ + maintainGrammar(editor: TextEditor): Disposable; + + /** + * Force a TextEditor to use a different grammar than the one that would + * otherwise be selected for it. + */ + setGrammarOverride(editor: TextEditor, scopeName: string): void; + + /** + * Retrieve the grammar scope name that has been set as a grammar override + * for the given TextEditor. + */ + getGrammarOverride(editor: TextEditor): string|null; + + /** Remove any grammar override that has been set for the given TextEditor. */ + clearGrammarOverride(editor: TextEditor): void; + + // Event Subscription + /** Invoke the given callback with all the current and future registered TextEditors. */ + observe(callback: (editor: TextEditor) => void): Disposable; +} + +export type TooltipPlacement = + |"top"|"bottom"|"left"|"right" + |"auto"|"auto top"|"auto bottom"|"auto left"|"auto right"; + +/** Associates tooltips with HTML elements or selectors. */ +export interface TooltipManager { + /** Add a tooltip to the given element. */ + add(target: HTMLElement, options: { + item?: object, + } | { + title?: string|(() => string), + html?: boolean, + keyBindingCommand?: string, + keyBindingTarget?: HTMLElement + } & { + class?: string; + placement?: TooltipPlacement|(() => TooltipPlacement), + trigger?: "click"|"hover"|"focus"|"manual", + delay?: { show: number, hide: number } + }): Disposable; + + /** Find the tooltips that have been applied to the given element. */ + findTooltips(target: HTMLElement): Tooltip[]; +} + +/** + * ViewRegistry handles the association between model and view types in Atom. + * We call this association a View Provider. As in, for a given model, this class + * can provide a view via ::getView, as long as the model/view association was + * registered via ::addViewProvider. + */ +export interface ViewRegistry { + /** + * Add a provider that will be used to construct views in the workspace's view + * layer based on model objects in its model layer. + */ + addViewProvider(createView: (model: object) => HTMLElement|undefined): Disposable; + /** + * Add a provider that will be used to construct views in the workspace's view + * layer based on model objects in its model layer. + */ + // tslint:disable-next-line:no-any + addViewProvider(modelConstructor: { new (...args: any[]): T }, createView: + (instance: T) => HTMLElement|undefined): Disposable; + + /** Get the view associated with an object in the workspace. */ + getView(obj: TextEditor): TextEditorElement; + getView(obj: object): HTMLElement; +} + +/** Represents the state of the user interface for the entire window. */ +export interface Workspace { + // Event Subscription + /** + * Invoke the given callback with all current and future text editors in + * the workspace. + */ + observeTextEditors(callback: (editor: TextEditor) => void): Disposable; + + /** + * Invoke the given callback with all current and future panes items in the + * workspace. + */ + observePaneItems(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item changes. */ + onDidChangeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback when a text editor becomes the active text editor and + * when there is no longer an active text editor. + */ + onDidChangeActiveTextEditor(callback: (editor?: TextEditor) => void): Disposable; + + /** + * Invoke the given callback with the current active pane item and with all + * future active pane items in the workspace. + */ + observeActivePaneItem(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback with the current active text editor (if any), with all + * future active text editors, and when there is no longer an active text editor. + */ + observeActiveTextEditor(callback: (editor?: TextEditor) => void): Disposable; + + /** + * Invoke the given callback whenever an item is opened. Unlike ::onDidAddPaneItem, + * observers will be notified for items that are already present in the workspace + * when they are reopened. + */ + onDidOpen(callback: (event: PaneItemOpenedEvent) => void): Disposable; + + /** Invoke the given callback when a pane is added to the workspace. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback before a pane is destroyed in the workspace. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback when a pane is destroyed in the workspace. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback with all current and future panes in the workspace. */ + observePanes(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): Disposable; + + /** + * Invoke the given callback with the current active pane and when the + * active pane changes. + */ + observeActivePane(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when a pane item is added to the workspace. */ + onDidAddPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** + * Invoke the given callback when a pane item is about to be destroyed, + * before the user is prompted to save it. + * @param callback The function to be called before pane items are destroyed. + * If this function returns a Promise, then the item will not be destroyed + * until the promise resolves. + */ + onWillDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void|Promise): + Disposable; + + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** Invoke the given callback when a text editor is added to the workspace. */ + onDidAddTextEditor(callback: (event: TextEditorObservedEvent) => void): Disposable; + + // Opening + /** + * Opens the given URI in Atom asynchronously. If the URI is already open, + * the existing item for that URI will be activated. If no URI is given, or + * no registered opener can open the URI, a new empty TextEditor will be created. + */ + open(uri: string, options?: WorkspaceOpenOptions): Promise; + /** + * Opens the given item in Atom asynchronously. If the item is already open, + * the existing item will be activated. If no item is given, a new empty TextEditor + * will be created. + */ + open(item: T, options?: WorkspaceOpenOptions): + Promise; + /** + * Opens the given URI in Atom asynchronously. If the URI is already open, + * the existing item for that URI will be activated. If no URI is given, or + * no registered opener can open the URI, a new empty TextEditor will be created. + */ + open(): Promise; + + /** + * Search the workspace for items matching the given URI and hide them. + * Returns a boolean indicating whether any items were found (and hidden). + */ + hide(itemOrURI: object|string): boolean; + + /** + * Search the workspace for items matching the given URI. If any are found, + * hide them. Otherwise, open the URL. + * Returns a Promise that resolves when the item is shown or hidden. + */ + toggle(itemOrURI: object|string): Promise; + + /** + * Creates a new item that corresponds to the provided URI. + * If no URI is given, or no registered opener can open the URI, a new empty TextEditor + * will be created. + */ + createItemForURI(uri: string): Promise; + + /** Returns a boolean that is true if object is a TextEditor. */ + isTextEditor(object: object): object is TextEditor; + + /** + * Asynchronously reopens the last-closed item's URI if it hasn't already + * been reopened. + */ + reopenItem(): Promise; + + /** Register an opener for a URI. */ + addOpener(opener: (uri: string, options?: WorkspaceOpenOptions) => + ViewModel|undefined): Disposable; + + /** Create a new text editor. */ + buildTextEditor(params: object): TextEditor; + + // Pane Items + /** Get all pane items in the workspace. */ + getPaneItems(): object[]; + + /** Get the active Pane's active item. */ + getActivePaneItem(): object; + + /** Get all text editors in the workspace. */ + getTextEditors(): TextEditor[]; + + /** Get the workspace center's active item if it is a TextEditor. */ + getActiveTextEditor(): TextEditor|undefined; + + // Panes + /** Get the most recently focused pane container. */ + getActivePaneContainer(): Dock|WorkspaceCenter; + + /** Get all panes in the workspace. */ + getPanes(): Pane[]; + + /** Get the active Pane. */ + getActivePane(): Pane; + + /** Make the next pane active. */ + activateNextPane(): boolean; + + /** Make the previous pane active. */ + activatePreviousPane(): boolean; + + /** Get the first pane container that contains an item with the given URI. */ + paneContainerForURI(uri: string): Dock|WorkspaceCenter|undefined; + + /** Get the first pane container that contains the given item. */ + paneContainerForItem(item: object): Dock|WorkspaceCenter|undefined; + + /** Get the first Pane with an item for the given URI. */ + paneForURI(uri: string): Pane|undefined; + + /** Get the Pane containing the given item. */ + paneForItem(item: object): Pane|undefined; + + // Pane Locations + /** Get the WorkspaceCenter at the center of the editor window. */ + getCenter(): WorkspaceCenter; + + /** Get the Dock to the left of the editor window. */ + getLeftDock(): Dock; + + /** Get the Dock to the right of the editor window. */ + getRightDock(): Dock; + + /** Get the Dock below the editor window. */ + getBottomDock(): Dock; + + /** Returns all Pane containers. */ + getPaneContainers(): [WorkspaceCenter, Dock, Dock, Dock]; + + // Panels + /** Get an Array of all the panel items at the bottom of the editor window. */ + getBottomPanels(): Panel[]; + + /** Adds a panel item to the bottom of the editor window. */ + addBottomPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items to the left of the editor window. */ + getLeftPanels(): Panel[]; + + /** Adds a panel item to the left of the editor window. */ + addLeftPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items to the right of the editor window. */ + getRightPanels(): Panel[]; + + /** Adds a panel item to the right of the editor window. */ + addRightPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items at the top of the editor window. */ + getTopPanels(): Panel[]; + + /** Adds a panel item to the top of the editor window above the tabs. */ + addTopPanel(options: { + item: T, + visible?: boolean, + priority?: number + }): Panel; + + /** Get an Array of all the panel items in the header. */ + getHeaderPanels(): Panel[]; + + /** Adds a panel item to the header. */ + addHeaderPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items in the footer. */ + getFooterPanels(): Panel[]; + + /** Adds a panel item to the footer. */ + addFooterPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the modal panel items. */ + getModalPanels(): Panel[]; + + /** Adds a panel item as a modal dialog. */ + addModalPanel(options: { + item: T, + visible?: boolean, + priority?: number, + autoFocus?: boolean, + }): Panel; + + /** + * Returns the Panel associated with the given item or null when the item + * has no panel. + */ + panelForItem(item: T): Panel|null; + + // Searching and Replacing + /** Performs a search across all files in the workspace. */ + scan(regex: RegExp, iterator: (result: ScandalResult) => void): + CancellablePromise; + /** Performs a search across all files in the workspace. */ + scan(regex: RegExp, options: WorkspaceScanOptions, iterator: + (result: ScandalResult) => void): CancellablePromise; + + /** Performs a replace across all the specified files in the project. */ + replace(regex: RegExp, replacementText: string, filePaths: ReadonlyArray, + iterator: (result: { filePath: string|undefined, replacements: number }) => void): + Promise; +} + +// https://github.com/atom/atom/blob/master/src/workspace-center.js +/** The central container for the editor window capable of holding items. */ +export interface WorkspaceCenter { + // Event Subscription + /** + * Invoke the given callback with all current and future text editors in the + * workspace center. + */ + observeTextEditors(callback: (editor: TextEditor) => void): Disposable; + + /** + * Invoke the given callback with all current and future panes items in the + * workspace center. + */ + observePaneItems(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item changes. */ + onDidChangeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback with the current active pane item and with all future + * active pane items in the workspace center. + */ + observeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when a pane is added to the workspace center. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback before a pane is destroyed in the workspace center. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback when a pane is destroyed in the workspace center. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback with all current and future panes in the workspace center. */ + observePanes(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): Disposable; + + /** + * Invoke the given callback with the current active pane and when the active pane + * changes. + */ + observeActivePane(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when a pane item is added to the workspace center. */ + onDidAddPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** + * Invoke the given callback when a pane item is about to be destroyed, before the user + * is prompted to save it. + * @param callback The function to be called before pane items are destroyed. + * If this function returns a Promise, then the item will not be destroyed + * until the promise resolves. + */ + onWillDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void|Promise): + Disposable; + + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** Invoke the given callback when a text editor is added to the workspace center. */ + onDidAddTextEditor(callback: (event: TextEditorObservedEvent) => void): Disposable; + + // Pane Items + /** Get all pane items in the workspace center. */ + getPaneItems(): object[]; + + /** Get the active Pane's active item. */ + getActivePaneItem(): object|undefined; + + /** Get all text editors in the workspace center. */ + getTextEditors(): TextEditor[]; + + /** Get the active item if it is an TextEditor. */ + getActiveTextEditor(): TextEditor|undefined; + + /** Save all pane items. */ + saveAll(): void; + + // Panes + /** Get all panes in the workspace center. */ + getPanes(): Pane[]; + + /** Get the active Pane. */ + getActivePane(): Pane; + + /** Make the next pane active. */ + activateNextPane(): void; + + /** Make the previous pane active. */ + activatePreviousPane(): void; + + /** Retrieve the Pane associated with the given URI. */ + paneForURI(uri: string): Pane|undefined; + + /** Retrieve the Pane associated with the given item. */ + paneForItem(item: object): Pane|undefined; + + /** Destroy (close) the active pane. */ + destroyActivePane(): void; +} + +// Extended Classes =========================================================== + +/** + * A wrapper which provides standard error/output line buffering for + * Node's ChildProcess. + */ +export class BufferedProcess { + process?: ChildProcess; + + constructor(options: ProcessOptions); + + // Event Subscription + /** + * Will call your callback when an error will be raised by the process. Usually + * this is due to the command not being available or not on the PATH. You can + * call handle() on the object passed to your callback to indicate that you + * have handled this error. + */ + onWillThrowError(callback: (errorObject: HandleableErrorEvent) => + void): Disposable; + + // Helper Methods + /** Terminate the process. */ + kill(): void; + + /** Runs the process. */ + start(): void; +} + +/** + * Like BufferedProcess, but accepts a Node script as the command to run. + * This is necessary on Windows since it doesn't support shebang #! lines. + */ +export class BufferedNodeProcess extends BufferedProcess { + /** Runs the given Node script by spawning a new child process. */ + constructor(options: NodeProcessOptions); +} + +/** Represents the clipboard used for copying and pasting in Atom. */ +export interface Clipboard { + /** Write the given text to the clipboard. */ + write(text: string, metadata?: object): void; + + /** Read the text from the clipboard. */ + read(): string; + + /** + * Read the text from the clipboard and return both the text and the associated + * metadata. + */ + readWithMetadata(): { text: string, metadata: object }; +} + +/** Provides a registry for commands that you'd like to appear in the context menu. */ +export interface ContextMenuManager { + /** Add context menu items scoped by CSS selectors. */ + add(itemsBySelector: { [key: string]: ReadonlyArray }): Disposable; +} + +/** + * The Cursor class represents the little blinking line identifying where text + * can be inserted. + */ +export interface Cursor { + // Event Subscription + /** Calls your callback when the cursor has been moved. */ + onDidChangePosition(callback: (event: CursorPositionChangedEvent) => void): Disposable; + + /** Calls your callback when the cursor is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Calls your callback when the cursor's visibility has changed. */ + onDidChangeVisibility(callback: (visibility: boolean) => void): Disposable; + + // Managing Cursor Position + /** Moves a cursor to a given screen position. */ + setScreenPosition(screenPosition: PointCompatible, options?: { autoscroll?: boolean }): + void; + + /** Returns the screen position of the cursor as a Point. */ + getScreenPosition(): Point; + + /** Moves a cursor to a given buffer position. */ + setBufferPosition(bufferPosition: PointCompatible, options?: { autoscroll?: boolean }): + void; + + /** Returns the current buffer position as an Array. */ + getBufferPosition(): Point; + + /** Returns the cursor's current screen row. */ + getScreenRow(): number; + + /** Returns the cursor's current screen column. */ + getScreenColumn(): number; + + /** Retrieves the cursor's current buffer row. */ + getBufferRow(): number; + + /** Returns the cursor's current buffer column. */ + getBufferColumn(): number; + + /** Returns the cursor's current buffer row of text excluding its line ending. */ + getCurrentBufferLine(): string; + + /** Returns whether the cursor is at the start of a line. */ + isAtBeginningOfLine(): boolean; + + /** Returns whether the cursor is on the line return character. */ + isAtEndOfLine(): boolean; + + // Cursor Position Details + /** + * Returns the underlying DisplayMarker for the cursor. Useful with overlay + * Decorations. + */ + getMarker(): DisplayMarker; + + /** + * Identifies if the cursor is surrounded by whitespace. + * "Surrounded" here means that the character directly before and after the cursor + * are both whitespace. + */ + isSurroundedByWhitespace(): boolean; + + /** This method returns false if the character before or after the cursor is whitespace. */ + isBetweenWordAndNonWord(): boolean; + + /** Returns whether this cursor is between a word's start and end. */ + isInsideWord(options?: { wordRegex?: RegExp }): boolean; + + /** Returns the indentation level of the current line. */ + getIndentLevel(): number; + + /** Retrieves the scope descriptor for the cursor's current position. */ + getScopeDescriptor(): ScopeDescriptor; + + /** + * Returns true if this cursor has no non-whitespace characters before its + * current position. + */ + hasPrecedingCharactersOnLine(): boolean; + + /** + * Identifies if this cursor is the last in the TextEditor. + * "Last" is defined as the most recently added cursor. + */ + isLastCursor(): boolean; + + // Moving the Cursor + /** Moves the cursor up one screen row. */ + moveUp(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; + + /** Moves the cursor down one screen row. */ + moveDown(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; + + /** Moves the cursor left one screen column. */ + moveLeft(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; + + /** Moves the cursor right one screen column. */ + moveRight(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; + + /** Moves the cursor to the top of the buffer. */ + moveToTop(): void; + + /** Moves the cursor to the bottom of the buffer. */ + moveToBottom(): void; + + /** Moves the cursor to the beginning of the line. */ + moveToBeginningOfScreenLine(): void; + + /** Moves the cursor to the beginning of the buffer line. */ + moveToBeginningOfLine(): void; + + /** Moves the cursor to the beginning of the first character in the line. */ + moveToFirstCharacterOfLine(): void; + + /** Moves the cursor to the end of the line. */ + moveToEndOfScreenLine(): void; + + /** Moves the cursor to the end of the buffer line. */ + moveToEndOfLine(): void; + + /** Moves the cursor to the beginning of the word. */ + moveToBeginningOfWord(): void; + + /** Moves the cursor to the end of the word. */ + moveToEndOfWord(): void; + + /** Moves the cursor to the beginning of the next word. */ + moveToBeginningOfNextWord(): void; + + /** Moves the cursor to the previous word boundary. */ + moveToPreviousWordBoundary(): void; + + /** Moves the cursor to the next word boundary. */ + moveToNextWordBoundary(): void; + + /** Moves the cursor to the previous subword boundary. */ + moveToPreviousSubwordBoundary(): void; + + /** Moves the cursor to the next subword boundary. */ + moveToNextSubwordBoundary(): void; + + /** Moves the cursor to the beginning of the buffer line, skipping all whitespace. */ + skipLeadingWhitespace(): void; + + /** Moves the cursor to the beginning of the next paragraph. */ + moveToBeginningOfNextParagraph(): void; + + /** Moves the cursor to the beginning of the previous paragraph. */ + moveToBeginningOfPreviousParagraph(): void; + + // Local Positions and Ranges + /** + * Returns buffer position of previous word boundary. It might be on the current + * word, or the previous word. + */ + getPreviousWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): Point; + + /** + * Returns buffer position of the next word boundary. It might be on the current + * word, or the previous word. + */ + getNextWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): Point; + + /** Retrieves the buffer position of where the current word starts. */ + getBeginningOfCurrentWordBufferPosition(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean, + allowPrevious?: boolean + }): Point; + + /** Retrieves the buffer position of where the current word ends. */ + getEndOfCurrentWordBufferPosition(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean + }): Point; + + /** Retrieves the buffer position of where the next word starts. */ + getBeginningOfNextWordBufferPosition(options?: { wordRegex?: RegExp }): Point; + + /** Returns the buffer Range occupied by the word located under the cursor. */ + getCurrentWordBufferRange(options?: { wordRegex?: RegExp }): Range; + + /** Returns the buffer Range for the current line. */ + getCurrentLineBufferRange(options?: { includeNewline?: boolean }): Range; + + /** + * Retrieves the range for the current paragraph. + * A paragraph is defined as a block of text surrounded by empty lines or comments. + */ + getCurrentParagraphBufferRange(): Range; + + /** Returns the characters preceding the cursor in the current word. */ + getCurrentWordPrefix(): string; + + // Visibility + /** Sets whether the cursor is visible. */ + setVisible(visible: boolean): void; + + /** Returns the visibility of the cursor. */ + isVisible(): boolean; + + // Comparing to another cursor + /** + * Compare this cursor's buffer position to another cursor's buffer position. + * See Point::compare for more details. + */ + compare(otherCursor: Cursor): number; + + // Utilities + /** Prevents this cursor from causing scrolling. */ + clearAutoscroll(): void; + + /** Deselects the current selection. */ + clearSelection(): void; + + /** Get the RegExp used by the cursor to determine what a "word" is. */ + wordRegExp(options?: { includeNonWordCharacters?: boolean }): RegExp; + + /** Get the RegExp used by the cursor to determine what a "subword" is. */ + subwordRegExp(options?: { backwards?: boolean }): RegExp; +} + +/** Manages the deserializers used for serialized state. */ +export interface DeserializerManager { + /** Register the given class(es) as deserializers. */ + add(...deserializers: Deserializer[]): Disposable; + + /** Deserialize the state and params. */ + deserialize(state: object): object|undefined; +} + +/** Represents a directory on disk that can be watched for changes. */ +export class Directory { + // Construction + /** Configures a new Directory instance, no files are accessed. */ + constructor(directoryPath: string, symlink?: boolean); + + /** + * Creates the directory on disk that corresponds to ::getPath() if no such + * directory already exists. + */ + create(mode?: number): Promise; + + // Event Subscription + /** Invoke the given callback when the directory's contents change. */ + onDidChange(callback: () => void): Disposable; + + // Directory Metadata + /** Returns a boolean, always false. */ + isFile(): this is File; + + /** Returns a roolean, always true. */ + isDirectory(): this is Directory; + + /** Returns a boolean indicating whether or not this is a symbolic link. */ + isSymbolicLink(): boolean; + + /** + * Returns a promise that resolves to a boolean, true if the directory + * exists, false otherwise. + */ + exists(): Promise; + + /** Returns a boolean, true if the directory exists, false otherwise. */ + existsSync(): boolean; + + /** + * Return a boolean, true if this Directory is the root directory of the + * filesystem, or false if it isn't. + */ + isRoot(): boolean; + + // Managing Paths + /** + * This may include unfollowed symlinks or relative directory entries. + * Or it may be fully resolved, it depends on what you give it. + */ + getPath(): string; + + /** + * All relative directory entries are removed and symlinks are resolved to + * their final destination. + */ + getRealPathSync(): string; + + /** Returns the string basename of the directory. */ + getBaseName(): string; + + /** Returns the relative string path to the given path from this directory. */ + relativize(fullPath: string): string; + + // Traversing + /** Traverse to the parent directory. */ + getParent(): Directory; + + /** + * Traverse within this Directory to a child File. This method doesn't actually + * check to see if the File exists, it just creates the File object. + */ + getFile(filename: string): File; + + /** + * Traverse within this a Directory to a child Directory. This method doesn't actually + * check to see if the Directory exists, it just creates the Directory object. + */ + getSubdirectory(dirname: string): Directory; + + /** Reads file entries in this directory from disk synchronously. */ + getEntriesSync(): Array; + + /** Reads file entries in this directory from disk asynchronously. */ + getEntries(callback: (error: Error, entries: Array) => void): void; + + /** + * Determines if the given path (real or symbolic) is inside this directory. This + * method does not actually check if the path exists, it just checks if the path + * is under this directory. + */ + contains(pathToCheck: string): boolean; +} + +/** A container at the edges of the editor window capable of holding items. */ +export interface Dock { + // Methods + /** Show the dock and focus its active Pane. */ + activate(): void; + + /** Show the dock without focusing it. */ + show(): void; + + /** + * Hide the dock and activate the WorkspaceCenter if the dock was was previously + * focused. + */ + hide(): void; + + /** + * Toggle the dock's visibility without changing the Workspace's active pane + * container. + */ + toggle(): void; + + /** Check if the dock is visible. */ + isVisible(): boolean; + + // Event Subscription + /** Invoke the given callback when the visibility of the dock changes. */ + onDidChangeVisible(callback: (visible: boolean) => void): Disposable; + + /** + * Invoke the given callback with the current and all future visibilities of + * the dock. + */ + observeVisible(callback: (visible: boolean) => void): Disposable; + + /** Invoke the given callback with all current and future panes items in the dock. */ + observePaneItems(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback when the active pane item changes. + * + * Because observers are invoked synchronously, it's important not to perform any + * expensive operations via this method. Consider ::onDidStopChangingActivePaneItem + * to delay operations until after changes stop occurring. + */ + onDidChangeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback with the current active pane item and with all future + * active pane items in the dock. + */ + observeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when a pane is added to the dock. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback before a pane is destroyed in the dock. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback when a pane is destroyed in the dock. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback with all current and future panes in the dock. */ + observePanes(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): Disposable; + + /** + * Invoke the given callback with the current active pane and when the active + * pane changes. + */ + observeActivePane(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when a pane item is added to the dock. */ + onDidAddPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** + * Invoke the given callback when a pane item is about to be destroyed, before the user is + * prompted to save it. + * @param callback The function to be called before pane items are destroyed. + * If this function returns a Promise, then the item will not be destroyed + * until the promise resolves. + */ + onWillDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void|Promise): + Disposable; + + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + // Pane Items + /** Get all pane items in the dock. */ + getPaneItems(): object[]; + + /** Get the active Pane's active item. */ + getActivePaneItem(): object; + + // Panes + /** Returns an Array of Panes. */ + getPanes(): Pane[]; + + /** Get the active Pane. */ + getActivePane(): Pane; + + /** Make the next pane active. */ + activateNextPane(): boolean; + + /** Make the previous pane active. */ + activatePreviousPane(): boolean; +} + +/** Represents an individual file that can be watched, read from, and written to. */ +export class File { + // Construction + /** Configures a new File instance, no files are accessed. */ + constructor(filePath: string, symlink?: boolean); + + /** + * Creates the file on disk that corresponds to ::getPath() if no such file + * already exists. + */ + create(): Promise; + + // Event Subscription + /** Invoke the given callback when the file's contents change. */ + onDidChange(callback: () => void): Disposable; + + /** Invoke the given callback when the file's path changes. */ + onDidRename(callback: () => void): Disposable; + + /** Invoke the given callback when the file is deleted. */ + onDidDelete(callback: () => void): Disposable; + + /** + * Invoke the given callback when there is an error with the watch. When + * your callback has been invoked, the file will have unsubscribed from the + * file watches. + */ + onWillThrowWatchError(callback: (event: PathWatchErrorThrownEvent) => + void): Disposable; + + // File Metadata + /** Returns a boolean, always true. */ + isFile(): this is File; + + /** Returns a boolean, always false. */ + isDirectory(): this is Directory; + + /** Returns a boolean indicating whether or not this is a symbolic link. */ + isSymbolicLink(): boolean; + + /** + * Returns a promise that resolves to a boolean, true if the file exists, + * false otherwise. + */ + exists(): Promise; + + /** Returns a boolean, true if the file exists, false otherwise. */ + existsSync(): boolean; + + /** Get the SHA-1 digest of this file. */ + getDigest(): Promise; + + /** Get the SHA-1 digest of this file. */ + getDigestSync(): string; + + /** Sets the file's character set encoding name. */ + setEncoding(encoding: string): void; + + /** Returns the string encoding name for this file (default: "utf8"). */ + getEncoding(): string; + + // Managing Paths + /** Returns the string path for the file. */ + getPath(): string; + + /** Returns this file's completely resolved string path. */ + getRealPathSync(): string; + + /** + * Returns a promise that resolves to the file's completely resolved + * string path. + */ + getRealPath(): Promise; + + /** Return the string filename without any directory information. */ + getBaseName(): string; + + // Traversing + /** Return the Directory that contains this file. */ + getParent(): Directory; + + // Reading and Writing + /** Reads the contents of the file. */ + read(flushCache?: boolean): Promise; + + /** Returns a stream to read the content of the file. */ + createReadStream(): ReadStream; + + /** Overwrites the file with the given text. */ + write(text: string): Promise; + + /** Returns a stream to write content to the file. */ + createWriteStream(): WriteStream; + + /** Overwrites the file with the given text. */ + writeSync(text: string): undefined; +} + +/** Represents the underlying git operations performed by Atom. */ +export class GitRepository { + // Construction + /** Creates a new GitRepository instance. */ + static open(path: string, options?: { refreshOnWindowFocus?: boolean }): GitRepository; + + constructor(path: string, options?: { refreshOnWindowFocus?: boolean, config?: Config, + project?: Project }); + + // Lifecycle + /** Destroy this GitRepository object. */ + destroy(): void; + + /** Returns a boolean indicating if this repository has been destroyed. */ + isDestroyed(): boolean; + + // Event Subscription + /** + * Invoke the given callback when this GitRepository's destroy() method is + * invoked. + */ + onDidDestroy(callback: () => void): Disposable; + + /** + * Invoke the given callback when a specific file's status has changed. When + * a file is updated, reloaded, etc, and the status changes, this will be fired. + */ + onDidChangeStatus(callback: (event: RepoStatusChangedEvent) => void): Disposable; + + /** Invoke the given callback when a multiple files' statuses have changed. */ + onDidChangeStatuses(callback: () => void): Disposable; + + // Repository Details + /** A string indicating the type of version control system used by this repository. */ + getType(): "git"; + + /** Returns the string path of the repository. */ + getPath(): string; + + /** Returns the string working directory path of the repository. */ + getWorkingDirectory(): string; + + /** Returns true if at the root, false if in a subfolder of the repository. */ + isProjectAtRoot(): boolean; + + /** Makes a path relative to the repository's working directory. */ + relativize(): string; + + /** Returns true if the given branch exists. */ + hasBranch(branch: string): boolean; + + /** Retrieves a shortened version of the HEAD reference value. */ + getShortHead(path?: string): string; + + /** Is the given path a submodule in the repository? */ + isSubmodule(path: string): boolean; + + /** + * Returns the number of commits behind the current branch is from the its + * upstream remote branch. The default reference is the HEAD. + * @param reference The branch reference name. + * @param path The path in the repository to get this ifnromation for, only + * needed if the repository contains submodules. + * @return Returns the number of commits behind the current branch is from its + * upstream remote branch. + */ + getAheadBehindCount(reference: string, path?: string): { ahead: number, behind: number }; + + /** + * Get the cached ahead/behind commit counts for the current branch's + * upstream branch. + */ + getCachedUpstreamAheadBehindCount(path?: string): { ahead: number, behind: number }; + + /** Returns the git configuration value specified by the key. */ + getConfigValue(key: string, path?: string): string; + + /** Returns the origin url of the repository. */ + getOriginURL(path?: string): string; + + /** + * Returns the upstream branch for the current HEAD, or null if there is no + * upstream branch for the current HEAD. + */ + getUpstreamBranch(path?: string): string|null; + + /** Gets all the local and remote references. */ + getReferences(path?: string): { heads: string[], remotes: string[], tags: string[] }; + + /** Returns the current string SHA for the given reference. */ + getReferenceTarget(reference: string, path?: string): string; + + // Reading Status + /** Returns true if the given path is modified. */ + isPathModified(path: string): boolean; + + /** Returns true if the given path is new. */ + isPathNew(path: string): boolean; + + /** Is the given path ignored? */ + isPathIgnored(path: string): boolean; + + /** Get the status of a directory in the repository's working directory. */ + getDirectoryStatus(path: string): number; + + /** Get the status of a single path in the repository. */ + getPathStatus(path: string): number; + + /** Get the cached status for the given path. */ + getCachedPathStatus(path: string): number|null; + + /** Returns true if the given status indicates modification. */ + isStatusModified(status: number): boolean; + + /** Returns true if the given status indicates a new path. */ + isStatusNew(status: number): boolean; + + // Retrieving Diffs + /** + * Retrieves the number of lines added and removed to a path. + * This compares the working directory contents of the path to the HEAD version. + */ + getDiffStats(path: string): { added: number, deleted: number }; + + /** + * Retrieves the line diffs comparing the HEAD version of the given path + * and the given text. + */ + getLineDiffs(path: string, text: string): Array<{ oldStart: number, + newStart: number, oldLines: number, newLines: number }>; + + // Checking Out + /** + * Restore the contents of a path in the working directory and index to the + * version at HEAD. + */ + checkoutHead(path: string): boolean; + + /** Checks out a branch in your repository. */ + checkoutReference(reference: string, create: boolean): boolean; +} + +/** Grammar that tokenizes lines of text. */ +export interface Grammar { + /** The name of the Grammar. */ + readonly name: string; + + /** Undocumented: scope name of the Grammar. */ + readonly scopeName: string; + + // Event Subscription + onDidUpdate(callback: () => void): Disposable; + + // Tokenizing + /** + * Tokenize all lines in the given text. + * @param text A string containing one or more lines. + * @return An array of token arrays for each line tokenized. + */ + tokenizeLines(text: string): GrammarToken[][]; + + /** + * Tokenizes the line of text. + * @param line A string of text to tokenize. + * @param ruleStack An optional array of rules previously returned from this + * method. This should be null when tokenizing the first line in the file. + * @param firstLine A optional boolean denoting whether this is the first line + * in the file which defaults to `false`. + * @return An object representing the result of the tokenize. + */ + tokenizeLine(line: string, ruleStack?: null, firstLine?: boolean): TokenizeLineResult; + /** + * Tokenizes the line of text. + * @param line A string of text to tokenize. + * @param ruleStack An optional array of rules previously returned from this + * method. This should be null when tokenizing the first line in the file. + * @param firstLine A optional boolean denoting whether this is the first line + * in the file which defaults to `false`. + * @return An object representing the result of the tokenize. + */ + tokenizeLine(line: string, ruleStack: GrammarRule[], firstLine?: false): + TokenizeLineResult; +} + +/** Registry containing one or more grammars. */ +export interface GrammarRegistry { + // Event Subscription + /** + * Invoke the given callback when a grammar is added to the registry. + * @param callback The callback to be invoked whenever a grammar is added. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidAddGrammar(callback: (grammar: Grammar) => void): Disposable; + + /** + * Invoke the given callback when a grammar is updated due to a grammar it + * depends on being added or removed from the registry. + * @param callback The callback to be invoked whenever a grammar is updated. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidUpdateGrammar(callback: (grammar: Grammar) => void): Disposable; + + /** + * Invoke the given callback when a grammar is removed from the registry. + * @param callback The callback to be invoked whenever a grammar is removed. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidRemoveGrammar(callback: (grammar: Grammar) => void): Disposable; + + // Managing Grammars + /** + * Get all the grammars in this registry. + * @return A non-empty array of Grammar instances. + */ + getGrammars(): Grammar[]; + + /** + * Get a grammar with the given scope name. + * @param scopeName A string such as `source.js`. + * @return A Grammar or undefined. + */ + grammarForScopeName(scopeName: string): Grammar|undefined; + + /** + * Add a grammar to this registry. + * A 'grammar-added' event is emitted after the grammar is added. + * @param grammar The Grammar to add. This should be a value previously returned + * from ::readGrammar or ::readGrammarSync. + * @return Returns a Disposable on which `.dispose()` can be called to remove + * the grammar. + */ + addGrammar(grammar: Grammar): Disposable; + + /** + * Remove the given grammar from this registry. + * @param grammar The grammar to remove. This should be a grammar previously + * added to the registry from ::addGrammar. + */ + removeGrammar(grammar: Grammar): void; + + /** + * Remove the grammar with the given scope name. + * @param scopeName A string such as `source.js`. + * @return Returns the removed Grammar or undefined. + */ + removeGrammarForScopeName(scopeName: string): Grammar|undefined; + + /** + * Read a grammar synchronously but don't add it to the registry. + * @param grammarPath The absolute file path to a grammar. + * @return The newly loaded Grammar. + */ + readGrammarSync(grammarPath: string): Grammar; + + /** + * Read a grammar asynchronously but don't add it to the registry. + * @param grammarPath The absolute file path to the grammar. + * @param callback The function to be invoked once the Grammar has been read in. + */ + readGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => + void): void; + + /** + * Read a grammar synchronously and add it to this registry. + * @param grammarPath The absolute file path to the grammar. + * @return The newly loaded Grammar. + */ + loadGrammarSync(grammarPath: string): Grammar; + + /** + * Read a grammar asynchronously and add it to the registry. + * @param grammarPath The absolute file path to the grammar. + * @param callback The function to be invoked once the Grammar has been read in + * and added to the registry. + */ + loadGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => + void): void; + + /** + * Convert compact tags representation into convenient, space-inefficient tokens. + * @param lineText The text of the tokenized line. + * @param tags The tags returned from a call to Grammar::tokenizeLine(). + * @return An array of Token instances decoded from the given tags. + */ + decodeTokens(lineText: string, tags: Array): GrammarToken[]; +} + +/** Represents a gutter within a TextEditor. */ +export interface Gutter { + // Gutter Destruction + /** Destroys the gutter. */ + destroy(): void; + + // Event Subscription + /** Calls your callback when the gutter's visibility changes. */ + onDidChangeVisible(callback: (gutter: Gutter) => void): Disposable; + + /** Calls your callback when the gutter is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + // Visibility + /** Hide the gutter. */ + hide(): void; + + /** Show the gutter. */ + show(): void; + + /** Determine whether the gutter is visible. */ + isVisible(): boolean; + + /** + * Add a decoration that tracks a DisplayMarker. When the marker moves, is + * invalidated, or is destroyed, the decoration will be updated to reflect + * the marker's state. + */ + decorateMarker(marker: DisplayMarker, decorationParams: DecorationOptions): Decoration; +} + +/** + * History manager for remembering which projects have been opened. + * An instance of this class is always available as the atom.history global. + * The project history is used to enable the 'Reopen Project' menu. + */ +export interface HistoryManager { + /** Obtain a list of previously opened projects. */ + getProjects(): ProjectHistory[]; + + /** + * Clear all projects from the history. + * Note: This is not a privacy function - other traces will still exist, e.g. + * window state. + */ + clearProjects(): void; + + /** Invoke the given callback when the list of projects changes. */ + onDidChangeProjects(callback: (args: { reloaded: boolean }) => void): Disposable; +} + +/** + * Allows commands to be associated with keystrokes in a context-sensitive way. + * In Atom, you can access a global instance of this object via `atom.keymaps`. + */ +export interface KeymapManager { + /** Clear all registered key bindings and enqueued keystrokes. For use in tests. */ + clear(): void; + + /** Unwatch all watched paths. */ + destroy(): void; + + // Event Subscription + /** Invoke the given callback when one or more keystrokes completely match a key binding. */ + onDidMatchBinding(callback: (event: FullKeybindingMatchEvent) => void): Disposable; + + /** Invoke the given callback when one or more keystrokes partially match a binding. */ + onDidPartiallyMatchBindings(callback: (event: PartialKeybindingMatchEvent) => + void): Disposable; + + /** Invoke the given callback when one or more keystrokes fail to match any bindings. */ + onDidFailToMatchBinding(callback: (event: FailedKeybindingMatchEvent) => + void): Disposable; + + /** Invoke the given callback when a keymap file is reloaded. */ + onDidReloadKeymap(callback: (event: KeymapLoadedEvent) => void): Disposable; + + /** Invoke the given callback when a keymap file is unloaded. */ + onDidUnloadKeymap(callback: (event: KeymapLoadedEvent) => void): Disposable; + + /** Invoke the given callback when a keymap file not able to be loaded. */ + onDidFailToReadFile(callback: (error: FailedKeymapFileReadEvent) => void): Disposable; + + // Adding and Removing Bindings + /** Construct KeyBindings from an object grouping them by CSS selector. */ + build(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): KeyBinding[]; + + /** Add sets of key bindings grouped by CSS selector. */ + add(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): Disposable; + + // Accessing Bindings + /** Get all current key bindings. */ + getKeyBindings(): KeyBinding[]; + + /** Get the key bindings for a given command and optional target. */ + findKeyBindings(params?: { + keystrokes?: string, // e.g. 'ctrl-x ctrl-s' + command?: string, // e.g. 'editor:backspace' + target?: Element, + }): KeyBinding[]; + + // Managing Keymap Files + /** Load the key bindings from the given path. */ + loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }): + void; + + /** + * Cause the keymap to reload the key bindings file at the given path whenever + * it changes. + */ + watchKeymap(filePath: string, options?: { priority: number }): void; + + // Managing Keyboard Events + /** + * Dispatch a custom event associated with the matching key binding for the + * given `KeyboardEvent` if one can be found. + */ + handleKeyboardEvent(event: KeyboardEvent): void; + + /** Translates a keydown event to a keystroke string. */ + keystrokeForKeyboardEvent(event: KeyboardEvent): string; + + /** Customize translation of raw keyboard events to keystroke strings. */ + addKeystrokeResolver(resolver: (event: AddedKeystrokeResolverEvent) => string): Disposable; + + /** + * Get the number of milliseconds allowed before pending states caused by + * partial matches of multi-keystroke bindings are terminated. + */ + getPartialMatchTimeout(): number; +} + +/** Provides a registry for menu items that you'd like to appear in the application menu. */ +export interface MenuManager { + /** Adds the given items to the application menu. */ + add(items: ReadonlyArray): Disposable; + + /** Refreshes the currently visible menu. */ + update(): void; +} + +/** + * Loads and activates a package's main module and resources such as stylesheets, + * keymaps, grammar, editor properties, and menus. + */ +export interface Package { + /** The name of the Package. */ + name: string; + + /** The path to the Package on disk. */ + path: string; + + // Event Subscription + /** Invoke the given callback when all packages have been activated. */ + onDidDeactivate(callback: () => void): Disposable; + + // Native Module Compatibility + /** + * Are all native modules depended on by this package correctly compiled + * against the current version of Atom? + */ + isCompatible(): boolean; + + /** + * Rebuild native modules in this package's dependencies for the current + * version of Atom. + */ + rebuild(): Promise<{ code: number, stdout: string, stderr: string }>; + + /** If a previous rebuild failed, get the contents of stderr. */ + getBuildFailureOutput(): string|null; +} + +/** Package manager for coordinating the lifecycle of Atom packages. */ +export interface PackageManager { + // Event Subscription + /** Invoke the given callback when all packages have been loaded. */ + onDidLoadInitialPackages(callback: () => void): Disposable; + + /** Invoke the given callback when all packages have been activated. */ + onDidActivateInitialPackages(callback: () => void): Disposable; + + /** Invoke the given callback when a package is activated. */ + onDidActivatePackage(callback: (package: Package) => void): Disposable; + + /** Invoke the given callback when a package is deactivated. */ + onDidDeactivatePackage(callback: (package: Package) => void): Disposable; + + /** Invoke the given callback when a package is loaded. */ + onDidLoadPackage(callback: (package: Package) => void): Disposable; + + /** Invoke the given callback when a package is unloaded. */ + onDidUnloadPackage(callback: (package: Package) => void): Disposable; + + /** Undocumented: invoke the given callback when an activation hook is triggered */ + onDidTriggerActivationHook(hook: string, callback: () => void): Disposable; + + // Package System Data + /** Get the path to the apm command. */ + getApmPath(): string; + + /** Get the paths being used to look for packages. */ + getPackageDirPaths(): string[]; + + // General Package Data + /** Resolve the given package name to a path on disk. */ + resolvePackagePath(name: string): string|undefined; + + /** Is the package with the given name bundled with Atom? */ + isBundledPackage(name: string): boolean; + + // Enabling and Disabling Packages + /** Enable the package with the given name. */ + enablePackage(name: string): Package|undefined; + + /** Disable the package with the given name. */ + disablePackage(name: string): Package|undefined; + + /** Is the package with the given name disabled? */ + isPackageDisabled(name: string): boolean; + + // Accessing Active Packages + /** Get an Array of all the active Packages. */ + getActivePackages(): Package[]; + + /** Get the active Package with the given name. */ + getActivePackage(name: string): Package|undefined; + + /** Is the Package with the given name active? */ + isPackageActive(name: string): boolean; + + /** Returns a boolean indicating whether package activation has occurred. */ + hasActivatedInitialPackages(): boolean; + + // Accessing Loaded Packages + /** Get an Array of all the loaded Packages. */ + getLoadedPackages(): Package[]; + + /** Get the loaded Package with the given name. */ + getLoadedPackage(name: string): Package|undefined; + + /** Is the package with the given name loaded? */ + isPackageLoaded(name: string): boolean; + + /** Returns a boolean indicating whether package loading has occurred. */ + hasLoadedInitialPackages(): boolean; + + // Accessing Available Packages + /** Returns an Array of strings of all the available package paths. */ + getAvailablePackagePaths(): string[]; + + /** Returns an Array of strings of all the available package names. */ + getAvailablePackageNames(): string[]; + + /** Returns an Array of strings of all the available package metadata. */ + getAvailablePackageMetadata(): string[]; + + /** Activate a single package by name or path. */ + activatePackage(nameOrPath: string): Promise; + + /** Triggers the given package activation hook. */ + triggerActivationHook(hook: string): void; + + /** Trigger all queued activation hooks immediately. */ + triggerDeferredActivationHooks(): void; +} + +/** A container for presenting content in the center of the workspace. */ +export interface Pane { + // Event Subscription + /** Invoke the given callback when the pane resizes. */ + onDidChangeFlexScale(callback: (flexScale: number) => void): Disposable; + + /** Invoke the given callback with the current and future values of ::getFlexScale. */ + observeFlexScale(callback: (flexScale: number) => void): Disposable; + + /** Invoke the given callback when the pane is activated. */ + onDidActivate(callback: () => void): Disposable; + + /** Invoke the given callback before the pane is destroyed. */ + onWillDestroy(callback: () => void): Disposable; + + /** Invoke the given callback when the pane is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Invoke the given callback when the value of the ::isActive property changes. */ + onDidChangeActive(callback: (active: boolean) => void): Disposable; + + /** + * Invoke the given callback with the current and future values of the ::isActive + * property. + */ + observeActive(callback: (active: boolean) => void): Disposable; + + /** Invoke the given callback when an item is added to the pane. */ + onDidAddItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable; + + /** Invoke the given callback when an item is removed from the pane. */ + onDidRemoveItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable; + + /** Invoke the given callback before an item is removed from the pane. */ + onWillRemoveItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable; + + /** Invoke the given callback when an item is moved within the pane. */ + onDidMoveItem(callback: (event: PaneItemMovedEvent) => void): Disposable; + + /** Invoke the given callback with all current and future items. */ + observeItems(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the value of ::getActiveItem changes. */ + onDidChangeActiveItem(callback: (activeItem: object) => void): Disposable; + + /** + * Invoke the given callback when ::activateNextRecentlyUsedItem has been called, + * either initiating or continuing a forward MRU traversal of pane items. + */ + onChooseNextMRUItem(callback: (nextRecentlyUsedItem: object) => void): Disposable; + + /** + * Invoke the given callback when ::activatePreviousRecentlyUsedItem has been called, + * either initiating or continuing a reverse MRU traversal of pane items. + */ + onChooseLastMRUItem(callback: (previousRecentlyUsedItem: object) => void): Disposable; + + /** + * Invoke the given callback when ::moveActiveItemToTopOfStack has been called, + * terminating an MRU traversal of pane items and moving the current active item + * to the top of the stack. Typically bound to a modifier (e.g. CTRL) key up event. + */ + onDoneChoosingMRUItem(callback: () => void): Disposable; + + /** Invoke the given callback with the current and future values of ::getActiveItem. */ + observeActiveItem(callback: (activeItem: object) => void): Disposable; + + /** Invoke the given callback before items are destroyed. */ + onWillDestroyItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable; + + // Items + /** Get the items in this pane. */ + getItems(): object[]; + + /** Get the active pane item in this pane. */ + getActiveItem(): object; + + /** Return the item at the given index. */ + itemAtIndex(index: number): object|undefined; + + /** Makes the next item active. */ + activateNextItem(): void; + + /** Makes the previous item active. */ + activatePreviousItem(): void; + + /** Move the active tab to the right. */ + moveItemRight(): void; + + /** Move the active tab to the left. */ + moveItemLeft(): void; + + /** Get the index of the active item. */ + getActiveItemIndex(): number; + + /** Activate the item at the given index. */ + activateItemAtIndex(index: number): void; + + /** Make the given item active, causing it to be displayed by the pane's view. */ + activateItem(item: object, options?: { pending: boolean }): void; + + /** Add the given item to the pane. */ + addItem(item: object, options?: { index?: number, pending?: boolean }): object; + + /** Add the given items to the pane. */ + addItems(items: object[], index?: number): object[]; + + /** Move the given item to the given index. */ + moveItem(item: object, index: number): void; + + /** Move the given item to the given index on another pane. */ + moveItemToPane(item: object, pane: Pane, index: number): void; + + /** Destroy the active item and activate the next item. */ + destroyActiveItem(): Promise; + + /** Destroy the given item. */ + destroyItem(item: object, force?: boolean): Promise; + + /** Destroy all items. */ + destroyItems(): Promise; + + /** Destroy all items except for the active item. */ + destroyInactiveItems(): Promise; + + /** Save the active item. */ + saveActiveItem(nextAction?: (error?: Error) => T): + Promise|undefined; + + /** + * Prompt the user for a location and save the active item with the path + * they select. + */ + saveActiveItemAs(nextAction?: (error?: Error) => T): + Promise|undefined; + + /** Save the given item. */ + saveItem(item: object, nextAction?: (error?: Error) => T): + Promise|undefined; + + /** + * Prompt the user for a location and save the active item with the path + * they select. + */ + saveItemAs(item: object, nextAction?: (error?: Error) => T): + Promise|undefined; + + /** Save all items. */ + saveItems(): void; + + /** Return the first item that matches the given URI or undefined if none exists. */ + itemForURI(uri: string): object|undefined; + + /** Activate the first item that matches the given URI. */ + activateItemForURI(uri: string): boolean; + + // Lifecycle + /** Determine whether the pane is active. */ + isActive(): boolean; + + /** Makes this pane the active pane, causing it to gain focus. */ + activate(): void; + + /** Close the pane and destroy all its items. */ + destroy(): void; + + /** Determine whether this pane has been destroyed. */ + isDestroyed(): boolean; + + // Splitting + /** Create a new pane to the left of this pane. */ + splitLeft(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Create a new pane to the right of this pane. */ + splitRight(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Creates a new pane above the receiver. */ + splitUp(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Creates a new pane below the receiver. */ + splitDown(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; +} + +/** + * A container representing a panel on the edges of the editor window. You + * should not create a Panel directly, instead use Workspace::addTopPanel and + * friends to add panels. + */ +export interface Panel { + /** Whether or not the Panel is visible. */ + visible: boolean; + + // Construction and Destruction + /** Destroy and remove this panel from the UI. */ + destroy(): void; + + // Event Subscription + /** Invoke the given callback when the pane hidden or shown. */ + onDidChangeVisible(callback: (visible: boolean) => void): Disposable; + + /** Invoke the given callback when the pane is destroyed. */ + onDidDestroy(callback: (panel: Panel) => void): Disposable; + + // Panel Details + /** Returns the panel's item. */ + getItem(): T; + + /** Returns a number indicating this panel's priority. */ + getPriority(): number; + + /** Returns a boolean true when the panel is visible. */ + isVisible(): boolean; + + /** Hide this panel. */ + hide(): void; + + /** Show this panel. */ + show(): void; +} + +/** Manage a subscription to filesystem events that occur beneath a root directory. */ +export interface PathWatcher extends DisposableLike { + /** + * Return a Promise that will resolve when the underlying native watcher is + * ready to begin sending events. + */ + getStartPromise(): Promise; + + /** Invokes a function when any errors related to this watcher are reported. */ + onDidError(callback: (error: Error) => void): Disposable; + + /** + * Unsubscribe all subscribers from filesystem events. Native resources will be + * release asynchronously, but this watcher will stop broadcasting events + * immediately. + */ + dispose(): void; +} + +/** Represents a project that's opened in Atom. */ +export interface Project { + // Event Subscription + /** Invoke the given callback when the project paths change. */ + onDidChangePaths(callback: (projectPaths: string[]) => void): Disposable; + + /** Invoke the given callback when a text buffer is added to the project. */ + onDidAddBuffer(callback: (buffer: TextBuffer) => void): Disposable; + + /** + * Invoke the given callback with all current and future text buffers in + * the project. + */ + observeBuffers(callback: (buffer: TextBuffer) => void): Disposable; + + /** Invoke a callback when a filesystem change occurs within any open project path. */ + onDidChangeFiles(callback: (events: FilesystemChangeEvent) => void): Disposable; + + // Accessing the Git Repository + /** Get an Array of GitRepositorys associated with the project's directories. */ + getRepositories(): GitRepository[]; + + /** Get the repository for a given directory asynchronously. */ + repositoryForDirectory(directory: Directory): Promise; + + // Managing Paths + /** Get an Array of strings containing the paths of the project's directories. */ + getPaths(): string[]; + + /** Set the paths of the project's directories. */ + setPaths(projectPaths: string[]): void; + + /** Add a path to the project's list of root paths. */ + addPath(projectPath: string): void; + + /** + * Access a promise that resolves when the filesystem watcher associated with a + * project root directory is ready to begin receiving events. + */ + getWatcherPromise(projectPath: string): Promise; + + /** Remove a path from the project's list of root paths. */ + removePath(projectPath: string): void; + + /** Get an Array of Directorys associated with this project. */ + getDirectories(): Directory[]; + + /** Get the relative path from the project directory to the given path. */ + relativize(fullPath: string): string; + + /** + * Get the path to the project directory that contains the given path, and + * the relative path from that project directory to the given path. + */ + relativizePath(fullPath: string): [string|null, string]; + + /** + * Determines whether the given path (real or symbolic) is inside the + * project's directory. + */ + contains(pathToCheck: string): boolean; +} + +/** + * Wraps an array of strings. The Array describes a path from the root of the + * syntax tree to a token including all scope names for the entire path. + */ +export interface ScopeDescriptor { + scopes: string[]; + + /** Returns all scopes for this descriptor. */ + getScopesArray(): string[]; +} + +/** Represents a selection in the TextEditor. */ +export interface Selection { + // Event Subscription + /** Calls your callback when the selection was moved. */ + onDidChangeRange(callback: (event: SelectionChangedEvent) => void): Disposable; + + /** Calls your callback when the selection was destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + // Managing the selection range + /** Returns the screen Range for the selection. */ + getScreenRange(): Range; + + /** Modifies the screen range for the selection. */ + setScreenRange(screenRange: RangeCompatible, options?: { + preserveFolds?: boolean, + autoscroll?: boolean + }): void; + + /** Returns the buffer Range for the selection. */ + getBufferRange(): Range; + + /** Modifies the buffer Range for the selection. */ + setBufferRange(bufferRange: RangeCompatible, options?: { + preserveFolds?: boolean, + autoscroll?: boolean, + }): void; + + /** Returns the starting and ending buffer rows the selection is highlighting. */ + getBufferRowRange(): [number, number]; + + // Info about the selection + /** Determines if the selection contains anything. */ + isEmpty(): boolean; + + /** + * Determines if the ending position of a marker is greater than the starting position. + * This can happen when, for example, you highlight text "up" in a TextBuffer. + */ + isReversed(): boolean; + + /** Returns whether the selection is a single line or not. */ + isSingleScreenLine(): boolean; + + /** Returns the text in the selection. */ + getText(): string; + + // NOTE: this calls into Range.intersectsWith(), which is one of the few functions + // that doesn't take a range-compatible range, despite what the API says. + /** Identifies if a selection intersects with a given buffer range. */ + intersectsBufferRange(bufferRange: RangeLike): boolean; + + /** Identifies if a selection intersects with another selection. */ + intersectsWith(otherSelection: Selection): boolean; + + // Modifying the selected range + /** Clears the selection, moving the marker to the head. */ + clear(options?: { autoscroll?: boolean }): void; + + /** Selects the text from the current cursor position to a given screen position. */ + selectToScreenPosition(position: PointCompatible): void; + + /** Selects the text from the current cursor position to a given buffer position. */ + selectToBufferPosition(position: PointCompatible): void; + + /** Selects the text one position right of the cursor. */ + selectRight(columnCount?: number): void; + + /** Selects the text one position left of the cursor. */ + selectLeft(columnCount?: number): void; + + /** Selects all the text one position above the cursor. */ + selectUp(rowCount?: number): void; + + /** Selects all the text one position below the cursor. */ + selectDown(rowCount?: number): void; + + /** + * Selects all the text from the current cursor position to the top of the + * buffer. + */ + selectToTop(): void; + + /** + * Selects all the text from the current cursor position to the bottom of + * the buffer. + */ + selectToBottom(): void; + + /** Selects all the text in the buffer. */ + selectAll(): void; + + /** + * Selects all the text from the current cursor position to the beginning of + * the line. + */ + selectToBeginningOfLine(): void; + + /** + * Selects all the text from the current cursor position to the first character + * of the line. + */ + selectToFirstCharacterOfLine(): void; + + /** + * Selects all the text from the current cursor position to the end of the + * screen line. + */ + selectToEndOfLine(): void; + + /** + * Selects all the text from the current cursor position to the end of the + * buffer line. + */ + selectToEndOfBufferLine(): void; + + /** + * Selects all the text from the current cursor position to the beginning + * of the word. + */ + selectToBeginningOfWord(): void; + + /** Selects all the text from the current cursor position to the end of the word. */ + selectToEndOfWord(): void; + + /** + * Selects all the text from the current cursor position to the beginning of + * the next word. + */ + selectToBeginningOfNextWord(): void; + + /** Selects text to the previous word boundary. */ + selectToPreviousWordBoundary(): void; + + /** Selects text to the next word boundary. */ + selectToNextWordBoundary(): void; + + /** Selects text to the previous subword boundary. */ + selectToPreviousSubwordBoundary(): void; + + /** Selects text to the next subword boundary. */ + selectToNextSubwordBoundary(): void; + + /** + * Selects all the text from the current cursor position to the beginning of + * the next paragraph. + */ + selectToBeginningOfNextParagraph(): void; + + /** + * Selects all the text from the current cursor position to the beginning of + * the previous paragraph. + */ + selectToBeginningOfPreviousParagraph(): void; + + /** Modifies the selection to encompass the current word. */ + selectWord(): void; + + /** + * Expands the newest selection to include the entire word on which the + * cursors rests. + */ + expandOverWord(): void; + + /** Selects an entire line in the buffer. */ + selectLine(row: number): void; + + /** + * Expands the newest selection to include the entire line on which the cursor + * currently rests. + * It also includes the newline character. + */ + expandOverLine(): void; + + // Modifying the selected text + /** Replaces text at the current selection. */ + insertText(text: string, options?: TextInsertionOptions): void; + + /** + * Removes the first character before the selection if the selection is empty + * otherwise it deletes the selection. + */ + backspace(): void; + + /** + * Removes the selection or, if nothing is selected, then all characters from + * the start of the selection back to the previous word boundary. + */ + deleteToPreviousWordBoundary(): void; + + /** + * Removes the selection or, if nothing is selected, then all characters from + * the start of the selection up to the next word boundary. + */ + deleteToNextWordBoundary(): void; + + /** + * Removes from the start of the selection to the beginning of the current + * word if the selection is empty otherwise it deletes the selection. + */ + deleteToBeginningOfWord(): void; + + /** + * Removes from the beginning of the line which the selection begins on all + * the way through to the end of the selection. + */ + deleteToBeginningOfLine(): void; + + /** + * Removes the selection or the next character after the start of the selection + * if the selection is empty. + */ + delete(): void; + + /** + * If the selection is empty, removes all text from the cursor to the end of + * the line. If the cursor is already at the end of the line, it removes the following + * newline. If the selection isn't empty, only deletes the contents of the selection. + */ + deleteToEndOfLine(): void; + + /** + * Removes the selection or all characters from the start of the selection to + * the end of the current word if nothing is selected. + */ + deleteToEndOfWord(): void; + + /** + * Removes the selection or all characters from the start of the selection to + * the end of the current word if nothing is selected. + */ + deleteToBeginningOfSubword(): void; + + /** + * Removes the selection or all characters from the start of the selection to + * the end of the current word if nothing is selected. + */ + deleteToEndOfSubword(): void; + + /** Removes only the selected text. */ + deleteSelectedText(): void; + + /** + * Removes the line at the beginning of the selection if the selection is empty + * unless the selection spans multiple lines in which case all lines are removed. + */ + deleteLine(): void; + + /** + * Joins the current line with the one below it. Lines will be separated by a single space. + * If there selection spans more than one line, all the lines are joined together. + */ + joinLines(): void; + + /** Removes one level of indent from the currently selected rows. */ + outdentSelectedRows(): void; + + /** + * Sets the indentation level of all selected rows to values suggested by the + * relevant grammars. + */ + autoIndentSelectedRows(): void; + + /** + * Wraps the selected lines in comments if they aren't currently part of a comment. + * Removes the comment if they are currently wrapped in a comment. + */ + toggleLineComments(): void; + + /** Cuts the selection until the end of the screen line. */ + cutToEndOfLine(): void; + + /** Cuts the selection until the end of the buffer line. */ + cutToEndOfBufferLine(): void; + + /** Copies the selection to the clipboard and then deletes it. */ + cut(maintainClipboard?: boolean, fullLine?: boolean): void; + + /** Copies the current selection to the clipboard. */ + copy(maintainClipboard?: boolean, fullLine?: boolean): void; + + /** Creates a fold containing the current selection. */ + fold(): void; + + /** If the selection spans multiple rows, indent all of them. */ + indentSelectedRows(): void; + + // Managing multiple selections + /** Moves the selection down one row. */ + addSelectionBelow(): void; + + /** Moves the selection up one row. */ + addSelectionAbove(): void; + + /** + * Combines the given selection into this selection and then destroys the + * given selection. + */ + merge(otherSelection: Selection, options?: { preserveFolds?: boolean, + autoscroll?: boolean }): void; + + // Comparing to other selections + /** + * Compare this selection's buffer range to another selection's buffer range. + * See Range::compare for more details. + */ + compare(otherSelection: Selection): number; +} + +/** + * A singleton instance of this class available via atom.styles, which you can + * use to globally query and observe the set of active style sheets. + */ +export interface StyleManager { + // Event Subscription + /** Invoke callback for all current and future style elements. */ + observeStyleElements(callback: (styleElement: StyleElementObservedEvent) => + void): Disposable; + + /** Invoke callback when a style element is added. */ + onDidAddStyleElement(callback: (styleElement: StyleElementObservedEvent) => + void): Disposable; + + /** Invoke callback when a style element is removed. */ + onDidRemoveStyleElement(callback: (styleElement: HTMLStyleElement) => void): Disposable; + + /** Invoke callback when an existing style element is updated. */ + onDidUpdateStyleElement(callback: (styleElement: StyleElementObservedEvent) => + void): Disposable; + + // Reading Style Elements + /** Get all loaded style elements. */ + getStyleElements(): HTMLStyleElement[]; + + // Paths + /** Get the path of the user style sheet in ~/.atom. */ + getUserStyleSheetPath(): string; +} + +/** Run a node script in a separate process. */ +export class Task { + // NOTE: this is actually the best we can do here with the REST parameter for + // this appearing in the middle of the parameter list, which isn't aligned with + // the ES6 spec. Maybe when they rewrite it in JavaScript this will change. + /** A helper method to easily launch and run a task once. */ + // tslint:disable-next-line:no-any + static once(taskPath: string, ...args: any[]): Task; + + /** Creates a task. You should probably use .once */ + constructor(taskPath: string); + + // NOTE: this is actually the best we can do here with the REST parameter + // for this appearing in the beginning of the parameter list, which isn't + // aligned with the ES6 spec. + /** + * Starts the task. + * Throws an error if this task has already been terminated or if sending a + * message to the child process fails. + */ + // tslint:disable-next-line:no-any + start(...args: any[]): void; + + /** + * Send message to the task. + * Throws an error if this task has already been terminated or if sending a + * message to the child process fails. + */ + send(message: string): void; + + /** Call a function when an event is emitted by the child process. */ + // tslint:disable-next-line:no-any + on(eventName: string, callback: (param: any) => void): Disposable; + + /** + * Forcefully stop the running task. + * No more events are emitted once this method is called. + */ + terminate(): void; + + /** Cancel the running task and emit an event if it was canceled. */ + cancel(): boolean; +} + +/** + * A mutable text container with undo/redo support and the ability to + * annotate logical regions in the text. + */ +export class TextBuffer { + /** The unique identifier for this buffer. */ + id: string; + + /** The number of retainers for the buffer. */ + refcount: number; + + /** Whether or not the bufffer has been destroyed. */ + destroyed: boolean; + + /** Create a new buffer backed by the given file path. */ + static load(filePath: string, params?: BufferLoadOptions): Promise; + + /** + * Create a new buffer backed by the given file path. For better performance, + * use TextBuffer.load instead. + */ + static loadSync(filePath: string, params?: BufferLoadOptions): TextBuffer; + + /** + * Restore a TextBuffer based on an earlier state created using the + * TextBuffer::serialize method. + */ + static deserialize(params: object): Promise; + + /** Create a new buffer with the given starting text. */ + constructor(text: string); + /** Create a new buffer with the given params. */ + constructor(params?: { + /** The initial string text of the buffer. */ + text?: string + /** + * A function that returns a Boolean indicating whether the buffer should + * be destroyed if its file is deleted. + */ + shouldDestroyOnFileDelete?(): boolean + }); + + /** Returns a plain javascript object representation of the TextBuffer. */ + serialize(options?: { markerLayers?: boolean, history?: boolean }): object; + + /** Returns the unique identifier for this buffer. */ + getId(): string; + + // Event Subscription + /** + * Invoke the given callback synchronously before the content of the buffer + * changes. + */ + onWillChange(callback: (event: BufferChangingEvent) => void): Disposable; + + /** + * Invoke the given callback synchronously when the content of the buffer + * changes. You should probably not be using this in packages. + */ + onDidChange(callback: (event: BufferChangedEvent) => void): Disposable; + + /** + * Invoke the given callback synchronously when a transaction finishes with + * a list of all the changes in the transaction. + */ + onDidChangeText(callback: (event: BufferStoppedChangingEvent) => void): Disposable; + + /** + * Invoke the given callback asynchronously following one or more changes after + * ::getStoppedChangingDelay milliseconds elapse without an additional change. + */ + onDidStopChanging(callback: (event: BufferStoppedChangingEvent) => void): + Disposable; + + /** + * Invoke the given callback when the in-memory contents of the buffer become + * in conflict with the contents of the file on disk. + */ + onDidConflict(callback: () => void): Disposable; + + /** Invoke the given callback if the value of ::isModified changes. */ + onDidChangeModified(callback: (modified: boolean) => void): Disposable; + + /** + * Invoke the given callback when all marker ::onDidChange observers have been + * notified following a change to the buffer. + */ + onDidUpdateMarkers(callback: () => void): Disposable; + + onDidCreateMarker(callback: (marker: Marker) => void): Disposable; + + /** Invoke the given callback when the value of ::getPath changes. */ + onDidChangePath(callback: (path: string) => void): Disposable; + + /** Invoke the given callback when the value of ::getEncoding changes. */ + onDidChangeEncoding(callback: (encoding: string) => void): Disposable; + + /** + * Invoke the given callback before the buffer is saved to disk. If the + * given callback returns a promise, then the buffer will not be saved until + * the promise resolves. + */ + onWillSave(callback: () => Promise|void): Disposable; + + /** Invoke the given callback after the buffer is saved to disk. */ + onDidSave(callback: (event: FileSavedEvent) => void): Disposable; + + /** Invoke the given callback after the file backing the buffer is deleted. */ + onDidDelete(callback: () => void): Disposable; + + /** + * Invoke the given callback before the buffer is reloaded from the contents + * of its file on disk. + */ + onWillReload(callback: () => void): Disposable; + + /** + * Invoke the given callback after the buffer is reloaded from the contents + * of its file on disk. + */ + onDidReload(callback: () => void): Disposable; + + /** Invoke the given callback when the buffer is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Invoke the given callback when there is an error in watching the file. */ + onWillThrowWatchError(callback: (errorObject: HandleableErrorEvent) => void): + Disposable; + + /** + * Get the number of milliseconds that will elapse without a change before + * ::onDidStopChanging observers are invoked following a change. + */ + getStoppedChangingDelay(): number; + + // File Details + /** + * Determine if the in-memory contents of the buffer differ from its contents + * on disk. + * If the buffer is unsaved, always returns true unless the buffer is empty. + */ + isModified(): boolean; + + /** + * Determine if the in-memory contents of the buffer conflict with the on-disk + * contents of its associated file. + */ + isInConflict(): boolean; + + /** Get the path of the associated file. */ + getPath(): string|undefined; + + /** Set the path for the buffer's associated file. */ + setPath(filePath: string): void; + + /** Sets the character set encoding for this buffer. */ + setEncoding(encoding: string): void; + + /** Returns the string encoding of this buffer. */ + getEncoding(): string; + + /** Get the path of the associated file. */ + getUri(): string; + + // Reading Text + /** Determine whether the buffer is empty. */ + isEmpty(): boolean; + + /** Get the entire text of the buffer. */ + getText(): string; + + /** Get the text in a range. */ + getTextInRange(range: RangeCompatible): string; + + /** Get the text of all lines in the buffer, without their line endings. */ + getLines(): string[]; + + /** Get the text of the last line of the buffer, without its line ending. */ + getLastLine(): string; + + /** Get the text of the line at the given row, without its line ending. */ + lineForRow(row: number): string|undefined; + + /** Get the line ending for the given 0-indexed row. */ + lineEndingForRow(row: number): string|undefined; + + /** + * Get the length of the line for the given 0-indexed row, without its line + * ending. + */ + lineLengthForRow(row: number): number; + + /** Determine if the given row contains only whitespace. */ + isRowBlank(row: number): boolean; + + /** + * Given a row, find the first preceding row that's not blank. + * Returns a number or null if there's no preceding non-blank row. + */ + previousNonBlankRow(startRow: number): number|null; + + /** + * Given a row, find the next row that's not blank. + * Returns a number or null if there's no next non-blank row. + */ + nextNonBlankRow(startRow: number): number|null; + + // Mutating Text + /** Replace the entire contents of the buffer with the given text. */ + setText(text: string): Range; + + /** + * Replace the current buffer contents by applying a diff based on the + * given text. + */ + setTextViaDiff(text: string): void; + + /** Set the text in the given range. */ + setTextInRange(range: RangeCompatible, text: string, options?: + { normalizeLineEndings?: boolean, undo?: "skip" }): Range; + + /** Insert text at the given position. */ + insert(position: PointCompatible, text: string, options?: + { normalizeLineEndings?: boolean, undo?: "skip" }): Range; + + /** Append text to the end of the buffer. */ + append(text: string, options?: { normalizeLineEndings?: boolean, undo?: + "skip" }): Range; + + /** Delete the text in the given range. */ + delete(range: RangeCompatible): Range; + + /** Delete the line associated with a specified row. */ + deleteRow(row: number): Range; + + /** Delete the lines associated with the specified row range. */ + deleteRows(startRow: number, endRow: number): Range; + + // Markers + /** Create a layer to contain a set of related markers. */ + addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean }): + MarkerLayer; + + /** + * Get a MarkerLayer by id. + * Returns a MarkerLayer or `` if no layer exists with the given id. + */ + getMarkerLayer(id: string): MarkerLayer|undefined; + + /** Get the default MarkerLayer. */ + getDefaultMarkerLayer(): MarkerLayer; + + /** Create a marker with the given range in the default marker layer. */ + markRange(range: RangeCompatible, properties?: { reversed?: boolean, + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + exclusive?: boolean }): Marker; + + /** Create a marker at the given position with no tail in the default marker layer. */ + markPosition(position: PointCompatible, options?: { invalidate?: "never"|"surround" + |"overlap"|"inside"|"touch", exclusive?: boolean }): Marker; + + /** Get all existing markers on the default marker layer. */ + getMarkers(): Marker[]; + + /** Get an existing marker by its id from the default marker layer. */ + getMarker(id: number): Marker; + + /** Find markers conforming to the given parameters in the default marker layer. */ + findMarkers(params: FindMarkerOptions): Marker[]; + + /** Get the number of markers in the default marker layer. */ + getMarkerCount(): number; + + // History + /** Undo the last operation. If a transaction is in progress, aborts it. */ + undo(): boolean; + + /** Redo the last operation. */ + redo(): boolean; + + /** Batch multiple operations as a single undo/redo step. */ + transact(groupingInterval: number, fn: () => T): T; + transact(fn: () => T): T; + + /** + * Call within a transaction to terminate the function's execution and + * revert any changes performed up to the abortion. + */ + abortTransaction(): void; + + /** + * Clear the undo stack. When calling this method within a transaction, + * the ::onDidChangeText event will not be triggered because the information + * describing the changes is lost. + */ + clearUndoStack(): void; + + /** + * Create a pointer to the current state of the buffer for use with + * ::revertToCheckpoint and ::groupChangesSinceCheckpoint. + */ + createCheckpoint(): number; + + /** + * Revert the buffer to the state it was in when the given checkpoint was created. + * Returns a boolean indicating whether the operation succeeded. + */ + revertToCheckpoint(checkpoint: number): boolean; + + /** + * Group all changes since the given checkpoint into a single transaction for + * purposes of undo/redo. + * Returns a boolean indicating whether the operation succeeded. + */ + groupChangesSinceCheckpoint(checkpoint: number): boolean; + + /** + * Returns a list of changes since the given checkpoint. + * If the given checkpoint is no longer present in the undo history, this method + * will return an empty Array. + */ + getChangesSinceCheckpoint(checkpoint: number): Array<{ + /** A Point representing where the change started. */ + start: Point, + + /** A Point representing the replaced extent. */ + oldExtent: Point, + + /** A Point representing the replacement extent. */ + newExtent: Point, + + /** A String representing the replacement text. */ + newText: string + }>; + + // Search and Replace + /** + * Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + */ + scan(regex: RegExp, iterator: (params: BufferScanResult) => void): void; + /** + * Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + */ + scan(regex: RegExp, options: ScanContextOptions, iterator: (params: + ContextualBufferScanResult) => void): void; + + /** + * Scan regular expression matches in the entire buffer in reverse order, + * calling the given iterator function on each match. + */ + backwardsScan(regex: RegExp, iterator: (params: BufferScanResult) => void): void; + /** + * Scan regular expression matches in the entire buffer in reverse order, + * calling the given iterator function on each match. + */ + backwardsScan(regex: RegExp, options: ScanContextOptions, iterator: (params: + ContextualBufferScanResult) => void): void; + + /** + * Scan regular expression matches in a given range , calling the given + * iterator function on each match. + */ + scanInRange(regex: RegExp, range: RangeCompatible, iterator: + (params: BufferScanResult) => void): void; + /** + * Scan regular expression matches in a given range , calling the given + * iterator function on each match. + */ + scanInRange(regex: RegExp, range: RangeCompatible, options: ScanContextOptions, + iterator: (params: ContextualBufferScanResult) => void): void; + + /** + * Scan regular expression matches in a given range in reverse order, + * calling the given iterator function on each match. + */ + backwardsScanInRange(regex: RegExp, range: RangeCompatible, iterator: + (params: BufferScanResult) => void): void; + /** + * Scan regular expression matches in a given range in reverse order, + * calling the given iterator function on each match. + */ + backwardsScanInRange(regex: RegExp, range: RangeCompatible, options: ScanContextOptions, + iterator: (params: ContextualBufferScanResult) => void): void; + + /** Replace all regular expression matches in the entire buffer. */ + replace(regex: RegExp, replacementText: string): number; + + // Buffer Range Details + /** Get the range spanning from [0, 0] to ::getEndPosition. */ + getRange(): Range; + + /** Get the number of lines in the buffer. */ + getLineCount(): number; + + /** Get the last 0-indexed row in the buffer. */ + getLastRow(): number; + + /** Get the first position in the buffer, which is always [0, 0]. */ + getFirstPosition(): Point; + + /** Get the maximal position in the buffer, where new text would be appended. */ + getEndPosition(): Point; + + /** Get the length of the buffer in characters. */ + getMaxCharacterIndex(): number; + + /** Get the range for the given row. */ + rangeForRow(row: number, includeNewline: boolean): Range; + + /** + * Convert a position in the buffer in row/column coordinates to an absolute + * character offset, inclusive of line ending characters. + */ + characterIndexForPosition(position: Point|[number, number]): number; + + /** + * Convert an absolute character offset, inclusive of newlines, to a position + * in the buffer in row/column coordinates. + */ + positionForCharacterIndex(offset: number): Point; + + /** Clip the given range so it starts and ends at valid positions. */ + clipRange(range: RangeCompatible): Range; + + /** Clip the given point so it is at a valid position in the buffer. */ + clipPosition(position: PointCompatible): Point; + + // Buffer Operations + /** Save the buffer. */ + save(): Promise; + + /** Save the buffer at a specific path. */ + saveAs(filePath: string): Promise; + + /** Reload the buffer's contents from disk. */ + reload(): void; + + /** Destroy the buffer, even if there are retainers for it. */ + destroy(): void; + + /** Returns whether or not this buffer is alive. */ + isAlive(): boolean; + + /** Returns whether or not this buffer has been destroyed. */ + isDestroyed(): boolean; + + /** Returns whether or not this buffer has a retainer. */ + isRetained(): boolean; + + /** + * Places a retainer on the buffer, preventing its destruction until the + * final retainer has called ::release(). + */ + retain(): TextBuffer; + + /** + * Releases a retainer on the buffer, destroying the buffer if there are + * no additional retainers. + */ + release(): TextBuffer; + + /** Identifies if the buffer belongs to multiple editors. */ + hasMultipleEditors(): boolean; +} + +/** Handles loading and activating available themes. */ +export interface ThemeManager { + // Event Subscription + /** + * Invoke callback when style sheet changes associated with updating the + * list of active themes have completed. + */ + onDidChangeActiveThemes(callback: () => void): Disposable; + + // Accessing Loaded Themes + /** Returns an Array of strings of all the loaded theme names. */ + getLoadedThemeNames(): string[]|undefined; + + /** Returns an Array of all the loaded themes. */ + getLoadedThemes(): Package[]|undefined; + + // Accessing Active Themes + /** Returns an Array of strings all the active theme names. */ + getActiveThemeNames(): string[]|undefined; + + /** Returns an Array of all the active themes. */ + getActiveThemes(): Package[]|undefined; + + // Managing Enabled Themes + /** Get the enabled theme names from the config. */ + getEnabledThemeNames(): string[]; +} + +// Events ===================================================================== +// The event objects that are passed into the callbacks which the user provides to +// specific API calls. + +export interface AddedKeystrokeResolverEvent { + /** + * The currently resolved keystroke string. If your function returns a falsy + * value, this is how Atom will resolve your keystroke. + */ + keystroke: string; + + /** + * The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation + * for more details. + */ + event: KeyboardEvent; + + /** The OS-specific name of the current keyboard layout. */ + layoutName: string; + + /** + * An object mapping DOM 3 `KeyboardEvent.code` values to objects with the + * typed character for that key in each modifier state, based on the current + * operating system layout. + */ + keymap: object; +} + +export interface BufferChangingEvent { + /** Range of the old text. */ + oldRange: Range; +} + +export interface BufferChangedEvent { + /** + * An array of objects summarizing the aggregated changes that occurred + * during the transaction. + */ + changes: Array<{ + /** + * The Range of the deleted text in the contents of the buffer as it existed + * before the batch of changes reported by this event. + */ + oldRange: Range; + + /** The Range of the inserted text in the current contents of the buffer. */ + newRange: Range; + }>; + + /** Range of the old text. */ + oldRange: Range; + + /** Range of the new text. */ + newRange: Range; + + /** String containing the text that was replaced. */ + oldText: string; + + /** String containing the text that was inserted. */ + newText: string; +} + +export interface BufferStoppedChangingEvent { + changes: TextChange[]; +} + +/** + * This custom subclass of CustomEvent exists to provide the ::abortKeyBinding + * method, as well as versions of the ::stopPropagation methods that record the + * intent to stop propagation so event bubbling can be properly simulated for + * detached elements. + */ +export interface CommandEvent extends CustomEvent { + keyBindingAborted: boolean; + propagationStopped: boolean; + + abortKeyBinding(): void; + stopPropagation(): CustomEvent; + stopImmediatePropagation(): CustomEvent; + currentTarget: CurrentTarget; +} + +export interface CursorPositionChangedEvent { + oldBufferPosition: Point; + oldScreenPosition: Point; + newBufferPosition: Point; + newScreenPosition: Point; + textChanged: boolean; + cursor: Cursor; +} + +export interface DecorationPropsChangedEvent { + /** Object the old parameters the decoration used to have. */ + oldProperties: DecorationOptions; + + /** Object the new parameters the decoration now has */ + newProperties: DecorationOptions; +} + +export interface DisplayMarkerChangedEvent { + /** Point representing the former head buffer position. */ + oldHeadBufferPosition: Point; + + /** Point representing the new head buffer position. */ + newHeadBufferPosition: Point; + + // Point representing the former tail buffer position. */ + oldTailBufferPosition: Point; + + /** Point representing the new tail buffer position. */ + newTailBufferPosition: Point; + + /** Point representing the former head screen position. */ + oldHeadScreenPosition: Point; + + /** Point representing the new head screen position. */ + newHeadScreenPosition: Point; + + /** Point representing the former tail screen position. */ + oldTailScreenPosition: Point; + + /** Point representing the new tail screen position. */ + newTailScreenPosition: Point; + + /** Boolean indicating whether the marker was valid before the change. */ + wasValid: boolean; + + /** Boolean indicating whether the marker is now valid. */ + isValid: boolean; + + /** Boolean indicating whether the marker had a tail before the change. */ + hadTail: boolean; + + /** Boolean indicating whether the marker now has a tail */ + hasTail: boolean; + + /** + * -DEPRECATED- Object containing the marker's custom properties before the change. + * @deprecated + */ + oldProperties: object; + + /** + * -DEPRECATED- Object containing the marker's custom properties after the change. + * @deprecated + */ + newProperties: object; + + /** + * Boolean indicating whether this change was caused by a textual change to the + * buffer or whether the marker was manipulated directly via its public API. + */ + textChanged: boolean; +} + +export interface EditorChangedEvent { + /** A Point representing where the change started. */ + start: Point; + + /** A Point representing the replaced extent. */ + oldExtent: Point; + + /** A Point representing the replacement extent. */ + newExtent: Point; +} + +export interface ExceptionThrownEvent { + originalError: Error; + message: string; + url: string; + line: number; + column: number; +} + +export interface FailedKeybindingMatchEvent { + /** The string of keystrokes that failed to match the binding. */ + keystrokes: string; + + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; +} + +export interface FailedKeymapFileReadEvent { + /** The error message. */ + message: string; + + /** The error stack trace. */ + stack: string; +} + +export interface FileSavedEvent { + /** The path to which the buffer was saved. */ + path: string; +} + +export type FilesystemChangeEvent = Array<{ + /** A string describing the filesystem action that occurred. */ + action: "created"|"modified"|"deleted"|"renamed"; + + /** The absolute path to the filesystem entry that was acted upon. */ + path: string; + + /** + * For rename events, a string containing the filesystem entry's former + * absolute path. + */ + oldPath?: string; +}>; + +export interface FullKeybindingMatchEvent { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; + + /** The KeyBinding that the keystrokes matched. */ + binding: KeyBinding; + + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; +} + +export interface HandleableErrorEvent { + /** The error object. */ + error: Error; + + /** + * Call this function to indicate you have handled the error. + * The error will not be thrown if this function is called. + */ + handle(): void; +} + +export interface KeymapLoadedEvent { + /** The path of the keymap file. */ + path: string; +} + +export interface MarkerChangedEvent { + /** Point representing the former head position. */ + oldHeadPosition: Point; + + /** Point representing the new head position. */ + newHeadPosition: Point; + + /** Point representing the former tail position. */ + oldTailPosition: Point; + + /** Point representing the new tail position. */ + newTailPosition: Point; + + /** Boolean indicating whether the marker was valid before the change. */ + wasValid: boolean; + + /** Boolean indicating whether the marker is now valid. */ + isValid: boolean; + + /** Boolean indicating whether the marker had a tail before the change. */ + hadTail: boolean; + + /** Boolean indicating whether the marker now has a tail. */ + hasTail: boolean; + + /** + * -DEPRECATED- Object containing the marker's custom properties before the change. + * @deprecated + */ + oldProperties: object; + + /** + * -DEPRECATED- Object containing the marker's custom properties after the change. + * @deprecated + */ + newProperties: object; + + /** + * Boolean indicating whether this change was caused by a textual + * change to the buffer or whether the marker was manipulated directly + * via its public API. + */ + textChanged: boolean; +} + +export interface PaneItemObservedEvent { + item: object; + pane: Pane; + index: number; +} + +export interface PaneListItemShiftedEvent { + /** The pane item that was added or removed. */ + item: object; + + /** A number indicating where the item is located. */ + index: number; +} + +export interface PaneItemMovedEvent { + /** The removed pane item. */ + item: object; + + /** A number indicating where the item was located. */ + oldIndex: number; + + /** A number indicating where the item is now located. */ + newIndex: number; +} + +export interface PaneItemOpenedEvent extends PaneItemObservedEvent { + uri: string; +} + +export interface PartialKeybindingMatchEvent { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; + + /** The KeyBindings that the keystrokes partially matched. */ + partiallyMatchedBindings: KeyBinding[]; + + /** DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; +} + +export interface PathWatchErrorThrownEvent { + /** The error object. */ + error: Error; + + /** + * Call this function to indicate you have handled the error. + * The error will not be thrown if this function is called. + */ + handle(): void; +} + +export interface PreventableExceptionThrownEvent extends ExceptionThrownEvent { + preventDefault(): void; +} + +export interface RepoStatusChangedEvent { + path: string; + + /** + * This value can be passed to ::isStatusModified or ::isStatusNew to get more + * information. + */ + pathStatus: number; +} + +export interface SelectionChangedEvent { + oldBufferRange: Range; + oldScreenRange: Range; + newBufferRange: Range; + newScreenRange: Range; + selection: Selection; +} + +export interface StyleElementObservedEvent extends HTMLStyleElement { + sourcePath: string; + context: string; +} + +export interface TextEditorObservedEvent { + textEditor: TextEditor; + pane: Pane; + index: number; +} + +// Extendables ================================================================ +// Interfaces which can be augmented in order to provide additional type +// information under certain contexts. + +// NOTE: the config schema with these defaults can be found here: +// https://github.com/atom/atom/blob/v1.23.0/src/config-schema.js +/** + * Allows you to strongly type Atom configuration variables. Additional key:value + * pairings merged into this interface will result in configuration values under + * the value of each key being templated by the type of the associated value. + */ +export interface ConfigValues { + /** + * List of glob patterns. Files and directories matching these patterns will be + * ignored by some packages, such as the fuzzy finder and tree view. Individual + * packages might have additional config settings for ignoring names. + */ + "core.ignoredNames": string[]; + + /** + * Files and directories ignored by the current project's VCS system will be ignored + * by some packages, such as the fuzzy finder and find and replace. For example, + * projects using Git have these paths defined in the .gitignore file. Individual + * packages might have additional config settings for ignoring VCS ignored files and + * folders. + */ + "core.excludeVcsIgnoredPaths": boolean; + + /** + * Follow symbolic links when searching files and when opening files with the fuzzy + * finder. + */ + "core.followSymlinks": boolean; + + /** List of names of installed packages which are not loaded at startup. */ + "core.disabledPackages": string[]; + + /** List of names of installed packages which are not automatically updated. */ + "core.versionPinnedPackages": string[]; + + /** + * Associates scope names (e.g. "source.coffee") with arrays of file extensions + * and file names (e.g. ["Cakefile", ".coffee2"]). + */ + "core.customFileTypes": { + [key: string]: string[]; + }; + + /** Names of UI and syntax themes which will be used when Atom starts. */ + "core.themes": string[]; + + /** + * Trigger the system's beep sound when certain actions cannot be executed or + * there are no results. + */ + "core.audioBeep": boolean; + + /** Close corresponding editors when a file is deleted outside Atom. */ + "core.closeDeletedFileTabs": boolean; + + /** When the last tab of a pane is closed, remove that pane as well. */ + "core.destroyEmptyPanes": boolean; + + /** + * When a window with no open tabs or panes is given the 'Close Tab' command, + * close that window. + */ + "core.closeEmptyWindows": boolean; + + /** Default character set encoding to use when reading and writing files. */ + "core.fileEncoding": FileEncoding; + + /** + * When checked opens an untitled editor when loading a blank environment (such as + * with 'File > New Window' or when "Restore Previous Windows On Start" is unchecked); + * otherwise, no editor is opened when loading a blank environment. + * This setting has no effect when restoring a previous state. + */ + "core.openEmptyEditorOnStart": boolean; + + /** + * When selected 'no', a blank environment is loaded. When selected 'yes' and Atom + * is started from the icon or `atom` by itself from the command line, restores the + * last state of all Atom windows; otherwise a blank environment is loaded. When + * selected 'always', restores the last state of all Atom windows always, no matter + * how Atom is started. + */ + "core.restorePreviousWindowsOnStart": "no"|"yes"|"always"; + + /** How many recent projects to show in the Reopen Project menu. */ + "core.reopenProjectMenuCount": number; + + /** Automatically update Atom when a new release is available. */ + "core.automaticallyUpdate": boolean; + + /** Use detected proxy settings when calling the `apm` command-line tool. */ + "core.useProxySettingsWhenCallingApm": boolean; + + /** + * Allow items to be previewed without adding them to a pane permanently, such as + * when single clicking files in the tree view. + */ + "core.allowPendingPaneItems": boolean; + + /** + * Allow usage statistics and exception reports to be sent to the Atom team to help + * improve the product. + */ + "core.telemetryConsent": "limited"|"no"|"undecided"; + + /** Warn before opening files larger than this number of megabytes. */ + "core.warnOnLargeFileLimit": number; + + /** + * Choose the underlying implementation used to watch for filesystem changes. Emulating + * changes will miss any events caused by applications other than Atom, but may help + * prevent crashes or freezes. + */ + "core.fileSystemWatcher": "native"|"atom"; + + "editor.commentStart": string|null; + + "editor.commentEnd": string|null; + + "editor.increaseIndentPattern": string|null; + + "editor.decreaseIndentPattern": string|null; + + "editor.foldEndPattern": string|null; + + /** The name of the font family used for editor text. */ + "editor.fontFamily": string; + + /** Height in pixels of editor text. */ + "editor.fontSize": number; + + /** Height of editor lines, as a multiplier of font size. */ + "editor.lineHeight": string|number; + + /** Show cursor while there is a selection. */ + "editor.showCursorOnSelection": boolean; + + /** Render placeholders for invisible characters, such as tabs, spaces and newlines. */ + "editor.showInvisibles": boolean; + + /** Show indentation indicators in the editor. */ + "editor.showIndentGuide": boolean; + + /** Show line numbers in the editor's gutter. */ + "editor.showLineNumbers": boolean; + + /** Skip over tab-length runs of leading whitespace when moving the cursor. */ + "editor.atomicSoftTabs": boolean; + + /** Automatically indent the cursor when inserting a newline. */ + "editor.autoIndent": boolean; + + /** Automatically indent pasted text based on the indentation of the previous line. */ + "editor.autoIndentOnPaste": boolean; + + /** A string of non-word characters to define word boundaries. */ + "editor.nonWordCharacters": string; + + /** + * Identifies the length of a line which is used when wrapping text with the + * `Soft Wrap At Preferred Line Length` setting enabled, in number of characters. + */ + "editor.preferredLineLength": number; + + /** + * Defines the maximum width of the editor window before soft wrapping is enforced, + * in number of characters. + */ + "editor.maxScreenLineLength": number; + + /** Number of spaces used to represent a tab. */ + "editor.tabLength": number; + + /** + * Wraps lines that exceed the width of the window. When `Soft Wrap At Preferred + * Line Length` is set, it will wrap to the number of characters defined by the + * `Preferred Line Length` setting. + */ + "editor.softWrap": boolean; + + /** + * If the `Tab Type` config setting is set to "auto" and autodetection of tab type + * from buffer content fails, then this config setting determines whether a soft tab + * or a hard tab will be inserted when the Tab key is pressed. + */ + "editor.softTabs": boolean; + + /** + * Determine character inserted when Tab key is pressed. Possible values: "auto", + * "soft" and "hard". When set to "soft" or "hard", soft tabs (spaces) or hard tabs + * (tab characters) are used. When set to "auto", the editor auto-detects the tab + * type based on the contents of the buffer (it uses the first leading whitespace + * on a non-comment line), or uses the value of the Soft Tabs config setting if + * auto-detection fails. + */ + "editor.tabType": "auto"|"soft"|"hard"; + + /** + * Instead of wrapping lines to the window's width, wrap lines to the number of + * characters defined by the `Preferred Line Length` setting. This will only take + * effect when the soft wrap config setting is enabled globally or for the current + * language. + * **Note:** If you want to hide the wrap guide (the vertical line) you can disable + * the `wrap-guide` package. + */ + "editor.softWrapAtPreferredLineLength": boolean; + + /** + * When soft wrap is enabled, defines length of additional indentation applied to + * wrapped lines, in number of characters. + */ + "editor.softWrapHangingIndent": number; + + /** Determines how fast the editor scrolls when using a mouse or trackpad. */ + "editor.scrollSensitivity": number; + + /** Allow the editor to be scrolled past the end of the last line. */ + "editor.scrollPastEnd": boolean; + + /** + * Time interval in milliseconds within which text editing operations will be + * grouped together in the undo history. + */ + "editor.undoGroupingInterval": number; + + /** + * Show confirmation dialog when checking out the HEAD revision and discarding + * changes to current file since last commit. + */ + "editor.confirmCheckoutHeadRevision": boolean; + + /** + * A hash of characters Atom will use to render whitespace characters. Keys are + * whitespace character types, values are rendered characters (use value false to + * turn off individual whitespace character types). + */ + "editor.invisibles": Invisibles; + + /** + * Change the editor font size when pressing the Ctrl key and scrolling the mouse + * up/down. + */ + "editor.zoomFontWhenCtrlScrolling": boolean; + + // tslint:disable-next-line:no-any + [key: string]: any; +} + +// Options ==================================================================== +// The option objects that the user is expected to fill out and provide to +// specific API call. + +export interface BufferLoadOptions { + /** The file's encoding. */ + encoding?: string; + + /** + * A function that returns a boolean indicating whether the buffer should + * be destroyed if its file is deleted. + */ + shouldDestroyOnFileDelete?(): boolean; +} + +export interface BuildEnvironmentOptions { + /** + * An object responsible for Atom's interaction with the browser process and host OS. + * Use buildDefaultApplicationDelegate for a default instance. + */ + applicationDelegate?: object; + + /** A window global. */ + window?: Window; + + /** A document global. */ + document?: Document; + + /** A path to the configuration directory (usually ~/.atom). */ + configDirPath?: string; + + /** + * A boolean indicating whether the Atom environment should save or load state + * from the file system. You probably want this to be false. + */ + enablePersistence?: boolean; +} + +export interface ContextMenuOptions { + /** The menu item's label. */ + label?: string; + + /** + * The command to invoke on the target of the right click that invoked the + * context menu. + */ + command?: string; + + /** + * Whether the menu item should be clickable. Disabled menu items typically + * appear grayed out. Defaults to true. + */ + enabled?: boolean; + + /** An array of additional items. */ + submenu?: ReadonlyArray; + + /** + * If you want to create a separator, provide an item with type: 'separator' + * and no other keys. + */ + type?: "separator"; + + /** Whether the menu item should appear in the menu. Defaults to true. */ + visible?: boolean; + + /** + * A function that is called on the item each time a context menu is created + * via a right click. + */ + created?(event: Event): void; + + /** + * A function that is called to determine whether to display this item on a + * given context menu deployment. + */ + shouldDisplay?(event: Event): void; +} + +export interface CopyMarkerOptions { + /** Whether or not the marker should be tailed. */ + tailed?: boolean; + + /** Creates the marker in a reversed orientation. */ + reversed?: boolean; + + /** Determines the rules by which changes to the buffer invalidate the marker. */ + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch"; + + /** + * Indicates whether insertions at the start or end of the marked range should + * be interpreted as happening outside the marker. + */ + exclusive?: boolean; + + /** -DEPRECATED- Custom properties to be associated with the marker. */ + properties?: object; +} + +export interface DecorationLayerOptions extends SharedDecorationOptions { + /** One of several supported decoration types. */ + type?: "line"|"line-number"|"highlight"|"block"; +} + +export interface DecorationOptions extends SharedDecorationOptions { + /** One of several supported decoration types. */ + type?: "line"|"line-number"|"highlight"|"overlay"|"gutter"|"block"; + + /** The name of the gutter we're decorating, if type is "gutter". */ + gutterName?: string; +} + +export interface ErrorNotificationOptions extends NotificationOptions { + stack?: string; +} + +export interface FindDisplayMarkerOptions { + /** Only include markers starting at this Point in buffer coordinates. */ + startBufferPosition?: PointCompatible; + + /** Only include markers ending at this Point in buffer coordinates. */ + endBufferPosition?: PointCompatible; + + /** Only include markers starting at this Point in screen coordinates. */ + startScreenPosition?: PointCompatible; + + /** Only include markers ending at this Point in screen coordinates. */ + endScreenPosition?: PointCompatible; + + /** Only include markers starting inside this Range in buffer coordinates. */ + startsInBufferRange?: RangeCompatible; + + /** Only include markers ending inside this Range in buffer coordinates. */ + endsInBufferRange?: RangeCompatible; + + /** Only include markers starting inside this Range in screen coordinates. */ + startsInScreenRange?: RangeCompatible; + + /** Only include markers ending inside this Range in screen coordinates. */ + endsInScreenRange?: RangeCompatible; + + /** Only include markers starting at this row in buffer coordinates. */ + startBufferRow?: number; + + /** Only include markers ending at this row in buffer coordinates. */ + endBufferRow?: number; + + /** Only include markers starting at this row in screen coordinates. */ + startScreenRow?: number; + + /** Only include markers ending at this row in screen coordinates. */ + endScreenRow?: number; + + /** + * Only include markers intersecting this Array of [startRow, endRow] in + * buffer coordinates. + */ + intersectsBufferRowRange?: [number, number]; + + /** + * Only include markers intersecting this Array of [startRow, endRow] in + * screen coordinates. + */ + intersectsScreenRowRange?: [number, number]; + + /** Only include markers containing this Range in buffer coordinates. */ + containsBufferRange?: RangeCompatible; + + /** Only include markers containing this Point in buffer coordinates. */ + containsBufferPosition?: PointCompatible; + + /** Only include markers contained in this Range in buffer coordinates. */ + containedInBufferRange?: RangeCompatible; + + /** Only include markers contained in this Range in screen coordinates. */ + containedInScreenRange?: RangeCompatible; + + /** Only include markers intersecting this Range in buffer coordinates. */ + intersectsBufferRange?: RangeCompatible; + + /** Only include markers intersecting this Range in screen coordinates. */ + intersectsScreenRange?: RangeCompatible; +} + +export interface FindMarkerOptions { + /** Only include markers that start at the given Point. */ + startPosition?: PointCompatible; + + /** Only include markers that end at the given Point. */ + endPosition?: PointCompatible; + + /** Only include markers that start inside the given Range. */ + startsInRange?: RangeCompatible; + + /** Only include markers that end inside the given Range. */ + endsInRange?: RangeCompatible; + + /** Only include markers that contain the given Point, inclusive. */ + containsPoint?: PointCompatible; + + /** Only include markers that contain the given Range, inclusive. */ + containsRange?: RangeCompatible; + + /** Only include markers that start at the given row number. */ + startRow?: number; + + /** Only include markers that end at the given row number. */ + endRow?: number; + + /** Only include markers that intersect the given row number. */ + intersectsRow?: number; +} + +export interface MenuOptions { + /** The menu itme's label. */ + label: string; + + /** An array of sub menus. */ + submenu?: ReadonlyArray; + + /** The command to trigger when the item is clicked. */ + command?: string; +} + +export interface NodeProcessOptions { + /** The command to execute. */ + command: string; + + /** The array of arguments to pass to the command. */ + args?: ReadonlyArray; + + /** The options object to pass to Node's ChildProcess.spawn method. */ + options?: SpawnProcessOptions; + + /** + * The callback that receives a single argument which contains the standard + * output from the command. + */ + stdout?(data: string): void; + + /** + * The callback that receives a single argument which contains the standard + * error output from the command. + */ + stderr?(data: string): void; + + /** The callback which receives a single argument containing the exit status. */ + exit?(code: number): void; +} + +export interface NotificationOptions { + buttons?: Array<{ + className?: string; + onDidClick?(event: MouseEvent): void; + text?: string; + }>; + description?: string; + detail?: string; + dismissable?: boolean; + icon?: string; +} + +export interface ProcessOptions extends NodeProcessOptions { + /** + * Whether the command will automatically start when this BufferedProcess is + * created. + */ + autoStart?: boolean; +} + +export interface ScanContextOptions { + /** The number of lines before the matched line to include in the results object. */ + leadingContextLineCount?: number; + + /** The number of lines after the matched line to include in the results object. */ + trailingContextLineCount?: number; +} + +export interface SharedDecorationOptions { + /** + * This CSS class will be applied to the decorated line number, line, highlight, + * or overlay. + */ + class?: string; + + /** + * An HTMLElement or a model Object with a corresponding view registered. Only + * applicable to the gutter, overlay and block types. + */ + item?: object; + + /** + * If true, the decoration will only be applied to the head of the DisplayMarker. + * Only applicable to the line and line-number types. + */ + onlyHead?: boolean; + + /** + * If true, the decoration will only be applied if the associated DisplayMarker + * is empty. Only applicable to the gutter, line, and line-number types. + */ + onlyEmpty?: boolean; + + /** + * If true, the decoration will only be applied if the associated DisplayMarker + * is non-empty. Only applicable to the gutter, line, and line-number types. + */ + onlyNonEmpty?: boolean; + + /** + * Only applicable to decorations of type overlay and block. Controls where the + * view is positioned relative to the TextEditorMarker. Values can be + * 'head' (the default) or 'tail' for overlay decorations, and 'before' (the default) + * or 'after' for block decorations. + */ + position?: "head"|"tail"|"before"|"after"; + + /** + * Only applicable to decorations of type overlay. Determines whether the decoration + * adjusts its horizontal or vertical position to remain fully visible when it would + * otherwise overflow the editor. Defaults to true. + */ + avoidOverflow?: boolean; +} + +export interface SpawnProcessOptions { + /** Current working directory of the child process. */ + cwd?: string; + + /** Environment key-value pairs. */ + env?: { [key: string]: string }; + + /** The child's stdio configuration. */ + stdio?: string|Array; + + /** Prepare child to run independently of its parent process. */ + detached?: boolean; + + /** Sets the user identity of the process. */ + uid?: number; + + /** Sets the group identity of the process. */ + gid?: number; + + /** + * If true, runs command inside of a shell. Uses "/bin/sh" on UNIX, and process.env.ComSpec + * on Windows. A different shell can be specified as a string. + */ + shell?: boolean | string; +} + +export interface TextInsertionOptions { + /** If true, selects the newly added text. */ + select?: boolean; + + /** If true, indents all inserted text appropriately. */ + autoIndent?: boolean; + + /** If true, indent newline appropriately. */ + autoIndentNewline?: boolean; + + /** + * If true, decreases indent level appropriately (for example, when a closing + * bracket is inserted). + */ + autoDecreaseIndent?: boolean; + + /** + * By default, when pasting multiple lines, Atom attempts to preserve the relative + * indent level between the first line and trailing lines, even if the indent + * level of the first line has changed from the copied text. If this option is + * true, this behavior is suppressed. + */ + preserveTrailingLineIndentation?: boolean; + + /** If true, all line endings will be normalized to match the editor's current mode. */ + normalizeLineEndings?: boolean; + + /** If skip, skips the undo stack for this operation. */ + undo?: "skip"; +} + +/** The options for a Bootstrap 3 Tooltip class, which Atom uses a variant of. */ +export interface TooltipOptions { + /** Apply a CSS fade transition to the tooltip. */ + animation?: boolean; + + /** Appends the tooltip to a specific element. */ + container?: string|HTMLElement|false; + + /** + * Delay showing and hiding the tooltip (ms) - does not apply to manual + * trigger type. + */ + delay?: number|{ show: number, hide: number }; + + /** Allow HTML in the tooltip. */ + html?: boolean; + + /** How to position the tooltip. */ + placement?: "top"|"bottom"|"left"|"right"|"auto"; + + /** + * If a selector is provided, tooltip objects will be delegated to the + * specified targets. + */ + selector?: string; + + /** Base HTML to use when creating the tooltip. */ + template?: string; + + /** + * Default title value if title attribute isn't present. + * If a function is given, it will be called with its this reference set to + * the element that the tooltip is attached to. + */ + title?: string|HTMLElement|(() => string); + + /** + * How tooltip is triggered - click | hover | focus | manual. + * You may pass multiple triggers; separate them with a space. + */ + trigger?: string; +} + +export interface WorkspaceOpenOptions { + /** A number indicating which row to move the cursor to initially. Defaults to 0. */ + initialLine?: number; + + /** A number indicating which column to move the cursor to initially. Defaults to 0. */ + initialColumn?: number; + + /** + * Either 'left', 'right', 'up' or 'down'. If 'left', the item will be opened in + * leftmost pane of the current active pane's row. If 'right', the item will be + * opened in the rightmost pane of the current active pane's row. If only one pane + * exists in the row, a new pane will be created. If 'up', the item will be opened + * in topmost pane of the current active pane's column. If 'down', the item will be + * opened in the bottommost pane of the current active pane's column. If only one pane + * exists in the column, a new pane will be created. + */ + split?: "left"|"right"|"up"|"down"; + + /** + * A boolean indicating whether to call Pane::activate on containing pane. + * Defaults to true. + */ + activatePane?: boolean; + + /** + * A boolean indicating whether to call Pane::activateItem on containing pane. + * Defaults to true. + */ + activateItem?: boolean; + + /** + * A Boolean indicating whether or not the item should be opened in a pending state. + * Existing pending items in a pane are replaced with new pending items when they + * are opened. + */ + pending?: boolean; + + /** + * A boolean. If true, the workspace will attempt to activate an existing item for + * the given URI on any pane. If false, only the active pane will be searched for + * an existing item for the same URI. Defaults to false. + */ + searchAllPanes?: boolean; + + /** + * A String containing the name of the location in which this item should be opened. + * If omitted, Atom will fall back to the last location in which a user has placed + * an item with the same URI or, if this is a new URI, the default location specified + * by the item. + * NOTE: This option should almost always be omitted to honor user preference. + */ + location?: "left"|"right"|"bottom"|"center"; +} + +export interface WorkspaceScanOptions { + /** An array of glob patterns to search within. */ + paths?: ReadonlyArray; + + /** A function to be periodically called with the number of paths searched. */ + onPathsSearched?(pathsSearched: number): void; + + /** The number of lines before the matched line to include in the results object. */ + leadingContextLineCount?: number; + + /** The number of lines after the matched line to include in the results object. */ + trailingContextLineCount?: number; +} + +// Interfaces ================================================================= +// The requirements placed on object parameters for specific API calls. + +export interface Deserializer { + name: string; + deserialize(state: object): object; +} + +export interface DisposableLike { + dispose(): void; +} + +/** The types usable when constructing a point via the Point::fromObject method. */ +export type PointCompatible = PointLike|[number, number]; + +/** The interface that should be implemented for all "point-compatible" objects. */ +export interface PointLike { + /** A zero-indexed number representing the row of the Point. */ + row: number; + + /** A zero-indexed number representing the column of the Point. */ + column: number; +} + +/** The types usable when constructing a range via the Range::fromObject method. */ +export type RangeCompatible = + | RangeLike + | [PointLike, PointLike] + | [PointLike, [number, number]] + | [[number, number], PointLike] + | [[number, number], [number, number]]; + +/** The interface that should be implemented for all "range-compatible" objects. */ +export interface RangeLike { + /** A Point representing the start of the Range. */ + start: PointLike; + + /** A Point representing the end of the Range. */ + end: PointLike; +} + +/** An interface which all custom test runners should implement. */ +export type TestRunner = (params: TestRunnerParams) => Promise; + +// Structures ================================================================= +// The structures that are passed to the user by Atom following specific API calls. + +export interface BufferScanResult { + buffer: TextBuffer; + lineText: string; + match: RegExpExecArray; + matchText: string; + range: Range; + replace(replacementText: string): void; + stop(): void; + stopped: boolean; +} + +export interface CancellablePromise extends Promise { + cancel(): void; +} + +export interface ContextualBufferScanResult extends BufferScanResult { + leadingContextLines: string[]; + trailingContextLines: string[]; +} + +export type FileEncoding = + | "iso88596" // Arabic (ISO 8859-6) + | "windows1256" // Arabic (Windows 1256) + | "iso88594" // Baltic (ISO 8859-4) + | "windows1257" // Baltic (Windows 1257) + | "iso885914" // Celtic (ISO 8859-14) + | "iso88592" // Central European (ISO 8859-2) + | "windows1250" // Central European (Windows 1250) + | "gb18030" // Chinese (GB18030) + | "gbk" // Chinese (GBK) + | "cp950" // Traditional Chinese (Big5) + | "big5hkscs" // Traditional Chinese (Big5-HKSCS) + | "cp866" // Cyrillic (CP 866) + | "iso88595" // Cyrillic (ISO 8859-5) + | "koi8r" // Cyrillic (KOI8-R) + | "koi8u" // Cyrillic (KOI8-U) + | "windows1251" // Cyrillic (Windows 1251) + | "cp437" // DOS (CP 437) + | "cp850" // DOS (CP 850) + | "iso885913" // Estonian (ISO 8859-13) + | "iso88597" // Greek (ISO 8859-7) + | "windows1253" // Greek (Windows 1253) + | "iso88598" // Hebrew (ISO 8859-8) + | "windows1255" // Hebrew (Windows 1255) + | "cp932" // Japanese (CP 932) + | "eucjp" // Japanese (EUC-JP) + | "shiftjis" // Japanese (Shift JIS) + | "euckr" // Korean (EUC-KR) + | "iso885910" // Nordic (ISO 8859-10) + | "iso885916" // Romanian (ISO 8859-16) + | "iso88599" // Turkish (ISO 8859-9) + | "windows1254" // Turkish (Windows 1254) + | "utf8" // Unicode (UTF-8) + | "utf16le" // Unicode (UTF-16 LE) + | "utf16be" // Unicode (UTF-16 BE) + | "windows1258" // Vietnamese (Windows 1258) + | "iso88591" // Western (ISO 8859-1) + | "iso88593" // Western (ISO 8859-3) + | "iso885915" // Western (ISO 8859-15) + | "macroman" // Western (Mac Roman) + | "windows1252"; // Western (Windows 1252) + +export interface GrammarRule { + // https://github.com/atom/first-mate/blob/v7.0.7/src/rule.coffee + // This is private. Don't go down the rabbit hole. + rule: object; + scopeName: string; + contentScopeName: string; +} + +export interface GrammarToken { + value: string; + scopes: string[]; +} + +export interface Invisibles { + /** + * Character used to render newline characters (\n) when the `Show Invisibles` + * setting is enabled. + */ + eol?: boolean|string; + + /** + * Character used to render leading and trailing space characters when the + * `Show Invisibles` setting is enabled. + */ + space?: boolean|string; + + /** + * Character used to render hard tab characters (\t) when the `Show Invisibles` + * setting is enabled. + */ + tab?: boolean|string; + + /** + * Character used to render carriage return characters (for Microsoft-style line + * endings) when the `Show Invisibles` setting is enabled. + */ + cr?: boolean|string; +} + +export interface KeyBinding { + // Properties + enabled: boolean; + source: string; + command: string; + keystrokes: string; + keystrokeArray: string[]; + keystrokeCount: number; + selector: string; + specificity: number; + + // Comparison + /** Determines whether the given keystroke matches any contained within this binding. */ + matches(keystroke: string): boolean; + + /** + * Compare another KeyBinding to this instance. + * Returns <= -1 if the argument is considered lesser or of lower priority. + * Returns 0 if this binding is equivalent to the argument. + * Returns >= 1 if the argument is considered greater or of higher priority. + */ + compare(other: KeyBinding): number; +} + +export interface ProjectHistory { + paths: string[]; + lastOpened: Date; +} + +export interface ScandalResult { + filePath: string; + matches: Array<{ + matchText: string; + lineText: string; + lineTextOffset: number; + range: [[number, number], [number, number]]; + leadingContextLines: string[]; + trailingContextLines: string[]; + }>; +} + +export interface TestRunnerParams { + /** An array of paths to tests to run. Could be paths to files or directories. */ + testPaths: string[]; + + /** + * A function that can be called to construct an instance of the atom global. + * No atom global will be explicitly assigned, but you can assign one in your + * runner if desired. + */ + buildAtomEnvironment(options: BuildEnvironmentOptions): AtomEnvironment; + + /** + * A function that builds a default instance of the application delegate, suitable + * to be passed as the applicationDelegate parameter to buildAtomEnvironment. + */ + buildDefaultApplicationDelegate(): object; + + /** An optional path to a log file to which test output should be logged. */ + logFile: string; + + /** + * A boolean indicating whether or not the tests are being run from the command + * line via atom --test. + */ + headless: boolean; +} + +export interface TextChange { + newExtent: Point; + oldExtent: Point; + newRange: Range; + oldRange: Range; + newText: string; + oldText: string; + start: Point; +} + +/** Result returned by `Grammar.tokenizeLine`. */ +export interface TokenizeLineResult { + /** The string of text that was tokenized. */ + line: string; + + /** + * An array of integer scope ids and strings. Positive ids indicate the + * beginning of a scope, and negative tags indicate the end. To resolve ids + * to scope names, call GrammarRegistry::scopeForId with the absolute + * value of the id. + */ + tags: Array; + + /** + * This is a dynamic property. Invoking it will incur additional overhead, + * but will automatically translate the `tags` into token objects with `value` + * and `scopes` properties. + */ + tokens: GrammarToken[]; + + /** + * An array of rules representing the tokenized state at the end of the line. + * These should be passed back into this method when tokenizing the next line + * in the file. + */ + ruleStack: GrammarRule[]; +} + +/** + * This tooltip class is derived from Bootstrap 3, but modified to not require + * jQuery, which is an expensive dependency we want to eliminate. + */ +export interface Tooltip { + options: TooltipOptions; + enabled: boolean; + timeout: number; + hoverState: "in"|"out"|null; + element: JQuery|HTMLElement; + + getTitle(): string; + getTooltipElement(): HTMLElement; + getArrowElement(): HTMLElement; + enable(): void; + disable(): void; + toggleEnabled(): void; + toggle(): void; + recalculatePosition(): void; +} + +export interface ViewModel { + getTitle: () => string; +} + +export interface WindowLoadSettings { + appVersion: string; + atomHome: string; + devMode: boolean; + resourcePath: string; + safeMode: boolean; + env?: { [key: string]: string|undefined }; + profileStartup?: boolean; +} diff --git a/types/atom/linter/config.d.ts b/types/atom/linter/config.d.ts new file mode 100644 index 0000000000..c70728fff5 --- /dev/null +++ b/types/atom/linter/config.d.ts @@ -0,0 +1,26 @@ +import "../index"; + +declare module "atom" { + interface ConfigValues { + /** Lint tabs while they are still in preview status. */ + "linter.lintPreviewTabs": boolean; + + /** Lint files automatically when they are opened. */ + "linter.lintOnOpen": boolean; + + /** + * Lint files while typing, without the need to save (only for supported + * providers). + */ + "linter.lintOnChange": boolean; + + /** Interval at which linting is done as you type (in ms). */ + "linter.lintOnChangeInterval": number; + + /** Ignore files matching this Glob. */ + "linter.ignoreGlob": string; + + /** Disabled providers. */ + "linter.disabledProviders": string[]; + } +} diff --git a/types/atom/linter/index.d.ts b/types/atom/linter/index.d.ts new file mode 100644 index 0000000000..bf085d9859 --- /dev/null +++ b/types/atom/linter/index.d.ts @@ -0,0 +1,82 @@ +// Linter 2.x +// https://atom.io/packages/linter + +/// + +import { Disposable, Point, Range, TextEditor } from "../index"; + +export interface ReplacementSolution { + title?: string; + position: Range; + priority?: number; + currentText?: string; + replaceWith: string; +} + +export interface CallbackSolution { + title?: string; + position: Range; + priority?: number; + // tslint:disable-next-line:no-any + apply(): any; +} + +export interface Message { + /** The location of the issue (aka where to highlight). */ + location: { + /** The path to the file to which the message applies. */ + file: string; + + /** The range of the message in the editor. */ + position: Range; + }; + + /** A reference to a different location in the editor. */ + reference?: { + /** The path to the file being referenced. */ + file: string; + + /** The point being referenced in that file. */ + position?: Point; + }; + + /** An HTTP link to a resource explaining the issue. Default is a google search. */ + url?: string; + + /** The name of the octicon to show in the gutter. */ + icon?: string; + + /** The text for the message. */ + excerpt: string; + + /** The severity level for the message. */ + severity: "error"|"warning"|"info"; + + /** Possible solutions (which the user can invoke at will). */ + solutions?: Array; + + /** + * Markdown long description of the error. Accepts a callback so that you can + * do things like HTTP requests. + */ + description?: string|(() => Promise|string); +} + +export interface IndieDelegate { + name: string; + getMessages(): Message[]; + clearMessages(): void; + setMessages(filePath: string, messages: Message[]): void; + setAllMessages(messages: Message[]): void; + onDidUpdate(callback: () => void): Disposable; + onDidDestroy(callback: () => void): Disposable; + dispose(): void; +} + +export interface LinterProvider { + name: string; + scope: "file"|"project"; + lintsOnChange: boolean; + grammarScopes: string[]; + lint(textEditor: TextEditor): Message[]|void|Promise; +} diff --git a/types/atom/services/index.d.ts b/types/atom/services/index.d.ts deleted file mode 100644 index 33b85ff511..0000000000 --- a/types/atom/services/index.d.ts +++ /dev/null @@ -1,190 +0,0 @@ -/* tslint:disable:no-unnecessary-qualifier */ -declare namespace Atom { - namespace Services { - /** Type definitions for autocomplete+ 2 */ - namespace Autocomplete { - /** Objects that appear as parameters to callbacks. */ - namespace Events { - /** The parameters passed into getSuggestions by Autocomplete+. */ - interface SuggestionsRequested { - /** The current TextEditor. */ - editor: Atom.TextEditor; - - /** The position of the cursor. */ - bufferPosition: Atom.Point; - - /** The scope descriptor for the current cursor position. */ - scopeDescriptor: Atom.ScopeDescriptor; - - /** The prefix for the word immediately preceding the current cursor position. */ - prefix: string; - - /** Whether the autocomplete request was initiated by the user. */ - activatedManually: boolean; - } - - /** The parameters passed into onDidInsertSuggestion by Autocomplete+. */ - interface SuggestionInserted { - editor: Atom.TextEditor; - triggerPosition: Atom.Point; - suggestion: TextSuggestion|SnippetSuggestion; - } - } - - /** An autocompletion suggestion for the user. - * Primary data type for the Atom Autocomplete+ service. - */ - interface Suggestion { - /** A string that will show in the UI for this suggestion. - * When not set, snippet || text is displayed. - */ - displayText?: string; - - /** The text immediately preceding the cursor, which will be replaced by the text. - * If not provided, the prefix passed into getSuggestions will be used. - */ - replacementPrefix?: string; - - /** The suggestion type. It will be converted into an icon shown against the suggestion. */ - type?: string; - - /** This is shown before the suggestion. Useful for return values. */ - leftLabel?: string; - - /** Use this instead of leftLabel if you want to use html for the left label. */ - leftLabelHTML?: string; - - /** An indicator (e.g. function, variable) denoting the "kind" of suggestion this represents. */ - rightLabel?: string; - - /** Use this instead of rightLabel if you want to use html for the right label. */ - rightLabelHTML?: string; - - /** Class name for the suggestion in the suggestion list. Allows you to style your suggestion - * via CSS, if desired. - */ - className?: string; - - /** If you want complete control over the icon shown against the suggestion. e.g. iconHTML: - * - */ - iconHTML?: string; - - /** A doc-string summary or short description of the suggestion. When specified, it will be - * displayed at the bottom of the suggestions list. - */ - description?: string; - - /** A url to the documentation or more information about this suggestion. When specified, - * a More.. link will be displayed in the description area. - */ - descriptionMoreURL?: string; - } - - interface TextSuggestion extends Suggestion { - /** The text which will be inserted into the editor, in place of the prefix. */ - text: string; - } - - interface SnippetSuggestion extends Suggestion { - /** A snippet string. This will allow users to tab through function arguments or other - * options. - */ - snippet: string; - } - - type Suggestions = Array; - - interface Provider { - /** Defines the scope selector(s) (can be comma-separated) for which your provider - * should receive suggestion requests. - */ - selector: string; - - /** Is called when a suggestion request has been dispatched by autocomplete+ to your - * provider. Return an array of suggestions (if any) in the order you would like them - * displayed to the user. Returning a Promise of an array of suggestions is also - * supported. - */ - getSuggestions(params: Events.SuggestionsRequested): Suggestions|Promise; - - /** Defines the scope selector(s) (can be comma-separated) for which your provider - * should not be used. - */ - disableForSelector?: string; - - /** A number to indicate its priority to be included in a suggestions request. - * The default provider has an inclusion priority of 0. Higher priority providers - * can suppress lower priority providers with excludeLowerPriority. - */ - inclusionPriority?: number; - - /** Will not use lower priority providers when this provider is used. */ - excludeLowerPriority?: boolean; - - /** A number to determine the sort order of suggestions. The default provider has - * an suggestion priority of 1. - */ - suggestionPriority?: number; - - /** Function that is called when a suggestion from your provider was inserted - * into the buffer. - */ - onDidInsertSuggestion?(params: Events.SuggestionInserted): void; - - /** Will be called if your provider is being destroyed by autocomplete+ */ - dispose?(): void; - } - } - - /** Type definitions for status-bar 1.8 */ - namespace StatusBar { - /** Objects that appear as parameters to functions. */ - namespace Options { - interface AddTile { - /** A DOM element, a jQuery object, or a model object for which a view provider - * has been registered in the the view registry. - */ - item: object; - - /** Determines the placement of the tile within the status bar. Lower priority - * will result in closer placement to the anchor. - */ - priority: number; - } - } - - interface Tile { - /** Retrieve the priority that was assigned to the Tile when it was created. */ - getPriority(): number; - - /** Retrieve the Tile's item. */ - getItem(): object; - - /** Remove the Tile from the status bar. */ - destroy(): void; - } - - interface StatusBar { - /** Add a tile to the left side of the status bar. Lower priority tiles are placed - * further to the left. - */ - addLeftTile(options: Options.AddTile): Tile; - - /** Add a tile to the right side of the status bar. Lower priority tiles are placed - * further to the right. - */ - addRightTile(options: Options.AddTile): Tile; - - /** Retrieve all of the tiles on the left side of the status bar. */ - getLeftTiles(): Tile[]; - - /** Retrieve all of the tiles on the right side of the status bar. */ - getRightTiles(): Tile[]; - } - - type Consumer = (statusBar: StatusBar) => void; - } - } -} -/* tslint:enable:no-unnecessary-qualifier */ diff --git a/types/atom/status-bar/config.d.ts b/types/atom/status-bar/config.d.ts new file mode 100644 index 0000000000..1561030a84 --- /dev/null +++ b/types/atom/status-bar/config.d.ts @@ -0,0 +1,23 @@ +import "../index"; + +declare module "atom" { + interface ConfigValues { + /** Show status bar at the bottom of the workspace. */ + "status-bar.isVisible": boolean; + + /** Fit the status-bar to the window's full-width. */ + "status-bar.fullWidth": boolean; + + /** + * Format for the cursor position status bar element, where %L is the line + * number and %C is the column number. + */ + "status-bar.cursorPositionFormat": string; + + /** + * Format for the selection count status bar element, where %L is the line + * count and %C is the character count. + */ + "status-bar.selectionCountFormat": string; + } +} diff --git a/types/atom/status-bar/index.d.ts b/types/atom/status-bar/index.d.ts new file mode 100644 index 0000000000..3cc4a99a59 --- /dev/null +++ b/types/atom/status-bar/index.d.ts @@ -0,0 +1,49 @@ +// Status Bar 1.x +// https://atom.io/packages/status-bar + +/// + +export interface AddTileOptions { + /** + * A DOM element, a jQuery object, or a model object for which a view provider + * has been registered in the the view registry. + */ + item: object; + + /** + * Determines the placement of the tile within the status bar. Lower priority + * will result in closer placement to the anchor. + */ + priority: number; +} + +export interface Tile { + /** Retrieve the priority that was assigned to the Tile when it was created. */ + getPriority(): number; + + /** Retrieve the Tile's item. */ + getItem(): object; + + /** Remove the Tile from the status bar. */ + destroy(): void; +} + +export interface StatusBar { + /** + * Add a tile to the left side of the status bar. Lower priority tiles are placed + * further to the left. + */ + addLeftTile(options: AddTileOptions): Tile; + + /** + * Add a tile to the right side of the status bar. Lower priority tiles are placed + * further to the right. + */ + addRightTile(options: AddTileOptions): Tile; + + /** Retrieve all of the tiles on the left side of the status bar. */ + getLeftTiles(): Tile[]; + + /** Retrieve all of the tiles on the right side of the status bar. */ + getRightTiles(): Tile[]; +} diff --git a/types/atom/tsconfig.json b/types/atom/tsconfig.json index 794b99eadc..a58ec7b74c 100644 --- a/types/atom/tsconfig.json +++ b/types/atom/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,6 +20,8 @@ "files": [ "index.d.ts", "atom-tests.ts", - "services/index.d.ts" + "autocomplete-plus/index.d.ts", + "linter/index.d.ts", + "status-bar/index.d.ts" ] -} \ No newline at end of file +} diff --git a/types/atom/tslint.json b/types/atom/tslint.json index adbd6dcf49..4c3e6e9036 100644 --- a/types/atom/tslint.json +++ b/types/atom/tslint.json @@ -1,38 +1,9 @@ { "extends": "dtslint/dt.json", "rules": { - // Custom rules. "await-promise": [true, "CancellablePromise"], - "class-name": true, - "indent": [true, "tabs"], - "jsdoc-format": true, + "indent": [true, "spaces", 4], "max-line-length": [true, 100], - "quotemark": [true, "double", "avoid-escape"], - "trailing-comma": [true, { - "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, - "singleline": { "objects": "never", "arrays": "never", "functions": "never" } - }], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-type", - "check-typecast", - "check-rest-spread", - "check-preblock" - ], - // Soon to be defaults. - "arrow-return-shorthand": [true, "multiline"], - "no-any": true, - "no-floating-promises": true, - "no-unbound-method": true, - "no-unsafe-any": true, - "number-literal-format": true, - "restrict-plus-operands": true, - "return-undefined": true, - "switch-final-break": true + "no-any": true } } diff --git a/types/atom/v0/api-docs.d.ts b/types/atom/v0/api-docs.d.ts deleted file mode 100644 index 41ea32a277..0000000000 --- a/types/atom/v0/api-docs.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -// Type definitions for Atom API docs -// Project: https://github.com/atom/atom/blob/master/build/tasks/docs-task.coffee -// Definitions by: vvakame -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* - How to generate. - $ git clone git@github.com:atom/atom.git - $ cd atom - $ npm install - $ cd build - $ npm install - $ grunt build-docs - $ cd ../ - $ ls -la la docs/output/api.json - api.json example https://gist.github.com/vvakame/10f8d2f3884affc32476 - */ - -declare namespace AtomDocTypes { - interface Metadata { - classes: { [className: string]: ClassInfo; }; - } - - interface ClassInfo { - name: string; - superClass: string; - visibility: string; - - filename: string; - srcUrl: string; - summary: string; - description: string; - examples: Example[]; - sections: Section[]; - - classMethods: ClassMethod[]; - classProperties: ClassProperty[]; - instanceMethods: InstanceMethod[]; - instanceProperties: InstanceProperty[]; - } - - interface Example { - description: string; - lang: string; - code: string; - raw: string; - } - - interface Section { - name: string; - description: string; - } - - interface ClassMethod { - name: string; - sectionName: string; - srcUrl: string; - visibility: string; - summary: string; - description: string; - arguments: Argument[]; - returnValues: ReturnValue[]; - } - - interface ClassProperty { - } - - interface InstanceMethod { - name: string; - sectionName: string; - srcUrl: string; - visibility: string; - summary: string; - description: string; - arguments: Argument[]; - returnValues: ReturnValue[]; - titledArguments: TitledArgument[]; - } - - interface InstanceProperty { - name: string; - sectionName: string; - srcUrl: string; - visibility: string; - summary: string; - description: string; - } - - interface Argument { - name: string; - description: string; - type: string; - isOptional: boolean; - children: Argument[]; - } - - interface TitledArgument { - title: string; - description: string; - arguments: Argument[]; - } - - interface ReturnValue { - type: string; - description: string; - } -} diff --git a/types/atom/v0/atom-tests.ts b/types/atom/v0/atom-tests.ts deleted file mode 100644 index 5987f4901d..0000000000 --- a/types/atom/v0/atom-tests.ts +++ /dev/null @@ -1,70 +0,0 @@ -import path = require("path"); -import _atom = require("atom"); - -import PathWatcher = require("pathwatcher"); -var File = PathWatcher.File; - -const jq: JQuery = $("selector"); - -class SampleView extends _atom.ScrollView { - - editorId:string; - file:PathWatcher.IFile; - editor:AtomCore.IEditor; - - static deserialize(state:any):SampleView { - return new SampleView(state); - } - - static content():any { - return this.div({class: 'sample native-key-bindings', tabindex: -1}); - } - - constructor(params:{editorId?:string; filePath?:string;} = {}) { - super(); - - this.editorId = params.editorId; - - if (this.editorId) { - this.resolveEditor(this.editorId); - } else { - this.file = new File(params.filePath); - } - } - - serialize() { - return { - deserializer: 'SampleView', - editorId: this.editorId - }; - } - - destroy() { - this.unsubscribe(); - } - - resolveEditor(editorId:string) { - var resolve = ()=> { - if (this.editor) { - jq.trigger("title-changed"); - } else { - var view = jq.parents('.pane').view(); - if (view) { - view.destroyItem(this); - } - } - }; - - if (atom.workspace) { - resolve(); - } else { - atom.packages.once("activated", ()=> { - resolve(); - }); - } - } -} - -atom.deserializers.add(SampleView); - -export = SampleView; diff --git a/types/atom/v0/index.d.ts b/types/atom/v0/index.d.ts deleted file mode 100644 index 7dba05663c..0000000000 --- a/types/atom/v0/index.d.ts +++ /dev/null @@ -1,1977 +0,0 @@ -// Type definitions for Atom -// Project: https://atom.io/ -// Definitions by: vvakame , smhxx -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// -/// -/// -/// -/// -/// - -// Policy: this definition file only declare element related to `atom`. -// if js file include to another npm package (e.g. "space-pen", "mixto" and "emissary"). -// you should create a separate file. - -// API documentation : https://atom.io/docs/api/v1.20.1 - -interface Window { - atom: AtomCore.IAtom; - measure(description:string, fn:Function):any; // return fn result - profile(description:string, fn:Function):any; // return fn result -} - -declare namespace AtomCore { - - // https://atom.io/docs/v0.84.0/advanced/view-system - interface IWorkspaceViewStatic { - new ():IWorkspaceView; - version: number; - configDefaults:any; - content():any; - } - - interface Decoration { - destroy(): void; - } - - /** - * Represents a buffer annotation that remains logically stationary even as the buffer changes. This is used - * to represent cursors, folds, snippet targets, misspelled words, any anything else that needs to track a - * logical location in the buffer over time. - */ - interface Marker { - /** - * Destroys the marker, causing it to emit the 'destroyed' event. Once destroyed, a marker cannot be - * restored by undo/redo operations. - */ - destroy(): void; - - /** - * Gets the screen range of the display marker. - */ - getScreenRange(): Range; - } - - interface IWorkspaceView extends View { - // Delegator.includeInto(WorkspaceView); - - // delegate to model property's property - fullScreen:boolean; - - // delegate to model property's method - open(uri:string, options:any):Q.Promise; - openSync(uri:string, options?:any):any; - saveActivePaneItem():any; - saveActivePaneItemAs():any; - saveAll():void; - destroyActivePaneItem():any; - destroyActivePane():any; - increaseFontSize():void; - decreaseFontSize():void; - - // own property & methods - initialize(model:IWorkspace):any; - initialize(view:View, args:any):void; // do not use - model:IWorkspace; - panes: IPaneContainerView; - getModel():IWorkspace; - installShellCommands():any; - handleFocus():any; - afterAttach(onDom?:any):any; - confirmClose():boolean; - updateTitle():any; - setTitle(title:string):any; - getEditorViews():any[]; // atom.EditorView - prependToTop(element:any):any; - appendToTop(element:any):any; - prependToBottom(element:any):any; - appendToBottom(element:any):any; - prependToLeft(element:any):any; - appendToLeft(element:any):any; - prependToRight(element:any):any; - appendToRight(element:any):any; - getActivePaneView():IPaneView; - getActiveView():View; - focusPreviousPaneView():any; - focusNextPaneView():any; - focusPaneViewAbove():any; - focusPaneViewBelow():any; - focusPaneViewOnLeft():any; - focusPaneViewOnRight():any; - eachPaneView(callback:(paneView:IPaneView)=>any):{ off():any; }; - getPaneViews():IPaneView[]; - eachEditorView(callback:(editorView:any /* EditorView */)=>any):{ off():any; }; - beforeRemove():any; - - command(eventName:string, handler:Function):any; - command(eventName:string, selector:Function, handler:Function):any; - command(eventName:string, options:any, handler:Function):any; - command(eventName:string, selector:Function, options:any, handler:Function):any; - - statusBar:StatusBar.IStatusBarView; - } - - interface IPanes { - // TBD - } - - interface IPaneView { - // TBD - } - - interface IPaneContainerView { - // TBD - } - - interface ITreeView { - // TBD - } - - interface IGutterViewStatic { - new(): IGutterView; - content():any; - } - - interface IGutterView extends View { - firstScreenRow:any; - lastScreenRow:any; - initialize():void; - initialize(view:View, args:any):void; // do not use - afterAttach(onDom?:any):any; - beforeRemove():any; - handleMouseEvents(e:JQueryMouseEventObject):any; - getEditorView():any; /* EditorView */ - getEditor():IEditor; - getLineNumberElements():HTMLCollection; - getLineNumberElementsForClass(klass:string):NodeList; - getLineNumberElement(bufferRow:number):NodeList; - addClassToAllLines(klass:string):boolean; - removeClassFromAllLines(klass:string):boolean; - addClassToLine(bufferRow:number, klass:string):boolean; - removeClassFromLine(bufferRow:number, klass:string):boolean; - updateLineNumbers(changes:any[], startScreenRow?:number, endScreenRow?:number):any; - prependLineElements(lineElements:any):void; - appendLineElements(lineElements:any):void; - removeLineElements(numberOfElements:number):void; - buildLineElements(startScreenRow:any, endScreenRow:any):any; - buildLineElementsHtml(startScreenRow:any, endScreenRow:any):any; - updateFoldableClasses(changes:any[]):any; - removeLineHighlights():void; - addLineHighlight(row:number, emptySelection?:boolean):any; - highlightLines():boolean; - } - - interface ICommandRegistry { - add(target: string, commandName: Object, callback?: (event: any) => void): any; // selector:'atom-editor'|'atom-workspace' - findCommands(params: Object): Object[]; - dispatch(selector: any, name:string): void; - } - - interface ICommandPanel { - // TBD - } - - interface IDisplayBufferStatic { - new(_arg?:any):IDisplayBuffer; - } - - interface IDisplayBuffer /* extends Theorist.Model */ { - // Serializable.includeInto(Editor); - - constructor:IDisplayBufferStatic; - - verticalScrollMargin:number; - horizontalScrollMargin:number; - - declaredPropertyValues:any; - tokenizedBuffer: ITokenizedBuffer; - buffer: TextBuffer.ITextBuffer; - charWidthsByScope:any; - markers:{ [index:number]:IDisplayBufferMarker; }; - foldsByMarkerId:any; - maxLineLength:number; - screenLines:ITokenizedLine[]; - rowMap:any; // return type are RowMap - longestScreenRow:number; - subscriptions:Emissary.ISubscription[]; - subscriptionsByObject:any; // return type are WeakMap - behaviors:any; - subscriptionCounts:any; - eventHandlersByEventName:any; - pendingChangeEvent:any; - - softWrap:boolean; - - serializeParams():{id:number; softWrap:boolean; editorWidthInChars: number; scrollTop: number; scrollLeft: number; tokenizedBuffer: any; }; - deserializeParams(params:any):any; - copy():IDisplayBuffer; - updateAllScreenLines():any; - emitChanged(eventProperties:any, refreshMarkers?:boolean):any; - updateWrappedScreenLines():any; - setVisible(visible:any):any; - getVerticalScrollMargin():number; - setVerticalScrollMargin(verticalScrollMargin:number):number; - getHorizontalScrollMargin():number; - setHorizontalScrollMargin(horizontalScrollMargin:number):number; - getHeight():any; - setHeight(height:any):any; - getWidth():any; - setWidth(newWidth:any):any; - getScrollTop():number; - setScrollTop(scrollTop:number):number; - getScrollBottom():number; - setScrollBottom(scrollBottom:number):number; - getScrollLeft():number; - setScrollLeft(scrollLeft:number):number; - getScrollRight():number; - setScrollRight(scrollRight:number):number; - getLineHeight():any; - setLineHeight(lineHeight:any):any; - getDefaultCharWidth():any; - setDefaultCharWidth(defaultCharWidth:any):any; - getScopedCharWidth(scopeNames:any, char:any):any; - getScopedCharWidths(scopeNames:any):any; - setScopedCharWidth(scopeNames:any, char:any, width:any):any; - setScopedCharWidths(scopeNames:any, charWidths:any):any; - clearScopedCharWidths():any; - getScrollHeight():number; - getScrollWidth():number; - getVisibleRowRange():number[]; - intersectsVisibleRowRange(startRow:any, endRow:any):any; - selectionIntersectsVisibleRowRange(selection:any):any; - scrollToScreenRange(screenRange:any):any; - scrollToScreenPosition(screenPosition:any):any; - scrollToBufferPosition(bufferPosition:any):any; - pixelRectForScreenRange(screenRange:TextBuffer.IRange):any; - getTabLength():number; - setTabLength(tabLength:number):any; - setSoftWrap(softWrap:boolean):boolean; - getSoftWrap():boolean; - setEditorWidthInChars(editorWidthInChars:number):any; - getEditorWidthInChars():number; - getSoftWrapColumn():number; - lineForRow(row:number):any; - linesForRows(startRow:number, endRow:number):any; - getLines():any[]; - indentLevelForLine(line:any):any; - bufferRowsForScreenRows(startScreenRow:any, endScreenRow:any):any; - createFold(startRow:number, endRow:number):IFold; - isFoldedAtBufferRow(bufferRow:number):boolean; - isFoldedAtScreenRow(screenRow:number):boolean; - destroyFoldWithId(id:number):any; - unfoldBufferRow(bufferRow:number):any[]; - largestFoldStartingAtBufferRow(bufferRow:number):any; - foldsStartingAtBufferRow(bufferRow:number):any; - largestFoldStartingAtScreenRow(screenRow:any):any; - largestFoldContainingBufferRow(bufferRow:any):any; - outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; - foldsContainingBufferRow(bufferRow:any):any[]; - screenRowForBufferRow(bufferRow:number):number; - lastScreenRowForBufferRow(bufferRow:number):number; - bufferRowForScreenRow(screenRow:number):number; - - screenRangeForBufferRange(bufferRange:TextBuffer.IPoint[]):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:TextBuffer.IRange):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: number[]}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:TextBuffer.IPoint[]):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:TextBuffer.IRange):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: number[]}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:TextBuffer.IPoint[], clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:TextBuffer.IRange, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: number[]}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - - pixelPositionForScreenPosition(screenPosition:TextBuffer.IPoint, clip?:boolean):TextBuffer.IPoint; - pixelPositionForScreenPosition(screenPosition:number[], clip?:boolean):TextBuffer.IPoint; - pixelPositionForScreenPosition(screenPosition:{row:number; col:number;}, clip?:boolean):TextBuffer.IPoint; - - screenPositionForPixelPosition(pixelPosition:any):TextBuffer.IPoint; - - pixelPositionForBufferPosition(bufferPosition:any):any; - getLineCount():number; - getLastRow():number; - getMaxLineLength():number; - screenPositionForBufferPosition(bufferPosition:any, options:any):any; - bufferPositionForScreenPosition(bufferPosition:any, options:any):any; - scopesForBufferPosition(bufferPosition:any):any; - bufferRangeForScopeAtPosition(selector:any, position:any):any; - tokenForBufferPosition(bufferPosition:any):any; - getGrammar():IGrammar; - setGrammar(grammar:IGrammar):any; - reloadGrammar():any; - clipScreenPosition(screenPosition:any, options:any):any; - findWrapColumn(line:any, softWrapColumn:any):any; - rangeForAllLines():TextBuffer.IRange; - getMarker(id:number):IDisplayBufferMarker; - getMarkers():IDisplayBufferMarker[]; - getMarkerCount():number; - markScreenRange(range:TextBuffer.IRange, ...args:any[]):IDisplayBufferMarker; - markBufferRange(range:TextBuffer.IRange, options?:any):IDisplayBufferMarker; - markScreenPosition(screenPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; - markBufferPosition(bufferPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; - destroyMarker(id:number):any; - findMarker(params?:any):IDisplayBufferMarker; - findMarkers(params?:any):IDisplayBufferMarker[]; - translateToBufferMarkerParams(params?:any):any; - findFoldMarker(attributes:any):IMarker; - findFoldMarkers(attributes:any):IMarker[]; - getFoldMarkerAttributes(attributes?:any):any; - pauseMarkerObservers():any; - resumeMarkerObservers():any; - refreshMarkerScreenPositions():any; - destroy():any; - logLines(start:number, end:number):any[]; - handleTokenizedBufferChange(tokenizedBufferChange:any):any; - updateScreenLines(startBufferRow:any, endBufferRow:any, bufferDelta?:number, options?:any):any; - buildScreenLines(startBufferRow:any, endBufferRow:any):any; - findMaxLineLength(startScreenRow:any, endScreenRow:any, newScreenLines:any):any; - handleBufferMarkersUpdated():any; - handleBufferMarkerCreated(marker:any):any; - createFoldForMarker(maker:any):IFold; - foldForMarker(marker:any):any; - } - - interface IViewRegistry { - getView(selector:any):any; - } - - interface ICursorStatic { - new (arg:{editor:IEditor; marker:IDisplayBufferMarker; id: number;}):ICursor; - } - - interface ScopeDescriptor { - scopes: string[]; - } - - interface ICursor /* extends Theorist.Model */ { - getScopeDescriptor(): ScopeDescriptor; - screenPosition:any; - bufferPosition:any; - goalColumn:any; - visible:boolean; - needsAutoscroll:boolean; - - editor:IEditor; - marker:IDisplayBufferMarker; - id: number; - - destroy():any; - changePosition(options:any, fn:Function):any; - getPixelRect():any; - setScreenPosition(screenPosition:any, options?:any):any; - getScreenPosition():TextBuffer.IPoint; - getScreenRange():TextBuffer.IRange; - setBufferPosition(bufferPosition:any, options?:any):any; - getBufferPosition():TextBuffer.IPoint; - autoscroll():any; - updateVisibility():any; - setVisible(visible:boolean):any; - isVisible():boolean; - wordRegExp(arg?:any):any; - isLastCursor():boolean; - isSurroundedByWhitespace():boolean; - isBetweenWordAndNonWord():boolean; - isInsideWord():boolean; - clearAutoscroll():void; - clearSelection():void; - getScreenRow():number; - getScreenColumn():number; - getBufferRow():number; - getBufferColumn():number; - getCurrentBufferLine():string; - moveUp(rowCount:number, arg?:any):any; - moveDown(rowCount:number, arg?:any):any; - moveLeft(arg?:any):any; - moveRight(arg?:any):any; - moveToTop():any; - moveToBottom():void; - moveToBeginningOfScreenLine():void; - moveToBeginningOfLine():void; - moveToFirstCharacterOfLine():void; - moveToEndOfScreenLine():void; - moveToEndOfLine():void; - moveToBeginningOfWord():void; - moveToEndOfWord():void; - moveToBeginningOfNextWord():void; - moveToPreviousWordBoundary():void; - moveToNextWordBoundary():void; - getBeginningOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; - getPreviousWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; - getMoveNextWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; - getEndOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; - getBeginningOfNextWordBufferPosition(options?:any):TextBuffer.IPoint; - getCurrentWordBufferRange(options?:any):TextBuffer.IPoint; - getCurrentLineBufferRange(options?:any):TextBuffer.IPoint; - getCurrentParagraphBufferRange():any; - getCurrentWordPrefix():string; - isAtBeginningOfLine():boolean; - getIndentLevel():number; - isAtEndOfLine():boolean; - getScopes():string[]; - hasPrecedingCharactersOnLine():boolean; - getMarker(): Marker; - } - - interface ILanguageMode { - // TBD - } - - interface ISelection { - // https://atom.io/docs/api/v1.7.3/Selection - - // Event Subscription - onDidChangeRange(callback: (event: { - oldBufferRange: TextBuffer.IRange; - oldScreenRange: TextBuffer.IRange; - newBufferRange: TextBuffer.IRange; - newScreenRange: TextBuffer.IRange; - selection: ISelection; - }) => {}): Disposable; - onDidDestroy(callback: () => {}): Disposable; - - // Managing the selection range - getScreenRange(): TextBuffer.IRange; - setScreenRange(screenRange: TextBuffer.IRange, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - getBufferRange(): TextBuffer.IRange; - setBufferRange(bufferRange: TextBuffer.IRange, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - getBufferRowRange(): [number]; - - // Info about the selection - isEmpty(): boolean; - isReversed(): boolean; - isSingleScreenLine(): boolean; - getText(): string; - intersectsBufferRange(bufferRange: TextBuffer.IRange): boolean; - intersectsWith(otherSelection: ISelection): boolean; - - // Modifying the selected range - clear(options?: {autoscroll?: boolean}): void; - selectToScreenPosition(position: any): void; - selectToBufferPosition(position: any): void; - selectRight(columnCount?: number): void; - selectLeft(columnCount?: number): void; - selectUp(rowCount: number): void; - selectDown(rowCount: number): void; - selectToTop(): void; - selectToBottom(): void; - selectAll(): void; - selectToBeginningOfLine(): void; - selectToFirstCharacterOfLine(): void; - selectToEndOfLine(): void; - selectToEndOfBufferLine(): void; - selectToBeginningOfWord(): void; - selectToEndOfWord(): void; - selectToBeginningOfNextWord(): void; - selectToPreviousWordBoundary(): void; - selectToNextWordBoundary(): void; - selectToPreviousSubwordBoundary(): void; - selectToNextSubwordBoundary(): void; - selectToBeginningOfNextParagraph(): void; - selectToBeginningOfPreviousParagraph(): void; - selectWord(): TextBuffer.IRange; - expandOverWord(): void; - selectLine(row?: number): void; - expandOverLine(): void; - - // Modifying the selected text - insertText(text: string, options?: { - select: boolean; - autoIndent: boolean; - autoIndentNewline: boolean; - autoDecreaseIndent: boolean; - normalizeLineEndings?: boolean; - undo?: 'skip'; - }): void; - backspace(): void; - deleteToPreviousWordBoundary(): void; - deleteToNextWordBoundary(): void; - deleteToBeginningOfWord(): void; - deleteToBeginningOfLine(): void; - delete(): void; - deleteToEndOfLine(): void; - deleteToEndOfWord(): void; - deleteToBeginningOfSubword(): void; - deleteToEndOfSubword(): void; - deleteSelectedText(): void; - deleteLine(): void; - joinLines(): void; - outdentSelectedRows(): void; - autoIndentSelectedRows(): void; - toggleLineComments(): void; - cutToEndOfLine(): void; - cutToEndOfBufferLine(): void; - cut(maintainClipboard?: boolean, fullLine?: boolean): void; - copy(maintainClipboard?: boolean, fullLine?: boolean): void; - fold(): void; - indentSelectedRows(): void; - - // Managing multiple selections - addSelectionBelow(): void; - addSelectionAbove(): void; - merge(otherSelection: ISelection, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - - // Comparing to other selections - compare(otherSelection: ISelection): any; - } - - interface IDecorationParams { - id?: number; - class: string; - type: any /* string or string[] */; - } - - interface IDecorationStatic { - isType(decorationParams:IDecorationParams, type:any /* string or string[] */):boolean; - new (marker:IDisplayBufferMarker, displayBuffer:IDisplayBuffer, params: IDecorationParams): IDecoration; - } - - interface IDecoration extends Emissary.IEmitter { - marker: IDisplayBufferMarker; - displayBuffer: IDisplayBuffer; - params: IDecorationParams - id: number; - flashQueue: any[]; - isDestroyed: boolean; - - destroy():void; - update(newParams:IDecorationParams):void; - getMarker():IDisplayBufferMarker; - getParams():IDecorationParams; - isType(type:string):boolean; - matchesPattern(decorationPattern:{[key:string]:IDecorationParams;}):boolean; - flash(klass:string, duration?:number):void; - consumeNextFlash():any; - } - - interface IEditor { - // Serializable.includeInto(Editor); - // Delegator.includeInto(Editor); - - deserializing:boolean; - callDisplayBufferCreatedHook:boolean; - registerEditor:boolean; - buffer:TextBuffer.ITextBuffer; - languageMode: ILanguageMode; - cursors:ICursor[]; - selections: ISelection[]; - suppressSelectionMerging:boolean; - updateBatchDepth: number; - selectionFlashDuration: number; - softTabs: boolean; - displayBuffer: IDisplayBuffer; - - id:number; - behaviors:any; - declaredPropertyValues: any; - eventHandlersByEventName: any; - eventHandlersByNamespace: any; - lastOpened: number; - subscriptionCounts: any; - subscriptionsByObject: any; /* WeakMap */ - subscriptions: Emissary.ISubscription[]; - destroy():void; - - mini: any; - - serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;}; - deserializeParams(params:any):any; - subscribeToBuffer():void; - subscribeToDisplayBuffer():void; - getViewClass():any; // return type are EditorView - destroyed():void; - isDestroyed():boolean; - copy():IEditor; - getTitle():string; - getLongTitle():string; - setVisible(visible:boolean):void; - setMini(mini:any):void; - setScrollTop(scrollTop:any):void; - getScrollTop():number; - setScrollLeft(scrollLeft:any):void; - getScrollLeft():number; - setEditorWidthInChars(editorWidthInChars:any):void; - getSoftWrapColumn():number; - getSoftTabs():boolean; - setSoftTabs(softTabs:boolean):void; - getSoftWrap():boolean; - setSoftWrap(softWrap:any):void; - getTabText():string; - getTabLength():number; - setTabLength(tabLength:any):void; - usesSoftTabs():boolean; - clipBufferPosition(bufferPosition:any):void; - clipBufferRange(range:any):void; - indentationForBufferRow(bufferRow:any):void; - setIndentationForBufferRow(bufferRow:any, newLevel:any, _arg:any):void; - indentLevelForLine(line:any):number; - buildIndentString(number:any):string; - save():void; - saveAs(filePath:any):void; - copyPathToClipboard():void; - getPath():string; - getText():string; - setText(text:any):void; - getTextInRange(range:any):any; - getLineCount():number; - getBuffer():TextBuffer.ITextBuffer; - getURI():string; - isBufferRowBlank(bufferRow:any):boolean; - isBufferRowCommented(bufferRow:any):void; - nextNonBlankBufferRow(bufferRow:any):void; - getEofBufferPosition():TextBuffer.IPoint; - getLastBufferRow():number; - bufferRangeForBufferRow(row:any, options:any):TextBuffer.IRange; - lineForBufferRow(row:number):string; - lineLengthForBufferRow(row:number):number; - scan():any; - scanInBufferRange():any; - backwardsScanInBufferRange():any; - isModified():boolean; - isEmpty():boolean; - shouldPromptToSave():boolean; - screenPositionForBufferPosition(bufferPosition:any, options?:any):TextBuffer.IPoint; - bufferPositionForScreenPosition(screenPosition:any, options?:any):TextBuffer.IPoint; - screenRangeForBufferRange(bufferRange:any):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:any):TextBuffer.IRange; - clipScreenPosition(screenPosition:any, options:any):TextBuffer.IRange; - lineForScreenRow(row:any):ITokenizedLine; - linesForScreenRows(start?:any, end?:any):ITokenizedLine[]; - getScreenLineCount():number; - getMaxScreenLineLength():number; - getLastScreenRow():number; - bufferRowsForScreenRows(startRow:any, endRow:any):any[]; - bufferRowForScreenRow(row:any):number; - scopesForBufferPosition(bufferPosition:any):string[]; - bufferRangeForScopeAtCursor(selector:string):any; - tokenForBufferPosition(bufferPosition:any):IToken; - getCursorScopes():string[]; - logCursorScope():void; - insertText(text:string, options?:any):TextBuffer.IRange[]; - insertNewline():TextBuffer.IRange[]; - insertNewlineBelow():TextBuffer.IRange[]; - insertNewlineAbove():any; - indent(options?:any):any; - backspace():any[]; - // deprecated backspaceToBeginningOfWord():any[]; - // deprecated backspaceToBeginningOfLine():any[]; - deleteToBeginningOfWord():any[]; - deleteToBeginningOfLine():any[]; - delete():any[]; - deleteToEndOfLine():any[]; - deleteToEndOfWord():any[]; - deleteLine():TextBuffer.IRange[]; - indentSelectedRows():TextBuffer.IRange[][]; - outdentSelectedRows():TextBuffer.IRange[][]; - toggleLineCommentsInSelection():TextBuffer.IRange[]; - autoIndentSelectedRows():TextBuffer.IRange[][]; - normalizeTabsInBufferRange(bufferRange:any):any; - cutToEndOfLine():boolean[]; - cutSelectedText():boolean[]; - copySelectedText():boolean[]; - pasteText(options?:any):TextBuffer.IRange[]; - undo():any[]; - redo():any[]; - foldCurrentRow():any; - unfoldCurrentRow():any[]; - foldSelectedLines():any[]; - foldAll():any[]; - unfoldAll():any[]; - foldAllAtIndentLevel(level:any):any; - foldBufferRow(bufferRow:any):any; - unfoldBufferRow(bufferRow:any):any; - isFoldableAtBufferRow(bufferRow:any):boolean; - isFoldableAtScreenRow(screenRow:any):boolean; - createFold(startRow:any, endRow:any):IFold; - destroyFoldWithId(id:any):any; - destroyFoldsIntersectingBufferRange(bufferRange:any):any; - toggleFoldAtBufferRow(bufferRow:any):any; - isFoldedAtCursorRow():boolean; - isFoldedAtBufferRow(bufferRow:any):boolean; - isFoldedAtScreenRow(screenRow:any):boolean; - largestFoldContainingBufferRow(bufferRow:any):boolean; - largestFoldStartingAtScreenRow(screenRow:any):any; - outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; - moveLineUp():ISelection[]; - moveLineDown():ISelection[]; - duplicateLines():any[][]; - // duprecated duplicateLine():any[][]; - mutateSelectedText(fn:(selection:ISelection)=>any):any; - replaceSelectedText(options:any, fn:(selection:string)=>any):any; - decorationsForScreenRowRange(startScreenRow:any, endScreenRow:any):{[id:number]: IDecoration[]}; - decorateMarker(marker:IDisplayBufferMarker, decorationParams: {type:string; class: string;}):IDecoration; - decorationForId(id:number):IDecoration; - getMarker(id:number):IDisplayBufferMarker; - getMarkers():IDisplayBufferMarker[]; - findMarkers(...args:any[]):IDisplayBufferMarker[]; - markScreenRange(...args:any[]):IDisplayBufferMarker; - markBufferRange(...args:any[]):IDisplayBufferMarker; - markScreenPosition(...args:any[]):IDisplayBufferMarker; - markBufferPosition(...args:any[]):IDisplayBufferMarker; - destroyMarker(...args:any[]):boolean; - getMarkerCount():number; - hasMultipleCursors():boolean; - getCursors():ICursor[]; - getCursor():ICursor; - addCursorAtScreenPosition(screenPosition:any):ICursor; - addCursorAtBufferPosition(bufferPosition:any):ICursor; - addCursor(marker:any):ICursor; - removeCursor(cursor:any):ICursor[]; - addSelection(marker:any, options:any):ISelection; - addSelectionForBufferRange(bufferRange:any, options:any):ISelection; - setSelectedBufferRange(bufferRange:any, options:any):any; - setSelectedBufferRanges(bufferRanges:any, options:any):any; - removeSelection(selection:ISelection):any; - clearSelections():boolean; - consolidateSelections():boolean; - selectionScreenRangeChanged(selection:any):void; - getSelections():ISelection[]; - getSelection(index?:number):ISelection; - getLastSelection():ISelection; - getSelectionsOrderedByBufferPosition():ISelection[]; - getLastSelectionInBuffer():ISelection; - selectionIntersectsBufferRange(bufferRange:any):any; - setCursorScreenPosition(position:TextBuffer.IPoint, options?:any):any; - getCursorScreenPosition():TextBuffer.IPoint; - getCursorScreenRow():number; - setCursorBufferPosition(position:any, options?:any):any; - getCursorBufferPosition():TextBuffer.IPoint; - getSelectedScreenRange():TextBuffer.IRange; - getSelectedBufferRange():TextBuffer.IRange; - getSelectedBufferRanges():TextBuffer.IRange[]; - getSelectedText():string; - getTextInBufferRange(range:TextBuffer.IRange):string; - setTextInBufferRange(range:TextBuffer.IRange | any[], text:string):any; - getCurrentParagraphBufferRange():TextBuffer.IRange; - getWordUnderCursor(options?:any):string; - moveCursorUp(lineCount?:number):void; - moveCursorDown(lineCount?:number):void; - moveCursorLeft():void; - moveCursorRight():void; - moveCursorToTop():void; - moveCursorToBottom():void; - moveCursorToBeginningOfScreenLine():void; - moveCursorToBeginningOfLine():void; - moveCursorToFirstCharacterOfLine():void; - moveCursorToEndOfScreenLine():void; - moveCursorToEndOfLine():void; - moveCursorToBeginningOfWord():void; - moveCursorToEndOfWord():void; - moveCursorToBeginningOfNextWord():void; - moveCursorToPreviousWordBoundary():void; - moveCursorToNextWordBoundary():void; - moveCursorToBeginningOfNextParagraph():void; - moveCursorToBeginningOfPreviousParagraph():void; - moveToBottom():void; - scrollToCursorPosition(options:any):any; - pageUp():void; - pageDown():void; - selectPageUp():void; - selectPageDown():void; - getRowsPerPage():number; - moveCursors(fn:(cursor:ICursor)=>any):any; - cursorMoved(event:any):void; - selectToScreenPosition(position:TextBuffer.IPoint):any; - selectRight():ISelection[]; - selectLeft():ISelection[]; - selectUp(rowCount?:number):ISelection[]; - selectDown(rowCount?:number):ISelection[]; - selectToTop():ISelection[]; - selectAll():ISelection[]; - selectToBottom():ISelection[]; - selectToBeginningOfLine():ISelection[]; - selectToFirstCharacterOfLine():ISelection[]; - selectToEndOfLine():ISelection[]; - selectToPreviousWordBoundary():ISelection[]; - selectToNextWordBoundary():ISelection[]; - selectLine():ISelection[]; - selectLinesContainingCursors():ISelection[]; - addSelectionBelow():ISelection[]; - addSelectionAbove():ISelection[]; - splitSelectionsIntoLines():any[]; - transpose():TextBuffer.IRange[]; - upperCase():boolean[]; - lowerCase():boolean[]; - joinLines():any[]; - selectToBeginningOfWord():ISelection[]; - selectToEndOfWord():ISelection[]; - selectToBeginningOfNextWord():ISelection[]; - selectWord():ISelection[]; - selectToBeginningOfNextParagraph():ISelection[]; - selectToBeginningOfPreviousParagraph():ISelection[]; - selectMarker(marker:any):any; - mergeCursors():number[]; - expandSelectionsForward():any; - expandSelectionsBackward(fn:(selection:ISelection)=>any):ISelection[]; - finalizeSelections():boolean[]; - mergeIntersectingSelections():any; - preserveCursorPositionOnBufferReload():Emissary.ISubscription; - getGrammar(): IGrammar; - setGrammar(grammer:IGrammar):void; - reloadGrammar():any; - shouldAutoIndent():boolean; - shouldShowInvisibles():boolean; - updateInvisibles():void; - transact(fn:Function):any; - beginTransaction():ITransaction; - commitTransaction():any; - abortTransaction():any[]; - inspect():string; - logScreenLines(start:number, end:number):any[]; - handleTokenization():void; - handleGrammarChange():void; - handleMarkerCreated(marker:any):any; - getSelectionMarkerAttributes():{type: string; editorId: number; invalidate: string; }; - getVerticalScrollMargin():number; - setVerticalScrollMargin(verticalScrollMargin:number):void; - getHorizontalScrollMargin():number; - setHorizontalScrollMargin(horizontalScrollMargin:number):void; - getLineHeightInPixels():number; - setLineHeightInPixels(lineHeightInPixels:number):void; - batchCharacterMeasurement(fn:Function):void; - getScopedCharWidth(scopeNames:any, char:any):any; - setScopedCharWidth(scopeNames:any, char:any, width:any):any; - getScopedCharWidths(scopeNames:any):any; - clearScopedCharWidths():any; - getDefaultCharWidth():number; - setDefaultCharWidth(defaultCharWidth:number):void; - setHeight(height:number):void; - getHeight():number; - getClientHeight():number; - setWidth(width:number):void; - getWidth():number; - getScrollTop():number; - setScrollTop(scrollTop:number):void; - getScrollBottom():number; - setScrollBottom(scrollBottom:number):void; - getScrollLeft():number; - setScrollLeft(scrollLeft:number):void; - getScrollRight():number; - setScrollRight(scrollRight:number):void; - getScrollHeight():number; - getScrollWidth():number; - getVisibleRowRange():number; - intersectsVisibleRowRange(startRow:any, endRow:any):any; - selectionIntersectsVisibleRowRange(selection:any):any; - pixelPositionForScreenPosition(screenPosition:any):any; - pixelPositionForBufferPosition(bufferPosition:any):any; - screenPositionForPixelPosition(pixelPosition:any):any; - pixelRectForScreenRange(screenRange:any):any; - scrollToScreenRange(screenRange:any, options:any):any; - scrollToScreenPosition(screenPosition:any, options:any):any; - scrollToBufferPosition(bufferPosition:any, options:any):any; - horizontallyScrollable():any; - verticallyScrollable():any; - getHorizontalScrollbarHeight():any; - setHorizontalScrollbarHeight(height:any):any; - getVerticalScrollbarWidth():any; - setVerticalScrollbarWidth(width:any):any; - // deprecated joinLine():any; - - onDidChange(callback: Function): Disposable; - onDidDestroy(callback: Function): Disposable; - onDidStopChanging(callback: Function): Disposable; - onDidChangeCursorPosition(callback: Function): Disposable; - onDidSave(callback: (event: { path: string }) => void): Disposable; - - decorateMarker(marker: Marker, options: any): Decoration; - getLastCursor(): ICursor; - } - - interface IGrammar { - bundledPackage: boolean; - emitter: any; - fileTypes: [string]; - firstLineRegex: any; - foldingStopMarker: any; - includedGrammarScopes: [any]; - initialRule: any; - injectionSelector: any; - injections: any; - maxTokensPerLine: Number; - name: string; - packageName: string; - path: string; - rawPatterns: [any]; - rawRepository: any; - registration: Disposable; - registry: any; - repository: Object; - scopeName: string; - tokenizeLines: (text: string) => any; - // TBD - - } - - interface IGrammars { - grammarForScopeName(scope: string): IGrammar; - } - - interface IPane /* extends Theorist.Model */ { - itemForURI: (uri:string)=>IEditor; - items:any[]; - activeItem:any; - - serializeParams():any; - deserializeParams(params:any):any; - getViewClass():any; // return type are PaneView - isActive():boolean; - isDestroyed():boolean; - focus():void; - blur():void; - activate():void; - getPanes():IPane[]; - getItems():any[]; - getActiveItem():any; - getActiveEditor():any; - itemAtIndex(index:number):any; - activateNextItem():any; - activatePreviousItem():any; - getActiveItemIndex():number; - activateItemAtIndex(index:number):any; - activateItem(item:any):any; - addItem(item:any, index:number):any; - addItems(items:any[], index:number):any[]; - removeItem(item:any, destroying:any):void; - moveItem(item:any, newIndex:number):void; - moveItemToPane(item:any, pane:IPane, index:number):void; - destroyActiveItem():boolean; // always return false - destroyItem(item:any):boolean; - destroyItems():any[]; - destroyInactiveItems():any[]; - destroy():void; - destroyed():any[]; - promptToSaveItem(item:any):boolean; - saveActiveItem():void; - saveActiveItemAs():void; - saveItem(item:any, nextAction:Function):void; - saveItemAs(item:any, nextAction:Function):void; - saveItems():any[]; - activateItemForURI(uri:any):any; - copyActiveItem():void; - splitLeft(params:any):IPane; - splitRight(params:any):IPane; - splitUp(params:any):IPane; - splitDown(params:any):IPane; - split(orientation:string, side:string, params:any):IPane; - findLeftmostSibling():IPane; - findOrCreateRightmostSibling():IPane; - } - - // https://atom.io/docs/v0.84.0/advanced/serialization - interface ISerializationStatic { - deserialize(data:ISerializationInfo):T; - new (data:T): ISerialization; - } - - interface ISerialization { - serialize():ISerializationInfo; - } - - interface ISerializationInfo { - deserializer: string; - } - - interface IBrowserWindow { - getPosition():number[]; - getSize():number[]; - } - - interface IAtomWindowDimentions { - x:number; - y:number; - width:number; - height:number; - } - - interface IProjectStatic { - pathForRepositoryUrl(repoUrl:string):string; - - new (arg?:{path:any; buffers:any[];}):IProject; - } - - interface IProject /* extends Theorist.Model */ { - // Serializable.includeInto(Project); - - path:string; - /** deprecated */ - rootDirectory?:PathWatcher.IDirectory; - rootDirectories:PathWatcher.IDirectory[]; - - serializeParams():any; - deserializeParams(params:any):any; - destroyed():any; - destroyRepo():any; - destroyUnretainedBuffers():any; - getRepo():IGit; - getPath():string; - setPath(projectPath:string):any; - getRootDirectory():PathWatcher.IDirectory; - resolve(uri:string):string; - relativize(fullPath:string):string; - contains(pathToCheck:string):boolean; - open(filePath:string, options?:any):Q.Promise; - openSync(filePath:string, options?:any):IEditor; - getBuffers():TextBuffer.ITextBuffer; - isPathModified(filePath:string):boolean; - findBufferForPath(filePath:string):TextBuffer.ITextBuffer; - bufferForPathSync(filePath:string):TextBuffer.ITextBuffer; - bufferForPath(filePath:string):Q.Promise; - bufferForId(id:any):TextBuffer.ITextBuffer; - buildBufferSync(absoluteFilePath:string):TextBuffer.ITextBuffer; - buildBuffer(absoluteFilePath:string):Q.Promise; - addBuffer(buffer:TextBuffer.ITextBuffer, options?:any):any; - addBufferAtIndex(buffer:TextBuffer.ITextBuffer, index:number, options?:any):any; - scan(regex:any, options:any, iterator:any):Q.Promise; - replace(regex:any, replacementText:any, filePaths:any, iterator:any):Q.Promise; - buildEditorForBuffer(buffer:any, editorOptions:any):IEditor; - eachBuffer(...args:any[]):any; - - onDidChangePaths(callback: Function): Disposable; - } - - interface IWorkspaceStatic { - new():IWorkspace; - } - - interface IWorkspacePanelOptions{ - item:any; - visible?:boolean; - priority?:number; - } - - interface Panel{ - getItem():any; - getPriority():any; - isVisible():boolean; - show():void; - hide():void; - } - - interface IWorkspace { - addBottomPanel(options:IWorkspacePanelOptions):Panel; - addLeftPanel(options:IWorkspacePanelOptions):Panel; - addRightPanel(options:IWorkspacePanelOptions):Panel; - addTopPanel(options:IWorkspacePanelOptions):Panel; - addModalPanel(options:IWorkspacePanelOptions):Panel; - addOpener(opener: Function): any; - - deserializeParams(params:any):any; - serializeParams():{paneContainer:any;fullScreen:boolean;}; - eachEditor(callback: Function): void; - getTextEditors():IEditor[]; - open(uri:string, options:any):Q.Promise; - openLicense():void; - openSync(uri:string, options:any):any; - openUriInPane(uri: string, pane: any, options: any): Q.Promise; - observeTextEditors(callback: Function): Disposable; - reopenItemSync():any; - registerOpener(opener:(urlToOpen:string)=>any):void; - unregisterOpener(opener:Function):void; - getOpeners():any; - getActivePane(): IPane; - getActivePaneItem(): IPane; - getActiveTextEditor(): IEditor; - getPanes():any; - saveAll():void; - activateNextPane():any; - activatePreviousPane():any; - paneForURI: (uri:string) => IPane; - saveActivePaneItem():any; - saveActivePaneItemAs():any; - destroyActivePaneItem():any; - destroyActivePane():any; - getActiveEditor():IEditor; - increaseFontSize():void; - decreaseFontSize():void; - resetFontSize():void; - itemOpened(item:any):void; - onPaneItemDestroyed(item:any):void; - destroyed():void; - isTextEditor(object: any): boolean; - - onDidChangeActivePaneItem(item:any):Disposable; - } - - interface IAtomSettings { - appVersion: string; - bootstrapScript: string; - devMode: boolean; - initialPath: string; - pathToOpen: string; - resourcePath: string; - shellLoadTime: number; - windowState:string; - } - - interface IAtomState { - mode:string; - packageStates:any; - project:any; - syntax:any; - version:number; - windowDimensions:any; - workspace:any; - } - - interface IDeserializerManager { - deserializers:Function; - add:Function; - remove:Function; - deserialize:Function; - get:Function; - } - - interface IColorlike { - red: number; - green: number; - blue: number; - alpha: number; - } - - class Color { - public static parse(value:string): Color - public static parse(value:IColorlike): Color - public toHexString(): string - public toRGBAString(): string - } - - interface IConfigGetOptions { - sources?:Array; - excludeSources?:Array; - scope?:ScopeDescriptor; - } - - interface IConfigSetOptions { - scopeSelector?:string; - source?:string; - } - - interface IConfigObserveOptions { - scope?:ScopeDescriptor; - } - - interface IConfigChangeEvent { - newValue:T; - oldValue:T; - } - - type ConfigSetting = string | number | boolean | Color | IConfigArray | IConfigObject - - interface IConfigArray extends Array { } - - interface IConfigObject { [key: string]: ConfigSetting } - - interface IConfig { - get(keyPath:string, options?:IConfigGetOptions):ConfigSetting; - set(keyPath:string, value:ConfigSetting, options?:IConfigSetOptions):boolean; - unset(keyPath:string, options?:IConfigSetOptions):void; - observe(keyPath:string, options?:IConfigObserveOptions, callback?:(value:ConfigSetting) => void):Disposable; - onDidChange(keyPath?:string, options?:IConfigObserveOptions, callback?:(event:IConfigChangeEvent) => void):Disposable; - } - - interface IKeymapManager { - defaultTarget:HTMLElement; - // TBD - } - - interface IPackage { - mainModulePath: string; - mainModule: any; - enable(): void; - disable(): void; - isTheme(): boolean; - getType(): string; - getStylesheetType(): string; - load(): IPackage; - reset(): void; - activate(): Q.Promise; - activateNow(): void; - // TBD - } - - interface IPackageManager extends Emissary.IEmitter { - packageDirPaths:string[]; - loadedPackages:any; - activePackages:any; - packageStates:any; - packageActivators:any[]; - - getApmPath():string; - getPackageDirPaths():string; - getPackageState(name:string):any; - setPackageState(name:string, state:any):void; - enablePackage(name:string):any; - disablePackage(name:string):any; - activate():void; - registerPackageActivator(activator:any, types:any):void; - activatePackages(packages:any):void; - activatePackage(name:string):Q.Promise; - deactivatePackages():void; - deactivatePackage(name:string):void; - getActivePackages():any; - getActivePackage(name:string):any; - isPackageActive(name:string):boolean; - unobserveDisabledPackages():void; - observeDisabledPackages():void; - loadPackages():void; - loadPackage(nameOrPath:string):void; - unloadPackages():void; - unloadPackage(name:string):void; - getLoadedPackage(name:string):any; - isPackageLoaded(name:string):boolean; - getLoadedPackages():any; - getLoadedPackagesForTypes(types:any):any[]; - resolvePackagePath(name:string):string; - isPackageDisabled(name:string):boolean; - hasAtomEngine(packagePath:string):boolean; - isBundledPackage(name:string):boolean; - getPackageDependencies():any; - getAvailablePackagePaths():any[]; - getAvailablePackageNames():any[]; - getAvailablePackageMetadata():any[]; - } - - interface INotifications { - addInfo: Function; - addError: Function; - addSuccess: Function; - addWarning: Function; - } - - interface IThemeManager { - // TBD - } - - interface IContextMenuManager { - // TBD - } - - interface IMenuManager { - // TBD - } - - interface IClipboard { - write(text:string, metadata?:any):any; - read():string; - } - - interface ISyntax { - // TBD - } - - interface IWindowEventHandler { - // TBD - } - - interface IAtomStatic extends ISerializationStatic { - version: number; - loadSettings: IAtomSettings; - - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:'editor'):IAtom; - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:'spec'):IAtom; - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:string):IAtom; - - loadState(mode:any):void; - getStatePath(mode:any):string; - getConfigDirPath():string; - getStorageDirPath():string; - getLoadSettings():IAtomSettings; - getCurrentWindow():IBrowserWindow; - getVersion():string; - isReleasedVersion():boolean; - - new(state:IAtomState):IAtom; - } - - class Disposable { - constructor(disposalAction:any) - static isDisposable(object: any): boolean - dispose():void - } - - class CompositeDisposable { - constructor(... disposables: Array) - clear():void - dispose():void - add(... disposables: Array): void - remove(disposable: Disposable): void - delete(disposable: Disposable): void - } - - // https://atom.io/docs/api/v0.106.0/api/classes/Atom.html - /* Global Atom class : instance members */ - interface IAtom { - constructor:IAtomStatic; - - state:IAtomState; - mode:string; - deserializers:IDeserializerManager; - config: IConfig; - commands: ICommandRegistry; - grammars: IGrammars; - keymaps: IKeymapManager; - keymap: IKeymapManager; - packages: IPackageManager; - themes: IThemeManager; - contextManu: IContextMenuManager; - menu: IMenuManager; - notifications: INotifications; // https://github.com/atom/notifications - clipboard:IClipboard; - syntax:ISyntax; - views: IViewRegistry; - windowEventHandler: IWindowEventHandler; - - // really exists? start - subscribe:Function; - unsubscribe:Function; - loadTime:number; - workspaceViewParentSelector:string; - - project: IProject; - workspaceView: IWorkspaceView; - workspace: IWorkspace; - // really exists? end - - initialize:Function; - // registerRepresentationClass:Function; - // registerRepresentationClasses:Function; - setBodyPlatformClass:Function; - getCurrentWindow():IBrowserWindow; - getWindowDimensions:Function; - setWindowDimensions:Function; - restoreWindowDimensions:Function; - storeWindowDimensions:Function; - getLoadSettings:Function; - deserializeProject: Function; - deserializeWorkspaceView:Function; - deserializePackageStates:Function; - deserializeEditorWindow:Function; - startEditorWindow:Function; - unloadEditorWindow:Function; - loadThemes:Function; - watchThemes:Function; - open:Function; - confirm:Function; - showSaveDialog:Function; - showSaveDialogSync:Function; - openDevTools:Function; - toggleDevTools:Function; - executeJavaScriptInDevTools:Function; - reload:Function; - focus:Function; - show:Function; - hide:Function; - setSize:Function; - setPosition:Function; - center:Function; - displayWindow:Function; - close:Function; - exit:Function; - inDevMode:Function; - inSpecMode:Function; - toggleFullScreen:Function; - setFullScreen:Function; - isFullScreen:Function; - getVersion:Function; - isReleasedVersion:Function; - getGitHubAuthTokenName:Function; - setGitHubAuthToken:Function; - getGitHubAuthToken:Function; - getConfigDirPath:Function; - saveSync:Function; - getWindowLoadTime():number; - crashMainProcess:Function; - crashRenderProcess:Function; - beep:Function; - getUserInitScriptPath:Function; - requireUserInitScript:Function; - requireWithGlobals:Function; - - services: any; // TODO: New services api - } - - interface IBufferedNodeProcessStatic { - new (arg:any):IBufferedNodeProcess; - } - - interface IBufferedNodeProcess extends IBufferedProcess { - } - - interface IBufferedProcessStatic { - new (arg:any):IBufferedProcess; - } - - interface IBufferedProcess { - process:Function; - killed:boolean; - - bufferStream:Function; - kill:Function; - } - - interface IGitStatic { - new(path:any, options:any):IGit; - } - - interface IGit { - } - - interface ITokenizedBuffer { - // TBD - } - - interface ITokenizedLine { - // TBD - } - - interface IToken { - // TBD - } - - interface IFoldStatic { - new (displayBuffer:IDisplayBuffer, marker:IMarker):IFold; - // TBD - } - - interface IFold { - id:number; - displayBuffer:IDisplayBuffer; - marker:IMarker; - - // TBD - } - - interface IDisplayBufferMarkerStatic { - new (_arg:{bufferMarker:IMarker; displayBuffer: IDisplayBuffer}):IDisplayBufferMarker; - } - - interface IDisplayBufferMarker extends Emissary.IEmitter, Emissary.ISubscriber { - constructor:IDisplayBufferMarkerStatic; - - id: number; - - bufferMarkerSubscription:any; - oldHeadBufferPosition:TextBuffer.IPoint; - oldHeadScreenPosition:TextBuffer.IPoint; - oldTailBufferPosition:TextBuffer.IPoint; - oldTailScreenPosition:TextBuffer.IPoint; - wasValid:boolean; - - bufferMarker: IMarker; - displayBuffer: IDisplayBuffer; - globalPauseCount:number; - globalQueuedEvents:any; - - subscriptions:Emissary.ISubscription[]; - subscriptionsByObject:any; // WeakMap - - copy(attributes?:any /* maybe IMarker */):IDisplayBufferMarker; - getScreenRange():TextBuffer.IRange; - setScreenRange(screenRange:any, options:any):any; - getBufferRange():TextBuffer.IRange; - setBufferRange(bufferRange:any, options:any):any; - getPixelRange():any; - getHeadScreenPosition():TextBuffer.IPoint; - setHeadScreenPosition(screenPosition:any, options:any):any; - getHeadBufferPosition():TextBuffer.IPoint; - setHeadBufferPosition(bufferPosition:any):any; - getTailScreenPosition():TextBuffer.IPoint; - setTailScreenPosition(screenPosition:any, options:any):any; - getTailBufferPosition():TextBuffer.IPoint; - setTailBufferPosition(bufferPosition:any):any; - plantTail():boolean; - clearTail():boolean; - hasTail():boolean; - isReversed():boolean; - isValid():boolean; - isDestroyed():boolean; - getAttributes():any; - setAttributes(attributes:any):any; - matchesAttributes(attributes:any):any; - destroy():any; - isEqual(other:IDisplayBufferMarker):boolean; - compare(other:IDisplayBufferMarker):boolean; - inspect():string; - destroyed():any; - notifyObservers(_arg:any):any; - } - - interface ITransaction { - // TBD - } - - interface IMarker extends Emissary.IEmitter { - // Serializable.includeInto(Editor); - // Delegator.includeInto(Editor); - - // TBD - } - - interface ITaskStatic { - new(taskPath:any):ITask; - } - - interface ITask { - // TBD - } -} - -declare var atom:AtomCore.IAtom; - -declare module "atom" { - import spacePen = require("space-pen"); - import Q = require("q"); - - var $:typeof spacePen.$; - var $$:typeof spacePen.$$; - var $$$:typeof spacePen.$$$; - - var BufferedNodeProcess:AtomCore.IBufferedNodeProcessStatic; - var BufferedProcess:AtomCore.IBufferedProcessStatic; - var Git:AtomCore.IGitStatic; - var Point:TextBuffer.IPointStatic; - var Range:TextBuffer.IRangeStatic; - - class View extends spacePen.View implements Emissary.ISubscriber { - // Subscriber.includeInto(spacePen.View); - - // inherit from Subscriber - subscribeWith(eventEmitter:any, methodName:string, args:any):any; - - addSubscription(subscription:any):any; - - subscribe(eventEmitterOrSubscription:any, ...args:any[]):any; - - subscribeToCommand(eventEmitter:any, ...args:any[]):any; - - unsubscribe(object?:any):any; - } - - class EditorView extends View { - static characterWidthCache:any; - static configDefaults:any; - static nextEditorId:number; - - static content(params:any):void; - - static classes(_arg?:{mini?:any}):string; - - vScrollMargin:number; - hScrollMargin:number; - lineHeight:any; - charWidth:any; - charHeight:any; - cursorViews:any[]; - selectionViews:any[]; - lineCache:any[]; - isFocused:any; - editor:AtomCore.IEditor; - attached:any; - lineOverdraw:number; - pendingChanges:any[]; - newCursors:any[]; - newSelections:any[]; - redrawOnReattach:any; - bottomPaddingInLines:number; - active:boolean; - - id:number; - - gutter:AtomCore.IGutterView; - overlayer:JQuery; - scrollView:JQuery; - renderedLines:JQuery; - underlayer:JQuery; - hiddenInput:JQuery; - verticalScrollbar:JQuery; - verticalScrollbarContent:JQuery; - - constructor(editor:AtomCore.IEditor); - - initialize(editorOrOptions:AtomCore.IEditor):void; // return type are same as editor method. - initialize(editorOrOptions?:{editor: AtomCore.IEditor; mini:any; placeholderText:any}):void; - - initialize(editorOrOptions:{}):void; // compatible for spacePen.View - - bindKeys():void; - - getEditor():AtomCore.IEditor; - - getText():string; - - setText(text:string):void; - - insertText(text:string, options?:any):TextBuffer.IRange[]; - - setHeightInLines(heightInLines:number):number; - - setWidthInChars(widthInChars:number):number; - - pageDown():void; - - pageUp():void; - - getPageRows():number; - - setShowInvisibles(showInvisibles:boolean):void; - - setInvisibles(invisibles:{ eol:string; space: string; tab: string; cr: string; }):void; - - setShowIndentGuide(showIndentGuide:boolean):void; - - setPlaceholderText(placeholderText:string):void; - - getPlaceholderText():string; - - checkoutHead():boolean; - - configure():Emissary.ISubscription; - - handleEvents():void; - - handleInputEvents():void; - - bringHiddenInputIntoView():JQuery; - - selectOnMousemoveUntilMouseup():any; - - afterAttach(onDom:any):any; - - edit(editor:AtomCore.IEditor):any; - - getModel():AtomCore.IEditor; - - setModel(editor:AtomCore.IEditor):any; - - showBufferConflictAlert(editor:AtomCore.IEditor):any; - - scrollTop(scrollTop:number, options?:any):any; - - scrollBottom(scrollBottom?:number):any; - - scrollLeft(scrollLeft?:number):number; - - scrollRight(scrollRight?:number):any; - - scrollToBottom():any; - - scrollToCursorPosition():any; - - scrollToBufferPosition(bufferPosition:any, options:any):any; - - scrollToScreenPosition(screenPosition:any, options:any):any; - - scrollToPixelPosition(pixelPosition:any, options:any):any; - - highlightFoldsContainingBufferRange(bufferRange:any):any; - - saveScrollPositionForEditor():any; - - toggleSoftTabs():any; - - toggleSoftWrap():any; - - calculateWidthInChars():number; - - calculateHeightInLines():number; - - getScrollbarWidth():number; - - setSoftWrap(softWrap:boolean):any; - - setFontSize(fontSize:number):any; - - getFontSize():number; - - setFontFamily(fontFamily?:string):any; - - getFontFamily():string; - - setLineHeight(lineHeight:number):any; - - redraw():any; - - splitLeft():any; - - splitRight():any; - - splitUp():any; - - splitDown():any; - - getPane():any; // return type are PaneView - - remove(selector:any, keepData:any):any; - - beforeRemove():any; - - getCursorView(index?:number):any; // return type are CursorView - - getCursorViews():any[]; // return type are CursorView[] - - addCursorView(cursor:any, options:any):any; // return type are CursorView - - removeCursorView(cursorView:any):any; - - getSelectionView(index?:number):any; // return type are SelectionView - - getSelectionViews():any[]; // return type are SelectionView[] - - addSelectionView(selection:any):any; - - removeSelectionView(selectionView:any):any; - - removeAllCursorAndSelectionViews():any[]; - - appendToLinesView(view:any):any; - - scrollVertically(pixelPosition:any, _arg:any):any; - - scrollHorizontally(pixelPosition:any):any; - - calculateDimensions():number; - - recalculateDimensions():any; - - updateLayerDimensions():any; - - isHidden():boolean; - - clearRenderedLines():void; - - resetDisplay():any; - - requestDisplayUpdate():any; - - updateDisplay(options?:any):any; - - updateCursorViews():any; - - shouldUpdateCursor(cursorView:any):any; - - updateSelectionViews():any[]; - - shouldUpdateSelection(selectionView:any):any; - - syncCursorAnimations():any[]; - - autoscroll(suppressAutoscroll?:any):any[]; - - updatePlaceholderText():any; - - updateRenderedLines(scrollViewWidth:any):any; - - computeSurroundingEmptyLineChanges(change:any):any; - - computeIntactRanges(renderFrom:any, renderTo:any):any; - - truncateIntactRanges(intactRanges:any, renderFrom:any, renderTo:any):any; - - clearDirtyRanges(intactRanges:any):any; - - clearLine(lineElement:any):any; - - fillDirtyRanges(intactRanges:any, renderFrom:any, renderTo:any):any; - - updatePaddingOfRenderedLines():any; - - getFirstVisibleScreenRow():number; - - getLastVisibleScreenRow():number; - - isScreenRowVisible():boolean; - - handleScreenLinesChange(change:any):any; - - buildLineElementForScreenRow(screenRow:any):any; - - buildLineElementsForScreenRows(startRow:any, endRow:any):any; - - htmlForScreenRows(startRow:any, endRow:any):any; - - htmlForScreenLine(screenLine:any, screenRow:any):any; - - buildIndentation(screenRow:any, editor:any):any; - - buildHtmlEndOfLineInvisibles(screenLine:any):any; - - getEndOfLineInvisibles(screenLine:any):any; - - lineElementForScreenRow(screenRow:any):any; - - toggleLineCommentsInSelection():any; - - pixelPositionForBufferPosition(position:any):any; - - pixelPositionForScreenPosition(position:any):any; - - positionLeftForLineAndColumn(lineElement:any, screenRow:any, screenColumn:any):any; - - measureToColumn(lineElement:any, tokenizedLine:any, screenColumn:any):any; - - getCharacterWidthCache(scopes:any, char:any):any; - - setCharacterWidthCache(scopes:any, char:any, val:any):any; - - clearCharacterWidthCache():any; - - pixelOffsetForScreenPosition(position:any):any; - - screenPositionFromMouseEvent(e:any):any; - - highlightCursorLine():any; - - copyPathToClipboard():any; - - buildLineHtml(_arg:any):any; - - updateScopeStack(line:any, scopeStack:any, desiredScopes:any):any; - - pushScope(line:any, scopeStack:any, scope:any):any; - - popScope(line:any, scopeStack:any):any; - - buildEmptyLineHtml(showIndentGuide:any, eolInvisibles:any, htmlEolInvisibles:any, indentation:any, editor:any, mini:any):any; - - replaceSelectedText(replaceFn:(str:string)=>string):any; - - consolidateSelections(e:any):any; - - logCursorScope():any; - - logScreenLines(start:any, end:any):any; - - logRenderedLines():any; - } - - class ScrollView extends View { - // TBD - } - - interface ISelectListItem { - /** e.g. application:about */ - eventName:string; - /** e.g. Application: About */ - eventDescription:string; - } - - class SelectListView extends View { - static content():any; - - maxItems:number; - scheduleTimeout:any; - inputThrottle:number; - cancelling:boolean; - items:any[]; - list:JQuery; - filterEditorView: JQuery; - - previouslyFocusedElement:JQuery; - - initialize():any; - - schedulePopulateList():number; - - setItems(items:any[]):any; - - setError(message?:string):any; - - setLoading(message?:string):any; - - getFilterQuery():string; - - populateList():any; - - getEmptyMessage(itemCount?:any, filteredItemCount?:any):string; - - setMaxItems(maxItems:number):void; - - selectPreviousItemView():any; - - selectNextItemView():any; - - selectItemView(view:any):any; - - scrollToItemView(view:any):any; - - getSelectedItemView():any; - - getSelectedItem():any; - - confirmSelection():any; - - viewForItem(item:any):JQuery|string|HTMLElement|View; // You must override this method! - confirmed(item:any):any; // You must override this method! - getFilterKey():any; - - focusFilterEditor():any; - - storeFocusedElement():any; - - restoreFocus():any; - - cancelled():any; - - cancel():any; - } - - class Disposable extends AtomCore.Disposable { } - class CompositeDisposable extends AtomCore.CompositeDisposable { } - - var WorkspaceView:AtomCore.IWorkspaceViewStatic; - - var Task:AtomCore.ITaskStatic; - var Workspace:AtomCore.IWorkspaceStatic; -} diff --git a/types/atom/v0/tsconfig.json b/types/atom/v0/tsconfig.json deleted file mode 100644 index 1330ba894b..0000000000 --- a/types/atom/v0/tsconfig.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "atom": [ - "atom/v0" - ], - "pathwatcher": [ - "pathwatcher/v0" - ], - "q": [ - "q/v0" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "api-docs.d.ts", - "atom-tests.ts" - ] -} \ No newline at end of file diff --git a/types/atpl/tslint.json b/types/atpl/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/atpl/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aurelia-knockout/aurelia-knockout-tests.ts b/types/aurelia-knockout/aurelia-knockout-tests.ts deleted file mode 100644 index cf769d0dc2..0000000000 --- a/types/aurelia-knockout/aurelia-knockout-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class ViewModel { - constructor(private knockoutBindable: KnockoutBindable) { - } - - activate(settings: any): void { - this.knockoutBindable.applyBindableValues(settings, this); - this.knockoutBindable.applyBindableValues(settings, this, true); - } -} diff --git a/types/aurelia-knockout/index.d.ts b/types/aurelia-knockout/index.d.ts deleted file mode 100644 index 6f04567a5f..0000000000 --- a/types/aurelia-knockout/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for aurelia-knockout 2.0 -// Project: https://github.com/code-chris/aurelia-knockout -// Definitions by: Christian Kotzbauer -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface KnockoutBindable { - /** - * Applys all values from a data object (usually the activation data) to the corresponding instance fields - * in the current view model if they are marked as @bindable. By default all matching values from the data object - * are applied. To only apply observable values set the last parameter to `true`. Subscriptions are created - * for all Knockout observables in the data object to update the view-model values respectively. - * - * @param data - the data object - * @param target - the target view model - * @param applyOnlyObservables - `true` if only observable values should be applied, false by default. - */ - applyBindableValues(data: any, target: any, applyOnlyObservables?: boolean): void; -} diff --git a/types/aurelia-knockout/tsconfig.json b/types/aurelia-knockout/tsconfig.json deleted file mode 100644 index ceb4710331..0000000000 --- a/types/aurelia-knockout/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "aurelia-knockout-tests.ts" - ] -} \ No newline at end of file diff --git a/types/auth0-angular/tslint.json b/types/auth0-angular/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/auth0-angular/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index b70ff8d688..d05ee2251e 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -109,7 +109,9 @@ webAuth.renewAuth({}, (err, authResult) => {}); webAuth.renewAuth({ nonce: '123', state: '456', - postMessageDataType: 'auth0:silent-authentication' + postMessageDataType: 'auth0:silent-authentication', + usePostMessage: true, + timeout: 30 * 1000 }, (err, authResult) => { // Renewed tokens or error }); @@ -151,7 +153,7 @@ webAuth.client.login({ webAuth.popup.buildPopupHandler(); webAuth.popup.preload({}); -webAuth.popup.authorize({}, (err, data) => { +webAuth.popup.authorize({ domain: "", redirectUri: "", responseType: "code" }, (err, data) => { if (err) /* handle error */ return; // do something with data }); @@ -159,11 +161,11 @@ webAuth.popup.loginWithCredentials({}, (err, data) => { if (err) /* handle error */ return; // do something with data }); -webAuth.popup.passwordlessVerify({}, (err, data) => { +webAuth.popup.passwordlessVerify({ type: "sms", phoneNumber: "", connection: "", verificationCode: "" }, (err, data) => { if (err) /* handle error */ return; // do something with data }); -webAuth.popup.signupAndLogin({}, (err, data) => { +webAuth.popup.signupAndLogin({ email: "", password: "", connection: "" }, (err, data) => { if (err) /* handle error */ return; // do something with data }); @@ -172,6 +174,23 @@ webAuth.login({username: 'bar', password: 'foo'}, (err, data) => {}); webAuth.crossOriginAuthenticationCallback(); +webAuth.checkSession({ + audience: 'https://mystore.com/api/v2', + scope: 'read:order write:order', + redirectUri: 'https://example.com/auth/silent-callback' + }, (err, authResult) => { + // Authentication tokens or error +}); + +webAuth.checkSession({ + audience: 'https://mystore.com/api/v2', + scope: 'read:order write:order', + redirectUri: 'https://example.com/auth/silent-callback', + usePostMessage: true + }, (err, authResult) => { + // Renewed tokens or error +}); + const authentication = new auth0.Authentication({ domain: 'me.auth0.com', clientID: '...', diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 980ba162b5..6110f2fe52 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for Auth0.js 8.10 +// Type definitions for Auth0.js 8.11 // Project: https://github.com/auth0/auth0.js // Definitions by: Adrian Chia // Matt Durrant +// Peter Blazejewicz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export as namespace auth0; @@ -15,82 +16,68 @@ export class Authentication { /** * Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction * - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db + * @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db */ buildAuthorizeUrl(options: any): string; /** * Builds and returns the Logout url in order to initialize a new authN/authZ transaction * - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout + * @param options: https://auth0.com/docs/api/authentication#!#get--v2-logout */ buildLogoutUrl(options?: LogoutOptions): string; /** * Makes a call to the `oauth/token` endpoint with `password` grant type * - * @param {DefaultDirectoryLoginOptions} options: https://auth0.com/docs/api-auth/grant/password - * @param {Function} callback + * @param options: https://auth0.com/docs/api-auth/grant/password */ loginWithDefaultDirectory(options: DefaultDirectoryLoginOptions, callback: Auth0Callback): void; /** * Makes a call to the `/ro` endpoint - * @param {ResourceOwnerLoginOptions} options - * @param {Function} callback * @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead. */ loginWithResourceOwner(options: ResourceOwnerLoginOptions, callback: Auth0Callback): void; /** * Makes a call to the `oauth/token` endpoint with `password-realm` grant type - * @param {DefaultLoginOptions} options - * @param {Function} callback */ login(options: DefaultLoginOptions, callback: Auth0Callback): void; /** * Makes a call to the `oauth/token` endpoint - * @param {any} options - * @param {Function} callback */ oauthToken(options: any, callback: Auth0Callback): void; /** * Makes a call to the `/ssodata` endpoint * - * @param {Function} callback */ getSSOData(callback?: Auth0Callback): void; /** * Makes a call to the `/ssodata` endpoint * - * @param {Boolean} withActiveDirectories - * @param {Function} callback */ getSSOData(withActiveDirectories: boolean, callback?: Auth0Callback): void; /** * Makes a call to the `/userinfo` endpoint and returns the user profile * - * @param {String} accessToken - * @param {Function} callback */ userInfo(accessToken: string, callback: Auth0Callback): void; /** * Makes a call to the `/delegation` endpoint * - * @param {DelegationOptions} options: https://auth0.com/docs/api/authentication#!#post--delegation - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--delegation */ delegation(options: DelegationOptions, callback: Auth0Callback): any; /** * Fetches the user country based on the ip. * - * @param {Function} callback */ getUserCountry(callback: Auth0Callback<{ countryCode: string }>): void; } @@ -101,24 +88,19 @@ export class PasswordlessAuthentication { /** * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction * - * @param {PasswordlessVerifyOptions} options - * @param {Function} callback */ buildVerifyUrl(options: PasswordlessVerifyOptions): string; /** * Initializes a new passwordless authN/authZ transaction * - * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#passwordless */ start(options: PasswordlessStartOptions, callback: Auth0Callback): void; /** * Verifies the passwordless TOTP and returns an error if any. * - * @param {PasswordlessVerifyOptions} options - * @param {Function} callback */ verify(options: PasswordlessVerifyOptions, callback: Auth0Callback): void; } @@ -129,16 +111,14 @@ export class DBConnection { /** * Signup a new user * - * @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} calback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup */ signup(options: DbSignUpOptions, callback: Auth0Callback): void; /** * Initializes the change password flow * - * @param {ChangePasswordOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password */ changePassword(options: ChangePasswordOptions, callback: Auth0Callback): void; } @@ -146,15 +126,12 @@ export class DBConnection { export class Management { /** * Initialize your client class, by using a Non Interactive Client to fetch an access_token via the Client Credentials Grant. - * @param {ManagementOptions} options */ constructor(options: ManagementOptions); /** * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id * - * @param {String} userId - * @param {Function} callback */ getUser(userId: string, callback: Auth0Callback): void; @@ -162,18 +139,12 @@ export class Management { * Updates the user metdata. It will patch the user metdata with the attributes sent. * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id * - * @param {String} userId - * @param {Object} userMetadata - * @param {Function} callback */ patchUserMetadata(userId: string, userMetadata: any, callback: Auth0Callback): void; /** * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities * - * @param {String} userId - * @param {String} secondaryUserToken - * @param {Function} callback */ linkUser(userId: string, secondaryUserToken: string, callback: Auth0Callback): void; } @@ -188,7 +159,7 @@ export class WebAuth { /** * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction * - * @param {AuthorizeOptions} options: https://auth0.com/docs/api/authentication#!#get--authorize_db + * @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db */ authorize(options?: AuthorizeOptions): void; @@ -199,8 +170,7 @@ export class WebAuth { * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be * accepted. * - * @param {ParseHashOptions} options - * @param {Function} callback: any(err, token_payload) + * @param callback: any(err, token_payload) */ parseHash(callback: Auth0Callback): void; @@ -211,17 +181,14 @@ export class WebAuth { * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be * accepted. * - * @param {ParseHashOptions} options - * @param {Function} callback: any(err, token_payload) + * @param callback: any(err, token_payload) */ parseHash(options: ParseHashOptions, callback: Auth0Callback): void; /** * Decodes the id_token and verifies the nonce. * - * @param {String} token - * @param {String} nonce - * @param {Function} callback: function(err, {payload, transaction}) + * @param callback: function(err, {payload, transaction}) */ validateToken(token: string, nonce: string, callback: Auth0Callback): void; @@ -231,24 +198,21 @@ export class WebAuth { * Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social). * If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method. * - * @param {RenewAuthOptions} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint - * @param {Function} callback + * @param options: any valid oauth2 parameter to be sent to the `/authorize` endpoint */ renewAuth(options: RenewAuthOptions, callback: Auth0Callback): void; /** * Initialices a change password transaction * - * @param {ChangePasswordOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password */ changePassword(options: ChangePasswordOptions, callback: Auth0Callback): void; /** * Signs up a new user * - * @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup */ signup(options: DbSignUpOptions, callback: Auth0Callback): void; @@ -256,8 +220,7 @@ export class WebAuth { * Signs up a new user, automatically logs the user in after the signup and returns the user token. * The login will be done using /oauth/token with password-realm grant type. * - * @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup */ signupAndAuthorize(options: DbSignUpOptions, callback: Auth0Callback): void; @@ -268,8 +231,8 @@ export class WebAuth { * This only works when 3rd party cookies are enabled in the browser. * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. * - * @param {CrossOriginLoginOptions} options options used in the {@link authorize} call after the login_ticket is acquired - * @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs. + * @param options options used in the {@link authorize} call after the login_ticket is acquired + * @param cb Callback function called only when an authentication error, like invalid username or password, occurs. * For other types of errors, there will be a redirect to the `redirectUri`. */ login(options: CrossOriginLoginOptions, callback: Auth0Callback): void; @@ -288,7 +251,6 @@ export class WebAuth { * - If the client_id parameter is included, the returnTo URL must be listed in the Allowed Logout URLs set at the client level (see Setting Allowed Logout URLs at the App Level). * - If the client_id parameter is NOT included, the returnTo URL must be listed in the Allowed Logout URLs set at the account level (see Setting Allowed Logout URLs at the Account Level). * - * @param {LogoutOptions} options * @see {@link https://auth0.com/docs/api/authentication#logout} */ logout(options: LogoutOptions): void; @@ -296,19 +258,24 @@ export class WebAuth { /** * Initialices a passwordless authentication transaction * - * @param {PasswordlessStartOptions} options: https://auth0.com/docs/api/authentication#passwordless - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#passwordless */ passwordlessStart(options: PasswordlessStartOptions, callback: Auth0Callback): void; /** * Verifies the passwordless TOTP and redirects to finish the passwordless transaction * - * @method passwordlessVerify - * @param {PasswordlessVerifyOptions} options: - * @param {Function} callback + * @param options: */ passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback): void; + + /** + * Renews an existing session on Auth0's servers using `response_mode=web_message` (i.e. Auth0's hosted login page) + * + * @param options options used in {@link authorize} call + * @param callback: any(err, token_payload) + */ + checkSession(options: CheckSessionOptions, callback: Auth0Callback): void; } export class Redirect { @@ -319,28 +286,35 @@ export class Redirect { * * This method is not compatible with API Auth so if you need to fetch API tokens with audience * you should use {@link authorize} or {@link login}. - * - * @method loginWithCredentials - * @param {Object} options - * @param {String} [options.redirectUri] url that the Auth0 will redirect after Auth with the Authorization Response - * @param {String} [options.responseType] type of the response used. It can be any of the values `code` and `token` - * @param {String} [options.responseMode] how the AuthN response is encoded and redirected back to the client. Supported values are `query` and `fragment` - * @param {String} [options.scope] scopes to be requested during AuthN. e.g. `openid email` - * @param {credentialsCallback} cb */ - loginWithCredentials(options: any, callback: Auth0Callback): void; + loginWithCredentials( + options: { + /** url that the Auth0 will redirect after Auth with the Authorization Response */ + redirectUri?: string, + /** type of the response used. It can be any of the values `code` and `token` */ + responseType?: string, + /** how the AuthN response is encoded and redirected back to the client. */ + responseMode?: "query" | "fragment", + /** scopes to be requested during AuthN. e.g. `openid email` */ + scope: string, + }, + callback: Auth0Callback, + ): void; /** * Signs up a new user and automatically logs the user in after the signup. - * - * @method signupAndLogin - * @param {Object} options - * @param {String} options.email user email address - * @param {String} options.password user password - * @param {String} options.connection name of the connection where the user will be created - * @param {credentialsCallback} cb */ - signupAndLogin(options: any, callback: Auth0Callback): void; + signupAndLogin( + options: { + /** user email address */ + email: string, + /** user password */ + password: string, + /** name of the connection where the user will be created */ + connection: string, + }, + callback: Auth0Callback, + ): void; } export class Popup { @@ -349,98 +323,141 @@ export class Popup { /** * Returns a new instance of the popup handler * - * @method buildPopupHandler */ buildPopupHandler(): any; /** * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser. * - * @method preload - * @param {Object} options: receives the window height and width and any other window feature to be sent to window.open + * @param options: receives the window height and width and any other window feature to be sent to window.open */ preload(options: any): any; /** * Handles the popup logic for the callback page. - * - * @method callback - * @param {Object} options - * @param {String} options.hash the url hash. If not provided it will extract from window.location.hash - * @param {String} [options.state] value originally sent in `state` parameter to {@link authorize} to mitigate XSRF - * @param {String} [options.nonce] value originally sent in `nonce` parameter to {@link authorize} to prevent replay attacks - * @param {String} [options._idTokenVerification] makes parseHash perform or skip `id_token` verification. - * We **strongly** recommend validating the `id_token` yourself if you disable the verification. - * @see {@link parseHash} + * @see {@link parseHash} */ - callback(options: any): void; + callback(options: { + /** + * the url hash. + * @default window.location.hash + */ + hash: string, + /** value originally sent in `state` parameter to {@link authorize} to mitigate XSRF */ + state?: string, + /** value originally sent in `nonce` parameter to {@link authorize} to prevent replay attacks */ + nonce?: string, + /** + * makes parseHash perform or skip `id_token` verification. + * We **strongly** recommend validating the `id_token` yourself if you disable the verification. + */ + _idTokenVerification?: string, + }): void; /** * Shows inside a new window the hosted login page (`/authorize`) in order to start a new authN/authZ transaction and post its result using `postMessage`. - * - * @method authorize - * @param {Object} options - * @param {String} [options.domain] your Auth0 domain - * @param {String} [options.clientID] your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard - * @param {String} options.redirectUri url that the Auth0 will redirect after Auth with the Authorization Response - * @param {String} options.responseType type of the response used by OAuth 2.0 flow. - * It can be any space separated list of the values `code`, `token`, `id_token`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} - * @param {String} [options.responseMode] how the Auth response is encoded and redirected back to the client. - * Supported values are `query`, `fragment` and `form_post`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes} - * @param {String} [options.state] value used to mitigate XSRF attacks. {@link https://auth0.com/docs/protocols/oauth2/oauth-state} - * @param {String} [options.nonce] value used to mitigate replay attacks when using Implicit Grant. {@link https://auth0.com/docs/api-auth/tutorials/nonce} - * @param {String} [options.scope] scopes to be requested during Auth. e.g. `openid email` - * @param {String} [options.audience] identifier of the resource server who will consume the access token issued after Auth - * @param {Boolean} [options.owp] determines if Auth0 should render the relay page or not and the caller is responsible of handling the response. - * @param {authorizeCallback} cb * @see {@link https://auth0.com/docs/api/authentication#authorize-client} */ - authorize(options: any, callback: Auth0Callback): void; + authorize( + options: { + /** your Auth0 domain */ + domain: string, + /** your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard */ + clientId?: string, + /** + * identity provider whose login page will be displayed in the popup. + * If omitted the hosted login page is used. + * {@link https://auth0.com/docs/identityproviders} + */ + connection?: string, + /** url that the Auth0 will redirect after Auth with the Authorization Response */ + redirectUri: string, + /** + * type of the response used by OAuth 2.0 flow. + * It can be any space separated list of the values `code`, `token`, `id_token`. + * {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} + */ + responseType: string, + /** + * how the Auth response is encoded and redirected back to the client. + * {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes} + */ + responseMode?: "query" | "fragment" | "form_post", + /** + * value used to mitigate XSRF attacks. + * {@link https://auth0.com/docs/protocols/oauth2/oauth-state} + */ + state?: string, + /** + * value used to mitigate replay attacks when using Implicit Grant. + * {@link https://auth0.com/docs/api-auth/tutorials/nonce} + */ + nonce?: string, + /** scopes to be requested during Auth. e.g. `openid email` */ + scope?: string, + /** identifier of the resource server who will consume the access token issued after Auth */ + audience?: string, + /** determines if Auth0 should render the relay page or not and the caller is responsible of handling the response. */ + owp?: boolean, + }, + callback: Auth0Callback, + ): void; /** * Performs authentication with username/email and password with a database connection inside a new window * * This method is not compatible with API Auth so if you need to fetch API tokens with audience * you should use {@link authorize} or {@link login}. - * - * @method loginWithCredentials - * @param {Object} options - * @param {String} [options.redirectUri] url that the Auth0 will redirect after Auth with the Authorization Response - * @param {String} [options.responseType] type of the response used. It can be any of the values `code` and `token` - * @param {String} [options.responseMode] how the AuthN response is encoded and redirected back to the client. Supported values are `query` and `fragment` - * @param {String} [options.scope] scopes to be requested during AuthN. e.g. `openid email` - * @param {credentialsCallback} cb */ - loginWithCredentials(options: any, callback: Auth0Callback): void; + loginWithCredentials( + options: { + /** url that the Auth0 will redirect after Auth with the Authorization Response */ + redirectUri?: string, + /** type of the response used. */ + responseType?: "code" | "token", + /** how the AuthN response is encoded and redirected back to the client. */ + responseMode?: "query" | "fragment", + /** scopes to be requested during AuthN. e.g. `openid email` */ + scope?: string, + }, + callback: Auth0Callback, + ): void; /** * Verifies the passwordless TOTP and returns the requested token - * - * @method passwordlessVerify - * @param {Object} options: - * @param {Object} options.type: `sms` or `email` - * @param {Object} options.phoneNumber: only if type = sms - * @param {Object} options.email: only if type = email - * @param {Object} options.connection: the connection name - * @param {Object} options.verificationCode: the TOTP code - * @param {Function} callback */ - passwordlessVerify(options: any, callback: Auth0Callback): void; + passwordlessVerify( + options: { + type: "sms" | "email", + /** only if type = sms */ + phoneNumber?: string, + /** only if type = email */ + email?: string, + /** the connection name */ + connection: string, + /** the TOTP code */ + verificationCode: string, + }, + callback: Auth0Callback, + ): void; /** * Signs up a new user and automatically logs the user in after the signup. * * This method is not compatible with API Auth so if you need to fetch API tokens with audience * you should use {@link authorize} or {@link signupAndAuthorize}. - * - * @method signupAndLogin - * @param {Object} options - * @param {String} options.email user email address - * @param {String} options.password user password - * @param {String} options.connection name of the connection where the user will be created - * @param {credentialsCallback} cb */ - signupAndLogin(options: any, callback: Auth0Callback): void; + signupAndLogin( + options: { + /** user email address */ + email: string, + /** user password */ + password: string, + /** name of the connection where the user will be created */ + connection: string, + }, + callback: Auth0Callback, + ): void; } export class CrossOriginAuthentication { @@ -452,8 +469,8 @@ export class CrossOriginAuthentication { * This only works when 3rd party cookies are enabled in the browser. * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. * - * @param {CrossOriginLoginOptions} options options used in the {@link authorize} call after the login_ticket is acquired - * @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs. + * @param options options used in the {@link authorize} call after the login_ticket is acquired + * @param cb Callback function called only when an authentication error, like invalid username or password, occurs. * For other types of errors, there will be a redirect to the `redirectUri`. */ login(options: CrossOriginLoginOptions, callback: Auth0Callback): void; @@ -517,14 +534,19 @@ export interface Auth0Error { statusText?: string; } +/** + * The contents of the authResult object returned by {@link WebAuth#parseHash } + */ export interface Auth0DecodedHash { accessToken?: string; idToken?: string; idTokenPayload?: any; + appState?: any; refreshToken?: string; state?: string; expiresIn?: number; tokenType?: string; + scope?: string; } /** Represents the response from an API Token Delegation request. */ @@ -659,17 +681,72 @@ export interface ParseHashOptions { } export interface RenewAuthOptions { + /** + * your Auth0 domain + */ domain?: string; + /** + * your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard + */ clientID?: string; + /** + * url that the Auth0 will redirect after Auth with the Authorization Response + */ redirectUri?: string; + /** + * type of the response used by OAuth 2.0 flow. It can be any space separated + * list of the values `code`, `token`, `id_token`. + * {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} + */ responseType?: string; + /** + * how the Auth response is encoded and redirected back to the client. + * Supported values are `query`, `fragment` and `form_post`. + * The `query` value is only supported when `responseType` is `code`. + * {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes} + */ responseMode?: string; + /** + * value used to mitigate XSRF attacks. + * {@link https://auth0.com/docs/protocols/oauth2/oauth-state} + */ state?: string; + /** + * value used to mitigate replay attacks when using Implicit Grant. + * {@link https://auth0.com/docs/api-auth/tutorials/nonce} + */ nonce?: string; + /** + * scopes to be requested during Auth. e.g. `openid email` + */ scope?: string; + /** + * identifier of the resource server who will consume the access token issued after Auth + */ audience?: string; - usePostMessage?: boolean; + /** + * identifier data type to look for in postMessage event data, where events are initiated + * from silent callback urls, before accepting a message event is the event expected. + * A value of false means any postMessage event will trigger a callback. + */ postMessageDataType?: string; + /** + * origin of redirectUri to expect postMessage response from. + * Defaults to the origin of the receiving window. Only used if usePostMessage is truthy. + */ + postMessageOrigin?: string; + /** + * value in milliseconds used to timeout when the `/authorize` call is failing + * as part of the silent authentication with postmessage enabled due to a configuration. + */ + timeout?: number; + /** + * use postMessage to comunicate between the silent callback and the SPA. + * When false the SDK will attempt to parse the url hash should ignore the url hash + * and no extra behaviour is needed + * @default false + */ + usePostMessage?: boolean; } export interface AuthorizeOptions { @@ -684,3 +761,10 @@ export interface AuthorizeOptions { scope?: string; audience?: string; } + +export interface CheckSessionOptions extends AuthorizeOptions { + /** + * optional parameter for auth0 to use postMessage to communicate between the silent callback and the SPA. + */ + usePostMessage?: boolean; +} diff --git a/types/auth0-js/v7/tslint.json b/types/auth0-js/v7/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/auth0-js/v7/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index 0642453a13..c2107b11e4 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -10,6 +10,17 @@ lock.show(); lock.hide(); lock.logout(() => {}); +lock.checkSession({}, function(error: auth0.Auth0Error, authResult: AuthResult): void { + if (error || !authResult) { + lock.show(); + } else { + // user has an active session, so we can use the accessToken directly. + lock.getUserInfo(authResult.accessToken, function(error, profile) { + console.log(error, profile); + }); + } +}); + // Show supports UI arguments const showOptions : Auth0LockShowOptions = { @@ -37,7 +48,7 @@ lock.show(showOptions); // "on" event-driven example -lock.on("authenticated", function(authResult : any) { +lock.on("authenticated", function(authResult: AuthResult) { lock.getProfile(authResult.idToken, function(error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) { if (error) { // Handle error @@ -49,7 +60,7 @@ lock.on("authenticated", function(authResult : any) { }); }); -lock.on("authenticated", function(authResult : any) { +lock.on("authenticated", function(authResult: AuthResult) { lock.getUserInfo(authResult.accessToken, function(error, profile) { if (error) { // Handle error diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 0a57d988ce..8ed6b50c87 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -154,6 +154,7 @@ interface Auth0LockStatic { // deprecated getProfile(token: string, callback: (error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) => void): void; getUserInfo(token: string, callback: (error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) => void): void; + checkSession(options: any, callback: (error: auth0.Auth0Error, authResult: AuthResult | undefined) => void): void; // https://github.com/auth0/lock#resumeauthhash-callback resumeAuth(hash: string, callback: (error: auth0.Auth0Error, authResult: AuthResult) => void): void; show(options?: Auth0LockShowOptions): void; diff --git a/types/auth0.widget/tslint.json b/types/auth0.widget/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/auth0.widget/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index 08a866e9b1..e9e347cc69 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -111,3 +111,23 @@ management // Update app metadata using callback management .updateAppMetadata({id: "user_id"}, {"key": "value"}, (err: Error, users: auth0.User) => {}); + + +management.getUsersByEmail('email@address.com', (err, users) => { + console.log(users); +}); + +management.getUsersByEmail('email@address.com').then((users) => { + console.log(users); +}); + +// Using different client settings. + +const retryableManagementClient = new auth0.ManagementClient({ + clientId: '', + clientSecret: '', + domain: 'xxx.auth0.com', + retry: { + enabled : true + } +}); diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 353fa38559..479bf70c03 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0 2.3 +// Type definitions for auth0 2.6 // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -14,6 +14,7 @@ export interface ManagementClientOptions { audience?: string; scope?: string; tokenProvider?: TokenProvider; + retry?: RetryOptions; } export interface TokenProvider { @@ -21,6 +22,17 @@ export interface TokenProvider { cacheTTLInSeconds?: number; } +export interface RetryOptions { + /** + * Default value is `true`. + */ + enabled?: boolean; + /** + * Default value is `10`. + */ + maxRetries?: number; +} + export interface UserMetadata { } export interface AppMetadata { } @@ -60,6 +72,191 @@ export interface GetUsersData { search_engine?: string; } +export interface Rule { + /** + * The name of the rule. + */ + name?: string; + /** + * The rule's identifier. + */ + id?: string; + /** + * The code to be executed when the rule runs. + */ + script?: string; + /** + * The rule's execution stage. + */ + stage?: string; + /** + * `true` if the connection is enabled, `false` otherwise. + */ + enabled?: boolean; + /** + * The rule's order in relation to other rules. A rule with a lower order than another rule executes first. + */ + order?: number; +} + + +export interface Client { + /** + * The name of the client. + */ + name?: string; + /** + * Free text description of the purpose of the Client. (Max character length: `140`). + */ + description?: string; + /** + * The id of the client. + */ + client_id?: string; + /** + * The client secret, it must not be public. + */ + client_secret?: string; + /** + * The type of application this client represents. + */ + app_type?: string; + /** + * The URL of the client logo (recommended size: 150x150). + */ + logo_uri?: string; + /** + * Whether this client a first party client or not. + */ + is_first_party?: boolean; + /** + * Whether this client will conform to strict OIDC specifications. + */ + oidc_conformant?: boolean; + /** + * The URLs that Auth0 can use to as a callback for the client. + */ + callbacks?: string[]; + allowed_origins?: string[]; + web_origins?: string[]; + client_aliases?: string[]; + allowed_clients?: string[]; + allowed_logout_urls?: string[]; + jwt_configuration?: any; + /** + * Client signing keys. + */ + signing_keys?: string[]; + encryption_key?: any; + sso?: boolean; + /** + * `true` to disable Single Sign On, `false` otherwise (default: `false`) + */ + sso_disabled?: boolean; + /** + * `true` if this client can be used to make cross-origin authentication requests, `false` otherwise (default: `false`) + */ + cross_origin_auth?: boolean; + /** + * Url fo the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + cross_origin_loc?: string; + /** + * `true` if the custom login page is to be used, `false` otherwise. (default: `true`) + */ + custom_login_page_on?: boolean; + custom_login_page?: string; + custom_login_page_preview?: string; + form_template?: string; + addons?: any; + /** + * Defines the requested authentication method for the token endpoint. Possible values are 'none' (public client without a client secret), 'client_secret_post' (client uses HTTP POST parameters) or 'client_secret_basic' (client uses HTTP Basic) ['none' or 'client_secret_post' or 'client_secret_basic'] + */ + token_endpoint_auth_method?: string; + client_metadata?: any; + mobile?: any; +} + +export interface ResourceServer { + /** + * The identifier of the resource server. + */ + identifier?: string; + scopes?: { description: string, value: string }[]; + /** + * The algorithm used to sign tokens. + */ + signing_alg?: 'HS256' | 'RS256'; + /** + * The secret used to sign tokens when using symmetric algorithms. + */ + signing_secret?: string; + /** + * Allows issuance of refresh tokens for this entity. + */ + allow_offline_access?: boolean; + /** + * Flag this entity as capable of skipping consent. + */ + skip_consent_for_verifiable_first_party_clients?: boolean; + /** + * The amount of time (in seconds) that the token will be valid after being issued. + */ + token_lifetime?: number; + /** + * The amount of time (in seconds) that the token will be valid after being issued from browser based flows. Value cannot be larger than token_lifetime.. + */ + token_lifetime_for_web?: number; + /** + * The ID of the resource server. + */ + id?: string; + /** + * A friendly name for the resource server. + */ + name?: string; +} + +export interface CreateResourceServer extends ResourceServer { + /** + * The identifier of the client. + */ + identifier: string; +} + +export interface CreateClientGrant { + /** + * The identifier of the resource server. + */ + client_id: string; + /** + * The audience. + */ + audience: string; + scope: string[]; +} + +export type UpdateClientGrant = Pick, 'scope'>; + +export type ClientGrant = Partial & { + /** + * The id of the client grant. + */ + id?: string; +}; + +export interface CreateClientGrant { + /** + * The identifier of the resource server. + */ + client_id: string; + /** + * The audience. + */ + audience: string; + scope: string[]; +} + export interface User { email?: string; email_verified?: boolean; @@ -311,33 +508,34 @@ export class ManagementClient { // Clients - getClients(): Promise; - getClients(cb: (err: Error, data: any) => void): void; + getClients(): Promise; + getClients(cb: (err: Error, clients: Client[]) => void): void; - getClient(params: ClientParams): Promise; - getClient(params: ClientParams, cb: (err: Error, data: any) => void): void; + getClient(params: ClientParams): Promise; + getClient(params: ClientParams, cb: (err: Error, client: Client) => void): void; - createClient(data: Data): Promise; - createClient(data: Data, cb: (err: Error, data: any) => void): void; + createClient(data: Data): Promise; + createClient(data: Data, cb: (err: Error, client: Client) => void): void; - updateClient(params: ClientParams, data: Data): Promise; - updateClient(params: ClientParams, data: Data, cb: (err: Error, data: any) => void): void; + updateClient(params: ClientParams, data: Data): Promise; + updateClient(params: ClientParams, data: Data, cb: (err: Error, client: Client) => void): void; - deleteClient(params: ClientParams): Promise; - deleteClient(params: ClientParams, cb: (err: Error, data: any) => void): void; + deleteClient(params: ClientParams): Promise; + deleteClient(params: ClientParams, cb: (err: Error) => void): void; + // Client Grants - getClientGrants(): Promise; - getClientGrants(cb: (err: Error, data: any) => void): void; + getClientGrants(): Promise; + getClientGrants(cb: (err: Error, data: ClientGrant[]) => void): void; - createClientGrant(data: Data): Promise; - createClientGrant(data: Data, cb: (err: Error, data: any) => void): void; + createClientGrant(data: CreateClientGrant): Promise; + createClientGrant(data: CreateClientGrant, cb: (err: Error, data: ClientGrant) => void): void; - updateClientGrant(params: ObjectWithId, data: Data): Promise; - updateClientGrant(params: ObjectWithId, data: Data, cb: (err: Error, data: any) => void): void; + updateClientGrant(params: ObjectWithId, data: UpdateClientGrant): Promise; + updateClientGrant(params: ObjectWithId, data: UpdateClientGrant, cb: (err: Error, data: ClientGrant) => void): void; - deleteClientGrant(params: ObjectWithId): Promise; - deleteClientGrant(params: ObjectWithId, cb: (err: Error, data: any) => void): void; + deleteClientGrant(params: ObjectWithId): Promise; + deleteClientGrant(params: ObjectWithId, cb: (err: Error) => void): void; // Device Keys @@ -352,20 +550,20 @@ export class ManagementClient { // Rules - getRules(): Promise; - getRules(cb: (err: Error, data: any) => void): void; + getRules(): Promise; + getRules(cb: (err: Error, rules: Rule[]) => void): void; - getRule(params: ClientParams): Promise; - getRule(params: ClientParams, cb: (err: Error, data: any) => void): void; + getRule(params: ClientParams): Promise; + getRule(params: ClientParams, cb: (err: Error, rule: Rule) => void): void; - createRules(data: Data): Promise; - createRules(data: Data, cb: (err: Error, data: any) => void): void; + createRule(data: Data): Promise; + createRule(data: Data, cb: (err: Error, rule: Rule) => void): void; - updateRule(params: ObjectWithId, data: Data): Promise; - updateRule(params: ObjectWithId, data: Data, cb: (err: Error, data: any) => void): void; + updateRule(params: ObjectWithId, data: Data): Promise; + updateRule(params: ObjectWithId, data: Data, cb: (err: Error, rule: Rule) => void): void; - deleteRule(params: ObjectWithId): Promise; - deleteRule(params: ObjectWithId, cb: (err: Error, data: any) => void): void; + deleteRule(params: ObjectWithId): Promise; + deleteRule(params: ObjectWithId, cb: (err: Error) => void): void; // Users @@ -376,8 +574,11 @@ export class ManagementClient { getUser(params: ObjectWithId): Promise; getUser(params: ObjectWithId, cb?: (err: Error, user: User) => void): void; + getUsersByEmail(email: string): Promise; + getUsersByEmail(email: string, cb?: (err: Error, users: User[]) => void): void; + createUser(data: CreateUserData): Promise; - createUser(data: CreateUserData, cb: (err: Error, data: User) => void): void; + createUser(data: CreateUserData, cb: (err: Error, user: User) => void): void; updateUser(params: ObjectWithId, data: UpdateUserData): Promise; updateUser(params: ObjectWithId, data: UpdateUserData, cb: (err: Error, data: User) => void): void; @@ -423,8 +624,8 @@ export class ManagementClient { deleteEmailProvider(): Promise; deleteEmailProvider(cb?: (err: Error, data: any) => void): void; - updateEmailProvider(data: Data): Promise; - updateEmailProvider(data: Data, cb?: (err: Error, data: any) => void): void; + updateEmailProvider(params: {}, data: Data): Promise; + updateEmailProvider(params: {}, data: Data, cb?: (err: Error, data: any) => void): void; // Statistics @@ -469,22 +670,18 @@ export class ManagementClient { // Resource Server - createResourceServer(data: Data): Promise; - createResourceServer(data: Data, cb?: (err: Error, data: any) => void): void; - - getResourceServers(): Promise; - getResourceServers(cb?: (err: Error, data: any) => void): void; - - getResourceServer(data: ObjectWithId): Promise; - getResourceServer(data: ObjectWithId, cb?: (err: Error, data: any) => void): void; - - deleteResourceServer(params: ObjectWithId): Promise; - deleteResourceServer(params: ObjectWithId, cb?: (err: Error, data: any) => void): void; - - updateResourceServer(params: ObjectWithId, data: Data): Promise; - updateResourceServer(params: ObjectWithId, data: Data, cb?: (err: Error, data: any) => void): void; + createResourceServer(data: CreateResourceServer): Promise; + createResourceServer(data: CreateResourceServer, cb?: (err: Error, data: ResourceServer) => void): void; + getResourceServers(): Promise; + getResourceServers(cb?: (err: Error, data: ResourceServer[]) => void): void; + getResourceServer(data: ObjectWithId): Promise; + getResourceServer(data: ObjectWithId, cb?: (err: Error, data: ResourceServer) => void): void; + deleteResourceServer(params: ObjectWithId): Promise; + deleteResourceServer(params: ObjectWithId, cb?: (err: Error) => void): void; + updateResourceServer(params: ObjectWithId, data: ResourceServer): Promise; + updateResourceServer(params: ObjectWithId, data: ResourceServer, cb?: (err: Error, data: ResourceServer) => void): void; } diff --git a/types/auth0/tslint.json b/types/auth0/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/auth0/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index 7f01a53e3a..969c703478 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for AutobahnJS v0.9.7 // Project: http://autobahn.ws/js/ -// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino +// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -179,6 +179,7 @@ declare namespace autobahn { interface ISubscribeOptions { match?: string; + get_retained?: boolean; } interface IRegisterOptions { diff --git a/types/autobahn/tslint.json b/types/autobahn/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/autobahn/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autobind-decorator/autobind-decorator-tests.ts b/types/autobind-decorator/autobind-decorator-tests.ts deleted file mode 100644 index f5a0c76328..0000000000 --- a/types/autobind-decorator/autobind-decorator-tests.ts +++ /dev/null @@ -1,42 +0,0 @@ - -import autobind = require('autobind-decorator'); - -class Test { - public static what: string = 'static'; - - @autobind - public static test(): void { - console.log(this.what); - } - - public constructor(public what: string) { - this.what = what; - } - - @autobind - public test(): void { - console.warn(this.what); - } -} - -const tester: Test = new Test('bind'); -const { test } = tester; -tester.test(); // warns 'bind'. -test(); // warns 'bind'. -Test.test(); // logs 'static'. - -@autobind -class Component { - public constructor(private someMember: string) { - this.someMember = someMember; - } - - public someMethod(): void { - console.error(this.someMember); - } -} - -const component: Component = new Component('React vs Angular2'); -const { someMethod } = component; -component.someMethod(); // errors 'React vs Angular2' -someMethod(); // errors 'React vs Angular2' diff --git a/types/autobind-decorator/index.d.ts b/types/autobind-decorator/index.d.ts deleted file mode 100644 index d8d74bbfec..0000000000 --- a/types/autobind-decorator/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Type definitions for autobind-decorator v1.3.3 -// Project: https://github.com/andreypopp/autobind-decorator -// Definitions by: Ivo Stratev -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module 'autobind-decorator' { - function autobind(target: TFunction): TFunction | void; - function autobind(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void; - export = autobind; -} diff --git a/types/autobind-decorator/tsconfig.json b/types/autobind-decorator/tsconfig.json deleted file mode 100644 index 0b05ea04fb..0000000000 --- a/types/autobind-decorator/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "experimentalDecorators": true, - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "autobind-decorator-tests.ts" - ] -} \ No newline at end of file diff --git a/types/autolinker/tslint.json b/types/autolinker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/autolinker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autoprefixer-core/tslint.json b/types/autoprefixer-core/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/autoprefixer-core/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autosize/index.d.ts b/types/autosize/index.d.ts index a189b32817..b66dcc2aae 100644 --- a/types/autosize/index.d.ts +++ b/types/autosize/index.d.ts @@ -8,17 +8,14 @@ /** * Attach autosize to NodeList - * @param elements */ declare function autosize(elements: NodeList): NodeList; /** * Attach autosize to Element - * @param element */ declare function autosize(element: Element): Element; /** * Attach autosize to JQuery collection - * @param collection */ declare function autosize(collection: JQuery): JQuery; @@ -27,37 +24,31 @@ declare namespace autosize { * Triggers the height adjustment for an assigned textarea element. * Autosize will automatically adjust the textarea height on keyboard and window resize events. * There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element. - * @param elements */ function update(elements: NodeList): NodeList; /** * Triggers the height adjustment for an assigned textarea element. * Autosize will automatically adjust the textarea height on keyboard and window resize events. * There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element. - * @param element */ function update(element: Element): Element; /** * Triggers the height adjustment for an assigned textarea element. * Autosize will automatically adjust the textarea height on keyboard and window resize events. * There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element. - * @param collection */ function update(collection: JQuery): JQuery; /** * Removes Autosize and reverts any changes it made to the textarea element. - * @param elements */ function destroy(elements: NodeList): NodeList; /** * Removes Autosize and reverts any changes it made to the textarea element. - * @param element */ function destroy(element: Element): Element; /** * Removes Autosize and reverts any changes it made to the textarea element. - * @param collection */ function destroy(collection: JQuery): JQuery; } diff --git a/types/avoscloud-sdk/tslint.json b/types/avoscloud-sdk/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/avoscloud-sdk/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aws-iot-device-sdk/index.d.ts b/types/aws-iot-device-sdk/index.d.ts index 38cf00840d..f2bcab818c 100644 --- a/types/aws-iot-device-sdk/index.d.ts +++ b/types/aws-iot-device-sdk/index.d.ts @@ -32,19 +32,19 @@ export interface DeviceOptions extends mqtt.IClientOptions { * same as certPath, but can also accept a buffer containing client * certificate data */ - clientCert?: string; + clientCert?: string | Buffer; /** * same as keyPath, but can also accept a buffer containing private key * data */ - privateKey?: string; + privateKey?: string | Buffer; /** * same as caPath, but can also accept a buffer containing CA certificate * data */ - caCert?: string; + caCert?: string | Buffer; /** * set to "true" to automatically re-subscribe to topics after diff --git a/types/aws-iot-device-sdk/tslint.json b/types/aws-iot-device-sdk/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aws-iot-device-sdk/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aws-lambda-mock-context/index.d.ts b/types/aws-lambda-mock-context/index.d.ts index 0ccd43c876..6fc5fda67a 100644 --- a/types/aws-lambda-mock-context/index.d.ts +++ b/types/aws-lambda-mock-context/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/moskalyk/typed-aws-lambda-mock-context // Definitions by: Morgan Moskalyk , Anand Nimkar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare function context(options?: Options): Context; diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 4e404fcd55..1d756f21e0 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -4,6 +4,7 @@ var anyObj: any = { abc: 123 }; var num: number = 5; var error: Error = new Error(); var b: boolean = true; +var apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; var apiGwEvt: AWSLambda.APIGatewayEvent; var customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent; var clientCtx: AWSLambda.ClientContext; @@ -22,33 +23,33 @@ var snsEvtRec: AWSLambda.SNSEventRecord; var snsMsg: AWSLambda.SNSMessage; var snsMsgAttr: AWSLambda.SNSMessageAttribute; var snsMsgAttrs: AWSLambda.SNSMessageAttributes; -var S3EvtRec: AWSLambda.S3EventRecord = { +var S3EvtRec: AWSLambda.S3EventRecord = { eventVersion: '2.0', eventSource: 'aws:s3', awsRegion: 'us-east-1', eventTime: '1970-01-01T00:00:00.000Z', eventName: 'ObjectCreated:Put', - userIdentity: { + userIdentity: { principalId: 'AIDAJDPLRKLG7UEXAMPLE' }, - requestParameters:{ + requestParameters:{ sourceIPAddress: '127.0.0.1' }, - responseElements: { + responseElements: { 'x-amz-request-id': 'C3D13FE58DE4C810', 'x-amz-id-2': 'FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD' }, - s3: { + s3: { s3SchemaVersion: '1.0', configurationId: 'testConfigRule', - bucket: { + bucket: { name: 'mybucket', - ownerIdentity: { + ownerIdentity: { principalId: 'A3NL1KOZZKExample' }, arn: 'arn:aws:s3:::mybucket' }, - object: { + object: { key: 'HappyFace.jpg', size: 1024, eTag: 'd41d8cd98f00b204e9800998ecf8427e', @@ -64,6 +65,30 @@ var S3CreateEvent: AWSLambda.S3CreateEvent = { var cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent; var cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent; var cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse; +var cloudwatchLogsEvent: AWSLambda.CloudWatchLogsEvent; +var cloudwatchLogsDecodedData: AWSLambda.CloudWatchLogsDecodedData; + +/* API Gateway Event request context */ +str = apiGwEvtReqCtx.accountId; +str = apiGwEvtReqCtx.apiId; +authResponseContext = apiGwEvtReqCtx.authorizer; +str = apiGwEvtReqCtx.httpMethod; +str = apiGwEvtReqCtx.identity.accessKey; +str = apiGwEvtReqCtx.identity.accountId; +str = apiGwEvtReqCtx.identity.apiKey; +str = apiGwEvtReqCtx.identity.caller; +str = apiGwEvtReqCtx.identity.cognitoAuthenticationProvider; +str = apiGwEvtReqCtx.identity.cognitoAuthenticationType; +str = apiGwEvtReqCtx.identity.cognitoIdentityId; +str = apiGwEvtReqCtx.identity.cognitoIdentityPoolId; +str = apiGwEvtReqCtx.identity.sourceIp; +str = apiGwEvtReqCtx.identity.user; +str = apiGwEvtReqCtx.identity.userAgent; +str = apiGwEvtReqCtx.identity.userArn; +str = apiGwEvtReqCtx.stage; +str = apiGwEvtReqCtx.requestId; +str = apiGwEvtReqCtx.resourceId; +str = apiGwEvtReqCtx.resourcePath; /* API Gateway Event */ str = apiGwEvt.body; @@ -74,31 +99,112 @@ str = apiGwEvt.path; str = apiGwEvt.pathParameters["example"]; str = apiGwEvt.queryStringParameters["example"]; str = apiGwEvt.stageVariables["example"]; -str = apiGwEvt.requestContext.accountId; -str = apiGwEvt.requestContext.apiId; -str = apiGwEvt.requestContext.httpMethod; -str = apiGwEvt.requestContext.identity.accessKey; -str = apiGwEvt.requestContext.identity.accountId; -str = apiGwEvt.requestContext.identity.apiKey; -str = apiGwEvt.requestContext.identity.caller; -str = apiGwEvt.requestContext.identity.cognitoAuthenticationProvider; -str = apiGwEvt.requestContext.identity.cognitoAuthenticationType; -str = apiGwEvt.requestContext.identity.cognitoIdentityId; -str = apiGwEvt.requestContext.identity.cognitoIdentityPoolId; -str = apiGwEvt.requestContext.identity.sourceIp; -str = apiGwEvt.requestContext.identity.user; -str = apiGwEvt.requestContext.identity.userAgent; -str = apiGwEvt.requestContext.identity.userArn; -str = apiGwEvt.requestContext.stage; -str = apiGwEvt.requestContext.requestId; -str = apiGwEvt.requestContext.resourceId; -str = apiGwEvt.requestContext.resourcePath; +apiGwEvtReqCtx = apiGwEvt.requestContext; str = apiGwEvt.resource; /* API Gateway CustomAuthorizer Event */ str = customAuthorizerEvt.type; -str = customAuthorizerEvt.authorizationToken; str = customAuthorizerEvt.methodArn; +str = customAuthorizerEvt.authorizationToken; +str = apiGwEvt.pathParameters["example"]; +str = apiGwEvt.queryStringParameters["example"]; +str = apiGwEvt.stageVariables["example"]; +apiGwEvtReqCtx = apiGwEvt.requestContext; + +/* DynamoDB Stream Event */ +var dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = { + Records: [ + { + eventID: '1', + eventVersion: '1.0', + dynamodb: { + Keys: { + Id: { + N: '101' + } + }, + NewImage: { + Message: { + S: 'New item!' + }, + Id: { + N: '101' + } + }, + StreamViewType: 'NEW_AND_OLD_IMAGES', + SequenceNumber: '111', + SizeBytes: 26 + }, + awsRegion: 'us-west-2', + eventName: 'INSERT', + eventSourceARN: + 'arn:aws:dynamodb:us-west-2:account-id:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899', + eventSource: 'aws:dynamodb' + }, + { + eventID: '2', + eventVersion: '1.0', + dynamodb: { + OldImage: { + Message: { + S: 'New item!' + }, + Id: { + N: '101' + } + }, + SequenceNumber: '222', + Keys: { + Id: { + N: '101' + } + }, + SizeBytes: 59, + NewImage: { + Message: { + S: 'This item has changed' + }, + Id: { + N: '101' + } + }, + StreamViewType: 'NEW_AND_OLD_IMAGES' + }, + awsRegion: 'us-west-2', + eventName: 'MODIFY', + eventSourceARN: + 'arn:aws:dynamodb:us-west-2:account-id:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899', + eventSource: 'aws:dynamodb' + }, + { + eventID: '3', + eventVersion: '1.0', + dynamodb: { + Keys: { + Id: { + N: '101' + } + }, + SizeBytes: 38, + SequenceNumber: '333', + OldImage: { + Message: { + S: 'This item has changed' + }, + Id: { + N: '101' + } + }, + StreamViewType: 'NEW_AND_OLD_IMAGES' + }, + awsRegion: 'us-west-2', + eventName: 'REMOVE', + eventSourceARN: + 'arn:aws:dynamodb:us-west-2:account-id:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899', + eventSource: 'aws:dynamodb' + } + ] +}; /* SNS Event */ snsEvtRecs = snsEvt.Records; @@ -260,6 +366,18 @@ clientCtx = context.clientContext; str = identity.cognitoIdentityId; str = identity.cognitoIdentityPoolId; +/* CloudWatch Logs */ +str = cloudwatchLogsEvent.awslogs.data; + +str = cloudwatchLogsDecodedData.owner; +str = cloudwatchLogsDecodedData.logGroup; +str = cloudwatchLogsDecodedData.logStream; +str = cloudwatchLogsDecodedData.subscriptionFilters[0]; +str = cloudwatchLogsDecodedData.messageType; +str = cloudwatchLogsDecodedData.logEvents[0].id; +num = cloudwatchLogsDecodedData.logEvents[0].timestamp; +str = cloudwatchLogsDecodedData.logEvents[0].message; + /* ClientContext */ clientContextClient = clientCtx.client; anyObj = clientCtx.Custom; @@ -285,6 +403,9 @@ function callback(cb: AWSLambda.Callback) { cb(null); cb(error); cb(null, anyObj); + cb(null, b); + cb(null, str); + cb(null, num); } /* Proxy Callback */ @@ -303,6 +424,131 @@ function customAuthorizerCallback(cb: AWSLambda.CustomAuthorizerCallback) { cb(null, authResponse); } +/* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ +var CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { + "Records": [ + { + "cf": { + "config": { + "distributionId": "EDFDVBD6EXAMPLE", + "requestId": "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE==" + }, + "request": { + "clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334", + "method": "GET", + "uri": "/picture.jpg", + "querystring": "size=large", + "headers": { + "host": [ + { + "key": "Host", + "value": "d111111abcdef8.cloudfront.net" + } + ], + "user-agent": [ + { + "key": "User-Agent", + "value": "curl/7.51.0" + } + ] + }, + "origin": { + "custom": { + "customHeaders": { + "my-origin-custom-header": [ + { + "key": "My-Origin-Custom-Header", + "value": "Test" + } + ] + }, + "domainName": "example.com", + "keepaliveTimeout": 5, + "path": "/custom_path", + "port": 443, + "protocol": "https", + "readTimeout": 5, + "sslProtocols": [ + "TLSv1", + "TLSv1.1" + ] + }, + "s3": { + "authMethod": "origin-access-identity", + "customHeaders": { + "my-origin-custom-header": [ + { + "key": "My-Origin-Custom-Header", + "value": "Test" + } + ] + }, + "domainName": "my-bucket.s3.amazonaws.com", + "path": "/s3_path", + "region": "us-east-1" + } + } + } + } + } + ] +}; + +var CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = { + "Records": [ + { + "cf": { + "config": { + "distributionId": "EDFDVBD6EXAMPLE", + "requestId": "xGN7KWpVEmB9Dp7ctcVFQC4E-nrcOcEKS3QyAez--06dV7TEXAMPLE==" + }, + "request": { + "clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334", + "method": "GET", + "uri": "/picture.jpg", + "querystring": "size=large", + "headers": { + "host": [ + { + "key": "Host", + "value": "d111111abcdef8.cloudfront.net" + } + ], + "user-agent": [ + { + "key": "User-Agent", + "value": "curl/7.18.1" + } + ] + } + }, + "response": { + "status": "200", + "statusDescription": "OK", + "headers": { + "server": [ + { + "key": "Server", + "value": "MyCustomOrigin" + } + ], + "set-cookie": [ + { + "key": "Set-Cookie", + "value": "theme=light" + }, + { + "key": "Set-Cookie", + "value": "sessionToken=abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT" + } + ] + } + } + } + } + ] +}; + /* Compatibility functions */ context.done(); context.done(error); @@ -315,5 +561,8 @@ context.fail(str); /* Handler */ let handler: AWSLambda.Handler = (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; +let asyncHandler: AWSLambda.Handler = async (event: any, context: AWSLambda.Context, cb: AWSLambda.Callback) => { }; let proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { }; -let CustomAuthorizerHandler: AWSLambda.CustomAuthorizerHandler = (event: AWSLambda.CustomAuthorizerEvent, context: AWSLambda.Context, cb: AWSLambda.CustomAuthorizerCallback) => { }; +let asyncProxyHandler: AWSLambda.ProxyHandler = async (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { }; +let customAuthorizerHandler: AWSLambda.CustomAuthorizerHandler = (event: AWSLambda.CustomAuthorizerEvent, context: AWSLambda.Context, cb: AWSLambda.CustomAuthorizerCallback) => { }; +let asyncCustomAuthorizerHandler: AWSLambda.CustomAuthorizerHandler = async (event: AWSLambda.CustomAuthorizerEvent, context: AWSLambda.Context, cb: AWSLambda.CustomAuthorizerCallback) => { }; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index ee8790705e..320cf562f8 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -8,7 +8,38 @@ // Yoriki Yamaguchi // wwwy3y3 // Ishaan Malhi +// Michael Marner +// Daniel Cottone +// Kostya Misura +// Markus Tacker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// API Gateway "event" request context +interface APIGatewayEventRequestContext { + accountId: string; + apiId: string; + authorizer?: AuthResponseContext | null | undefined; + httpMethod: string; + identity: { + accessKey: string | null; + accountId: string | null; + apiKey: string | null; + caller: string | null; + cognitoAuthenticationProvider: string | null; + cognitoAuthenticationType: string | null; + cognitoIdentityId: string | null; + cognitoIdentityPoolId: string | null; + sourceIp: string; + user: string | null; + userAgent: string | null; + userArn: string | null; + }, + stage: string; + requestId: string; + resourceId: string; + resourcePath: string; +} // API Gateway "event" interface APIGatewayEvent { @@ -20,37 +51,66 @@ interface APIGatewayEvent { pathParameters: { [name: string]: string } | null; queryStringParameters: { [name: string]: string } | null; stageVariables: { [name: string]: string } | null; - requestContext: { - accountId: string; - apiId: string; - httpMethod: string; - identity: { - accessKey: string | null; - accountId: string | null; - apiKey: string | null; - caller: string | null; - cognitoAuthenticationProvider: string | null; - cognitoAuthenticationType: string | null; - cognitoIdentityId: string | null; - cognitoIdentityPoolId: string | null; - sourceIp: string; - user: string | null; - userAgent: string | null; - userArn: string | null; - }, - stage: string; - requestId: string; - resourceId: string; - resourcePath: string; - }; + requestContext: APIGatewayEventRequestContext; resource: string; } // API Gateway CustomAuthorizer "event" interface CustomAuthorizerEvent { type: string; - authorizationToken: string; methodArn: string; + authorizationToken?: string; + headers?: { [name: string]: string }; + pathParameters?: { [name: string]: string } | null; + queryStringParameters?: { [name: string]: string } | null; + requestContext?: APIGatewayEventRequestContext; +} + +// Context +// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_AttributeValue.html +interface AttributeValue { + B?: string; + BS?: Array; + BOOL?: boolean; + L?: Array; + M?: { [id: string]: AttributeValue }; + N?: string; + NS?: Array; + NULL?: boolean; + S?: string; + SS?: Array; +} + +// Context +// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_StreamRecord.html +interface StreamRecord { + ApproximateCreationTime?: number; + Keys?: { [key: string]: AttributeValue }; + NewImage?: { [key: string]: AttributeValue }; + OldImage?: { [key: string]: AttributeValue }; + SequenceNumber?: string; + SizeBytes?: number; + StreamViewType?: 'KEYS_ONLY' | 'NEW_IMAGE' | 'OLD_IMAGE' | 'NEW_AND_OLD_IMAGES'; +} + +// Context +// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Record.html +interface DynamoDBRecord { + awsRegion?: string; + dynamodb?: StreamRecord; + eventID?: string; + eventName?: 'INSERT' | 'MODIFY' | 'REMOVE'; + eventSource?: string; + eventSourceARN?: string; + eventVersion?: string; + userIdentity?: any; +} + +// AWS Lambda Stream event +// Context +// http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ddb-update +interface DynamoDBStreamEvent { + Records: Array; } // SNS "event" @@ -234,6 +294,37 @@ type CloudFormationCustomResourceFailedResponse = CloudFormationCustomResourceRe export type CloudFormationCustomResourceResponse = CloudFormationCustomResourceSuccessResponse | CloudFormationCustomResourceFailedResponse; +/** + * See http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-cloudwatch-logs + */ +interface CloudWatchLogsEvent { + awslogs: CloudWatchLogsEventData; +} + +interface CloudWatchLogsEventData { + data: string; +} + +interface CloudWatchLogsDecodedData { + owner: string; + logGroup: string; + logStream: string; + subscriptionFilters: string[]; + messageType: string; + logEvents: CloudWatchLogsLogEvent[]; +} + +/** + * See http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#LambdaFunctionExample + */ +interface CloudWatchLogsLogEvent { + id: string; + timestamp: number; + message: string; +} + + + // Context // http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html interface Context { @@ -322,9 +413,9 @@ interface PolicyDocument { * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ interface Statement { - Action: string | [string]; + Action: string | string[]; Effect: string; - Resource: string | [string]; + Resource: string | string[]; } /** @@ -335,6 +426,55 @@ interface AuthResponseContext { [name: string]: string | number | boolean; } +/** + * CloudFront events + * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html + */ +type CloudFrontHeaders = { + [name: string]: { + key: string; + value: string; + }[] +}; + +type CloudFrontResponse = { + status: string; + statusDescription: string; + headers: CloudFrontHeaders; +}; + +type CloudFrontRequest = { + clientIp: string; + method: string; + uri: string; + querystring: string; + headers: CloudFrontHeaders; +}; + +type CloudFrontEvent = { + config: { + distributionId: string; + requestId: string; + } +} + +export type CloudFrontResponseEvent = { + Records: { + cf: CloudFrontEvent & { + request: CloudFrontRequest; + response: CloudFrontResponse; + } + }[] +}; + +export type CloudFrontRequestEvent = { + Records: { + cf: CloudFrontEvent & { + request: CloudFrontRequest; + } + }[] +}; + /** * AWS Lambda handler function. * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html @@ -343,9 +483,9 @@ interface AuthResponseContext { * @param context – runtime information of the Lambda function that is executing. * @param callback – optional callback to return information to the caller, otherwise return value is null. */ -export type Handler = (event: any, context: Context, callback?: Callback) => void; -export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void; -export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Context, callback?: CustomAuthorizerCallback) => void; +export type Handler = (event: any, context: Context, callback?: Callback) => Promise | void; +export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => Promise | void; +export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Context, callback?: CustomAuthorizerCallback) => Promise | void; /** * Optional callback parameter. @@ -354,7 +494,7 @@ export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Co * @param error – an optional parameter that you can use to provide results of the failed Lambda function execution. * @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible. */ -export type Callback = (error?: Error | null, result?: object) => void; +export type Callback = (error?: Error | null, result?: object | boolean | number | string) => void; export type ProxyCallback = (error?: Error | null, result?: ProxyResult) => void; export type CustomAuthorizerCallback = (error?: Error | null, result?: AuthResponse) => void; diff --git a/types/aws-lambda/tslint.json b/types/aws-lambda/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aws-lambda/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aws-serverless-express/index.d.ts b/types/aws-serverless-express/index.d.ts index e612d5d8d6..14569396db 100644 --- a/types/aws-serverless-express/index.d.ts +++ b/types/aws-serverless-express/index.d.ts @@ -1,14 +1,18 @@ -// Type definitions for aws-serverless-express 2.1 +// Type definitions for aws-serverless-express 3.0 // Project: https://github.com/awslabs/aws-serverless-express -// Definitions by: Ben Speakman , Josh Caffey , Matthias Meyer +// Definitions by: Ben Speakman +// Josh Caffey +// Matthias Meyer +// Alberto Vasquez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// import * as http from 'http'; import * as lambda from 'aws-lambda'; export function createServer( - requestListener: (request: http.IncomingMessage, response: http.ServerResponse) => http.Server, + requestListener: (request: http.IncomingMessage, response: http.ServerResponse) => void, serverListenCallback?: () => any, binaryMimeTypes?: string[] ): http.Server; diff --git a/types/aws4/tslint.json b/types/aws4/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aws4/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/axel/tslint.json b/types/axel/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/axel/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/axios-mock-adapter/axios-mock-adapter-tests.ts b/types/axios-mock-adapter/axios-mock-adapter-tests.ts deleted file mode 100644 index 83fb345cd0..0000000000 --- a/types/axios-mock-adapter/axios-mock-adapter-tests.ts +++ /dev/null @@ -1,113 +0,0 @@ -import axios from "axios"; -import MockAdapter = require("axios-mock-adapter"); - -const instance = axios.create(); -const mock = new MockAdapter(instance); - -namespace AllowsConstructing { - new MockAdapter(instance); -} - -namespace AllowsConstructingWithOptions { - new MockAdapter(instance, { - delayResponse: 2000, - }); -} - -namespace ExposesAdapter { - mock.adapter(); -} - -namespace SupportsReset { - mock.reset(); -} - -namespace SupportsRestore { - mock.restore(); -} - -namespace SupportsAllHttpVerbs { - mock.onGet; - mock.onPost; - mock.onPut; - mock.onHead; - mock.onDelete; - mock.onPatch; -} - -namespace SupportsAnyVerb { - mock.onAny; -} - -namespace AllowsVerbOnlyMatcher { - mock.onGet(); -} - -namespace AllowsUrlMatcher { - mock.onGet("/foo"); -} - -namespace AllowsUrlRegExpMatcher { - mock.onGet(/\/fo+/); -} - -namespace AllowsStringBodyMatcher { - mock.onPatch("/foo", "bar"); -} - -namespace AllowsBodyMatcher { - mock.onGet("/foo", { - id: 4, - name: "foo", - }); -} - -namespace AllowsParameterMatcher { - mock.onGet("/foo", { - params: { - searchText: "John", - }, - }); -} - -namespace AllowsReplyWithStatus { - mock.onGet().reply(200); -} - -namespace SupportsReplyOnce { - mock.onGet().replyOnce(200); -} - -namespace SupportsPassThrough { - mock.onGet().passThrough(); -} - -namespace SupportsTimeout { - mock.onGet().timeout(); -} - -namespace AllowsFunctionReply { - mock.onGet().reply((config) => { - return [ - 200, - { data: "foo" }, - { RequestedURL: config.url }, - ]; - }); -} - -namespace AllowsPromiseReply { - mock.onGet().reply((config) => { - return Promise.resolve([ - 200, - { data: "bar" }, - { RequestedURL: config.url }, - ]); - }); -} - -namespace SupportsChanining { - mock - .onGet("/users").reply(200, [/* users */]) - .onGet("/posts").reply(200, [/* posts */]); -} diff --git a/types/axios-mock-adapter/index.d.ts b/types/axios-mock-adapter/index.d.ts deleted file mode 100644 index dbc37f1b80..0000000000 --- a/types/axios-mock-adapter/index.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Type definitions for axios-mock-adapter 1.9 -// Project: https://github.com/ctimmerm/axios-mock-adapter -// Definitions by: Tomasz Kryskiewicz -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version 2.1 - -import { AxiosAdapter, AxiosInstance, AxiosRequestConfig } from "axios"; - -type CallbackResponseSpecFunc = (config: AxiosRequestConfig) => any[] | Promise; - -type ResponseSpecFunc = (statusOrCallback: number | CallbackResponseSpecFunc, data?: any, headers?: any) => MockAdapter; - -interface RequestHandler { - reply: ResponseSpecFunc; - replyOnce: ResponseSpecFunc; - - passThrough(): void; - networkError(): void; - timeout(): void; -} - -interface MockAdapterOptions { - delayResponse?: number; -} - -interface RequestDataMatcher { - [index: string]: any; - params?: { - [index: string]: any, - }; -} - -type RequestMatcherFunc = (matcher?: string | RegExp, body?: string | RequestDataMatcher) => RequestHandler; - -declare class MockAdapter { - constructor(axiosInstance: AxiosInstance, options?: MockAdapterOptions); - - adapter(): AxiosAdapter; - reset(): void; - restore(): void; - - onGet: RequestMatcherFunc; - onPost: RequestMatcherFunc; - onPut: RequestMatcherFunc; - onHead: RequestMatcherFunc; - onDelete: RequestMatcherFunc; - onPatch: RequestMatcherFunc; - onAny: RequestMatcherFunc; -} - -export = MockAdapter; diff --git a/types/axios-mock-adapter/package.json b/types/axios-mock-adapter/package.json deleted file mode 100644 index bd5a40b16d..0000000000 --- a/types/axios-mock-adapter/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "dependencies": { - "axios": "^0.16.2" - } -} diff --git a/types/axios-mock-adapter/tsconfig.json b/types/axios-mock-adapter/tsconfig.json deleted file mode 100644 index 0de216c230..0000000000 --- a/types/axios-mock-adapter/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "../", - "types": [], - "typeRoots": [ - "../" - ], - "module": "commonjs", - "lib": [ - "es6" - ], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true - }, - "files": [ - "index.d.ts", - "axios-mock-adapter-tests.ts" - ] -} \ No newline at end of file diff --git a/types/axios-mock-adapter/tslint.json b/types/axios-mock-adapter/tslint.json deleted file mode 100644 index 1f85ae1a3b..0000000000 --- a/types/axios-mock-adapter/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "no-namespace": false - } -} diff --git a/types/azure-mobile-services-client/tslint.json b/types/azure-mobile-services-client/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/azure-mobile-services-client/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/azure-sb/azure-sb-tests.ts b/types/azure-sb/azure-sb-tests.ts index 68b0fc8df7..411862a3b2 100644 --- a/types/azure-sb/azure-sb-tests.ts +++ b/types/azure-sb/azure-sb-tests.ts @@ -1,16 +1,82 @@ +import { Azure } from 'azure-sb'; +import AzureSB = require('azure-sb'); +import Models = Azure.ServiceBus.Results.Models; -var nh = new Azure.ServiceBus.NotificationHubService(); -nh.send('tag', '', function (error, result) {}); -nh.send('tag', '', { headers: {} }, function (error, result) {}); +function createResultCallback() { + return (err: Error | null, result: T, response: Azure.ServiceBus.Response) => { + }; +} -nh.apns.send('tag', { payload: { } }, function (error, result) {}); -nh.apns.send(['tag'], { payload: { } }, function (error, result) {}); -nh.gcm.send('tag', { }, function (error, result) {}); -nh.gcm.send(['tag'], { }, function (error, result) {}); -nh.wns.send('tag', '', 'wns/toast', function (error, result) {}); -nh.wns.send(['tag'], '', 'wns/toast', function (error, result) {}); -nh.wns.send('tag', '', 'wns/toast', { headers: {} }, function (error, result) {}); -nh.wns.sendToastText01('tag', '', function (error, result) {}); -nh.wns.sendToastText01(['tag'], '', function (error, result) {}); -nh.wns.sendToastText01('tag', '', { headers: {} }, function (error, result) {}); \ No newline at end of file +function ResponseCallback(err: Error | null, response: Azure.ServiceBus.Response) { +} + +const ServiceBus = AzureSB.createServiceBusService('connectionstring'); + +// Queues +ServiceBus.listQueues('', createResultCallback()); +ServiceBus.createQueue('test', createResultCallback()); +ServiceBus.createQueueIfNotExists('test', createResultCallback()); +ServiceBus.getQueue('test', createResultCallback()); +ServiceBus.deleteQueue('test', ResponseCallback); + +// Topics +ServiceBus.listTopics('', createResultCallback()); +ServiceBus.createTopic('test', createResultCallback()); +ServiceBus.createTopicIfNotExists('test', createResultCallback()); +ServiceBus.getTopic('test', createResultCallback()); +ServiceBus.deleteTopic('test', ResponseCallback); + +// Subscriptions +ServiceBus.listSubscriptions('test', createResultCallback()); +ServiceBus.createSubscription('test', 'test', createResultCallback()); +ServiceBus.createSubscription('test', 'test', { + DefaultMessageTimeToLive: 'PT10M' +}, createResultCallback()); +ServiceBus.getSubscription('test', 'test', createResultCallback()); +ServiceBus.deleteSubscription('test', 'test', ResponseCallback); + +ServiceBus.listRules('testTopic', 'testSub', createResultCallback()); +ServiceBus.createRule('testTopic', 'testSub', 'testRule', createResultCallback()); +ServiceBus.getRule('testTopic', 'testSub', 'testRule', createResultCallback()); +ServiceBus.deleteRule('testTopic', 'testSub', 'testRule', ResponseCallback); + +// Messages +ServiceBus.sendQueueMessage('testTopic', 'My data', ResponseCallback); +ServiceBus.sendQueueMessage('testTopic', { + body: '{"data":"MyData"}', + contentType: 'application/json', + brokerProperties: { + CorrelationId: '123' + } +}, ResponseCallback); +ServiceBus.receiveQueueMessage('testQueue', createResultCallback()); + +ServiceBus.sendTopicMessage('testTopic', 'My data', ResponseCallback); +ServiceBus.sendTopicMessage('testTopic', { + body: '{"data":"MyData"}', + contentType: 'application/json', + brokerProperties: { + CorrelationId: '123' + } +}, ResponseCallback); +ServiceBus.receiveSubscriptionMessage('testTopic', 'testSub', createResultCallback()); + +ServiceBus.renewLockForMessage('test', ResponseCallback); +ServiceBus.unlockMessage('test', ResponseCallback); +ServiceBus.deleteMessage('test', ResponseCallback); + +// NotificationHub +const nh = AzureSB.createNotificationHubService('test'); +nh.send('tag', '', ResponseCallback); +nh.send('tag', '', { headers: {} }, ResponseCallback); +nh.apns.send('tag', { payload: {} }, ResponseCallback); +nh.apns.send(['tag'], { payload: {} }, ResponseCallback); +nh.gcm.send('tag', {}, ResponseCallback); +nh.gcm.send(['tag'], {}, ResponseCallback); +nh.wns.send('tag', '', 'wns/toast', ResponseCallback); +nh.wns.send(['tag'], '', 'wns/toast', ResponseCallback); +nh.wns.send('tag', '', 'wns/toast', { headers: {} }, ResponseCallback); +nh.wns.sendToastText01('tag', '', ResponseCallback); +nh.wns.sendToastText01(['tag'], '', ResponseCallback); +nh.wns.sendToastText01('tag', '', { headers: {} }, ResponseCallback); diff --git a/types/azure-sb/index.d.ts b/types/azure-sb/index.d.ts index bae1af04a9..ba92395c0f 100644 --- a/types/azure-sb/index.d.ts +++ b/types/azure-sb/index.d.ts @@ -2,172 +2,322 @@ // Project: https://github.com/Azure/azure-sdk-for-node/tree/master/lib/services/serviceBus // Definitions by: Microsoft Azure // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 -declare namespace Azure.ServiceBus { - interface Callback { - (error: any, response: any): void; +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 createNotificationHubService(hubName: string, + endpointOrConnectionString?: string, + sharedAccessKeyName?: string, + sharedAccessKeyValue?: string): NotificationHubService; + +export function createWrapService(acsHost: string, + issuer?: string, + accessKey?: string): WrapService; + +export namespace Azure.ServiceBus { + export type Duration = string; + export type DateString = string; + + export interface Dictionary { + [k: string]: T; } - interface NotificationHubRegistration { - RegistrationId: string; + export interface ReceiveQueueMessageOptions { + timeoutIntervalInS?: number; + } + + export interface ReceiveSubscriptionMessageOptions extends ReceiveQueueMessageOptions { + isPeekLock?: boolean; + } + + interface IBrokerPropertiesResponse { + readonly DeliveryCount: number; + readonly LockedUntil: DateString; + readonly LockToken: string; + readonly SequenceNumber: number; + } + + interface IBrokerProperties { + CorrelationId: string; + Label: string; + MessageId: string; + PartitionKey: string; + ReplyTo: string; + ReplyToSessionId: string; + ScheduledEnqueueTimeUtc: string; + SessionId: string; + TimeToLive: string; + To: string; + } + + export interface Message { + body: string; + brokerProperties?: BrokerProperties; + contentType?: string; + customProperties?: Dictionary; + } + + /* + * Options interfaces + */ + + interface CreateOptions { + DefaultMessageTimeToLive: string; + DuplicateDetectionHistoryTimeWindow: string; + EnablePartitioning: boolean; + MaxSizeInMegaBytes: number; + RequiresDuplicateDetection: boolean; + } + + interface IQueueOptions extends CreateOptions { + AutoDeleteOnIdle: string; + DeadLetteringOnMessageExpiration: boolean; + LockDuration: string; + RequiresSession: boolean; + } + + interface ICreateTopicOptions extends CreateOptions { + EnableBatchedOperations: boolean; + SizeInBytes: boolean; + SupportOrdering: boolean; + } + + interface ICreateTopicIfNotExistsOptions extends ICreateTopicOptions { + EnableDeadLetteringOnFilterEvaluationExceptions: boolean; + EnableDeadLetteringOnMessageExpiration: boolean; + MaxCorrelationFiltersPerTopic: number; + MaxSqlFiltersPerTopic: number; + MaxSubscriptionsPerTopic: number; + } + + interface ICreateSubscriptionOptions { + DefaultMessageTimeToLive: string; + EnableDeadLetteringOnFilterEvaluationExceptions: boolean; + EnableDeadLetteringOnMessageExpiration: boolean; + LockDuration: string; + RequiresSession: boolean; + } + + interface PaginationOptions { + top: number; + skip: number; + } + + interface ICreateRuleOptions { + trueFilter: string; + falseFilter: string; + sqlExpressionFilter: string; + correlationIdFilter: string; + sqlRuleAction: string; + } + + interface ICreateNotificationHubOptions { + apns: Dictionary; + gcm: Dictionary; + mpns: Dictionary; + wns: Dictionary; + } + + export interface NotificationHubRegistration { + BodyTemplate?: any; ChannelUri?: string; DeviceToken?: string; - gcmRegistrationId?: string; - Tags?: string; - BodyTemplate?: any; - WnsHeaders?: any; - MpnsHeaders?: any; Expiry?: Date; + gcmRegistrationId?: string; + MpnsHeaders?: any; + RegistrationId: string; + Tags?: string; + WnsHeaders?: any; } - export class NotificationHubService { - new(hubName: string, endpointOrConnectionString: string, sharedAccessKeyName?: string, sharedAccessKeyValue?: string): NotificationHubService; - hubName: string; - wns: Wns.Service; - apns: Apns.Service; - gcm: Gcm.Service; - mpns: Mpns.Service; - send(tags: string, payload: Object | string, optionsOrCallback?: { headers: Object } | Callback, callback?: Callback): void; - - createOrUpdateInstallation(installation: string, options: any, callback?: Callback): void; - patchInstallation(installationId: string, partialUpdateOperations: any[], options: any, callback?: Callback): void; - deleteInstallation(installationId: string, options: any, callback?: Callback): void; - getInstallation(installationId: string, options: any, callback?: Callback): void; - - /* - // old school? - createRegistrationId(callback?: Callback): void; - getRegistration(registrationId: string, options: any, callback?: Callback): void; - deleteRegistration(registrationId: string, options?: { etag: any }, callback?: Callback): void; - updateRegistration(registration: NotificationHubRegistration, options?: { etag: any }, callback?: Callback): void; - createOrUpdateRegistration(registration: NotificationHubRegistration, options?: { etag: any }, callback?: Callback): void; - listRegistrations(options?: { top: number, skip: number }, callback?: Callback): void; - listRegistrationsByTag(tag: string, options?: { top: number, skip: number }, callback?: Callback): void; - */ + export interface Response { + body: Dictionary; + headers: Dictionary; + isSuccessful: boolean; + md5?: string; + statusCode: number; } - export module Apns { - interface Payload { - expiry?: Date; - aps?: Object; - badge?: number; - alert?: string; - sound?: string; - payload: Object; + export interface ErrorResponse extends Response { + body: { + Error: { + Code: string; + Detail: string; + }; + }; + } + + 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' } - interface Service { - new(service: NotificationHubService): Service; - send(tags: string | string[], payload: Apns.Payload, callback?: Callback): void; - createNativeRegistration(token: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void; - createOrUpdateNativeRegistration(registrationId: string, token: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void; - createTemplateRegistration(token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void; - createOrUpdateTemplateRegistration(registrationId: string, token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void; - updateTemplateRegistration(registrationId: string, token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void; - listRegistrationsByToken(token: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void; + export enum EntityAvailabilityStatus { + Available = 'Available', + Limited = 'Limited', + Renaming = 'Renaming', + Restoring = 'Restoring', + Unknown = 'Unknown' } - } - export module Gcm { - interface Service { - new(service: NotificationHubService): Service; - send(tags: string | string[], payload: any, callback?: Callback): void; - createNativeRegistration(gcmRegistrationId: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void; - createOrUpdateNativeRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void; - createTemplateRegistration(gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void; - createOrUpdateTemplateRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void; - updateTemplateRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void; - listRegistrationsByGcmRegistrationId(gcmRegistrationId: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void; + + interface Base { + _: { + ContentRootElement: string; + id: string; + title: string; + published: DateString; + updated: DateString; + author?: { + name: string; + }; + link: string; + }; + CreatedAt: DateString; + } + + interface ExtendedBase extends Base { + AuthorizationRules: string; + AutoDeleteOnIdle: string; + DefaultMessageTimeToLive: string; + DuplicateDetectionHistoryTimeWindow: Duration; + EnableBatchedOperations: string; + EnableExpress: string; + EnablePartitioning: string; + EntityAvailabilityStatus: string; + IsAnonymousAccessible: string; + MaxSizeInMegabytes: string; + RequiresDuplicateDetection: string; + SizeInBytes: string; + Status: EntityStatus; + UpdatedAt: DateString; + } + + // export interface Generic extends Base { + // [x: string]: string | Dictionary; + // } + + export interface Topic extends ExtendedBase { + AccessedAt: DateString; + CountDetails: { + 'd2p1:ActiveMessageCount': string; + 'd2p1:DeadLetterMessageCount': string; + 'd2p1:ScheduledMessageCount': string; + 'd2p1:TransferMessageCount': string; + 'd2p1:TransferDeadLetterMessageCount': string; + }; + EnableSubscriptionPartitioning: string; + FilteringMessagesBeforePublishing: string; + IsExpress: string; + SubscriptionCount: string; + SupportOrdering: string; + TopicName: string; + } + + export interface Queue extends ExtendedBase { + DeadLetteringOnMessageExpiration: string; + LockDuration: Duration; + MaxDeliveryCount: string; + MessageCount: string; + QueueName: string; + RequiresSession: string; + SupportOrdering: string; + } + + export interface Subscription extends ExtendedBase { + CountDetails: { + 'd3p1:ActiveMessageCount': string; + 'd3p1:DeadLetterMessageCount': string; + 'd3p1:ScheduledMessageCount': string; + 'd3p1:TransferMessageCount': string; + 'd3p1:TransferDeadLetterMessageCount': string; + }; + DeadLetteringOnFilterEvaluationExceptions: string; + DeadLetteringOnMessageExpiration: string; + LockDuration: string; + MaxDeliveryCount: string; + MessageCount: string; + RequiresSession: string; + SubscriptionName: string; + TopicName: string; + } + + /** + * @see https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-sql-filter + */ + interface SqlFilter { + readonly CompatibilityLevel: string; + Parameters?: Dictionary; + RequiresPreprocessing?: string; + SqlExpression: string; + } + + type CorrelationFilter = Partial<{ + ContentType: string; + CorrelationId: string; + Label: string; + Properties: string; + ReplyTo: string; + ReplyToSessionId: string; + RequiresPreprocessing: string; + SessionId: string; + To: string; + }>; + + export interface Rule extends Base { + Action: string | SqlFilter; + Filter: SqlFilter | CorrelationFilter; + Name: string; + TopicName: string; + SubscriptionName: string; + RuleName: string; } } - export module Mpns { interface Service { } } + /* + * Callbacks + */ + export type ResponseCallback = (error: Error | null, response: Response) => void; - export module Wns { - interface Payload { - text1?: string; - text2?: string; - text3?: string; - text4?: string; - image1src?: string; - image1alt?: string; - image2src?: string; - image2alt?: string; - image3src?: string; - image3alt?: string; - image4src?: string; - image4alt?: string; - lang?: string; - type?: string; - } + export type ResultAndResponseCallback = (error: Error | null, + result: boolean | Results.Models.Base | Results.Models.Base[], + response: Response) => void; - interface Options { - headers: Object; - } + export type TypedResultAndResponseCallback = (error: Error | null, + result: T, + response: Response) => void; - interface Service { - new(service: NotificationHubService): Service; - sendTileSquareBlock(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquareText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquareText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquareText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquareText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText07(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText08(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText09(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText10(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideText11(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquareImage(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquarePeekImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquarePeekImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquarePeekImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileSquarePeekImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideImage(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideImageCollection(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideBlockAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideBlockAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideSmallImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideSmallImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideSmallImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideSmallImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWideSmallImageAndText05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImageCollection01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImageCollection02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImageCollection03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImageCollection04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImageCollection05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImageCollection06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImage01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImage02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImage03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImage04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImage05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendTileWidePeekImage06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendToastText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendToastText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendToastText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendToastText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendToastImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendToastImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendToastImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendToastImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - // badges = ['none','activity','alert','available','away','busy','newMessage','paused','playing','unavailable','error', 'attention'] - sendBadge(tags: string | string[], value: string | number, optionsOrCallback?: Options | Callback, callback?: Callback): void; - sendRaw(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void; - // types = ['wns/toast', 'wns/badge', 'wns/tile', 'wns/raw'] - send(tags: string | string[], payload: string, type: string, optionsOrCallback?: Options | Callback, callback?: Callback): void; - createNativeRegistration(channel: string, tags: string | string[], optionsOrCallback?: Options | Callback, callback?: Callback): void; - createOrUpdateNativeRegistration(registrationId: string, channel: string, tags: string | string[], optionsOrCallback?: Options | Callback, callback?: Callback): void; - listRegistrationsByChannel(channel: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void; - } - } + /* + * Options interfaces with all properties as optional + */ + export type BrokerProperties = Partial; + export type BrokerPropertiesResponse = IBrokerPropertiesResponse & Partial; + export type CreateQueueOptions = Partial; + export type CreateTopicOptions = Partial; + export type CreateTopicIfNotExistsOptions = Partial; + export type CreateSubscriptionOptions = Partial; + export type ListSubscriptionsOptions = Partial; + export type ListRulesOptions = Partial; + export type CreateRuleOptions = Partial; + export type CreateNotificationHubOptions = Partial; + export type ListNotificationHubsOptions = Partial; + + export type MessageOrName = Message | string; } diff --git a/types/azure-sb/lib/apnsservice.d.ts b/types/azure-sb/lib/apnsservice.d.ts new file mode 100644 index 0000000000..05ca2f7b43 --- /dev/null +++ b/types/azure-sb/lib/apnsservice.d.ts @@ -0,0 +1,83 @@ +import { Azure } from '../index'; +import NotificationHubService = require('azure-sb/lib/notificationhubservice'); +import ResponseCallback = Azure.ServiceBus.ResponseCallback; +import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration; +import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; +import Dictionary = Azure.ServiceBus.Dictionary; + +type Template = Partial<{ + expiry: Date; + aps: object; + badge: number; + alert: string; + sound: string; + payload: object; +}>; + +declare class ApnsService { + constructor(notificationHubService: NotificationHubService); + + public notificationHubService: NotificationHubService; + + public send(tags: string | string[], + payload: object | string, + callback: ResponseCallback): void; + + public send(tags: string | string[], + payload: object | string, + options: { headers: Dictionary }, + callback: ResponseCallback): void; + + public createNativeRegistration(token: string, + tags: string | string[], + callback: ResponseCallback): void; + + public createNativeRegistration(token: string, + tags: string | string[], + options: object, + callback: ResponseCallback): void; + + public createOrUpdateNativeRegistration(registrationId: string, + token: string, + tags: string | string[], + callback: ResponseCallback): void; + + public createOrUpdateNativeRegistration(registrationId: string, + token: string, + tags: string | string[], + options: object, + callback: ResponseCallback): void; + + public createTemplateRegistration(token: string, + tags: string | string[], + template: Template | string, + callback: ResponseCallback): void; + + public createTemplateRegistration(token: string, + tags: string | string[], + template: Template | string, + options: object, + callback: ResponseCallback): void; + + public updateTemplateRegistration(registrationId: string, + token: string, + tags: string | string[], + template: Template | string, + callback: ResponseCallback): void; + + public updateTemplateRegistration(registrationId: string, + token: string, + tags: string | string[], + template: Template | string, + options: { headers: Dictionary }, + callback: ResponseCallback): void; + + public listRegistrationsByToken(token: string, + callback: ResponseCallback): void; + + public listRegistrationsByToken(token: string, + options: ListNotificationHubsOptions, + callback: ResponseCallback): void; +} + +export = ApnsService; diff --git a/types/azure-sb/lib/gcmservice.d.ts b/types/azure-sb/lib/gcmservice.d.ts new file mode 100644 index 0000000000..4d1c8f203c --- /dev/null +++ b/types/azure-sb/lib/gcmservice.d.ts @@ -0,0 +1,71 @@ +import { Azure } from '../index'; +import NotificationHubService = require('azure-sb/lib/notificationhubservice'); +import ResponseCallback = Azure.ServiceBus.ResponseCallback; +import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration; +import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; +import Dictionary = Azure.ServiceBus.Dictionary; + +type Template = Partial<{}>; + +declare class GcmService { + constructor(notificationHubService: NotificationHubService); + + public notificationHubService: NotificationHubService; + + public send(tags: string | string[], + payload: object | string, + callback: ResponseCallback): void; + + public createNativeRegistration(gcmRegistrationId: string, + tags: string | string[], + callback: ResponseCallback): void; + + public createNativeRegistration(token: string, + tags: string | string[], + options: object, + callback: ResponseCallback): void; + + public createOrUpdateNativeRegistration(registrationId: string, + gcmRegistrationId: string, + tags: string | string[], + callback: ResponseCallback): void; + + public createOrUpdateNativeRegistration(registrationId: string, + gcmRegistrationId: string, + tags: string | string[], + options: object, + callback: ResponseCallback): void; + + public createTemplateRegistration(gcmRegistrationId: string, + tags: string | string[], + template: Template | string, + callback: ResponseCallback): void; + + public createTemplateRegistration(gcmRegistrationId: string, + tags: string | string[], + template: Template | string, + options: object, + callback: ResponseCallback): void; + + public updateTemplateRegistration(registrationId: string, + gcmRegistrationId: string, + tags: string | string[], + template: Template | string, + callback: ResponseCallback): void; + + public updateTemplateRegistration(registrationId: string, + gcmRegistrationId: string, + tags: string | string[], + template: Template | string, + options: { headers: Dictionary }, + callback: ResponseCallback): void; + + public listRegistrationsByGcmRegistrationId(gcmRegistrationId: string, + callback: ResponseCallback): void; + + public listRegistrationsByGcmRegistrationId(gcmRegistrationId: string, + options: ListNotificationHubsOptions, + callback: ResponseCallback): void; +} + +export = GcmService; diff --git a/types/azure-sb/lib/models/acstokenresult.d.ts b/types/azure-sb/lib/models/acstokenresult.d.ts new file mode 100644 index 0000000000..531c606de1 --- /dev/null +++ b/types/azure-sb/lib/models/acstokenresult.d.ts @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Azure } from 'azure-sb'; +import Dictionary = Azure.ServiceBus.Dictionary; + +export namespace Azure.ServiceBus.Results { + export interface AcsTokenResponse extends Dictionary> { + WrapAccessToken: Dictionary; + WrapAccessTokenExpiresIn: Dictionary; + } + + export interface AcsTokenResult { + parse(acsTokenQueryString: string): AcsTokenResponse; + } +} diff --git a/types/azure-sb/lib/models/notificationhubresult.d.ts b/types/azure-sb/lib/models/notificationhubresult.d.ts new file mode 100644 index 0000000000..1aef66c3d6 --- /dev/null +++ b/types/azure-sb/lib/models/notificationhubresult.d.ts @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Azure } from 'azure-sb'; +import Dictionary = Azure.ServiceBus.Dictionary; + +export namespace Azure.ServiceBus.Results { + export interface NotificationHubResult { + serialize(resource: Azure.ServiceBus.CreateNotificationHubOptions): string; + + parse(xml: object): object | object[]; + } +} diff --git a/types/azure-sb/lib/models/queuemessageresult.d.ts b/types/azure-sb/lib/models/queuemessageresult.d.ts new file mode 100644 index 0000000000..a50d0965cb --- /dev/null +++ b/types/azure-sb/lib/models/queuemessageresult.d.ts @@ -0,0 +1,40 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Module dependencies. +import { Azure } from 'azure-sb'; +import Dictionary = Azure.ServiceBus.Dictionary; + +export namespace Azure.ServiceBus.Results { + export interface QueueResponse { + body: any; + headers: Dictionary + } + + export interface QueueMessageResponse { + body: any; + brokerProperties?: Azure.ServiceBus.BrokerProperties; + customProperties?: Dictionary; + contentType?: string; + location?: string; + } + + export interface QueueMessageResult { + parse(responseObject: object): QueueMessageResponse; + + isRFC1123(value: string | any): boolean; + } +} diff --git a/types/azure-sb/lib/models/queueresult.d.ts b/types/azure-sb/lib/models/queueresult.d.ts new file mode 100644 index 0000000000..abeed96dff --- /dev/null +++ b/types/azure-sb/lib/models/queueresult.d.ts @@ -0,0 +1,41 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Azure } from 'azure-sb'; +import Dictionary = Azure.ServiceBus.Dictionary; + +export namespace Azure.ServiceBus.Results { + export interface QueueProperties { + DeadLetteringOnMessageExpiration: string; + DefaultMessageTimeToLive: string; + DuplicateDetectionHistoryTimeWindow: string; + EnableBatchedOperations: boolean; + EnablePartitioning: boolean; + LockDuration: string; + MaxDeliveryCount: number; + MaxSizeInMegabytes: number; + MessageCount: number; + RequiresDuplicateDetection: boolean; + RequiresSession: boolean; + SizeInBytes: number; + } + + export interface QueueResult { + serialize(resource: QueueProperties): string; + + parse(xml: object): object | object[]; + } +} diff --git a/types/azure-sb/lib/models/registrationresult.d.ts b/types/azure-sb/lib/models/registrationresult.d.ts new file mode 100644 index 0000000000..81c1fdd824 --- /dev/null +++ b/types/azure-sb/lib/models/registrationresult.d.ts @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Azure } from 'azure-sb'; +import Dictionary = Azure.ServiceBus.Dictionary; + +export namespace Azure.ServiceBus.Results { + export interface RegistrationResult { + serialize(type: string, resource: object, properties: string[]): string; + + parse(xml: object): object | object[]; + } +} diff --git a/types/azure-sb/lib/models/resourceresult.d.ts b/types/azure-sb/lib/models/resourceresult.d.ts new file mode 100644 index 0000000000..b9654b0438 --- /dev/null +++ b/types/azure-sb/lib/models/resourceresult.d.ts @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Azure } from 'azure-sb'; +import Dictionary = Azure.ServiceBus.Dictionary; + +export namespace Azure.ServiceBus.Results { + export interface ResourceResult { + setName(entry: Dictionary | { _: { id: string } }, nameProperty: string): void; + + serialize(resourceName: string, resource: object, properties: string[]): string; + + parse(resourceName: string, nameProperty: string, xml: object): object | object[]; + } +} diff --git a/types/azure-sb/lib/models/ruleresult.d.ts b/types/azure-sb/lib/models/ruleresult.d.ts new file mode 100644 index 0000000000..369a4ddeb7 --- /dev/null +++ b/types/azure-sb/lib/models/ruleresult.d.ts @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Module dependencies. +import { Azure } from 'azure-sb'; + +export namespace Azure.ServiceBus.Results { + export interface RuleResult { + serialize(rule: Azure.ServiceBus.CreateRuleOptions): string; + + parse(xml: object): object | object[]; + } +} diff --git a/types/azure-sb/lib/models/subscriptionresult.d.ts b/types/azure-sb/lib/models/subscriptionresult.d.ts new file mode 100644 index 0000000000..003c085da0 --- /dev/null +++ b/types/azure-sb/lib/models/subscriptionresult.d.ts @@ -0,0 +1,37 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import { Azure } from 'azure-sb'; + +export namespace Azure.ServiceBus.Results { + export interface SubscriptionProperties { + LockDuration: string; + RequiresSession: boolean; + DefaultMessageTimeToLive: string; + DeadLetteringOnMessageExpiration: string; + DeadLetteringOnFilterEvaluationExceptions: string; + MessageCount: number; + MaxDeliveryCount: number; + EnableBatchedOperations: boolean; + AutoDeleteOnIdle: boolean; + } + + export interface SubscriptionResult { + serialize(resource: SubscriptionProperties): string; + + parse(xml: object): object | object[]; + } +} diff --git a/types/azure-sb/lib/models/topicresult.d.ts b/types/azure-sb/lib/models/topicresult.d.ts new file mode 100644 index 0000000000..7f20125b51 --- /dev/null +++ b/types/azure-sb/lib/models/topicresult.d.ts @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +export namespace Azure.ServiceBus.Results { + export interface TopicProperties { + DefaultMessageTimeToLive: string; + MaxSizeInMegabytes: number; + RequiresDuplicateDetection: boolean; + DuplicateDetectionHistoryTimeWindow: string; + EnableBatchedOperations: boolean; + SizeInBytes: number; + SupportOrdering: boolean; + EnablePartitioning: boolean; + } +} + +export function serialize(resource: Azure.ServiceBus.Results.TopicProperties): string; + +export function parse(xml: object): object | object[]; diff --git a/types/azure-sb/lib/mpnservice.d.ts b/types/azure-sb/lib/mpnservice.d.ts new file mode 100644 index 0000000000..d476f4d984 --- /dev/null +++ b/types/azure-sb/lib/mpnservice.d.ts @@ -0,0 +1,116 @@ +import { Azure } from '../index'; +import NotificationHubService = require('azure-sb/lib/notificationhubservice'); +import ResponseCallback = Azure.ServiceBus.ResponseCallback; +import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration; +import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; +import Dictionary = Azure.ServiceBus.Dictionary; + +type Template = TileTemplate | FlipTileTemplate | ToastTemplate; + +interface TileTemplate { + backgroundImage: string; + count: string; + title: string; + backBackgroundImage: string; + backTitle: string; + backContent: string; + id: string; +} + +interface FlipTileTemplate extends TileTemplate { + smallBackgroundImage: string; + wideBackgroundImage: string; + wideBackContent: string; + wideBackBackgroundImage: string; +} + +interface ToastTemplate { + text1: string; + text2: string; + param?: string; +} + +declare class MpnsService { + constructor(notificationHubService: NotificationHubService); + + public notificationHubService: NotificationHubService; + + public send(tags: string | string[], + payload: object | string, + targetName: string, + notificationClass: string, + callback: ResponseCallback): void; + + public send(tags: string | string[], + payload: object | string, + targetName: string, + notificationClass: string, + options: { headers: Dictionary }, + callback: ResponseCallback): void; + + public createNativeRegistration(channel: string, + tags: string | string[], + callback: ResponseCallback): void; + + public createNativeRegistration(channel: string, + tags: string | string[], + options: object, + callback: ResponseCallback): void; + + public createOrUpdateNativeRegistration(registrationId: string, + channel: string, + tags: string | string[], + callback: ResponseCallback): void; + + public createOrUpdateNativeRegistration(registrationId: string, + channel: string, + tags: string | string[], + options: object, + callback: ResponseCallback): void; + + public createRawTemplateRegistration(channel: string, + tags: string | string[], + template: Template | string, + callback: ResponseCallback): void; + + public createRawTemplateRegistration(channel: string, + tags: string | string[], + template: Template | string, + options: object, + callback: ResponseCallback): void; + + public createOrUpdateRawTemplateRegistration(registrationId: string, + channel: string, + tags: string | string[], + template: Template | string, + callback: ResponseCallback): void; + + public createOrUpdateRawTemplateRegistration(registrationId: string, + channel: string, + tags: string | string[], + template: Template | string, + options: object, + callback: ResponseCallback): void; + + public updatesRawTemplateRegistration(registrationId: string, + channel: string, + tags: string | string[], + template: Template | string, + callback: ResponseCallback): void; + + public updatesRawTemplateRegistration(registrationId: string, + channel: string, + tags: string | string[], + template: Template | string, + options: object, + callback: ResponseCallback): void; + + public listRegistrationsByChannel(channel: string, + callback: ResponseCallback): void; + + public listRegistrationsByChannel(channel: string, + options: ListNotificationHubsOptions, + callback: ResponseCallback): void; +} + +export = MpnsService; diff --git a/types/azure-sb/lib/notificationhubservice.d.ts b/types/azure-sb/lib/notificationhubservice.d.ts new file mode 100644 index 0000000000..d56b53d9d5 --- /dev/null +++ b/types/azure-sb/lib/notificationhubservice.d.ts @@ -0,0 +1,102 @@ +import { Azure } from 'azure-sb'; +import Callback = Azure.ServiceBus.ResponseCallback; +import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration; +import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; + +import ApnsService = require('./apnsservice'); +import GcmService = require('./gcmservice'); +import MpnsService = require('./mpnservice'); +import WnsService = require('./wnsservice'); + +declare class NotificationHubService { + constructor(hubName: string, + endpointOrConnectionString: string, + sharedAccessKeyName: string, + sharedAccessKeyValue: string); + + public hubName: string; + public wns: WnsService; + public apns: ApnsService; + public gcm: GcmService; + public mpns: MpnsService; + + public send(tags: string, + payload: object | string, + callback: Callback): void; + + public send(tags: string, + payload: object | string, + options: { headers: object }, + callback: Callback): void; + + public createOrUpdateInstallation(installation: string, + callback: Callback): void; + + public createOrUpdateInstallation(installation: string, + options: any, + callback: Callback): void; + + public patchInstallation(installationId: string, + partialUpdateOperations: any[], + callback: Callback): void; + + public patchInstallation(installationId: string, + partialUpdateOperations: any[], + options: any, + callback: Callback): void; + + public deleteInstallation(installationId: string, + callback: Callback): void; + + public deleteInstallation(installationId: string, + options: any, + callback: Callback): void; + + public getInstallation(installationId: string, + callback: Callback): void; + + public getInstallation(installationId: string, + options: any, + callback: Callback): void; + + public createRegistrationId(callback: Callback): void; + + public getRegistration(registrationId: string, + callback: Callback): void; + + public getRegistration(registrationId: string, + options: any, + callback: Callback): void; + + public deleteRegistration(registrationId: string, + callback: Callback): void; + + public deleteRegistration(registrationId: string, + options: { etag: any }, + callback: Callback): void; + + public updateRegistration(registration: NotificationHubRegistration, + callback: Callback): void; + + public updateRegistration(registration: NotificationHubRegistration, + options: { etag: any }, + callback: Callback): void; + + public createOrUpdateRegistration(registration: NotificationHubRegistration, + options: { etag: any }, + callback: Callback): void; + + public listRegistrations(callback: Callback): void; + + public listRegistrations(options: ListNotificationHubsOptions, + callback: Callback): void; + + public listRegistrationsByTag(tag: string, + callback: Callback): void; + + public listRegistrationsByTag(tag: string, + options: ListNotificationHubsOptions, + callback: Callback): void; +} + +export = NotificationHubService; diff --git a/types/azure-sb/lib/servicebusservice.d.ts b/types/azure-sb/lib/servicebusservice.d.ts new file mode 100644 index 0000000000..44f2b2c522 --- /dev/null +++ b/types/azure-sb/lib/servicebusservice.d.ts @@ -0,0 +1,206 @@ +import { Azure } from '../index'; + +import ServiceBusServiceBase = require('./servicebusservicebase'); + +import CreateNotificationHubOptions = Azure.ServiceBus.CreateNotificationHubOptions; +import CreateQueueOptions = Azure.ServiceBus.CreateQueueOptions; +import CreateRuleOptions = Azure.ServiceBus.CreateRuleOptions; +import CreateSubscriptionOptions = Azure.ServiceBus.CreateSubscriptionOptions; +import CreateTopicIfNotExistsOptions = Azure.ServiceBus.CreateTopicIfNotExistsOptions; +import CreateTopicOptions = Azure.ServiceBus.CreateTopicOptions; +import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; +import ListRulesOptions = Azure.ServiceBus.ListRulesOptions; +import ListSubscriptionsOptions = Azure.ServiceBus.ListSubscriptionsOptions; +import MessageOrName = Azure.ServiceBus.MessageOrName; +import Queue = Azure.ServiceBus.Results.Models.Queue; +import ReceiveQueueMessageOptions = Azure.ServiceBus.ReceiveQueueMessageOptions; +import ReceiveSubscriptionMessageOptions = Azure.ServiceBus.ReceiveSubscriptionMessageOptions; +import ResponseCallback = Azure.ServiceBus.ResponseCallback; +import ResultAndResponseCallback = Azure.ServiceBus.ResultAndResponseCallback; +import Rule = Azure.ServiceBus.Results.Models.Rule; +import Subscription = Azure.ServiceBus.Results.Models.Subscription; +import Topic = Azure.ServiceBus.Results.Models.Topic; +import TypedResultAndResponseCallback = Azure.ServiceBus.TypedResultAndResponseCallback; +import Message = Azure.ServiceBus.Message; + +declare class ServiceBusService extends ServiceBusServiceBase { + constructor(configOrNamespaceOrConnectionString?: string, + accessKey?: string, + issuer?: string, + acsNamespace?: string, + host?: string, + authenticationProvider?: object); + + public receiveQueueMessage(queuePath: string, + callback: TypedResultAndResponseCallback): void; + + public receiveQueueMessage(queuePath: string, + options: ReceiveQueueMessageOptions, + callback: TypedResultAndResponseCallback): void; + + public receiveSubscriptionMessage(topicPath: string, + subscriptionPath: string, + callback: TypedResultAndResponseCallback): void; + + public receiveSubscriptionMessage(topicPath: string, + subscriptionPath: string, + options: ReceiveSubscriptionMessageOptions, + callback: TypedResultAndResponseCallback): void; + + public deleteMessage(message: MessageOrName, + callback: ResponseCallback): void; + + public unlockMessage(message: MessageOrName, + callback: ResponseCallback): void; + + public renewLockForMessage(message: MessageOrName, + callback: ResponseCallback): void; + + public sendQueueMessage(queuePath: string, + message: MessageOrName, + callback: ResponseCallback): void; + + public sendTopicMessage(topicPath: string, + message: MessageOrName, + callback: ResponseCallback): void; + + /* + * Queue Management functions + */ + + public createQueue(queuePath: string, + callback: TypedResultAndResponseCallback): void; + + public createQueue(queuePath: string, + options: CreateQueueOptions, + callback: TypedResultAndResponseCallback): void; + + public createQueueIfNotExists(queuePath: string, + callback: TypedResultAndResponseCallback): void; + + public createQueueIfNotExists(queuePath: string, + options: CreateQueueOptions, + callback: TypedResultAndResponseCallback): void; + + public deleteQueue(queuePath: string, + callback: ResponseCallback): void; + + public getQueue(queuePath: string, + callback: TypedResultAndResponseCallback): void; + + public listQueues(queuePath: string, + callback: TypedResultAndResponseCallback): void; + + /* + * Topic Management functions + */ + + public createTopic(topicPath: string, + callback: TypedResultAndResponseCallback): void; + + public createTopic(topicPath: string, + options: CreateTopicOptions, + callback: TypedResultAndResponseCallback): void; + + public createTopicIfNotExists(topicPath: string, + callback: TypedResultAndResponseCallback): void; + + public createTopicIfNotExists(topicPath: string, + options: CreateTopicIfNotExistsOptions, + callback: TypedResultAndResponseCallback): void; + + public deleteTopic(topicPath: string, + callback: ResponseCallback): void; + + public getTopic(topicPath: string, + callback: TypedResultAndResponseCallback): void; + + public listTopics(topicPath: string, + callback: TypedResultAndResponseCallback): void; + + /* + * Subscription functions + */ + + public createSubscription(topicPath: string, + subscriptionPath: string, + callback: TypedResultAndResponseCallback): void; + + public createSubscription(topicPath: string, + subscriptionPath: string, + options: CreateSubscriptionOptions, + callback: TypedResultAndResponseCallback): void; + + public deleteSubscription(topicPath: string, + subscriptionPath: string, + callback: ResponseCallback): void; + + public getSubscription(topicPath: string, + subscriptionPath: string, + callback: TypedResultAndResponseCallback): void; + + public listSubscriptions(topicPath: string, + callback: TypedResultAndResponseCallback): void; + + public listSubscriptions(topicPath: string, + options: ListSubscriptionsOptions, + callback: TypedResultAndResponseCallback): void; + + /* + * Rule functions + */ + + public createRule(topicPath: string, + subscriptionPath: string, + rulePath: string, + callback: TypedResultAndResponseCallback): void; + + public createRule(topicPath: string, + subscriptionPath: string, + rulePath: string, + options: CreateRuleOptions, + callback: TypedResultAndResponseCallback): void; + + public deleteRule(topicPath: string, + subscriptionPath: string, + rulePath: string, + callback: ResponseCallback): void; + + public getRule(topicPath: string, + subscriptionPath: string, + rulePath: string, + callback: TypedResultAndResponseCallback): void; + + public listRules(topicPath: string, + subscriptionPath: string, + callback: TypedResultAndResponseCallback): void; + + public listRules(topicPath: string, + subscriptionPath: string, + options: ListRulesOptions, + callback: TypedResultAndResponseCallback): void; + + /* + * NotificationHub functions + */ + + public createNotificationHub(hubPath: string, + callback: ResultAndResponseCallback): void; + + public createNotificationHub(hubPath: string, + options: CreateNotificationHubOptions, + callback: ResultAndResponseCallback): void; + + public getNotificationHub(hubPath: string, + callback: ResultAndResponseCallback): void; + + public listNotificationHubs(callback: ResultAndResponseCallback): void; + + public listNotificationHubs(options: ListNotificationHubsOptions, + callback: ResultAndResponseCallback): void; + + public deleteNotificationHub(hubPath: string, + callback: ResponseCallback): void; +} + +export = ServiceBusService; diff --git a/types/azure-sb/lib/servicebusservicebase.d.ts b/types/azure-sb/lib/servicebusservicebase.d.ts new file mode 100644 index 0000000000..c29ead478c --- /dev/null +++ b/types/azure-sb/lib/servicebusservicebase.d.ts @@ -0,0 +1,12 @@ +import ServiceBusServiceClient = require('azure-sb/lib/servicebusserviceclient'); + +declare class ServiceBusServiceBase extends ServiceBusServiceClient { + constructor(configOrNamespaceOrConnectionString: string, + accessKey?: string, + issuer?: string, + acsNamespace?: string, + host?: string, + authenticationProvider?: object); +} + +export = ServiceBusServiceBase; diff --git a/types/azure-sb/lib/servicebusserviceclient.d.ts b/types/azure-sb/lib/servicebusserviceclient.d.ts new file mode 100644 index 0000000000..c97b1e3107 --- /dev/null +++ b/types/azure-sb/lib/servicebusserviceclient.d.ts @@ -0,0 +1,14 @@ +/// +import EventEmitter = NodeJS.EventEmitter; + +declare class ServiceBusServiceClient extends EventEmitter { + constructor(accessKey?: string, + issuer?: string, + sharedAccessKeyName?: string, + sharedAccessKeyValue?: string, + host?: string, + acsHost?: string, + authenticationProvider?: object); +} + +export = ServiceBusServiceClient; diff --git a/types/azure-sb/lib/wnsservice.d.ts b/types/azure-sb/lib/wnsservice.d.ts new file mode 100644 index 0000000000..1fef2da042 --- /dev/null +++ b/types/azure-sb/lib/wnsservice.d.ts @@ -0,0 +1,377 @@ +import NotificationHubService = require('azure-sb/lib/notificationhubservice'); +import Callback = Azure.ServiceBus.ResponseCallback; +import { Azure } from 'azure-sb'; +import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; +import Dictionary = Azure.ServiceBus.Dictionary; + +type Payload = Partial<{ + text1: string; + text2: string; + text3: string; + text4: string; + image1src: string; + image1alt: string; + image2src: string; + image2alt: string; + image3src: string; + image3alt: string; + image4src: string; + image4alt: string; + lang: string; + type: string; +}>; + +interface Options { + headers: Dictionary; +} + +type badges = + 'none' + | 'activity' + | 'alert' + | 'available' + | 'away' + | 'busy' + | 'newMessage' + | 'paused' + | 'playing' + | 'unavailable' + | 'error' + | 'attention'; + +type types = 'wns/toast' | 'wns/badge' | 'wns/tile' | 'wns/raw'; + +declare class WnsService { + constructor(service: NotificationHubService); + + public notificationHubService: NotificationHubService; + + sendTileSquareBlock(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquareText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquareText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquareText03(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquareText04(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText03(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText04(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText05(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText06(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText07(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText08(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText09(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText10(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideText11(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquareImage(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquarePeekImageAndText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquarePeekImageAndText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquarePeekImageAndText03(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileSquarePeekImageAndText04(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideImage(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideImageCollection(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideImageAndText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideImageAndText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideBlockAndText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideBlockAndText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideSmallImageAndText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideSmallImageAndText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideSmallImageAndText03(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideSmallImageAndText04(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWideSmallImageAndText05(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImageCollection01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImageCollection02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImageCollection03(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImageCollection04(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImageCollection05(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImageCollection06(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImageAndText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImageAndText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImage01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImage02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImage03(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImage04(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImage05(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendTileWidePeekImage06(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendToastText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendToastText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendToastText03(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendToastText04(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendToastImageAndText01(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendToastImageAndText02(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendToastImageAndText03(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendToastImageAndText04(tags: string | string[], + payload: any, + optionsOrCallback: Options | Callback, + callback?: Callback): void; + + sendBadge(tags: badges | badges[], + value: string | number, + callback?: Callback): void; + + sendBadge(tags: badges | badges[], + value: string | number, + options: Options, + callback?: Callback): void; + + sendRaw(tags: string | string[], + payload: any, + callback?: Callback): void; + + sendRaw(tags: string | string[], + payload: any, + options: Options, + callback?: Callback): void; + + send(tags: string | string[], + payload: string, + type: types, + callback?: Callback): void; + + send(tags: string | string[], + payload: string, + type: types, + options: Options, + callback: Callback): void; + + createNativeRegistration(channel: string, + tags: string | string[], + callback: Callback): void; + + createNativeRegistration(channel: string, + tags: string | string[], + options: Options, + callback: Callback): void; + + createOrUpdateNativeRegistration(registrationId: string, + channel: string, + tags: string | string[], + callback: Callback): void; + + createOrUpdateNativeRegistration(registrationId: string, + channel: string, + tags: string | string[], + options: Options, + callback: Callback): void; + + listRegistrationsByChannel(channel: string, + callback: Callback): void; + + listRegistrationsByChannel(channel: string, + options: ListNotificationHubsOptions, + callback: Callback): void; + +} + +export = WnsService; diff --git a/types/azure-sb/lib/wrapservice.d.ts b/types/azure-sb/lib/wrapservice.d.ts new file mode 100644 index 0000000000..5fbbc87345 --- /dev/null +++ b/types/azure-sb/lib/wrapservice.d.ts @@ -0,0 +1,21 @@ +import { Azure } from 'azure-sb'; + +declare class WrapService { + constructor(acsHost: string, issuer?: string, accessKey?: string); + + public issuer?: string; + public accessKey?: string; + public authenticationProvider: { + signRequest(webResource: any, callback: () => void): void; + }; + public strictSSL: boolean; + + public wrapAccessToken(uri: string, + callback: Azure.ServiceBus.ResponseCallback): void; + + public wrapAccessToken(uri: string, + options: object, + callback: Azure.ServiceBus.ResponseCallback): void; +} + +export = WrapService; diff --git a/types/azure-sb/tsconfig.json b/types/azure-sb/tsconfig.json index 525d24577e..09c9a2a9e4 100644 --- a/types/azure-sb/tsconfig.json +++ b/types/azure-sb/tsconfig.json @@ -17,7 +17,26 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts", - "azure-sb-tests.ts" + "lib/servicebusservice.d.ts", + "lib/wrapservice.d.ts", + "lib/servicebusservicebase.d.ts", + "lib/notificationhubservice.d.ts", + "lib/models/topicresult.d.ts", + "lib/models/queuemessageresult.d.ts", + "lib/models/acstokenresult.d.ts", + "lib/models/registrationresult.d.ts", + "lib/models/ruleresult.d.ts", + "lib/models/queueresult.d.ts", + "lib/models/subscriptionresult.d.ts", + "lib/models/notificationhubresult.d.ts", + "lib/models/resourceresult.d.ts", + "lib/servicebusserviceclient.d.ts", + "lib/gcmservice.d.ts", + "lib/wnsservice.d.ts", + "lib/mpnservice.d.ts", + "lib/apnsservice.d.ts", + "azure-sb-tests.ts", + "index.d.ts" ] -} \ No newline at end of file +} + diff --git a/types/azure-sb/tslint.json b/types/azure-sb/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/azure-sb/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/azure/tslint.json b/types/azure/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/azure/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/babel-core/index.d.ts b/types/babel-core/index.d.ts index a2476245c1..3a41d2d252 100644 --- a/types/babel-core/index.d.ts +++ b/types/babel-core/index.d.ts @@ -162,8 +162,9 @@ export interface TransformOptions { /** Indicate the mode the code should be parsed in. Can be either “script” or “module”. Default: "module" */ sourceType?: "script" | "module"; - /** An optional callback that can be used to wrap visitor methods. - * NOTE: This is useful for things like introspection, and not really needed for implementing anything. + /** + * An optional callback that can be used to wrap visitor methods. + * NOTE: This is useful for things like introspection, and not really needed for implementing anything. */ wrapPluginVisitorMethod?(pluginAlias: string, visitorType: 'enter' | 'exit', callback: (path: NodePath, state: any) => void): (path: NodePath, state: any) => void ; } diff --git a/types/babel-generator/index.d.ts b/types/babel-generator/index.d.ts index 3b3d8126e9..2e34d158fc 100644 --- a/types/babel-generator/index.d.ts +++ b/types/babel-generator/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Troy Gerwien // Johnny Estilles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as t from 'babel-types'; diff --git a/types/babel-traverse/index.d.ts b/types/babel-traverse/index.d.ts index 682550b161..df420c17bd 100644 --- a/types/babel-traverse/index.d.ts +++ b/types/babel-traverse/index.d.ts @@ -600,185 +600,185 @@ export class NodePath { addComments(type: string, comments: any[]): void; // ------------------------- isXXX ------------------------- - isArrayExpression(opts?: object): boolean; - isAssignmentExpression(opts?: object): boolean; - isBinaryExpression(opts?: object): boolean; - isDirective(opts?: object): boolean; - isDirectiveLiteral(opts?: object): boolean; - isBlockStatement(opts?: object): boolean; - isBreakStatement(opts?: object): boolean; - isCallExpression(opts?: object): boolean; - isCatchClause(opts?: object): boolean; - isConditionalExpression(opts?: object): boolean; - isContinueStatement(opts?: object): boolean; - isDebuggerStatement(opts?: object): boolean; - isDoWhileStatement(opts?: object): boolean; - isEmptyStatement(opts?: object): boolean; - isExpressionStatement(opts?: object): boolean; - isFile(opts?: object): boolean; - isForInStatement(opts?: object): boolean; - isForStatement(opts?: object): boolean; - isFunctionDeclaration(opts?: object): boolean; - isFunctionExpression(opts?: object): boolean; - isIdentifier(opts?: object): boolean; - isIfStatement(opts?: object): boolean; - isLabeledStatement(opts?: object): boolean; - isStringLiteral(opts?: object): boolean; - isNumericLiteral(opts?: object): boolean; - isNullLiteral(opts?: object): boolean; - isBooleanLiteral(opts?: object): boolean; - isRegExpLiteral(opts?: object): boolean; - isLogicalExpression(opts?: object): boolean; - isMemberExpression(opts?: object): boolean; - isNewExpression(opts?: object): boolean; - isProgram(opts?: object): boolean; - isObjectExpression(opts?: object): boolean; - isObjectMethod(opts?: object): boolean; - isObjectProperty(opts?: object): boolean; - isRestElement(opts?: object): boolean; - isReturnStatement(opts?: object): boolean; - isSequenceExpression(opts?: object): boolean; - isSwitchCase(opts?: object): boolean; - isSwitchStatement(opts?: object): boolean; - isThisExpression(opts?: object): boolean; - isThrowStatement(opts?: object): boolean; - isTryStatement(opts?: object): boolean; - isUnaryExpression(opts?: object): boolean; - isUpdateExpression(opts?: object): boolean; - isVariableDeclaration(opts?: object): boolean; - isVariableDeclarator(opts?: object): boolean; - isWhileStatement(opts?: object): boolean; - isWithStatement(opts?: object): boolean; - isAssignmentPattern(opts?: object): boolean; - isArrayPattern(opts?: object): boolean; - isArrowFunctionExpression(opts?: object): boolean; - isClassBody(opts?: object): boolean; - isClassDeclaration(opts?: object): boolean; - isClassExpression(opts?: object): boolean; - isExportAllDeclaration(opts?: object): boolean; - isExportDefaultDeclaration(opts?: object): boolean; - isExportNamedDeclaration(opts?: object): boolean; - isExportSpecifier(opts?: object): boolean; - isForOfStatement(opts?: object): boolean; - isImportDeclaration(opts?: object): boolean; - isImportDefaultSpecifier(opts?: object): boolean; - isImportNamespaceSpecifier(opts?: object): boolean; - isImportSpecifier(opts?: object): boolean; - isMetaProperty(opts?: object): boolean; - isClassMethod(opts?: object): boolean; - isObjectPattern(opts?: object): boolean; - isSpreadElement(opts?: object): boolean; - isSuper(opts?: object): boolean; - isTaggedTemplateExpression(opts?: object): boolean; - isTemplateElement(opts?: object): boolean; - isTemplateLiteral(opts?: object): boolean; - isYieldExpression(opts?: object): boolean; - isAnyTypeAnnotation(opts?: object): boolean; - isArrayTypeAnnotation(opts?: object): boolean; - isBooleanTypeAnnotation(opts?: object): boolean; - isBooleanLiteralTypeAnnotation(opts?: object): boolean; - isNullLiteralTypeAnnotation(opts?: object): boolean; - isClassImplements(opts?: object): boolean; - isClassProperty(opts?: object): boolean; - isDeclareClass(opts?: object): boolean; - isDeclareFunction(opts?: object): boolean; - isDeclareInterface(opts?: object): boolean; - isDeclareModule(opts?: object): boolean; - isDeclareTypeAlias(opts?: object): boolean; - isDeclareVariable(opts?: object): boolean; - isExistentialTypeParam(opts?: object): boolean; - isFunctionTypeAnnotation(opts?: object): boolean; - isFunctionTypeParam(opts?: object): boolean; - isGenericTypeAnnotation(opts?: object): boolean; - isInterfaceExtends(opts?: object): boolean; - isInterfaceDeclaration(opts?: object): boolean; - isIntersectionTypeAnnotation(opts?: object): boolean; - isMixedTypeAnnotation(opts?: object): boolean; - isNullableTypeAnnotation(opts?: object): boolean; - isNumericLiteralTypeAnnotation(opts?: object): boolean; - isNumberTypeAnnotation(opts?: object): boolean; - isStringLiteralTypeAnnotation(opts?: object): boolean; - isStringTypeAnnotation(opts?: object): boolean; - isThisTypeAnnotation(opts?: object): boolean; - isTupleTypeAnnotation(opts?: object): boolean; - isTypeofTypeAnnotation(opts?: object): boolean; - isTypeAlias(opts?: object): boolean; - isTypeAnnotation(opts?: object): boolean; - isTypeCastExpression(opts?: object): boolean; - isTypeParameterDeclaration(opts?: object): boolean; - isTypeParameterInstantiation(opts?: object): boolean; - isObjectTypeAnnotation(opts?: object): boolean; - isObjectTypeCallProperty(opts?: object): boolean; - isObjectTypeIndexer(opts?: object): boolean; - isObjectTypeProperty(opts?: object): boolean; - isQualifiedTypeIdentifier(opts?: object): boolean; - isUnionTypeAnnotation(opts?: object): boolean; - isVoidTypeAnnotation(opts?: object): boolean; - isJSXAttribute(opts?: object): boolean; - isJSXClosingElement(opts?: object): boolean; - isJSXElement(opts?: object): boolean; - isJSXEmptyExpression(opts?: object): boolean; - isJSXExpressionContainer(opts?: object): boolean; - isJSXIdentifier(opts?: object): boolean; - isJSXMemberExpression(opts?: object): boolean; - isJSXNamespacedName(opts?: object): boolean; - isJSXOpeningElement(opts?: object): boolean; - isJSXSpreadAttribute(opts?: object): boolean; - isJSXText(opts?: object): boolean; - isNoop(opts?: object): boolean; - isParenthesizedExpression(opts?: object): boolean; - isAwaitExpression(opts?: object): boolean; - isBindExpression(opts?: object): boolean; - isDecorator(opts?: object): boolean; - isDoExpression(opts?: object): boolean; - isExportDefaultSpecifier(opts?: object): boolean; - isExportNamespaceSpecifier(opts?: object): boolean; - isRestProperty(opts?: object): boolean; - isSpreadProperty(opts?: object): boolean; - isExpression(opts?: object): boolean; - isBinary(opts?: object): boolean; - isScopable(opts?: object): boolean; - isBlockParent(opts?: object): boolean; - isBlock(opts?: object): boolean; - isStatement(opts?: object): boolean; - isTerminatorless(opts?: object): boolean; - isCompletionStatement(opts?: object): boolean; - isConditional(opts?: object): boolean; - isLoop(opts?: object): boolean; - isWhile(opts?: object): boolean; - isExpressionWrapper(opts?: object): boolean; - isFor(opts?: object): boolean; - isForXStatement(opts?: object): boolean; - isFunction(opts?: object): boolean; - isFunctionParent(opts?: object): boolean; - isPureish(opts?: object): boolean; - isDeclaration(opts?: object): boolean; - isLVal(opts?: object): boolean; - isLiteral(opts?: object): boolean; - isImmutable(opts?: object): boolean; - isUserWhitespacable(opts?: object): boolean; - isMethod(opts?: object): boolean; - isObjectMember(opts?: object): boolean; - isProperty(opts?: object): boolean; - isUnaryLike(opts?: object): boolean; - isPattern(opts?: object): boolean; - isClass(opts?: object): boolean; - isModuleDeclaration(opts?: object): boolean; - isExportDeclaration(opts?: object): boolean; - isModuleSpecifier(opts?: object): boolean; - isFlow(opts?: object): boolean; - isFlowBaseAnnotation(opts?: object): boolean; - isFlowDeclaration(opts?: object): boolean; - isJSX(opts?: object): boolean; - isNumberLiteral(opts?: object): boolean; - isRegexLiteral(opts?: object): boolean; - isReferencedIdentifier(opts?: object): boolean; - isReferencedMemberExpression(opts?: object): boolean; - isBindingIdentifier(opts?: object): boolean; - isScope(opts?: object): boolean; + isArrayExpression(opts?: object): this is NodePath ; + isAssignmentExpression(opts?: object): this is NodePath; + isBinaryExpression(opts?: object): this is NodePath; + isDirective(opts?: object): this is NodePath; + isDirectiveLiteral(opts?: object): this is NodePath; + isBlockStatement(opts?: object): this is NodePath; + isBreakStatement(opts?: object): this is NodePath; + isCallExpression(opts?: object): this is NodePath; + isCatchClause(opts?: object): this is NodePath; + isConditionalExpression(opts?: object): this is NodePath; + isContinueStatement(opts?: object): this is NodePath; + isDebuggerStatement(opts?: object): this is NodePath; + isDoWhileStatement(opts?: object): this is NodePath; + isEmptyStatement(opts?: object): this is NodePath; + isExpressionStatement(opts?: object): this is NodePath; + isFile(opts?: object): this is NodePath; + isForInStatement(opts?: object): this is NodePath; + isForStatement(opts?: object): this is NodePath; + isFunctionDeclaration(opts?: object): this is NodePath; + isFunctionExpression(opts?: object): this is NodePath; + isIdentifier(opts?: object): this is NodePath; + isIfStatement(opts?: object): this is NodePath; + isLabeledStatement(opts?: object): this is NodePath; + isStringLiteral(opts?: object): this is NodePath; + isNumericLiteral(opts?: object): this is NodePath; + isNullLiteral(opts?: object): this is NodePath; + isBooleanLiteral(opts?: object): this is NodePath; + isRegExpLiteral(opts?: object): this is NodePath; + isLogicalExpression(opts?: object): this is NodePath; + isMemberExpression(opts?: object): this is NodePath; + isNewExpression(opts?: object): this is NodePath; + isProgram(opts?: object): this is NodePath; + isObjectExpression(opts?: object): this is NodePath; + isObjectMethod(opts?: object): this is NodePath; + isObjectProperty(opts?: object): this is NodePath; + isRestElement(opts?: object): this is NodePath; + isReturnStatement(opts?: object): this is NodePath; + isSequenceExpression(opts?: object): this is NodePath; + isSwitchCase(opts?: object): this is NodePath; + isSwitchStatement(opts?: object): this is NodePath; + isThisExpression(opts?: object): this is NodePath; + isThrowStatement(opts?: object): this is NodePath; + isTryStatement(opts?: object): this is NodePath; + isUnaryExpression(opts?: object): this is NodePath; + isUpdateExpression(opts?: object): this is NodePath; + isVariableDeclaration(opts?: object): this is NodePath; + isVariableDeclarator(opts?: object): this is NodePath; + isWhileStatement(opts?: object): this is NodePath; + isWithStatement(opts?: object): this is NodePath; + isAssignmentPattern(opts?: object): this is NodePath; + isArrayPattern(opts?: object): this is NodePath; + isArrowFunctionExpression(opts?: object): this is NodePath; + isClassBody(opts?: object): this is NodePath; + isClassDeclaration(opts?: object): this is NodePath; + isClassExpression(opts?: object): this is NodePath; + isExportAllDeclaration(opts?: object): this is NodePath; + isExportDefaultDeclaration(opts?: object): this is NodePath; + isExportNamedDeclaration(opts?: object): this is NodePath; + isExportSpecifier(opts?: object): this is NodePath; + isForOfStatement(opts?: object): this is NodePath; + isImportDeclaration(opts?: object): this is NodePath; + isImportDefaultSpecifier(opts?: object): this is NodePath; + isImportNamespaceSpecifier(opts?: object): this is NodePath; + isImportSpecifier(opts?: object): this is NodePath; + isMetaProperty(opts?: object): this is NodePath; + isClassMethod(opts?: object): this is NodePath; + isObjectPattern(opts?: object): this is NodePath; + isSpreadElement(opts?: object): this is NodePath; + isSuper(opts?: object): this is NodePath; + isTaggedTemplateExpression(opts?: object): this is NodePath; + isTemplateElement(opts?: object): this is NodePath; + isTemplateLiteral(opts?: object): this is NodePath; + isYieldExpression(opts?: object): this is NodePath; + isAnyTypeAnnotation(opts?: object): this is NodePath; + isArrayTypeAnnotation(opts?: object): this is NodePath; + isBooleanTypeAnnotation(opts?: object): this is NodePath; + isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath; + isNullLiteralTypeAnnotation(opts?: object): this is NodePath; + isClassImplements(opts?: object): this is NodePath; + isClassProperty(opts?: object): this is NodePath; + isDeclareClass(opts?: object): this is NodePath; + isDeclareFunction(opts?: object): this is NodePath; + isDeclareInterface(opts?: object): this is NodePath; + isDeclareModule(opts?: object): this is NodePath; + isDeclareTypeAlias(opts?: object): this is NodePath; + isDeclareVariable(opts?: object): this is NodePath; + isExistentialTypeParam(opts?: object): this is NodePath; + isFunctionTypeAnnotation(opts?: object): this is NodePath; + isFunctionTypeParam(opts?: object): this is NodePath; + isGenericTypeAnnotation(opts?: object): this is NodePath; + isInterfaceExtends(opts?: object): this is NodePath; + isInterfaceDeclaration(opts?: object): this is NodePath; + isIntersectionTypeAnnotation(opts?: object): this is NodePath; + isMixedTypeAnnotation(opts?: object): this is NodePath; + isNullableTypeAnnotation(opts?: object): this is NodePath; + isNumericLiteralTypeAnnotation(opts?: object): this is NodePath; + isNumberTypeAnnotation(opts?: object): this is NodePath; + isStringLiteralTypeAnnotation(opts?: object): this is NodePath; + isStringTypeAnnotation(opts?: object): this is NodePath; + isThisTypeAnnotation(opts?: object): this is NodePath; + isTupleTypeAnnotation(opts?: object): this is NodePath; + isTypeofTypeAnnotation(opts?: object): this is NodePath; + isTypeAlias(opts?: object): this is NodePath; + isTypeAnnotation(opts?: object): this is NodePath; + isTypeCastExpression(opts?: object): this is NodePath; + isTypeParameterDeclaration(opts?: object): this is NodePath; + isTypeParameterInstantiation(opts?: object): this is NodePath; + isObjectTypeAnnotation(opts?: object): this is NodePath; + isObjectTypeCallProperty(opts?: object): this is NodePath; + isObjectTypeIndexer(opts?: object): this is NodePath; + isObjectTypeProperty(opts?: object): this is NodePath; + isQualifiedTypeIdentifier(opts?: object): this is NodePath; + isUnionTypeAnnotation(opts?: object): this is NodePath; + isVoidTypeAnnotation(opts?: object): this is NodePath; + isJSXAttribute(opts?: object): this is NodePath; + isJSXClosingElement(opts?: object): this is NodePath; + isJSXElement(opts?: object): this is NodePath; + isJSXEmptyExpression(opts?: object): this is NodePath; + isJSXExpressionContainer(opts?: object): this is NodePath; + isJSXIdentifier(opts?: object): this is NodePath; + isJSXMemberExpression(opts?: object): this is NodePath; + isJSXNamespacedName(opts?: object): this is NodePath; + isJSXOpeningElement(opts?: object): this is NodePath; + isJSXSpreadAttribute(opts?: object): this is NodePath; + isJSXText(opts?: object): this is NodePath; + isNoop(opts?: object): this is NodePath; + isParenthesizedExpression(opts?: object): this is NodePath; + isAwaitExpression(opts?: object): this is NodePath; + isBindExpression(opts?: object): this is NodePath; + isDecorator(opts?: object): this is NodePath; + isDoExpression(opts?: object): this is NodePath; + isExportDefaultSpecifier(opts?: object): this is NodePath; + isExportNamespaceSpecifier(opts?: object): this is NodePath; + isRestProperty(opts?: object): this is NodePath; + isSpreadProperty(opts?: object): this is NodePath; + isExpression(opts?: object): this is NodePath; + isBinary(opts?: object): this is NodePath; + isScopable(opts?: object): this is NodePath; + isBlockParent(opts?: object): this is NodePath; + isBlock(opts?: object): this is NodePath; + isStatement(opts?: object): this is NodePath; + isTerminatorless(opts?: object): this is NodePath; + isCompletionStatement(opts?: object): this is NodePath; + isConditional(opts?: object): this is NodePath; + isLoop(opts?: object): this is NodePath; + isWhile(opts?: object): this is NodePath; + isExpressionWrapper(opts?: object): this is NodePath; + isFor(opts?: object): this is NodePath; + isForXStatement(opts?: object): this is NodePath; + isFunction(opts?: object): this is NodePath; + isFunctionParent(opts?: object): this is NodePath; + isPureish(opts?: object): this is NodePath; + isDeclaration(opts?: object): this is NodePath; + isLVal(opts?: object): this is NodePath; + isLiteral(opts?: object): this is NodePath; + isImmutable(opts?: object): this is NodePath; + isUserWhitespacable(opts?: object): this is NodePath; + isMethod(opts?: object): this is NodePath; + isObjectMember(opts?: object): this is NodePath; + isProperty(opts?: object): this is NodePath; + isUnaryLike(opts?: object): this is NodePath; + isPattern(opts?: object): this is NodePath; + isClass(opts?: object): this is NodePath; + isModuleDeclaration(opts?: object): this is NodePath; + isExportDeclaration(opts?: object): this is NodePath; + isModuleSpecifier(opts?: object): this is NodePath; + isFlow(opts?: object): this is NodePath; + isFlowBaseAnnotation(opts?: object): this is NodePath; + isFlowDeclaration(opts?: object): this is NodePath; + isJSX(opts?: object): this is NodePath; + isNumberLiteral(opts?: object): this is NodePath; + isRegexLiteral(opts?: object): this is NodePath; + isReferencedIdentifier(opts?: object): this is NodePath; + isReferencedMemberExpression(opts?: object): this is NodePath; + isBindingIdentifier(opts?: object): this is NodePath; + isScope(opts?: object): this is NodePath; isReferenced(opts?: object): boolean; - isBlockScoped(opts?: object): boolean; - isVar(opts?: object): boolean; + isBlockScoped(opts?: object): this is NodePath; + isVar(opts?: object): this is NodePath; isUser(opts?: object): boolean; isGenerated(opts?: object): boolean; isPure(opts?: object): boolean; diff --git a/types/babel-types/babel-types-tests.ts b/types/babel-types/babel-types-tests.ts index af8ab2d0b7..8ffb1b32de 100644 --- a/types/babel-types/babel-types-tests.ts +++ b/types/babel-types/babel-types-tests.ts @@ -52,3 +52,64 @@ traverse(ast, { } } }); + +// TypeScript Types +// TODO: Test all variants of these functions' signatures + +const id = t.identifier("id"); +const tparam = t.typeParameterDeclaration([id]); + +const any = t.TSAnyKeyword(); +t.TSArrayType(any); +t.TSAsExpression(exp, any); +t.TSBooleanKeyword(); +t.TSCallSignatureDeclaration(tparam); +t.TSConstructSignatureDeclaration(); +t.TSConstructorType(); +t.TSDeclareFunction(id, t.noop(), [id], t.noop()); +t.TSDeclareMethod([t.decorator(exp)], exp, t.noop(), [id]); +t.TSEnumDeclaration(id, [t.TSEnumMember(id)]); +t.TSEnumMember(id); +const expo = t.TSExportAssignment(exp); +t.TSExpressionWithTypeArguments(id); +const ext = t.TSExternalModuleReference(t.stringLiteral()); +t.TSFunctionType(); +t.TSImportEqualsDeclaration(id, ext); +const sig = t.TSIndexSignature([id]); +t.TSIndexedAccessType(any, any); +t.TSInterfaceBody([sig]); +t.TSInterfaceDeclaration(id, null, null, t.TSInterfaceBody([sig])); +t.TSIntersectionType([any]); +t.TSLiteralType(t.stringLiteral("a")); +t.TSMappedType(t.typeParameter()); +t.TSMethodSignature(id); +const block = t.TSModuleBlock([expo]); +t.TSModuleDeclaration(id, block); +t.TSNamespaceExportDeclaration(id); +t.TSNeverKeyword(); +t.TSNonNullExpression(exp); +t.TSNullKeyword(); +t.TSNumberKeyword(); +t.TSObjectKeyword(); +t.TSParameterProperty(id); +t.TSParenthesizedType(any); +t.TSPropertySignature(id); +t.TSQualifiedName(id, id); +t.TSStringKeyword(); +t.TSSymbolKeyword(); +t.TSThisType(); +t.TSTupleType([any, any]); +t.TSTypeAliasDeclaration(id, tparam, any); +t.TSTypeAnnotation(any); +t.TSTypeAssertion(any, exp); +t.TSTypeLiteral([sig]); +t.TSTypeOperator(any); +const param = t.TSTypeParameter(); +t.TSTypeParameterDeclaration([param]); +t.TSTypeParameterInstantiation([any]); +t.TSTypePredicate(id, t.TSTypeAnnotation(any)); +t.TSTypeQuery(id); +t.TSTypeReference(id); +t.TSUndefinedKeyword(); +t.TSUnionType([any]); +t.TSVoidKeyword(); diff --git a/types/babel-types/index.d.ts b/types/babel-types/index.d.ts index 1879c81e85..cbed3e076c 100644 --- a/types/babel-types/index.d.ts +++ b/types/babel-types/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for babel-types 6.25 +// Type definitions for babel-types 7.0 // Project: https://github.com/babel/babel/tree/master/packages/babel-types // Definitions by: Troy Gerwien // Sam Baxter // Marvin Hagemeister +// Boris Cherny // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -711,6 +712,13 @@ export interface TypeCastExpression extends Node { typeAnnotation: FlowTypeAnnotation; } +export interface TypeParameter extends Node { + type: "TypeParameterDeclaration"; + bound: TypeAnnotation | null; + default: Flow | null; + name: string | null; +} + export interface TypeParameterDeclaration extends Node { type: "TypeParameterDeclaration"; params: Identifier[]; @@ -873,13 +881,344 @@ export interface SpreadProperty extends Node { argument: Expression; } +export interface TSAnyKeyword extends Node { + type: "TSAnyKeyword"; +} + +export interface TSArrayType extends Node { + type: "TSArrayType"; + elementType: TSType; +} + +export interface TSAsExpression extends Node { + type: "TSAsExpression"; + expression: Expression; + typeAnnotation: TSType; +} + +export interface TSBooleanKeyword extends Node { + type: "TSBooleanKeyword"; +} + +export interface TSCallSignatureDeclaration extends Node { + type: "TSCallSignatureDeclaration"; + typeParameters: TypeParameterDeclaration | null; + parameters: Array | null; + typeAnnotation: TSTypeAnnotation | null; +} + +export interface TSConstructSignatureDeclaration extends Node { + type: "TSConstructSignatureDeclaration"; + typeParameters: TypeParameterDeclaration | null; + parameters: Array | null; + typeAnnotation: TSTypeAnnotation | null; +} + +export interface TSConstructorType extends Node { + type: "TSConstructorType"; + typeParameters: TypeParameterDeclaration | null; + typeAnnotation: TSTypeAnnotation | null; + parameters: Array | null; +} + +export interface TSDeclareFunction extends Node { + type: "TSDeclareFunction"; + id: Identifier | null; + typeParameters: TypeParameterDeclaration | Noop | null; + params: LVal[]; + returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; + async: boolean; + declare: boolean | null; + generator: boolean; +} + +export interface TSDeclareMethod extends Node { + type: "TSDeclareMethod"; + decorators: Decorator[] | null; + key: Expression; + typeParameters: TypeParameterDeclaration | Noop | null; + params: LVal[]; + returnType: TypeAnnotation | TSTypeAnnotation | Noop | null; + abstract: boolean | null; + access: "public" | "private" | "protected" | null; + accessibility: "public" | "private" | "protected" | null; + async: boolean; + computed: boolean; + generator: boolean; + kind: "get" | "set" | "method" | "constructor"; + optional: boolean | null; + static: boolean | null; +} + +export interface TSEnumDeclaration extends Node { + type: "TSEnumDeclaration"; + id: Identifier; + members: TSEnumMember[]; + const: boolean | null; + declare: boolean | null; + initializer: Expression | null; +} + +export interface TSEnumMember extends Node { + type: "TSEnumMember"; + id: Identifier | StringLiteral; + initializer: Expression | null; +} + +export interface TSExportAssignment extends Node { + type: "TSExportAssignment"; + expression: Expression; +} + +export interface TSExpressionWithTypeArguments extends Node { + type: "TSExpressionWithTypeArguments"; + expression: TSEntityName; + typeParameters: TypeParameterInstantiation | null; +} + +export interface TSExternalModuleReference extends Node { + type: "TSExternalModuleReference"; + expression: StringLiteral; +} + +export interface TSFunctionType extends Node { + type: "TSFunctionType"; + typeParameters: TypeParameterDeclaration | null; + typeAnnotation: TSTypeAnnotation | null; + parameters: Array | null; +} + +export interface TSImportEqualsDeclaration extends Node { + type: "TSImportEqualsDeclaration"; + id: Identifier; + moduleReference: TSEntityName | TSExternalModuleReference; + isExport: boolean | null; +} + +export interface TSIndexSignature extends Node { + type: "TSIndexSignature"; + parameters: Identifier[]; + typeAnnotation: TSTypeAnnotation | null; + readonly: boolean | null; +} + +export interface TSIndexedAccessType extends Node { + type: "TSIndexedAccessType"; + objectType: TSType; + indexType: TSType; +} + +export interface TSInterfaceBody extends Node { + type: "TSInterfaceBody"; + body: TSTypeElement[]; +} + +export interface TSInterfaceDeclaration extends Node { + type: "TSInterfaceDeclaration"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + extends: TSExpressionWithTypeArguments[] | null; + body: TSInterfaceBody; + declare: boolean | null; +} + +export interface TSIntersectionType extends Node { + type: "TSIntersectionType"; + types: TSType[]; +} + +export interface TSLiteralType extends Node { + type: "TSLiteralType"; + literal: NumericLiteral | StringLiteral | BooleanLiteral; +} + +export interface TSMappedType extends Node { + type: "TSMappedType"; + typeParameter: TypeParameter; + typeAnnotation: TSType | null; + optional: boolean | null; + readonly: boolean | null; +} + +export interface TSMethodSignature extends Node { + type: "TSMethodSignature"; + key: Expression; + typeParameters: TypeParameterDeclaration | null; + parameters: Array | null; + typeAnnotation: TSTypeAnnotation | null; + computed: boolean | null; + optional: boolean | null; +} + +export interface TSModuleBlock extends Node { + type: "TSModuleBlock"; + body: Statement[]; +} + +export interface TSModuleDeclaration extends Node { + type: "TSModuleDeclaration"; + id: Identifier | StringLiteral; + body: TSModuleBlock | TSModuleDeclaration; + declare: boolean | null; + global: boolean | null; +} + +export interface TSNamespaceExportDeclaration extends Node { + type: "TSNamespaceExportDeclaration"; + id: Identifier; +} + +export interface TSNeverKeyword extends Node { + type: "TSNeverKeyword"; +} + +export interface TSNonNullExpression extends Node { + type: "TSNonNullExpression"; + expression: Expression; +} + +export interface TSNullKeyword extends Node { + type: "TSNullKeyword"; +} + +export interface TSNumberKeyword extends Node { + type: "TSNumberKeyword"; +} + +export interface TSObjectKeyword extends Node { + type: "TSObjectKeyword"; +} + +export interface TSParameterProperty extends Node { + type: "TSParameterProperty"; + parameter: Identifier | AssignmentPattern; + accessibility: 'public' | 'private' | 'protected' | null; + readonly: boolean | null; +} + +export interface TSParenthesizedType extends Node { + type: "TSParenthesizedType"; + typeAnnotation: TSType; +} + +export interface TSPropertySignature extends Node { + type: "TSPropertySignature"; + key: Expression; + typeAnnotation: TSTypeAnnotation | null; + initializer: Expression | null; + computed: boolean | null; + optional: boolean | null; + readonly: boolean | null; +} + +export interface TSQualifiedName extends Node { + type: "TSQualifiedName"; + left: TSEntityName; + right: Identifier; +} + +export interface TSStringKeyword extends Node { + type: "TSStringKeyword"; +} + +export interface TSSymbolKeyword extends Node { + type: "TSSymbolKeyword"; +} + +export interface TSThisType extends Node { + type: "TSThisType"; +} + +export interface TSTupleType extends Node { + type: "TSTupleType"; + elementTypes: TSType[]; +} + +export interface TSTypeAliasDeclaration extends Node { + type: "TSTypeAliasDeclaration"; + id: Identifier; + typeParameters: TypeParameterDeclaration | null; + typeAnnotation: TSType; + declare: boolean | null; +} + +export interface TSTypeAnnotation extends Node { + type: "TSTypeAnnotation"; + typeAnnotation: TSType; +} + +export interface TSTypeAssertion extends Node { + type: "TSTypeAssertion"; + typeAnnotation: TSType; + expression: Expression; +} + +export interface TSTypeLiteral extends Node { + type: "TSTypeLiteral"; + members: TSTypeElement[]; +} + +export interface TSTypeOperator extends Node { + type: "TSTypeOperator"; + typeAnnotation: TSType; + operator: string | null; +} + +export interface TSTypeParameter extends Node { + type: "TSTypeParameter"; + constraint: TSType | null; + default: TSType | null; + name: string | null; +} + +export interface TSTypeParameterDeclaration extends Node { + type: "TSTypeParameterDeclaration"; + params: TSTypeParameter[]; +} + +export interface TSTypeParameterInstantiation extends Node { + type: "TSTypeParameterInstantiation"; + params: TSType[]; +} + +export interface TSTypePredicate extends Node { + type: "TSTypePredicate"; + parameterName: Identifier | TSThisType; + typeAnnotation: TSTypeAnnotation; +} + +export interface TSTypeQuery extends Node { + type: "TSTypeQuery"; + exprName: TSEntityName; +} + +export interface TSTypeReference extends Node { + type: "TSTypeReference"; + typeName: TSEntityName; + typeParameters: TypeParameterInstantiation | null; +} + +export interface TSUndefinedKeyword extends Node { + type: "TSUndefinedKeyword"; +} + +export interface TSUnionType extends Node { + type: "TSUnionType"; + types: TSType[]; +} + +export interface TSVoidKeyword extends Node { + type: "TSVoidKeyword"; +} + export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | TypeCastExpression | JSXElement | JSXEmptyExpression | JSXIdentifier | JSXMemberExpression - | ParenthesizedExpression | AwaitExpression | BindExpression | DoExpression; + | ParenthesizedExpression | AwaitExpression | BindExpression | DoExpression | TSAsExpression + | TSNonNullExpression | TSTypeAssertion; export type Binary = BinaryExpression | LogicalExpression; @@ -898,7 +1237,9 @@ export type Statement = BlockStatement | BreakStatement | ContinueStatement | De | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface - | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias; + | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias | TSDeclareFunction + | TSEnumDeclaration | TSExportAssignment | TSImportEqualsDeclaration | TSInterfaceDeclaration + | TSModuleDeclaration | TSNamespaceExportDeclaration | TSTypeAliasDeclaration; export type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression; export type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement; @@ -914,9 +1255,11 @@ export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction - | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias; + | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias + | TSDeclareFunction | TSEnumDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSTypeAliasDeclaration; -export type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern; +export type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern + | TSParameterProperty; export type Literal = StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral | RegExpLiteral | TemplateLiteral; export type Immutable = StringLiteral | NumericLiteral | BooleanLiteral | NullLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXOpeningElement; export type UserWhitespacable = ObjectMethod | ObjectProperty | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty; @@ -952,6 +1295,17 @@ export type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText; +export type TSType = TSAnyKeyword | TSArrayType | TSBooleanKeyword | TSConstructorType | TSExpressionWithTypeArguments + | TSFunctionType | TSIndexedAccessType | TSIntersectionType | TSLiteralType | TSMappedType | TSNeverKeyword + | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSParenthesizedType | TSStringKeyword | TSSymbolKeyword + | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference + | TSUndefinedKeyword | TSUnionType | TSVoidKeyword; + +export type TSEntityName = Identifier | TSQualifiedName; + +export type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSIndexSignature + | TSMethodSignature | TSPropertySignature; + export function arrayExpression(elements?: Array): ArrayExpression; export function assignmentExpression(operator?: string, left?: LVal, right?: Expression): AssignmentExpression; export function binaryExpression( @@ -1060,6 +1414,7 @@ export function typeofTypeAnnotation(argument?: FlowTypeAnnotation): TypeofTypeA export function typeAlias(id?: Identifier, typeParameters?: TypeParameterDeclaration, right?: FlowTypeAnnotation): TypeAlias; export function typeAnnotation(typeAnnotation?: FlowTypeAnnotation): TypeAnnotation; export function typeCastExpression(expression?: Expression, typeAnnotation?: FlowTypeAnnotation): TypeCastExpression; +export function typeParameter(bound?: TypeAnnotation, default_?: Flow): TypeParameter; export function typeParameterDeclaration(params?: Identifier[]): TypeParameterDeclaration; export function typeParameterInstantiation(params?: FlowTypeAnnotation[]): TypeParameterInstantiation; export function objectTypeAnnotation(properties?: ObjectTypeProperty[], indexers?: ObjectTypeIndexer[], callProperties?: ObjectTypeCallProperty[]): ObjectTypeAnnotation; @@ -1091,6 +1446,74 @@ export function exportNamespaceSpecifier(exported?: Identifier): ExportNamespace export function restProperty(argument?: LVal): RestProperty; export function spreadProperty(argument?: Expression): SpreadProperty; +export function TSAnyKeyword(): TSAnyKeyword; +export function TSArrayType(elementType: TSType): TSArrayType; +export function TSAsExpression(expression: Expression, typeAnnotation: TSType): TSAsExpression; +export function TSBooleanKeyword(): TSBooleanKeyword; +export function TSCallSignatureDeclaration(typeParameters?: TypeParameterDeclaration, parameters?: Array, typeAnnotation?: TSTypeAnnotation): TSCallSignatureDeclaration; +export function TSConstructSignatureDeclaration(typeParameters?: TypeParameterDeclaration, parameters?: Array, typeAnnotation?: TSTypeAnnotation): TSTypeElement; +export function TSConstructorType(typeParameters?: TypeParameterDeclaration, typeAnnotation?: TSTypeAnnotation): TSConstructorType; +export function TSDeclareFunction( + id: Identifier | undefined | null, + typeParameters: TypeParameterDeclaration | Noop | undefined | null, + params: LVal[], + returnType: TypeAnnotation | TSTypeAnnotation | Noop | undefined | null): TSDeclareFunction; +export function TSDeclareMethod( + decorators: Decorator[] | undefined | null, + key: Expression, + typeParameters: TypeParameterDeclaration | Noop | undefined | null, + params: LVal[], + returnType?: TypeAnnotation | TSTypeAnnotation | Noop): TSDeclareMethod; +export function TSEnumDeclaration(id: Identifier, members: TSEnumMember[]): TSEnumDeclaration; +export function TSEnumMember(id: Identifier | StringLiteral, initializer?: Expression): TSEnumMember; +export function TSExportAssignment(expression: Expression): TSExportAssignment; +export function TSExpressionWithTypeArguments(expression: TSEntityName, typeParameters?: TypeParameterInstantiation): TSExpressionWithTypeArguments; +export function TSExternalModuleReference(expression: StringLiteral): TSExternalModuleReference; +export function TSFunctionType(typeParameters?: TypeParameterDeclaration, typeAnnotation?: TSTypeAnnotation): TSFunctionType; +export function TSImportEqualsDeclaration(id: Identifier, moduleReference: TSEntityName | TSExternalModuleReference): TSImportEqualsDeclaration; +export function TSIndexSignature(parameters: Identifier[], typeAnnotation?: TSTypeAnnotation): TSIndexSignature; +export function TSIndexedAccessType(objectType: TSType, indexType: TSType): TSIndexedAccessType; +export function TSInterfaceBody(body: TSTypeElement[]): TSInterfaceBody; +export function TSInterfaceDeclaration( + id: Identifier, + typeParameters: TypeParameterDeclaration | undefined | null, + extends_: TSExpressionWithTypeArguments[] | undefined | null, + body: TSInterfaceBody): TSInterfaceDeclaration; +export function TSIntersectionType(types: TSType[]): TSIntersectionType; +export function TSLiteralType(literal: NumericLiteral | StringLiteral | BooleanLiteral): TSLiteralType; +export function TSMappedType(typeParameter: TypeParameter, typeAnnotation?: TSType): TSMappedType; +export function TSMethodSignature(key: Expression, typeParameters?: TypeParameterDeclaration, parameters?: Array, typeAnnotation?: TSTypeAnnotation): TSMethodSignature; +export function TSModuleBlock(body: Statement[]): TSModuleBlock; +export function TSModuleDeclaration(id: Identifier | StringLiteral, body: TSModuleBlock | TSModuleDeclaration): TSModuleDeclaration; +export function TSNamespaceExportDeclaration(id: Identifier): TSNamespaceExportDeclaration; +export function TSNeverKeyword(): TSNeverKeyword; +export function TSNonNullExpression(expression: Expression): TSNonNullExpression; +export function TSNullKeyword(): TSNullKeyword; +export function TSNumberKeyword(): TSNumberKeyword; +export function TSObjectKeyword(): TSObjectKeyword; +export function TSParameterProperty(parameter: Identifier | AssignmentPattern): TSParameterProperty; +export function TSParenthesizedType(typeAnnotation: TSType): TSParenthesizedType; +export function TSPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation, initializer?: Expression): TSPropertySignature; +export function TSQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName; +export function TSStringKeyword(): TSStringKeyword; +export function TSSymbolKeyword(): TSSymbolKeyword; +export function TSThisType(): TSThisType; +export function TSTupleType(elementTypes: TSType[]): TSTupleType; +export function TSTypeAliasDeclaration(id: Identifier, typeParameters: TypeParameterDeclaration | undefined | null, typeAnnotation: TSType): TSTypeAliasDeclaration; +export function TSTypeAnnotation(typeAnnotation: TSType): TSTypeAnnotation; +export function TSTypeAssertion(typeAnnotation: TSType, expression: Expression): TSTypeAssertion; +export function TSTypeLiteral(members: TSTypeElement[]): TSTypeLiteral; +export function TSTypeOperator(typeAnnotation: TSType): TSTypeOperator; +export function TSTypeParameter(constraint?: TSType, default_?: TSType): TSTypeParameter; +export function TSTypeParameterDeclaration(params: TSTypeParameter[]): TSTypeParameterDeclaration; +export function TSTypeParameterInstantiation(params: TSType[]): TSTypeParameterInstantiation; +export function TSTypePredicate(parameterName: Identifier | TSThisType, typeAnnotation: TSTypeAnnotation): TSTypePredicate; +export function TSTypeQuery(exprName: TSEntityName): TSTypeQuery; +export function TSTypeReference(typeName: TSEntityName, typeParameters?: TypeParameterInstantiation): TSTypeReference; +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; @@ -1196,6 +1619,7 @@ export function isTypeofTypeAnnotation(node: object, opts?: object): node is Typ 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; @@ -1265,17 +1689,72 @@ 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 isReferencedIdentifier(node: object, opts?: object): boolean; -export function isReferencedMemberExpression(node: object, opts?: object): boolean; -export function isBindingIdentifier(node: object, opts?: object): boolean; -export function isScope(node: object, opts?: object): boolean; +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): boolean; -export function isVar(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 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; + // React specific export interface ReactHelpers { isCompatTag(tagName?: string): boolean; @@ -1388,6 +1867,7 @@ 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; @@ -1455,3 +1935,58 @@ 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 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; diff --git a/types/babel-webpack-plugin/babel-webpack-plugin-tests.ts b/types/babel-webpack-plugin/babel-webpack-plugin-tests.ts new file mode 100644 index 0000000000..89b8efc6e6 --- /dev/null +++ b/types/babel-webpack-plugin/babel-webpack-plugin-tests.ts @@ -0,0 +1,10 @@ +import BabelWebpackPlugin = require('babel-webpack-plugin'); + +new BabelWebpackPlugin(); +new BabelWebpackPlugin({}); +new BabelWebpackPlugin({ + test: /\.js$/, + presets: ['es2015'], + sourceMaps: false, + compact: false +}); diff --git a/types/babel-webpack-plugin/index.d.ts b/types/babel-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..3f16d154ac --- /dev/null +++ b/types/babel-webpack-plugin/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for babel-webpack-plugin 0.1 +// Project: https://github.com/simlrh/babel-webpack-plugin +// Definitions by: Jed Fox +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin } from 'webpack'; +import { TransformOptions } from 'babel-core'; + +export = BabelWebpackPlugin; + +declare class BabelWebpackPlugin extends Plugin { + constructor(options?: BabelWebpackPlugin.Options); +} + +declare namespace BabelWebpackPlugin { + type Matcher = RegExp | string | Array; + interface Options extends TransformOptions { + test?: Matcher; + include?: Matcher; + exclude?: Matcher; + } +} diff --git a/types/babel-webpack-plugin/tsconfig.json b/types/babel-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..3e73343283 --- /dev/null +++ b/types/babel-webpack-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", + "babel-webpack-plugin-tests.ts" + ] +} diff --git a/types/jimp/tslint.json b/types/babel-webpack-plugin/tslint.json similarity index 100% rename from types/jimp/tslint.json rename to types/babel-webpack-plugin/tslint.json diff --git a/types/babelify/tslint.json b/types/babelify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/babelify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/babylon-walk/babylon-walk-tests.ts b/types/babylon-walk/babylon-walk-tests.ts new file mode 100644 index 0000000000..f9489941df --- /dev/null +++ b/types/babylon-walk/babylon-walk-tests.ts @@ -0,0 +1,37 @@ +import * as babelTypes from "babel-types"; +import * as walk from "babylon-walk"; +declare function assert(expr: boolean): void; + +const simpleVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any) => { + state.out = 1; + }, +}; + +const ancestorVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any, ancestors: babelTypes.Node[]) => { + state.out = 2; + }, +}; + +const recursiveVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any, next: (node: babelTypes.Node) => void) => { + state.out = 3; + }, +}; + +const node: any = { + type: "File", +}; + +const state: any = { + out: 0, +}; +walk.simple(node, simpleVisitors, state); +assert(state.out === 1); + +walk.ancestor(node, ancestorVisitors, state); +assert(state.out === 2); + +walk.recursive(node, recursiveVisitors, state); +assert(state.out === 3); diff --git a/types/babylon-walk/index.d.ts b/types/babylon-walk/index.d.ts new file mode 100644 index 0000000000..02c3f39d10 --- /dev/null +++ b/types/babylon-walk/index.d.ts @@ -0,0 +1,118 @@ +// Type definitions for babylon-walk 3.10 +// Project: https://github.com/pugjs/babylon-walk +// Definitions by: Marek Buchar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as babelTypes from 'babel-types'; + +export type coreTypes = babelTypes.ArrayExpression | babelTypes.AssignmentExpression | babelTypes.BinaryExpression | + babelTypes.Directive | babelTypes.DirectiveLiteral | babelTypes.BlockStatement | babelTypes.BreakStatement | + babelTypes.CallExpression | babelTypes.CatchClause | babelTypes.ConditionalExpression | + babelTypes.ContinueStatement | babelTypes.DebuggerStatement | babelTypes.DoWhileStatement | + babelTypes.EmptyStatement | babelTypes.ExpressionStatement | babelTypes.File | babelTypes.ForInStatement | + babelTypes.ForStatement | babelTypes.FunctionDeclaration | babelTypes.FunctionExpression | babelTypes.Identifier | + babelTypes.IfStatement | babelTypes.LabeledStatement | babelTypes.StringLiteral | babelTypes.NumericLiteral | + babelTypes.NullLiteral | babelTypes.BooleanLiteral | babelTypes.RegExpLiteral | babelTypes.LogicalExpression | + babelTypes.MemberExpression | babelTypes.NewExpression | babelTypes.Program | babelTypes.ObjectExpression | + babelTypes.ObjectMethod | babelTypes.ObjectProperty | babelTypes.RestElement | babelTypes.ReturnStatement | + babelTypes.SequenceExpression | babelTypes.SwitchCase | babelTypes.SwitchStatement | babelTypes.ThisExpression | + babelTypes.ThrowStatement | babelTypes.TryStatement | babelTypes.UnaryExpression | babelTypes.UpdateExpression | + babelTypes.VariableDeclaration | babelTypes.VariableDeclarator | babelTypes.WhileStatement | + babelTypes.WithStatement; + +export type es2015Types = babelTypes.AssignmentPattern | babelTypes.ArrayPattern | babelTypes.ArrowFunctionExpression | + babelTypes.ClassBody | babelTypes.ClassDeclaration | babelTypes.ClassExpression | + babelTypes.ExportAllDeclaration | babelTypes.ExportDefaultDeclaration | babelTypes.ExportNamedDeclaration | + babelTypes.ExportSpecifier | babelTypes.ForOfStatement | babelTypes.ImportDeclaration | + babelTypes.ImportDefaultSpecifier | babelTypes.ImportNamespaceSpecifier | babelTypes.ImportSpecifier | + babelTypes.MetaProperty | babelTypes.ClassMethod | babelTypes.ObjectPattern | babelTypes.SpreadElement | + babelTypes.Super | babelTypes.TaggedTemplateExpression | babelTypes.TemplateElement | babelTypes.TemplateLiteral | + babelTypes.YieldExpression | babelTypes.AwaitExpression | babelTypes.BindExpression | babelTypes.ClassProperty | + babelTypes.Decorator | babelTypes.DoExpression | babelTypes.ExportDefaultSpecifier | + babelTypes.ExportNamespaceSpecifier; + +export type flowTypes = babelTypes.AnyTypeAnnotation | babelTypes.ArrayTypeAnnotation | babelTypes.BooleanTypeAnnotation | + babelTypes.BooleanLiteralTypeAnnotation | babelTypes.NullLiteralTypeAnnotation | babelTypes.ClassImplements | + babelTypes.DeclareClass | babelTypes.DeclareFunction | babelTypes.DeclareInterface | babelTypes.DeclareModule | + babelTypes.DeclareTypeAlias | babelTypes.DeclareVariable | babelTypes.FunctionTypeAnnotation | + babelTypes.FunctionTypeParam | babelTypes.GenericTypeAnnotation | babelTypes.InterfaceExtends | + babelTypes.InterfaceDeclaration | babelTypes.IntersectionTypeAnnotation | babelTypes.MixedTypeAnnotation | + babelTypes.NullableTypeAnnotation | babelTypes.NumberTypeAnnotation | babelTypes.ObjectTypeAnnotation | + babelTypes.ObjectTypeCallProperty | babelTypes.ObjectTypeIndexer | babelTypes.ObjectTypeProperty | + babelTypes.QualifiedTypeIdentifier | babelTypes.StringLiteralTypeAnnotation | babelTypes.StringTypeAnnotation | + babelTypes.ThisTypeAnnotation | babelTypes.TupleTypeAnnotation | babelTypes.TypeofTypeAnnotation | + babelTypes.TypeAlias | babelTypes.TypeAnnotation | babelTypes.TypeCastExpression | + babelTypes.TypeParameterDeclaration | babelTypes.TypeParameterInstantiation | babelTypes.UnionTypeAnnotation | + babelTypes.VoidTypeAnnotation; + +export type jsxTypes = babelTypes.JSXAttribute | babelTypes.JSXClosingElement | babelTypes.JSXElement | + babelTypes.JSXEmptyExpression | babelTypes.JSXExpressionContainer | babelTypes.JSXIdentifier | + babelTypes.JSXMemberExpression | babelTypes.JSXNamespacedName | babelTypes.JSXOpeningElement | + babelTypes.JSXSpreadAttribute | babelTypes.JSXText; + +export type miscTypes = babelTypes.Noop | babelTypes.ParenthesizedExpression; + +export type NodeTypes = coreTypes | es2015Types | flowTypes | jsxTypes | miscTypes; + +export interface coreVisitors { + ArrayExpression?: V; AssignmentExpression?: V; BinaryExpression?: V; Directive?: V; DirectiveLiteral?: V; + BlockStatement?: V; BreakStatement?: V; CallExpression?: V; CatchClause?: V; ConditionalExpression?: V; + ContinueStatement?: V; DebuggerStatement?: V; DoWhileStatement?: V; EmptyStatement?: V; ExpressionStatement?: V; + File?: V; ForInStatement?: V; ForStatement?: V; FunctionDeclaration?: V; FunctionExpression?: V; Identifier?: V; + IfStatement?: V; LabeledStatement?: V; StringLiteral?: V; NumericLiteral?: V; NullLiteral?: V; BooleanLiteral?: V; + RegExpLiteral?: V; LogicalExpression?: V; MemberExpression?: V; NewExpression?: V; Program?: V; + ObjectExpression?: V; ObjectMethod?: V; ObjectProperty?: V; RestElement?: V; ReturnStatement?: V; + SequenceExpression?: V; SwitchCase?: V; SwitchStatement?: V; ThisExpression?: V; ThrowStatement?: V; + TryStatement?: V; UnaryExpression?: V; UpdateExpression?: V; VariableDeclaration?: V; VariableDeclarator?: V; + WhileStatement?: V; WithStatement?: V; +} + +export interface es2015Visitors { + AssignmentPattern?: V; ArrayPattern?: V; ArrowFunctionExpression?: V; ClassBody?: V; ClassDeclaration?: V; + ClassExpression?: V; ExportAllDeclaration?: V; ExportDefaultDeclaration?: V; ExportNamedDeclaration?: V; + ExportSpecifier?: V; ForOfStatement?: V; ImportDeclaration?: V; ImportDefaultSpecifier?: V; + ImportNamespaceSpecifier?: V; ImportSpecifier?: V; MetaProperty?: V; ClassMethod?: V; ObjectPattern?: V; + SpreadElement?: V; Super?: V; TaggedTemplateExpression?: V; TemplateElement?: V; TemplateLiteral?: V; + YieldExpression?: V; AwaitExpression?: V; BindExpression?: V; ClassProperty?: V; Decorator?: V; DoExpression?: V; + ExportDefaultSpecifier?: V; ExportNamespaceSpecifier?: V; +} + +export interface flowVisitors { + AnyTypeAnnotation?: V; ArrayTypeAnnotation?: V; BooleanTypeAnnotation?: V; BooleanLiteralTypeAnnotation?: V; + NullLiteralTypeAnnotation?: V; ClassImplements?: V; DeclareClass?: V; DeclareFunction?: V; DeclareInterface?: V; + DeclareModule?: V; DeclareTypeAlias?: V; DeclareVariable?: V; FunctionTypeAnnotation?: V; FunctionTypeParam?: V; + GenericTypeAnnotation?: V; InterfaceExtends?: V; InterfaceDeclaration?: V; IntersectionTypeAnnotation?: V; + MixedTypeAnnotation?: V; NullableTypeAnnotation?: V; NumberTypeAnnotation?: V; ObjectTypeAnnotation?: V; + ObjectTypeCallProperty?: V; ObjectTypeIndexer?: V; ObjectTypeProperty?: V; QualifiedTypeIdentifier?: V; + StringLiteralTypeAnnotation?: V; StringTypeAnnotation?: V; ThisTypeAnnotation?: V; TupleTypeAnnotation?: V; + TypeofTypeAnnotation?: V; TypeAlias?: V; TypeAnnotation?: V; TypeCastExpression?: V; TypeParameterDeclaration?: V; + TypeParameterInstantiation?: V; UnionTypeAnnotation?: V; VoidTypeAnnotation?: V; +} + +export interface jsxVisitors { + JSXAttribute?: V; JSXClosingElement?: V; JSXElement?: V; JSXEmptyExpression?: V; JSXExpressionContainer?: V; + JSXIdentifier?: V; JSXMemberExpression?: V; JSXNamespacedName?: V; JSXOpeningElement?: V; JSXSpreadAttribute?: V; + JSXText?: V; +} + +export interface miscVisitors { + Noop?: V; ParenthesizedExpression?: V; +} + +export interface visitors extends coreVisitors, es2015Visitors, flowVisitors, jsxVisitors, miscVisitors { +} + +export type Visitor = (commentBlock: NodeTypes, state: any) => void; + +export type SimpleVisitor = (node: NodeTypes, state: any) => void; + +export type AncestorVisitor = (node: NodeTypes, state: any, ancestors: babelTypes.Node[]) => void; + +export type AncestorStatelessVisitor = (node: NodeTypes, state: any, ancestors: babelTypes.Node[]) => void; + +export type RecursiveVisitor = (node: NodeTypes, state: any, next: (node: babelTypes.Node) => void) => void; + +export function simple(node: NodeTypes, visitors: visitors, state: any): void; +export function ancestor(node: NodeTypes, visitors: visitors, state: any): void; +export function recursive(node: NodeTypes, visitors: visitors, state: any): void; diff --git a/types/babylon-walk/tsconfig.json b/types/babylon-walk/tsconfig.json new file mode 100644 index 0000000000..9e1d7c33b7 --- /dev/null +++ b/types/babylon-walk/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "babylon-walk-tests.ts" + ] +} \ No newline at end of file diff --git a/types/babylon-walk/tslint.json b/types/babylon-walk/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/babylon-walk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/babyparse/tslint.json b/types/babyparse/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/babyparse/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone-associations/tslint.json b/types/backbone-associations/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone-associations/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone-fetch-cache/tslint.json b/types/backbone-fetch-cache/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone-fetch-cache/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone-relational/tslint.json b/types/backbone-relational/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone-relational/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone.layoutmanager/tslint.json b/types/backbone.layoutmanager/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone.layoutmanager/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone.localstorage/tslint.json b/types/backbone.localstorage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone.localstorage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index be3dfd8582..cd8ccd3821 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -691,7 +691,7 @@ export class Region extends Object implements DomMixin { * Render a template with data by passing in the template selector and the * data to render. This is the default renderer that is used by Marionette. */ -export class Renderer { +export namespace Renderer { /** * This method returns a string containing the result of applying the * template using the data object as the context. @@ -703,7 +703,7 @@ export class Renderer { * that returns valid HTML as a string from the data parameter passed to * the function. */ - static render(template: any, data: any): string; + function render(template: any, data: any): string; } export interface ViewOptions extends Backbone.ViewOptions, ViewMixinOptions { @@ -1614,11 +1614,11 @@ export class Behavior extends Object { /** * DEPRECATED */ -export class Behaviors { +export namespace Behaviors { /** * This method defines where your behavior classes are stored. Override this to provide another lookup. */ - static behaviorsLookup(): any; + function behaviorsLookup(): any; /** * This method has a default implementation that is simple to override. It @@ -1626,5 +1626,5 @@ export class Behaviors { * Behaviors.behaviorsLookup or elsewhere. Note that it should return the type of the * class to instantiate, not an instance of that class. */ - static getBehaviorClass(options: any, key: string): any; + function getBehaviorClass(options: any, key: string): any; } diff --git a/types/backbone.paginator/tslint.json b/types/backbone.paginator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone.paginator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone.radio/tslint.json b/types/backbone.radio/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone.radio/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone/backbone-tests.ts b/types/backbone/backbone-tests.ts index c074ac57e5..7b6fad9b56 100644 --- a/types/backbone/backbone-tests.ts +++ b/types/backbone/backbone-tests.ts @@ -115,6 +115,8 @@ class Employee extends Backbone.Model { super(options); this.reports = new EmployeeCollection(); this.reports.url = '../api/employees/' + this.id + '/reports'; + // Test that collection url property can be set as a function returning a string. + this.reports.url = () => { return ""; }; } more() { @@ -157,6 +159,9 @@ function test_collection() { var book1: Book = new Book({ title: "Title 1", author: "Mike" }); books.add(book1); + // Test adding sort option to add. + books.add(new Book(), { sort: true }); + // Objects can be added to collection by casting to model type. // Compiler will check if object properties are valid for the cast. // This gives better type checking than declaring an `any` overload. @@ -178,6 +183,8 @@ function test_collection() { var alphabetical = books.sortBy((book: Book): number => null); + var copy = books.clone(); + let one: Book; let models: Book[]; let bool: boolean; @@ -186,6 +193,7 @@ function test_collection() { let modelsDict: _.Dictionary; let num: number; + models = books.slice(); models = books.slice(1); models = books.slice(1, 3); @@ -401,6 +409,12 @@ namespace v1Changes { validate: false }); } + + function test_set() { + var collection = new EmployeeCollection(); + var model = new Employee(); + collection.set([model], { add: false, remove: true, merge: false }); + } } namespace Router { @@ -411,4 +425,10 @@ namespace v1Changes { router.navigate('/employees', true); } } + + namespace Sync { + // Test for Backbone.sync override. + Backbone.sync('create', new Employee()); + Backbone.sync('read', new EmployeeCollection()); + } } diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index 42a322e4c2..3d4c90d369 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -16,6 +16,13 @@ declare namespace Backbone { interface AddOptions extends Silenceable { at?: number; merge?: boolean; + sort?: boolean; + } + + interface CollectionSetOptions extends Silenceable { + add?: boolean; + remove?: boolean; + merge?: boolean; } interface HistoryOptions extends Silenceable { @@ -100,7 +107,6 @@ declare namespace Backbone { } class ModelBase extends Events { - url: any; parse(response: any, options?: any): any; toJSON(options?: any): any; sync(...arg: any[]): JQueryXHR; @@ -133,6 +139,13 @@ declare namespace Backbone { id: any; idAttribute: string; validationError: any; + + /** + * Returns the relative URL where the model's resource would be located on the server. + * @memberof Model + */ + url: () => string; + urlRoot: any; constructor(attributes?: any, options?: any); @@ -229,6 +242,7 @@ declare namespace Backbone { **/ get(id: number|string|Model): TModel; has(key: number|string|Model): boolean; + clone(): this; create(attributes: any, options?: ModelSaveOptions): TModel; pluck(attribute: string): any[]; push(model: TModel, options?: AddOptions): TModel; @@ -236,7 +250,19 @@ declare namespace Backbone { remove(model: {}|TModel, options?: Silenceable): TModel; remove(models: ({}|TModel)[], options?: Silenceable): TModel[]; reset(models?: TModel[], options?: Silenceable): TModel[]; - set(models?: TModel[], options?: Silenceable): TModel[]; + + /** + * + * The set method performs a "smart" update of the collection with the passed list of models. + * If a model in the list isn't yet in the collection it will be added; if the model is already in the + * collection its attributes will be merged; and if the collection contains any models that aren't present + * in the list, they'll be removed. All of the appropriate "add", "remove", and "change" events are fired as + * this happens. Returns the touched models in the collection. If you'd like to customize the behavior, you can + * disable it with options: {add: false}, {remove: false}, or {merge: false}. + * @param models + * @param options + */ + set(models?: TModel[], options?: CollectionSetOptions): TModel[]; shift(options?: Silenceable): TModel; sort(options?: Silenceable): Collection; unshift(model: TModel, options?: AddOptions): TModel; @@ -252,7 +278,7 @@ declare namespace Backbone { /** * Return a shallow copy of this collection's models, using the same options as native Array#slice. */ - slice(min: number, max?: number): TModel[]; + slice(min?: number, max?: number): TModel[]; // mixins from underscore @@ -314,6 +340,14 @@ declare namespace Backbone { take(): TModel; take(n: number): TModel[]; toArray(): TModel[]; + + /** + * Sets the url property (or function) on a collection to reference its location on the server. + * + * @memberof Collection + */ + url: string | (() => string); + without(...values: TModel[]): TModel[]; } @@ -358,7 +392,7 @@ declare namespace Backbone { decodeFragment(fragment: string): string; getSearch(): string; stop(): void; - route(route: string, callback: Function): number; + route(route: string|RegExp, callback: Function): number; checkUrl(e?: any): void; getPath(): string; matchRoot(): boolean; @@ -426,7 +460,7 @@ declare namespace Backbone { } // SYNC - function sync(method: string, model: Model, options?: JQueryAjaxSettings): any; + function sync(method: string, model: Model | Collection, options?: JQueryAjaxSettings): any; function ajax(options?: JQueryAjaxSettings): JQueryXHR; var emulateHTTP: boolean; var emulateJSON: boolean; diff --git a/types/backbone/tslint.json b/types/backbone/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backgrid/tslint.json b/types/backgrid/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backgrid/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backlog-js/tslint.json b/types/backlog-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backlog-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/baconjs/baconjs-tests.ts b/types/baconjs/baconjs-tests.ts index 75560d4e42..2755bec595 100644 --- a/types/baconjs/baconjs-tests.ts +++ b/types/baconjs/baconjs-tests.ts @@ -165,7 +165,12 @@ function CommonMethodsInEventStreamsAndProperties() { { // Calculator for grouped consecutive values until group is cancelled: - var events = [ + interface Event { + id:number; + type:string; + val?:number; + } + var events: Event[] = [ {id: 1, type: "add", val: 3}, {id: 2, type: "add", val: -1}, {id: 1, type: "add", val: 2}, @@ -177,16 +182,16 @@ function CommonMethodsInEventStreamsAndProperties() { {id: 1, type: "cancel"} ], keyF = (event:{id:number}) => event.id, - limitF = (groupedStream:Bacon.EventStream) => { + limitF = (groupedStream:Bacon.EventStream) => { var cancel = groupedStream.filter(x => x.type === "cancel").take(1), adds = groupedStream.filter(x => x.type === "add"); return adds.takeUntil(cancel).map(x => x.val); }; - Bacon.sequentially(2, events) + Bacon.sequentially(2, events) .groupBy(keyF, limitF) .flatMap(groupedStream => groupedStream.fold(0, (acc, x) => acc + x)) - .onValue(sum => { + .onValue((sum: number) => { console.log(sum); // returns [-1, 2, 8] in an order }); } diff --git a/types/baconjs/tslint.json b/types/baconjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/baconjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bagpipes/index.d.ts b/types/bagpipes/index.d.ts index ec1d0cceb7..309ae38318 100755 --- a/types/bagpipes/index.d.ts +++ b/types/bagpipes/index.d.ts @@ -4,7 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface FittingContext { - /** The input defined in the fitting definition + /** + * The input defined in the fitting definition * (string, number, object, array) */ input: any; @@ -56,7 +57,7 @@ export type Fitting = ( * Executed during parsing * @see {@link https://github.com/apigee-127/bagpipes#fittings|Docs} * - * @param {Object} fittingDef Fitting Definition + * @param fittingDef Fitting Definition */ export type FittingFactory = (fittingDef: FittingDef, bagpipes: any) => Fitting; diff --git a/types/barcode/tslint.json b/types/barcode/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/barcode/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bardjs/bardjs-tests.ts b/types/bardjs/bardjs-tests.ts index 52f5ab1d3f..de656bc22e 100644 --- a/types/bardjs/bardjs-tests.ts +++ b/types/bardjs/bardjs-tests.ts @@ -5,7 +5,7 @@ var expect = chai.expect, assert = chai.assert; class MyService { - constructor(private $q: angular.IQService) {} + constructor(private readonly $q: angular.IQService) {} remoteCall(): angular.IPromise { return new this.$q((resolve, reject) => { diff --git a/types/bardjs/tslint.json b/types/bardjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bardjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/base-x/tslint.json b/types/base-x/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/base-x/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/base16/tslint.json b/types/base16/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/base16/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bases/tslint.json b/types/bases/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bases/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bash-glob/bash-glob-tests.ts b/types/bash-glob/bash-glob-tests.ts new file mode 100644 index 0000000000..cf63412653 --- /dev/null +++ b/types/bash-glob/bash-glob-tests.ts @@ -0,0 +1,21 @@ +import bashGlob = require('bash-glob'); + +bashGlob('pattern', (err, files) => {}); +bashGlob(['pattern'], (err, files) => {}); +bashGlob(['pattern'], {}, (err, files) => {}); +bashGlob(['pattern'], { cwd: 'cwd' }, (err, files) => { }); + +bashGlob.on('match', (match, cwd) => {}); +bashGlob.on('files', (files, cwd) => {}); +bashGlob.on('end', (files) => {}); + +bashGlob.each('pattern', (err, files) => {}); +bashGlob.each(['pattern'], (err, files) => {}); +bashGlob.each(['pattern'], {}, (err, files) => {}); +bashGlob.each(['pattern'], { cwd: 'cwd' }, (err, files) => {}); + +// $ExpectType string[] +bashGlob.sync('pattern'); +bashGlob.sync(['pattern']); +bashGlob.sync(['pattern'], {}); +bashGlob.sync(['pattern'], { cwd: 'cwd' }); diff --git a/types/bash-glob/index.d.ts b/types/bash-glob/index.d.ts new file mode 100644 index 0000000000..29582ea9bd --- /dev/null +++ b/types/bash-glob/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for bash-glob 2.0 +// Project: https://github.com/micromatch/bash-glob +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Patterns = string | string[]; +type Callback = (err: Error, files: string[]) => void; + +declare function bashGlob(pattern: Patterns, callback: Callback): void; +declare function bashGlob(pattern: Patterns, options: bashGlob.Options, callback: Callback): void; + +declare namespace bashGlob { + interface Options { + cwd?: string; + dot?: boolean; + dotglob?: boolean; + extglob?: boolean; + failglob?: boolean; + globstar?: boolean; + nocase?: boolean; + nocaseglob?: boolean; + nullglob?: boolean; + } + + function on(event: 'match' | 'files', callback: (files: string, cwd: string) => void): void; + function on(event: 'end', callback: (files: string) => void): void; + + function each(patterns: Patterns, callback: Callback): void; + function each(patterns: Patterns, options: Options, callback: Callback): void; + + function promise(patterns: Patterns, options?: Options): Promise; + + function sync(patterns: Patterns, options?: Options): string[]; +} + +export = bashGlob; diff --git a/types/bash-glob/tsconfig.json b/types/bash-glob/tsconfig.json new file mode 100644 index 0000000000..6a45a2d74d --- /dev/null +++ b/types/bash-glob/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", + "bash-glob-tests.ts" + ] +} diff --git a/types/koa-jwt/tslint.json b/types/bash-glob/tslint.json similarity index 100% rename from types/koa-jwt/tslint.json rename to types/bash-glob/tslint.json diff --git a/types/batch-stream/tslint.json b/types/batch-stream/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/batch-stream/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bazinga-translator/tslint.json b/types/bazinga-translator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bazinga-translator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bcrypt-nodejs/tslint.json b/types/bcrypt-nodejs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bcrypt-nodejs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bcrypt/tslint.json b/types/bcrypt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bcrypt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bcryptjs/tslint.json b/types/bcryptjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bcryptjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/beats/beats-tests.ts b/types/beats/beats-tests.ts new file mode 100644 index 0000000000..00659af2e5 --- /dev/null +++ b/types/beats/beats-tests.ts @@ -0,0 +1,11 @@ +import beats = require('beats'); + +const bins: beats.Bin[] = [ + { lo: 0, hi: 512, threshold: 0, decay: 0.005 }, + { lo: 512, hi: 1024, threshold: 0, decay: 0.005 }, +]; + +const detect = beats(bins, 1); + +const frequencies = new Uint8Array(1024); +const result = detect(frequencies); diff --git a/types/beats/index.d.ts b/types/beats/index.d.ts new file mode 100644 index 0000000000..e95f008c1f --- /dev/null +++ b/types/beats/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for beats 0.0 +// Project: https://github.com/hughsk/beats/ +// Definitions by: Uri Shaked +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = beats; + +declare function beats(bins: ReadonlyArray, minSeparation?: number): (frequencies: Uint8Array | Float32Array | ReadonlyArray, dt?: number) => Float32Array; + +declare namespace beats { + interface Bin { + lo: number; + hi: number; + threshold: number; + decay: number; + } +} diff --git a/types/beats/tsconfig.json b/types/beats/tsconfig.json new file mode 100644 index 0000000000..89bd0b5995 --- /dev/null +++ b/types/beats/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", + "beats-tests.ts" + ] +} diff --git a/types/left-pad/tslint.json b/types/beats/tslint.json similarity index 100% rename from types/left-pad/tslint.json rename to types/beats/tslint.json diff --git a/types/bech32/bech32-tests.ts b/types/bech32/bech32-tests.ts new file mode 100644 index 0000000000..7fd04abe56 --- /dev/null +++ b/types/bech32/bech32-tests.ts @@ -0,0 +1,19 @@ +import * as bech32 from 'bech32'; + +// Test decode +const testString = 'abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw'; +const decoded = bech32.decode(testString); +// Test decode with limit +bech32.decode(testString, testString.length); +decoded.prefix; +decoded.words; + +// Test convert from/to words +const words: Buffer = bech32.toWords(Buffer.from('foobar', 'utf8')); +bech32.fromWords(words); + +// Test encode +const testPrefix = 'foo'; +bech32.encode(testPrefix, words); +// Test encode with limit +bech32.encode(testPrefix, words, testPrefix.length + 7 + words.length); diff --git a/types/bech32/index.d.ts b/types/bech32/index.d.ts new file mode 100644 index 0000000000..878d56a6a6 --- /dev/null +++ b/types/bech32/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for bech32 1.1 +// Project: https://github.com/bitcoinjs/bech32 +// Definitions by: Satana Charuwichitratana +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export function decode(str: string, LIMIT?: number): { prefix: string, words: Buffer }; + +export function encode(prefix: string, words: Buffer, LIMIT?: number): string; + +export function fromWords(words: Buffer): Buffer; + +export function toWords(bytes: Buffer): Buffer; diff --git a/types/bech32/tsconfig.json b/types/bech32/tsconfig.json new file mode 100644 index 0000000000..886ec79796 --- /dev/null +++ b/types/bech32/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", + "bech32-tests.ts" + ] +} diff --git a/types/bech32/tslint.json b/types/bech32/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/bech32/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/benchmark/benchmark-tests.ts b/types/benchmark/benchmark-tests.ts index 8fbe2b1d92..cb02940b37 100644 --- a/types/benchmark/benchmark-tests.ts +++ b/types/benchmark/benchmark-tests.ts @@ -229,6 +229,27 @@ suite.add({ 'onComplete': onComplete }); +// unregister a listener for an event type +suite.off('cycle', listener) as Benchmark.Suite; + +// unregister a listener for multiple event types +suite.off('start cycle', listener) as Benchmark.Suite; + +// unregister all listeners for an event type +suite.off('cycle') as Benchmark.Suite; + +// unregister all listeners for multiple event types +suite.off('start cycle complete') as Benchmark.Suite; + +// unregister all listeners for all event types +suite.off() as Benchmark.Suite; + +// register a listener for an event type +suite.on('cycle', listener) as Benchmark.Suite; + +// register a listener for multiple event types +suite.on('start cycle', listener) as Benchmark.Suite; + // basic usage suite.run(); diff --git a/types/benchmark/index.d.ts b/types/benchmark/index.d.ts index 01bb379a48..d8c72aef68 100644 --- a/types/benchmark/index.d.ts +++ b/types/benchmark/index.d.ts @@ -170,10 +170,10 @@ declare namespace Benchmark { join(separator?: string): string; listeners(type: string): Function[]; map(callback: Function): any[]; - off(type?: string, callback?: Function): Benchmark; - off(types: string[]): Benchmark; - on(type?: string, callback?: Function): Benchmark; - on(types: string[]): Benchmark; + off(type?: string, callback?: Function): Suite; + off(types: string[]): Suite; + on(type?: string, callback?: Function): Suite; + on(types: string[]): Suite; pluck(property: string): any[]; pop(): Function; push(benchmark: Benchmark): number; diff --git a/types/benchmark/tslint.json b/types/benchmark/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/benchmark/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/better-curry/tslint.json b/types/better-curry/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/better-curry/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bezier-easing/bezier-easing-tests.ts b/types/bezier-easing/bezier-easing-tests.ts index 6cf2b28bf2..bf3e12bcc9 100644 --- a/types/bezier-easing/bezier-easing-tests.ts +++ b/types/bezier-easing/bezier-easing-tests.ts @@ -1,10 +1,4 @@ +import BezierEasing = require("bezier-easing"); - -function get_easing() { - let easing: Easing = BezierEasing(0, 0, 1, 0.5); -} - -function use_easing() { - let easing: Easing = BezierEasing(0, 0, 1, 0.5); - let eased: number = easing(1); -} \ No newline at end of file +const easing: BezierEasing.Easing = BezierEasing(0, 0, 1, 0.5); +const eased: number = easing(1); diff --git a/types/bezier-easing/index.d.ts b/types/bezier-easing/index.d.ts index e714e55535..d63eea8081 100644 --- a/types/bezier-easing/index.d.ts +++ b/types/bezier-easing/index.d.ts @@ -1,10 +1,12 @@ -// Type definitions for bezier-easing +// Type definitions for bezier-easing 2.0 // Project: https://github.com/gre/bezier-easing // Definitions by: brian ridley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare interface Easing { - (x: number): number; +declare namespace BezierEasing { + type Easing = (x: number) => number; } -declare function BezierEasing(mX1: number, mY1: number, mX2: number, mY2: number): Easing; +declare function BezierEasing(mX1: number, mY1: number, mX2: number, mY2: number): BezierEasing.Easing; +export = BezierEasing; +export as namespace BezierEasing; diff --git a/types/bezier-easing/tslint.json b/types/bezier-easing/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/bezier-easing/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/bezier-js/index.d.ts b/types/bezier-js/index.d.ts index 7706a46472..b44b027dc2 100644 --- a/types/bezier-js/index.d.ts +++ b/types/bezier-js/index.d.ts @@ -203,5 +203,5 @@ declare namespace BezierJs { } declare module "bezier-js" { - export = BezierJs; + export = BezierJs.Bezier; } diff --git a/types/bezier-js/tslint.json b/types/bezier-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bezier-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bgiframe/tslint.json b/types/bgiframe/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bgiframe/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/big.js/index.d.ts b/types/big.js/index.d.ts index cf197e8cfc..37f51a54bd 100644 --- a/types/big.js/index.d.ts +++ b/types/big.js/index.d.ts @@ -275,16 +275,26 @@ export interface Big { * the value of Big.E_POS and Big.E_NEG. By default, Big numbers correspond to Javascript's number type in this regard. */ toJSON(): string; + /** + * Returns an array of single digits + */ + c: number[]; + /** + * Returns the exponent, Integer, -1e+6 to 1e+6 inclusive + */ + e: number; + /** + * Returns the sign, -1 or 1 + */ + s: number; } export const Big: BigConstructor; // Helpers to allow referencing Big and BigConstructor from inside the global declaration without creating a self reference -/* tslint:disable:strict-export-declare-modifiers */ -type Big_ = Big; -type BigConstructor_ = BigConstructor; -type BigSource_ = BigSource; -/* tslint:enable:strict-export-declare-modifiers */ +export type Big_ = Big; +export type BigConstructor_ = BigConstructor; +export type BigSource_ = BigSource; declare global { namespace BigJs { diff --git a/types/big.js/test/big.js-global-tests.ts b/types/big.js/test/big.js-global-tests.ts index ef57a3880d..578391de7b 100644 --- a/types/big.js/test/big.js-global-tests.ts +++ b/types/big.js/test/big.js-global-tests.ts @@ -197,6 +197,24 @@ function toJSONTests() { JSON.parse(str, (k, v) => k === '' ? v : new Big(v)); // Returns an array of three Big numbers. } +// test Big.c +function coefficientTests() { + const x = new Big('123'); + x.c; // [1,2,3] +} + +// test Big.e +function exponentTests() { + const x = new Big('123e+20'); + x.e; // 22 +} + +// test Big.s +function signTests() { + const x = new Big('-123'); + x.s; // -1 +} + // see http://mikemcl.github.io/big.js/#faq // "How can I simultaneously use different decimal places and/or rounding mode settings for different Big numbers?" function testMultipleConstructors() { diff --git a/types/big.js/test/big.js-module-tests.ts b/types/big.js/test/big.js-module-tests.ts index 7cd246ffd4..056d41727b 100644 --- a/types/big.js/test/big.js-module-tests.ts +++ b/types/big.js/test/big.js-module-tests.ts @@ -199,6 +199,24 @@ function toJSONTests() { JSON.parse(str, (k, v) => k === '' ? v : new Big(v)); // Returns an array of three Big numbers. } +// test Big.c +function coefficientTests() { + const x = new Big('123'); + x.c; // [1, 2, 3] +} + +// test Big.e +function exponentTests() { + const x = new Big('123e+20'); + x.e; // 22 +} + +// test Big.s +function signTests() { + const x = new Big('-123'); + x.s; // -1 +} + // see http://mikemcl.github.io/big.js/#faq // "How can I simultaneously use different decimal places and/or rounding mode settings for different Big numbers?" function testMultipleConstructors() { diff --git a/types/bigint/tslint.json b/types/bigint/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bigint/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bignum/tslint.json b/types/bignum/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bignum/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bignumber.js/bignumber.js-tests.ts b/types/bignumber.js/bignumber.js-tests.ts deleted file mode 100644 index 424665d8ba..0000000000 --- a/types/bignumber.js/bignumber.js-tests.ts +++ /dev/null @@ -1,443 +0,0 @@ -let x: BigNumber.BigNumber = new BigNumber(9); -let y = new BigNumber(x); - -BigNumber(435.345); - -new BigNumber('5032485723458348569331745.33434346346912144534543'); -new BigNumber('4.321e+4'); -new BigNumber('-735.0918e-430'); -new BigNumber(Infinity); -new BigNumber(NaN); -new BigNumber('.5'); -new BigNumber('+2'); -new BigNumber(-10110100.1, 2); -new BigNumber(-0b10110100); -new BigNumber('123412421.234324', 5); -new BigNumber('ff.8', 16); -new BigNumber('0xff.8'); - -new BigNumber(9, 2); - -new BigNumber(96517860459076817.4395); - -new BigNumber('blurgh'); - -BigNumber.config({ DECIMAL_PLACES: 5 }); -new BigNumber(1.23456789); -new BigNumber(1.23456789, 10); - -BigNumber.config({ DECIMAL_PLACES: 5 }); -let BN = BigNumber.another({ DECIMAL_PLACES: 9 }); - -x = new BigNumber(1); -y = new BN(1); - -x.div(3); -y.div(3); - -BN = BigNumber.another(); -BN.config({ DECIMAL_PLACES: 9 }); - -BigNumber.config({ DECIMAL_PLACES: 5 }); -BigNumber.set({ DECIMAL_PLACES: 5 }); -BigNumber.config(5); - -BigNumber.config({ ROUNDING_MODE: 0 }); -BigNumber.config(undefined, BigNumber.ROUND_UP); - -BigNumber.config({ EXPONENTIAL_AT: 2 }); -new BigNumber(12.3); -new BigNumber(123); -new BigNumber(0.123); -new BigNumber(0.0123); - -BigNumber.config({ EXPONENTIAL_AT: [-7, 20] }); -new BigNumber(123456789); -new BigNumber(0.000000123); - -BigNumber.config({ EXPONENTIAL_AT: 1e+9 }); - -BigNumber.config({ EXPONENTIAL_AT: 0 }); - -BigNumber.config({ RANGE: 500 }); -BigNumber.config().RANGE; -new BigNumber('9.999e499'); -new BigNumber('1e500'); -new BigNumber('1e-499'); -new BigNumber('1e-500'); - -BigNumber.config({ RANGE: [-3, 4] }); -new BigNumber(99999); -new BigNumber(100000); -new BigNumber(0.001); -new BigNumber(0.0001); - -BigNumber.config({ ERRORS: false }); - -BigNumber.config({ CRYPTO: true }); -BigNumber.config().CRYPTO; -BigNumber.random(); - -BigNumber.config({ MODULO_MODE: BigNumber.EUCLID }); -BigNumber.config({ MODULO_MODE: 9 }); - -BigNumber.config({ POW_PRECISION: 100 }); - -BigNumber.config({ - FORMAT: { - decimalSeparator: '.', - groupSeparator: ',', - groupSize: 3, - secondaryGroupSize: 0, - fractionGroupSeparator: ' ', - fractionGroupSize: 0 - } -}); - -BigNumber.config({ - DECIMAL_PLACES: 40, - ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, - EXPONENTIAL_AT: [-10, 20], - RANGE: [-500, 500], - ERRORS: true, - CRYPTO: true, - MODULO_MODE: BigNumber.ROUND_FLOOR, - POW_PRECISION: 80, - FORMAT: { - groupSize: 3, - groupSeparator: ' ', - decimalSeparator: ',' - } -}); - -BigNumber.config(40, 7, [-10, 20], 500, 1, 1, 3, 80); - -const obj = BigNumber.config(); -obj.ERRORS; -obj.RANGE; - -x = new BigNumber('3257869345.0378653'); -BigNumber.max(4e9, x, '123456789.9'); - -let arr = [12, '13', new BigNumber(14)]; -BigNumber.max(arr); - -x = new BigNumber('3257869345.0378653'); -BigNumber.min(4e9, x, '123456789.9'); - -arr = [2, new BigNumber(-14), '-15.9999', -12]; -BigNumber.min(arr); - -BigNumber.config({ DECIMAL_PLACES: 10 }); -BigNumber.random(); -BigNumber.random(20); - -BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_CEIL }); -BigNumber.config({ ROUNDING_MODE: 2 }); - -x = new BigNumber(-0.8); -y = x.absoluteValue(); -let z = y.abs(); - -x = new BigNumber(1.3); -x.ceil(); -y = new BigNumber(-1.8); -y.ceil(); - -x = new BigNumber(Infinity); -y = new BigNumber(5); -x.comparedTo(y); -x.comparedTo(x.minus(1)); -y.cmp(NaN); -y.cmp('110', 2); - -x = new BigNumber(123.45); -x.decimalPlaces(); -y = new BigNumber('9.9e-101'); -y.dp(); - -x = new BigNumber(355); -y = new BigNumber(113); -x.dividedBy(y); -x.div(5); -x.div(47, 16); - -x = new BigNumber(5); -y = new BigNumber(3); -x.dividedToIntegerBy(y); -x.divToInt(0.7); -x.divToInt('0.f', 16); - -0 === 1e-324; -x = new BigNumber(0); -x.equals('1e-324'); -BigNumber(-0).eq(x); -BigNumber(255).eq('ff', 16); - -y = new BigNumber(NaN); -y.equals(NaN); - -x = new BigNumber(1.8); -x.floor(); -y = new BigNumber(-1.3); -y.floor(); - -0.1 > (0.3 - 0.2); // tslint:disable-line binary-expression-operand-order -x = new BigNumber(0.1); -x.greaterThan(BigNumber(0.3).minus(0.2)); -BigNumber(0).gt(x); -BigNumber(11, 3).gt(11.1, 2); - -x = new BigNumber(0.3).minus(0.2); -x.greaterThanOrEqualTo(0.1); -BigNumber(1).gte(x); -BigNumber(10, 18).gte('i', 36); - -x = new BigNumber(1); -x.isFinite(); -y = new BigNumber(Infinity); -y.isFinite(); - -x = new BigNumber(1); -x.isInteger(); -y = new BigNumber(123.456); -y.isInt(); - -x = new BigNumber(NaN); -x.isNaN(); -y = new BigNumber('Infinity'); -y.isNaN(); - -x = new BigNumber(-0); -x.isNegative(); -y = new BigNumber(2); -y.isNeg(); - -x = new BigNumber(-0); -x.isZero() && x.isNeg(); -y = new BigNumber(Infinity); -y.isZero(); - -x = new BigNumber(0.3).minus(0.2); -x.lessThan(0.1); -BigNumber(0).lt(x); -BigNumber(11.1, 2).lt(11, 3); - -x = new BigNumber(0.1); -x.lessThanOrEqualTo(BigNumber(0.3).minus(0.2)); -BigNumber(-1).lte(x); -BigNumber(10, 18).lte('i', 36); - -x = new BigNumber(0.3); -x.minus(0.1); -x.sub(0.6, 20); - -x = new BigNumber(1); -x.modulo(0.9); -y = new BigNumber(33); -y.mod('a', 33); - -x = new BigNumber(1.8); -x.negated(); -y = new BigNumber(-1.3); -y.neg(); - -x = new BigNumber(0.1); -y = x.plus(0.2); -BigNumber(0.7).plus(x).add(y); -x.plus('0.1', 8); - -x = new BigNumber(1.234); -x.precision(); -y = new BigNumber(987000); -y.sd(); -y.sd(true); - -y = new BigNumber(x); -y.round(); -y.round(1); -y.round(2); -y.round(10); -y.round(0, 1); -y.round(0, 6); -y.round(1, 1); -y.round(1, BigNumber.ROUND_HALF_EVEN); - -x = new BigNumber(1.23); -x.shift(3); -x.shift(-3); - -x = new BigNumber(16); -x.squareRoot(); -y = new BigNumber(3); -y.sqrt(); - -x = new BigNumber(0.6); -y = x.times(3); -BigNumber('7e+500').times(y); -x.times('-a', 16); - -BigNumber.config({ DECIMAL_PLACES: 5, ROUNDING_MODE: 4 }); -x = new BigNumber(9876.54321); - -x.toDigits(); -x.toDigits(6); -x.toDigits(6, BigNumber.ROUND_UP); -x.toDigits(2); -x.toDigits(2, 1); - -y = new BigNumber(45.6); -y.toExponential(); -y.toExponential(0); -y.toExponential(1); -y.toExponential(1, 1); -y.toExponential(3); - -y = new BigNumber(3.456); -y.toFixed(); -y.toFixed(0); -y.toFixed(2); -y.toFixed(2, 1); -y.toFixed(5); - -const format = { - decimalSeparator: '.', - groupSeparator: ',', - groupSize: 3, - secondaryGroupSize: 0, - fractionGroupSeparator: ' ', - fractionGroupSize: 0 -}; -BigNumber.config({ FORMAT: format }); - -x = new BigNumber('123456789.123456789'); -x.toFormat(); -x.toFormat(1); - -format.groupSeparator = ' '; -format.fractionGroupSize = 5; -x.toFormat(); - -BigNumber.config({ - FORMAT: { - decimalSeparator: ',', - groupSeparator: '.', - groupSize: 3, - secondaryGroupSize: 2 - } -}); - -x.toFormat(6); - -x = new BigNumber(1.75); -x.toFraction(); - -const pi = new BigNumber('3.14159265358'); -pi.toFraction(); -pi.toFraction(100000); -pi.toFraction(10000); -pi.toFraction(100); -pi.toFraction(10); -pi.toFraction(1); - -x = new BigNumber('177.7e+457'); -y = new BigNumber(235.4325); -z = new BigNumber('0.0098074'); - -const str = JSON.stringify([x, y, z]); - -JSON.parse(str, (key, val) => key === '' ? val : new BigNumber(val)); - -x = new BigNumber(456.789); -x.toNumber(); -{ +x; } - -y = new BigNumber('45987349857634085409857349856430985'); -y.toNumber(); - -z = new BigNumber(-0); -1 / +z; -1 / z.toNumber(); - -x = new BigNumber(0.7); -x.toPower(2); -BigNumber(3).pow(-2); - -y = new BigNumber(45.6); -x.toPrecision(); -y.toPrecision(); -x.toPrecision(1); -y.toPrecision(1); -y.toPrecision(2, 0); -y.toPrecision(2, 1); -x.toPrecision(5); -y.toPrecision(5); - -x = new BigNumber(750000); -x.toString(); -BigNumber.config({ EXPONENTIAL_AT: 5 }); -x.toString(); - -y = new BigNumber(362.875); -y.toString(2); -y.toString(9); -y.toString(32); - -BigNumber.config({ DECIMAL_PLACES: 4 }); -z = new BigNumber('1.23456789'); -z.toString(); -z.toString(10); - -x = new BigNumber(123.456); -x.truncated(); -y = new BigNumber(-12.3); -y.trunc(); - -x = new BigNumber('-0'); -x.toString(); -x.valueOf(); -y = new BigNumber('1.777e+457'); -y.valueOf(); - -x = new BigNumber(0.123); -x.toExponential(); -x.c; -x.e; -x.s; - -z = new BigNumber('-123.4567000e+2'); -z.toExponential(); -z.c; -z.e; -z.s; - -x = new BigNumber(3); -x instanceof BigNumber; -x.isBigNumber; - -BN = BigNumber.another(); - -y = new BN(3); -y instanceof BigNumber; -y.isBigNumber; - -y = new BigNumber(-0); -y.c; -y.e; -y.s; - -try { - // ... -} catch (e) { - if (e instanceof Error && e.name === 'BigNumber Error') { - // ... - } -} - -x = new BigNumber("1.0"); -y = new BigNumber("1.1000"); -z = x.add(y); - -x = new BigNumber("1.20"); -y = new BigNumber("3.45000"); -z = x.mul(y); diff --git a/types/bignumber.js/index.d.ts b/types/bignumber.js/index.d.ts deleted file mode 100644 index ae7ec5b6f7..0000000000 --- a/types/bignumber.js/index.d.ts +++ /dev/null @@ -1,676 +0,0 @@ -// Type definitions for bignumber.js 4.0 -// Project: https://github.com/MikeMcl/bignumber.js/ -// Definitions by: Viktor Smirnov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -declare var BigNumber: BigNumber.BigNumberStatic; - -export as namespace BigNumber; -export = BigNumber; - -declare namespace BigNumber { - interface FormatConfig { - /** - * The decimal separator. - */ - decimalSeparator: string; - - /** - * The grouping separator of the integer part. - */ - groupSeparator: string; - - /** - * The primary grouping size of the integer part. - */ - groupSize: number; - - /** - * The secondary grouping size of the integer part. - */ - secondaryGroupSize: number; - - /** - * The grouping separator of the fraction part. - */ - fractionGroupSeparator: string; - - /** - * The grouping size of the fraction part. - */ - fractionGroupSize: number; - } - - interface BigNumberConfig { - /** - * The maximum number of decimal places of the results of operations involving division, - * i.e. division, square root and base conversion operations, and power operations with negative exponents. - */ - DECIMAL_PLACES: number; - - /** - * The rounding mode used in the above operations and the default rounding mode of round, `toExponential`, `toFixed`, `toFormat` and `toPrecision`. - */ - ROUNDING_MODE: RoundingMode; - - /** - * The exponent value(s) at which `toString` returns exponential notation. - * - * If a single number is assigned, the value is the exponent magnitude. - * - * If an array of two numbers is assigned then the first number is the negative exponent value at and beneath which exponential notation is used, - * and the second number is the positive exponent value at and above which the same. - */ - EXPONENTIAL_AT: number | number[]; - - /** - * The exponent value(s) beyond which overflow to `Infinity` and underflow to zero occurs. - * - * If a single number is assigned, it is the maximum exponent magnitude: - * values wth a positive exponent of greater magnitude become `Infinity` - * and those with a negative exponent of greater magnitude become zero. - * - * If an array of two numbers is assigned then the first number is the negative exponent limit and the second number is the positive exponent limit. - */ - RANGE: number | number[]; - - /** - * The value that determines whether BigNumber Errors are thrown. - * - * If `ERRORS` is false, no errors will be thrown. - */ - ERRORS: boolean | 0 | 1; - - /** - * The value that determines whether cryptographically-secure pseudo-random number generation is used. - * - * If `CRYPTO` is set to `true` then the `random` method will generate random digits using `crypto.getRandomValues` in browsers that support it, - * or `crypto.randomBytes` if using a version of Node.js that supports it. - * - * If neither function is supported by the host environment then attempting to set `CRYPTO` to `true` will fail, and if `ERRORS` is `true` an exception will be thrown. - * - * If `CRYPTO` is `false` then the source of randomness used will be `Math.random` (which is assumed to generate at least `30` bits of randomness). - */ - CRYPTO: boolean | 0 | 1; - - /** - * The modulo mode used when calculating the modulus: `a mod n`. - * - * The quotient, `q = a / n`, is calculated according to the `ROUNDING_MODE` that corresponds to the chosen `MODULO_MODE`. - * - * The remainder, `r`, is calculated as: `r = a - n * q`. - */ - MODULO_MODE: ModuloMode; - - /** - * The maximum number of significant digits of the result of the power operation (unless a modulus is specified). - * - * If set to `0`, the number of signifcant digits will not be limited. - */ - POW_PRECISION: number; - - /** - * The `FORMAT` object configures the format of the string returned by the toFormat method. - */ - FORMAT: Partial; - } - - type NumberLike = number | string | BigNumber; - type RoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - type ModuloMode = RoundingMode | 9; - - interface BigNumberStatic { - /** - * Returns a new instance of a BigNumber object. - */ - (value: NumberLike, base?: number): BigNumber; - - /** - * Returns a new instance of a BigNumber object. - */ - new (value: NumberLike, base?: number): BigNumber; - - /** - * Returns a new independent BigNumber constructor with configuration as described by obj, or with the default configuration if obj is null or undefined. - */ - another(obj?: Partial): BigNumberStatic; - - /** - * Configures the settings for this particular BigNumber constructor. - * - */ - config(obj?: Partial): BigNumberConfig; - - /** - * Configures the settings for this particular BigNumber constructor. - */ - config( - DECIMAL_PLACES?: number, - ROUNDING_MODE?: RoundingMode, - EXPONENTIAL_AT?: number | number[], - RANGE?: number | number[], - ERRORS?: boolean | 0 | 1, - CRYPTO?: boolean | 0 | 1, - MODULO_MODE?: ModuloMode, - POW_PRECISION?: number - ): BigNumberConfig; - - /** - * Configures the settings for this particular BigNumber constructor. - */ - set(obj?: Partial): BigNumberConfig; - - /** - * Configures the settings for this particular BigNumber constructor. - */ - set( - DECIMAL_PLACES?: number, - ROUNDING_MODE?: RoundingMode, - EXPONENTIAL_AT?: number | number[], - RANGE?: number | number[], - ERRORS?: boolean | 0 | 1, - CRYPTO?: boolean | 0 | 1, - MODULO_MODE?: ModuloMode, - POW_PRECISION?: number - ): BigNumberConfig; - - /** - * Returns a BigNumber whose value is the maximum of `args`. - */ - max(...args: NumberLike[]): BigNumber; - - /** - * Returns a BigNumber whose value is the maximum of `args`. - */ - max(args: NumberLike[]): BigNumber; - - /** - * Returns a BigNumber whose value is the minimum of `args`. - */ - min(...args: NumberLike[]): BigNumber; - - /** - * Returns a BigNumber whose value is the minimum of `args`. - */ - min(args: NumberLike[]): BigNumber; - - /** - * Returns a new BigNumber with a pseudo-random value equal to or greater than `0` and less than `1`. - * - * The return value will have `dp` decimal places (or less if trailing zeros are produced). - * If `dp` is omitted then the number of decimal places will default to the current `DECIMAL_PLACES` setting. - * - * Depending on the value of this BigNumber constructor's `CRYPTO` setting and the support for the `crypto` object in the host environment, - * the random digits of the return value are generated by either - * `Math.random` (fastest), - * `crypto.getRandomValues` (Web Cryptography API in recent browsers) - * or `crypto.randomBytes` (Node.js). - * - * If `CRYPTO` is `true`, i.e. one of the `crypto` methods is to be used, - * the value of a returned BigNumber should be cryptographically-secure and statistically indistinguishable from a random value. - */ - random(dp?: number): BigNumber; - - /** - * Rounds away from zero - */ - ROUND_UP: 0; - - /** - * Rounds towards zero - */ - ROUND_DOWN: 1; - - /** - * Rounds towards `Infinity` - */ - ROUND_CEIL: 2; - - /** - * Rounds towards `-Infinity` - */ - ROUND_FLOOR: 3; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds away from zero. - */ - ROUND_HALF_UP: 4; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards zero. - */ - ROUND_HALF_DOWN: 5; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards even neighbour. - */ - ROUND_HALF_EVEN: 6; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards `Infinity`. - */ - ROUND_HALF_CEIL: 7; - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards `-Infinity`. - */ - ROUND_HALF_FLOOR: 8; - - /** - * The remainder is always positive. - * - * Euclidian division: `q = sign(n) * floor(a / abs(n))` - */ - EUCLID: 9; - } - - interface BigNumber { - /** - * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this BigNumber. - */ - absoluteValue(): BigNumber; - - /** - * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this BigNumber. - */ - abs(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to a whole number in the direction of positive Infinity. - */ - ceil(): BigNumber; - - /** - * Returns - * - * `1` if the value of this BigNumber is greater than the value of `n` - * - * `-1` if the value of this BigNumber is less than the value of `n` - * - * `0` if this BigNumber and `n` have the same value - * - * `null` if the value of either this BigNumber or `n` is `NaN` - */ - comparedTo(n: NumberLike, base?: number): 1 | -1 | 0 | null; - - /** - * Returns - * - * `1` if the value of this BigNumber is greater than the value of `n` - * - * `-1` if the value of this BigNumber is less than the value of `n` - * - * `0` if this BigNumber and `n` have the same value - * - * `null` if the value of either this BigNumber or `n` is `NaN` - */ - cmp(n: NumberLike, base?: number): 1 | -1 | 0 | null; - - /** - * Return the number of decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is `±Infinity` or `NaN`. - */ - decimalPlaces(): number; - - /** - * Return the number of decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is `±Infinity` or `NaN`. - */ - dp(): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - */ - dividedBy(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - */ - div(n: NumberLike, base?: number): BigNumber; - - /** - * Return a BigNumber whose value is the integer part of dividing the value of this BigNumber by `n`. - */ - dividedToIntegerBy(n: NumberLike, base?: number): BigNumber; - - /** - * Return a BigNumber whose value is the integer part of dividing the value of this BigNumber by `n`. - */ - divToInt(n: NumberLike, base?: number): BigNumber; - - /** - * Returns `true` if the value of this BigNumber equals the value of `n`, otherwise returns `false`. - * - * As with JavaScript, `NaN` does not equal `NaN`. - */ - equals(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber equals the value of `n`, otherwise returns `false`. - * - * As with JavaScript, `NaN` does not equal `NaN`. - */ - eq(n: NumberLike, base?: number): boolean; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to a whole number in the direction of negative `Infinity`. - */ - floor(): BigNumber; - - /** - * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise returns `false`. - */ - greaterThan(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise returns `false`. - */ - gt(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, otherwise returns `false`. - */ - greaterThanOrEqualTo(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, otherwise returns `false`. - */ - gte(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is a finite number, otherwise returns `false`. - * - * The only possible non-finite values of a BigNumber are `NaN`, `Infinity` and `-Infinity`. - */ - isFinite(): boolean; - - /** - * Returns `true` if the value of this BigNumber is a whole number, otherwise returns `false`. - */ - isInteger(): boolean; - - /** - * Returns `true` if the value of this BigNumber is a whole number, otherwise returns `false`. - */ - isInt(): boolean; - - /** - * Returns `true` if the value of this BigNumber is NaN, otherwise returns `false`. - */ - isNaN(): boolean; - - /** - * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. - */ - isNegative(): boolean; - - /** - * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. - */ - isNeg(): boolean; - - /** - * Returns `true` if the value of this BigNumber is zero or minus zero, otherwise returns `false`. - */ - isZero(): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns `false`. - */ - lessThan(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns `false`. - */ - lt(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, otherwise returns - */ - lessThanOrEqualTo(n: NumberLike, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, otherwise returns - */ - lte(n: NumberLike, base?: number): boolean; - - /** - * Returns a BigNumber whose value is the value of this BigNumber minus `n`. - */ - minus(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber minus `n`. - */ - sub(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer remainder of dividing this BigNumber by `n`. - * - * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` setting of this BigNumber constructor. - * If it is `1` (default value), the result will have the same sign as this BigNumber, - * and it will match that of Javascript's `%` operator (within the limits of double precision) and BigDecimal's `remainder` method. - */ - modulo(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer remainder of dividing this BigNumber by `n`. - * - * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` setting of this BigNumber constructor. - * If it is `1` (default value), the result will have the same sign as this BigNumber, - * and it will match that of Javascript's `%` operator (within the limits of double precision) and BigDecimal's `remainder` method. - */ - mod(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by `-1`. - */ - negated(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by `-1`. - */ - neg(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber plus `n`. - */ - plus(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber plus `n`. - */ - add(n: NumberLike, base?: number): BigNumber; - - /** - * Returns the number of significant digits of the value of this BigNumber. - * - * If `z` is `true` or `1` then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not. - */ - precision(z?: boolean | 0 | 1): number; - - /** - * Returns the number of significant digits of the value of this BigNumber. - * - * If `z` is `true` or `1` then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not. - */ - sd(z?: boolean | 0 | 1): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode `rm` to a maximum of `dp` decimal places. - * - * If `dp` is omitted, or is `null` or `undefined`, the return value is `n` rounded to a whole number. - * - * If `rm` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - round(dp?: number, rm?: RoundingMode): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber shifted `n` places. - * - * The shift is of the decimal point, i.e. of powers of ten, and is to the left if `n` is negative or to the right if `n` is positive. - */ - shift(n: number): BigNumber; - - /** - * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - * - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. - */ - squareRoot(): BigNumber; - - /** - * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - * - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. - */ - sqrt(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber times `n`. - */ - times(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber times `n`. - */ - mul(n: NumberLike, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to `sd` significant digits using rounding mode `rm`. - * - * If `sd` is omitted or is `null` or `undefined`, the return value will not be rounded. - * - * If `rm` is omitted or is `null` or `undefined`, ROUNDING_MODE will be used. - */ - toDigits(sd?: number, rm?: RoundingMode): BigNumber; - - /** - * Returns a string representing the value of this BigNumber in exponential notation rounded using rounding mode `rm` to `dp` decimal places, - * i.e with one digit before the decimal point and `dp` digits after it. - * - * If the value of this BigNumber in exponential notation has fewer than `dp` fraction digits, the return value will be appended with zeros accordingly. - * - * If `dp` is omitted, or is `null` or `undefined`, the number of digits after the decimal point defaults to the minimum number of digits necessary to represent the value exactly. - * - * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - toExponential(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string representing the value of this BigNumber in normal (fixed-point) notation rounded to `dp` decimal places using rounding mode `rm`. - * - * If the value of this BigNumber in normal notation has fewer than `dp` fraction digits, the return value will be appended with zeros accordingly. - * - * Unlike `Number.prototype.toFixed`, which returns exponential notation if a number is greater or equal to `10e21`, this method will always return normal notation. - * - * If `dp` is omitted or is `null` or `undefined`, the return value will be unrounded and in normal notation. - * This is also unlike `Number.prototype.toFixed`, which returns the value to zero decimal places. - * It is useful when fixed-point notation is required and the current `EXPONENTIAL_AT` setting causes `toString` to return exponential notation. - * - * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - toFixed(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string representing the value of this BigNumber in normal (fixed-point) notation rounded to `dp` decimal places using rounding mode `rm`, - * and formatted according to the properties of the `FORMAT` object. - * - * If `dp` is omitted or is `null` or `undefined`, then the return value is not rounded to a fixed number of decimal places. - * - * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - toFormat(dp?: number, rm?: RoundingMode): string; - - /** - * Returns a string array representing the value of this BigNumber as a simple fraction with an integer numerator and an integer denominator. - * The denominator will be a positive non-zero value less than or equal to `max`. - * - * If a maximum denominator, `max`, is not specified, or is `null` or `undefined`, the denominator will be the lowest value necessary to represent the number exactly. - */ - toFraction(max?: NumberLike): [string, string]; - - /** - * As `valueOf`. - */ - toJSON(): string; - - /** - * Returns the value of this BigNumber as a JavaScript number primitive. - * - * Type coercion with, for example, the unary plus operator will also work, except that a BigNumber with the value minus zero will be converted to positive zero. - */ - toNumber(): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber raised to the power `n`, and optionally modulo a modulus `m`. - * - * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - */ - toPower(n: number, m?: NumberLike): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber raised to the power `n`, and optionally modulo a modulus `m`. - * - * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. - */ - pow(n: number, m?: NumberLike): BigNumber; - - /** - * Returns a string representing the value of this BigNumber rounded to `sd` significant digits using rounding mode `rm`. - * - * If `sd` is less than the number of digits necessary to represent the integer part of the value in normal (fixed-point) notation, then exponential notation is used. - * - * If `sd` is omitted, or is `null` or `undefined`, then the return value is the same as `n.toString()`. - * - * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - */ - toPrecision(sd?: number, rm?: RoundingMode): string; - - /** - * Returns a string representing the value of this BigNumber in the specified base, or base `10` if `base` is omitted or is `null` or `undefined`. - */ - toString(base?: number): string; - - /** - * Returns a BigNumber whose value is the value of this BigNumber truncated to a whole number. - */ - truncated(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber truncated to a whole number. - */ - trunc(): BigNumber; - - /** - * As `toString`, but does not accept a base argument and includes the minus sign for negative zero. - */ - valueOf(): string; - - /** - * coefficient - * @description Array of base 1e14 numbers - */ - c: number[] | null; - - /** - * exponent - * @description Integer, -1000000000 to 1000000000 inclusive - */ - e: number | null; - - /** - * sign - */ - s: -1 | 1 | null; - - /** - * type identifier - */ - isBigNumber: true; - } -} diff --git a/types/bignumber.js/tsconfig.json b/types/bignumber.js/tsconfig.json deleted file mode 100644 index 6355540e00..0000000000 --- a/types/bignumber.js/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bignumber.js-tests.ts" - ] -} \ No newline at end of file diff --git a/types/bigscreen/tslint.json b/types/bigscreen/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bigscreen/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/binary-parser/binary-parser-tests.ts b/types/binary-parser/binary-parser-tests.ts new file mode 100644 index 0000000000..d0d09e5ef7 --- /dev/null +++ b/types/binary-parser/binary-parser-tests.ts @@ -0,0 +1,95 @@ +import { Parser } from "binary-parser"; + +// Build an IP packet header Parser +const ipHeader = new Parser() + .endianess('big') + .bit4('version') + .bit4('headerLength') + .uint8('tos') + .uint16('packetLength') + .uint16('id') + .bit3('offset') + .bit13('fragOffset') + .uint8('ttl') + .uint8('protocol') + .uint16('checksum') + .array('src', { + type: 'uint8', + length: 4 + }) + .array('dst', { + type: 'uint8', + length: 4 + }); + +// Prepare buffer to parse. +const buf = new Buffer('450002c5939900002c06ef98adc24f6c850186d1', 'hex'); + +// Parse buffer and show result +ipHeader.parse(buf); + +const parser2 = new Parser() + // Signed 32-bit integer (little endian) + .int32le('a') + // Unsigned 8-bit integer + .uint8('b') + // Signed 16-bit integer (big endian) + .int16be('c'); + +const parser3 = new Parser() + // 32-bit floating value (big endian) + .floatbe('a') + // 64-bit floating value (little endian) + .doublele('b'); + +const parser4 = new Parser() + // Statically sized array + .array('data', { + type: 'int32', + length: 8 + }) + + // Dynamically sized array (references another variable) + .uint8('dataLength') + .array('data2', { + type: 'int32', + length: 'dataLength' + }) + + // Dynamically sized array (with some calculation) + .array('data3', { + type: 'int32', + length: () => 4 // other fields are available through this + }) + + // Statically sized array + .array('data4', { + type: 'int32', + lengthInBytes: 16 + }) + + // Dynamically sized array (references another variable) + .uint8('dataLengthInBytes') + .array('data5', { + type: 'int32', + lengthInBytes: 'dataLengthInBytes' + }) + + // Dynamically sized array (with some calculation) + .array('data6', { + type: 'int32', + lengthInBytes: () => 4, // other fields are available through this + }) + + // Dynamically sized array (with stop-check on parsed item) + .array('data7', { + type: 'int32', + readUntil: (item, buffer) => true // stop when specific item is parsed. buffer can be used to perform a read-ahead. + }); + +const parser5 = new Parser() + .array('ipv4', { + type: 'uint8', + length: '4', + formatter: (arr) => { } + }); diff --git a/types/binary-parser/index.d.ts b/types/binary-parser/index.d.ts new file mode 100644 index 0000000000..657996bd8d --- /dev/null +++ b/types/binary-parser/index.d.ts @@ -0,0 +1,147 @@ +// Type definitions for binary-parser 1.3 +// Project: https://github.com/keichi/binary-parser +// Definitions by: Benjamin Riggs , Dolan Miu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface Parser { + parse(buffer: Buffer, callback?: (err?: Error, result?: any) => void): Parser.Parsed; + + create(constructorFunction: ObjectConstructor): Parser; + + int8(name: string, options?: Parser.Options): Parser; + uint8(name: string, options?: Parser.Options): Parser; + + int16(name: string, options?: Parser.Options): Parser; + uint16(name: string, options?: Parser.Options): Parser; + int16le(name: string, options?: Parser.Options): Parser; + int16be(name: string, options?: Parser.Options): Parser; + uint16le(name: string, options?: Parser.Options): Parser; + uint16be(name: string, options?: Parser.Options): Parser; + + int32(name: string, options?: Parser.Options): Parser; + uint32(name: string, options?: Parser.Options): Parser; + int32le(name: string, options?: Parser.Options): Parser; + int32be(name: string, options?: Parser.Options): Parser; + uint32le(name: string, options?: Parser.Options): Parser; + uint32be(name: string, options?: Parser.Options): Parser; + + bit1(name: string, options?: Parser.Options): Parser; + bit2(name: string, options?: Parser.Options): Parser; + bit3(name: string, options?: Parser.Options): Parser; + bit4(name: string, options?: Parser.Options): Parser; + bit5(name: string, options?: Parser.Options): Parser; + bit6(name: string, options?: Parser.Options): Parser; + bit7(name: string, options?: Parser.Options): Parser; + bit8(name: string, options?: Parser.Options): Parser; + bit9(name: string, options?: Parser.Options): Parser; + bit10(name: string, options?: Parser.Options): Parser; + bit11(name: string, options?: Parser.Options): Parser; + bit12(name: string, options?: Parser.Options): Parser; + bit13(name: string, options?: Parser.Options): Parser; + bit14(name: string, options?: Parser.Options): Parser; + bit15(name: string, options?: Parser.Options): Parser; + bit16(name: string, options?: Parser.Options): Parser; + bit17(name: string, options?: Parser.Options): Parser; + bit18(name: string, options?: Parser.Options): Parser; + bit19(name: string, options?: Parser.Options): Parser; + bit20(name: string, options?: Parser.Options): Parser; + bit21(name: string, options?: Parser.Options): Parser; + bit22(name: string, options?: Parser.Options): Parser; + bit23(name: string, options?: Parser.Options): Parser; + bit24(name: string, options?: Parser.Options): Parser; + bit25(name: string, options?: Parser.Options): Parser; + bit26(name: string, options?: Parser.Options): Parser; + bit27(name: string, options?: Parser.Options): Parser; + bit28(name: string, options?: Parser.Options): Parser; + bit29(name: string, options?: Parser.Options): Parser; + bit30(name: string, options?: Parser.Options): Parser; + bit31(name: string, options?: Parser.Options): Parser; + bit32(name: string, options?: Parser.Options): Parser; + + float(name: string, options?: Parser.Options): Parser; + floatle(name: string, options?: Parser.Options): Parser; + floatbe(name: string, options?: Parser.Options): Parser; + + double(name: string, options?: Parser.Options): Parser; + doublele(name: string, options?: Parser.Options): Parser; + doublebe(name: string, options?: Parser.Options): Parser; + + string(name: string, options?: Parser.StringOptions): Parser; + + buffer(name: string, options: Parser.BufferOptions): Parser; + + array(name: string, options: Parser.ArrayOptions): Parser; + + choice(name: string, options: Parser.ChoiceOptions): Parser; + + nest(name: string, options: Parser.NestOptions): Parser; + + skip(length: number): Parser; + + endianess(endianess: Parser.Endianness): Parser; /* [sic] */ + + namely(alias: string): Parser; + + compile(): void; + + getCode(): string; +} + +export interface ParserConstructor { + new(): Parser; +} + +export const Parser: ParserConstructor; + +export namespace Parser { + type Data = number | string | Array | Parsed | Buffer; + interface Parsed { + [name: string]: Data; + } + + interface Options { + formatter?: ((value: Data) => any); + assert?: string | number | ((value: Data) => boolean); + } + + interface StringOptions extends Options { + encoding?: string; + length?: number | string | ((this: Parsed) => number); + zeroTerminated?: boolean; + greedy?: boolean; + stripNull?: boolean; + } + + interface BufferOptions extends Options { + clone?: boolean; + length?: number | string | ((this: Parsed) => number); + readUntil?: string | ((item: number, buffer: Buffer) => boolean); + } + + interface ArrayOptions extends Options { + type: string | Parser; + length?: number | string | ((this: Parsed) => number); + lengthInBytes?: number | string | ((this: Parsed) => number); + readUntil?: string | ((item: number, buffer: Buffer) => boolean); + } + + interface ChoiceOptions extends Options { + tag: string | ((this: Parsed) => number); + choices: { [item: number]: Parser | string }; + defaultChoice?: Parser | string; + } + + interface NestOptions extends Options { + type: Parser | string; + } + + type Endianness = + 'little' | + 'big'; + + interface Context { + [name: string]: Parsed; + } +} diff --git a/types/binary-parser/tsconfig.json b/types/binary-parser/tsconfig.json new file mode 100644 index 0000000000..cb361f52c5 --- /dev/null +++ b/types/binary-parser/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", + "binary-parser-tests.ts" + ] +} diff --git a/types/passport-client-cert/tslint.json b/types/binary-parser/tslint.json similarity index 100% rename from types/passport-client-cert/tslint.json rename to types/binary-parser/tslint.json diff --git a/types/bind-ponyfill/tslint.json b/types/bind-ponyfill/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bind-ponyfill/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bindings/bindings-tests.ts b/types/bindings/bindings-tests.ts new file mode 100644 index 0000000000..e66ab51353 --- /dev/null +++ b/types/bindings/bindings-tests.ts @@ -0,0 +1,4 @@ +import bindings = require('bindings'); + +// Use your bindings defined in your C files +const result = bindings('binding.node').your_c_function(); diff --git a/types/bindings/index.d.ts b/types/bindings/index.d.ts new file mode 100644 index 0000000000..9403a7a92b --- /dev/null +++ b/types/bindings/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for bindings 1.3 +// Project: https://github.com/TooTallNate/node-bindings +// Definitions by: Daniel Perez Alvarez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * The main `bindings()` function loads the compiled bindings for a given module. + * It uses V8's Error API to determine the parent filename that this function is + * being invoked from, which is then used to find the root directory. + */ +declare function bindings(mod: string): any; + +export = bindings; diff --git a/types/bindings/tsconfig.json b/types/bindings/tsconfig.json new file mode 100644 index 0000000000..fb9350642a --- /dev/null +++ b/types/bindings/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", + "bindings-tests.ts" + ] +} diff --git a/types/pg-connection-string/tslint.json b/types/bindings/tslint.json similarity index 100% rename from types/pg-connection-string/tslint.json rename to types/bindings/tslint.json diff --git a/types/bingmaps/Autosuggest.d.ts b/types/bingmaps/Autosuggest.d.ts index 4ccfcc9270..7d83ca6e4b 100644 --- a/types/bingmaps/Autosuggest.d.ts +++ b/types/bingmaps/Autosuggest.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - declare module Microsoft.Maps { /** Options used to customize the autosuggest functionality. */ export interface IAutosuggestOptions { diff --git a/types/bingmaps/Clustering.d.ts b/types/bingmaps/Clustering.d.ts index a936653d3b..17c9425933 100644 --- a/types/bingmaps/Clustering.d.ts +++ b/types/bingmaps/Clustering.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - declare module Microsoft.Maps { /** The options used to customize how the ClusterLayer functions. */ export interface IClusterLayerOptions { diff --git a/types/bingmaps/Contour.d.ts b/types/bingmaps/Contour.d.ts index 8bc80e70b9..cd2d9767c7 100644 --- a/types/bingmaps/Contour.d.ts +++ b/types/bingmaps/Contour.d.ts @@ -1,13 +1,6 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - declare module Microsoft.Maps { - /** + /** * The contour layer options */ interface IContourLayerOptions { diff --git a/types/bingmaps/DataBinning.d.ts b/types/bingmaps/DataBinning.d.ts index 548a9cc681..e33b2d5113 100644 --- a/types/bingmaps/DataBinning.d.ts +++ b/types/bingmaps/DataBinning.d.ts @@ -1,9 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// /// declare module Microsoft.Maps { @@ -96,7 +90,7 @@ declare module Microsoft.Maps { } /** - * A polygon which represents a data bin on the map and contains the data bin information. + * A polygon which represents a data bin on the map and contains the data bin information. */ export class DataBinPolygon extends Polygon { diff --git a/types/bingmaps/Directions.d.ts b/types/bingmaps/Directions.d.ts index 80a3bd5a07..3663fc8c21 100644 --- a/types/bingmaps/Directions.d.ts +++ b/types/bingmaps/Directions.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - declare module Microsoft.Maps.Directions { ///////////////////////////////////// /// Enumerations @@ -309,7 +302,7 @@ declare module Microsoft.Maps.Directions { timeWithTraffic: number; } - /** Contains information about a transit line. */ + /** Contains information about a transit line. */ export interface ITransitLine { /** The short name for the transit line. */ abbreviatedName: string; @@ -338,12 +331,12 @@ declare module Microsoft.Maps.Directions { /** Options that can be used to define a waypoint. */ export interface IWaypointOptions { - /** + /** * The address string of the waypoint. For example, the following strings are valid for this parameter: "Seattle", "1 Microsoft Way, Redmond, WA". Either the address or location property must be specified. */ address?: string; - /** + /** * A boolean indicating whether the waypoint is a via point. A via point is a point along the route that is not a stop point. Set this property to * true if you just want the route to pass through this location. Default: false */ @@ -495,7 +488,7 @@ declare module Microsoft.Maps.Directions { public addWaypoint(waypoint: Waypoint, index?: number): void; /** - * Calculates directions based on request and render options set + * Calculates directions based on request and render options set */ public calculateDirections(): void; @@ -503,8 +496,8 @@ declare module Microsoft.Maps.Directions { public clearAll(): void; /** - * Clears the directions displayed and removes the route line from the map. - * This method does not remove waypoints from the route and retains all calculated direction information and option settings. + * Clears the directions displayed and removes the route line from the map. + * This method does not remove waypoints from the route and retains all calculated direction information and option settings. */ public clearDisplay(): void; @@ -534,7 +527,7 @@ declare module Microsoft.Maps.Directions { * @returns The directions request options. */ public getRequestOptions(): IDirectionsRequestOptions; - + /** * Gets the current calculated route(s) * @returns The current calculated route(s). If the route was not successfully calculated, null is returned. @@ -542,7 +535,7 @@ declare module Microsoft.Maps.Directions { public getRouteResult(): IRoute[]; /** - * Removes the given waypoint or the waypoint identified by the given index from the route. + * Removes the given waypoint or the waypoint identified by the given index from the route. * @param waypointOrIndex A Waypoint object to be removed or the index of the waypoint to be removed */ public removeWaypoint(waypointOrIndex: Waypoint | number): void; @@ -563,7 +556,7 @@ declare module Microsoft.Maps.Directions { * Displays an input panel for calculating directions in the specified container. Provides autosuggest for location inputs. * @param inputContainerId The id name of the HTML container in which to render the directions input panel. */ - public showInputPanel(inputContainerId: string): void; + public showInputPanel(inputContainerId: string): void; } } @@ -580,7 +573,7 @@ declare module Microsoft.Maps { * @param eventName The type of event to attach. Supported Events: * • directionsError * • directionsUpdated - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: Directions.DirectionsManager, eventName: string, handler: (eventArg?: Directions.IDirectionsEventArgs | Directions.IDirectionsErrorEventArgs) => void): IHandlerId; diff --git a/types/bingmaps/DrawingTools.d.ts b/types/bingmaps/DrawingTools.d.ts index 8bdc7e8b21..bd5c938e4e 100644 --- a/types/bingmaps/DrawingTools.d.ts +++ b/types/bingmaps/DrawingTools.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - declare module Microsoft.Maps { /** An object that contains the event arguments for when the drawing mode changes in the drawing tools. **/ export interface IDrawingModeChangedData { @@ -28,7 +21,7 @@ declare module Microsoft.Maps { • @param index The index at which to insert the shape into the layer. */ add(data: IPrimitive | IPrimitive[], index?: number): void; - + /** * Disposes the drawing manager instance. */ @@ -122,7 +115,7 @@ declare module Microsoft.Maps { /** * Creates a drawing manager which allows multi-shape editing and displays the toolbar. - * @param callback A callback function that is triggered after the DrawingTools have loaded. + * @param callback A callback function that is triggered after the DrawingTools have loaded. */ public showDrawingManager(callback?: (manager: DrawingManager) => void): void; } @@ -137,7 +130,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * drawingChanged, drawingChanging, drawingEnded, drawingModeChanged, drawingStarted - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: DrawingTools, eventName: string, handler: (eventArg?: IPrimitive | IDrawingModeChangedData) => void): IHandlerId; @@ -147,7 +140,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * disposed, drawingChanged, drawingChanging, drawingEnded, drawingErased, drawingModeChanged, drawingStarted - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: DrawingManager, eventName: string, handler: (eventArg?: IPrimitive | DrawingTools.DrawingMode) => void): IHandlerId; @@ -161,7 +154,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * drawingChanged, drawingChanging, drawingEnded, drawingModeChanged, drawingStarted - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. */ export function addOne(target: DrawingTools, eventName: string, handler: (eventArg?: IPrimitive | IDrawingModeChangedData) => void): void; @@ -183,7 +176,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * drawingChanged, drawingChanging, drawingEnded, drawingModeChanged, drawingStarted - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addThrottledHandler(target: DrawingTools, eventName: string, handler: (eventArg?: IPrimitive | IDrawingModeChangedData) => void): IHandlerId; diff --git a/types/bingmaps/GeoJson.d.ts b/types/bingmaps/GeoJson.d.ts index c68ce2e80f..94726ab542 100644 --- a/types/bingmaps/GeoJson.d.ts +++ b/types/bingmaps/GeoJson.d.ts @@ -1,17 +1,10 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - declare module Microsoft.Maps { /** GeoJSON object definition */ export interface IGeoJsonObject { - /** - * Type of the object - * could be one of the following: + /** + * Type of the object + * could be one of the following: * Point * LineString * Polygon @@ -20,7 +13,7 @@ declare module Microsoft.Maps { * MultiPolygon * GeometryCollection * Feature - * FeatureCollection + * FeatureCollection */ type: string; diff --git a/types/bingmaps/HeatMapLayer.d.ts b/types/bingmaps/HeatMapLayer.d.ts index c012e06422..c90813b00d 100644 --- a/types/bingmaps/HeatMapLayer.d.ts +++ b/types/bingmaps/HeatMapLayer.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - declare module Microsoft.Maps { /** A standard dictionary object (associative array). */ export interface IDictionary { @@ -34,15 +27,15 @@ declare module Microsoft.Maps { * The opacity of the HeatMapLayer canvas. Value should be a decimal between 0 and 1. Default: 1 */ opacity?: number; - + /** * The radius to draw each data point on the map. Default: 10 */ radius?: number; - + /** * The distance units of the radius. Possible values are: - * + * * • 'pixels' (defualt) * • 'meters' * @@ -73,14 +66,14 @@ declare module Microsoft.Maps { /** Disposes the heat map layer. */ public dispose(): void; - + /** * Gets a boolean indicating if the heat map layer is visible or not. * @returns A boolean indicating if the heat map layer is visible or not. */ public getVisible(): boolean; - /** + /** * @deprecated * Hides the heat map layer. */ @@ -104,10 +97,10 @@ declare module Microsoft.Maps { */ public setVisible(visible: boolean): void; - /** + /** * @deprecated * Shows the heat map layer. */ - public show(): void; + public show(): void; } } \ No newline at end of file diff --git a/types/bingmaps/Search.d.ts b/types/bingmaps/Search.d.ts index eea087480c..0d799c7078 100644 --- a/types/bingmaps/Search.d.ts +++ b/types/bingmaps/Search.d.ts @@ -1,16 +1,9 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - /** * Provides an easy method for geocoding address and searching for points of interest from JavaScript. * @requires The Microsoft.Maps.Search module. */ declare module Microsoft.Maps.Search { - /** + /** * Defines the match precision of a geocdoed result. * @requires The Microsoft.Maps.Search module. */ @@ -31,7 +24,7 @@ declare module Microsoft.Maps.Search { rooftop } - /** + /** * Defines the geocoding level of the location match found by the geocoder. * @requires The Microsoft.Maps.Search module. */ @@ -52,7 +45,7 @@ declare module Microsoft.Maps.Search { modified } - /** + /** * Defines the confidence of the location match found by the geocoding service. * @requires The Microsoft.Maps.Search module. */ @@ -117,16 +110,16 @@ declare module Microsoft.Maps.Search { /** The options for a geocode request. */ export interface IGeocodeRequestOptions { - /** - * A location rectangle that defines the boundaries of the area in which to search for - * location results. The default is the bounds of the map view associated with this + /** + * A location rectangle that defines the boundaries of the area in which to search for + * location results. The default is the bounds of the map view associated with this * instance of the SearchManager, which is usually the current map view. */ bounds?: LocationRect; /** - * The name of the function to call when a successful result is returned from the - * geocode request. The callback function must accept two parameters: result, which is + * The name of the function to call when a successful result is returned from the + * geocode request. The callback function must accept two parameters: result, which is * a GeocodeResult type, and a userData object. */ callback: (geocodeResult: IGeocodeResult, userData: any) => void; @@ -135,7 +128,7 @@ declare module Microsoft.Maps.Search { count?: number; /** - * The name of the function to call when the request is returned with an error. The + * The name of the function to call when the request is returned with an error. The * error callback function must accept an IGeocodeRequestOptions object. */ errorCallback?: (geocodeRequestOptions: IGeocodeRequestOptions) => void; @@ -218,15 +211,15 @@ declare module Microsoft.Maps.Search { constructor(map: Map); /** - * Matches the address or place query in the specified request - * options to a location and returns the results to the request + * Matches the address or place query in the specified request + * options to a location and returns the results to the request * options callback function. * @param request Options for sending geocode request */ public geocode(request: IGeocodeRequestOptions): void; /** - * Matches the specified location to an address and returns the + * Matches the specified location to an address and returns the * address results to the specified request options callback function. * @param request Options for sending reverse geocode request */ diff --git a/types/bingmaps/SpatialDataService.d.ts b/types/bingmaps/SpatialDataService.d.ts index f31642cc04..627ab7cbad 100644 --- a/types/bingmaps/SpatialDataService.d.ts +++ b/types/bingmaps/SpatialDataService.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - /** * This module wraps the Query and GeoData REST API’s in the Bing Spatial Dara Services and expose them as an easy to use JavaScript library. * @requires The Microsoft.Maps.SpatialDataService module. @@ -123,10 +116,10 @@ declare module Microsoft.Maps.SpatialDataService { /** The culture associated with this entity. Example: en */ OfficialCulture: string; - + /** The approximate population within this entity. Example: PopClass20000to99999 */ PopulationClass: string; - + /** The regional culture associated with this entity. */ RegionalCulture: string; } @@ -246,7 +239,7 @@ declare module Microsoft.Maps.SpatialDataService { /** * A Fitler object that defines the logic behind a filter expression that can be executed against a JSON object or generate * a filter string that can be used with the Bing Spatial Data Services. - */ + */ export interface IFilter { /** * Executes the filter logic against a JSON object and returns a boolean indicating if the object meets the requirements of the Filter. @@ -319,7 +312,7 @@ declare module Microsoft.Maps.SpatialDataService { /** Options for find near route query API. */ export interface ISpatialFilterOptions { - /** + /** * One of the following values: * • nearby – Searches in a radius around a location. * • nearRoute – Searches for results that are within 1 mile of a route. @@ -331,7 +324,7 @@ declare module Microsoft.Maps.SpatialDataService { /** Location at which the filter should be applied (only for nearby filter). */ location?: string | Location; - /** + /** * Radius to use when performing a nearby search. The distance in kilometers and must be between 0.16 and 1000 kilometers * (only for nearby filter). */ @@ -346,26 +339,26 @@ declare module Microsoft.Maps.SpatialDataService { /** Intersection object. Can be a well known text string or a LocationRect object (only for intersects filter). */ intersects?: string | LocationRect | IPrimitive; } - + /** Options for find near route query API. */ export interface IFindNearRouteOptions extends ISpatialFilterOptions { - /** + /** * One of the following values: * • Driving [default] * • Walking */ travelMode?: string; - /** - * An integer value between 0 and 359 that represents degrees from north - * where north is 0 degrees and the heading is specified clockwise from north. - * For example, setting the heading of 270 degrees creates a route that initially heads west + /** + * An integer value between 0 and 359 that represents degrees from north + * where north is 0 degrees and the heading is specified clockwise from north. + * For example, setting the heading of 270 degrees creates a route that initially heads west */ heading?: number; /** * An integer distance specified in meters. - * Use this parameter to make sure that the moving vehicle has enough distance + * Use this parameter to make sure that the moving vehicle has enough distance * to make the first turn */ distanceBeforeFirstTurn?: number; @@ -404,7 +397,7 @@ declare module Microsoft.Maps.SpatialDataService { isStaging?: boolean; /** - * Specifies one or more properties to use to sort the results of a query. + * Specifies one or more properties to use to sort the results of a query. * You can specify up to three (3) properties. Results are sorted in ascending order. * Note: You cannot use the latitude and longitude properties to sort results. You can use the elevation property. */ diff --git a/types/bingmaps/SpatialMath.d.ts b/types/bingmaps/SpatialMath.d.ts index 94c4ceab61..4fe3b4ea12 100644 --- a/types/bingmaps/SpatialMath.d.ts +++ b/types/bingmaps/SpatialMath.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - ////////////////////////////////////////////// /// Core Library ////////////////////////////////////////////// @@ -80,7 +73,7 @@ declare module Microsoft.Maps.SpatialMath { export function convertArea(area: number, fromUnits: AreaUnits, toUnits: AreaUnits): number; /** - * Converts a distance from one distance units to another. + * Converts a distance from one distance units to another. * @param distance A number that represents a distance to convert. * @param fromUnits The distance units the original distance is in. * @param toUnits The disired distance units to convert to. @@ -119,7 +112,7 @@ declare module Microsoft.Maps.SpatialMath { export function getDistanceTo(origin: Location, destination: Location, units?: DistanceUnits, highAccuracy?: boolean): number; /** - * Retrieves the radius of the earth in a specific distance unit for WGS84. + * Retrieves the radius of the earth in a specific distance unit for WGS84. * @param units Unit of distance measurement. Default: Meters * @returns A number that represents the radius of the earth in a specific distance unit. **/ @@ -145,13 +138,13 @@ declare module Microsoft.Maps.SpatialMath { * Calculates the distance between all Location objects in an array. * @param path The array of Location objects that make up the path to calculate the length of. * @param units Unit of distance measurement. Default: Meters - * @param highAccuracy If set to true, uses the more accurate Vincenty algorithm for calcuating distances. Otherwise the faster Haversine formula is used. + * @param highAccuracy If set to true, uses the more accurate Vincenty algorithm for calcuating distances. Otherwise the faster Haversine formula is used. * @returns The distance between all Locations in between all Location objects in an array on the surface of a earth in the specifed units. **/ export function getLengthOfPath(path: Location[], units?: DistanceUnits, highAccuracy?: boolean): number; /** - * Calculates the Location object on a path that is a specified distance away from the start of the path. If the specified distance is longer + * Calculates the Location object on a path that is a specified distance away from the start of the path. If the specified distance is longer * than the length of the path, the last Location of the path will be returned. * @param path A polyline or array of Location coordinates that form a path. * @param distance The distance along the path (from the start) to calculate the location for. @@ -197,7 +190,7 @@ declare module Microsoft.Maps.SpatialMath { /** * Tries to parse the given string that is in Degree Minute Seconds format. For Example: 35° 26′ 31″ E or 40° 26′ 46″ N 79° 58′ 56″ W * @param input A string in Degree Minute Seconds format to parse. - * @returns Returns a decimal degree value if only a single angle is provided. If two angles provided in the string, then a + * @returns Returns a decimal degree value if only a single angle is provided. If two angles provided in the string, then a * Location object is returned. If string is in an invalid format, null is returned. */ export function tryParseDegMinSec(input: string): number | Location; @@ -233,7 +226,7 @@ declare module Microsoft.Maps.SpatialMath.Tiles { export function groundResolution(latitude: number, zoom: number, units?: SpatialMath.DistanceUnits): number; /** - * Converts a Pixel coordinate into a Geospatial Location at a specified zoom level. + * Converts a Pixel coordinate into a Geospatial Location at a specified zoom level. * Global Pixel coordinates are relative to the top left corner of the map (90, -180) * @param point Pixel coordinate. * @param zoom Zoom level. @@ -346,22 +339,22 @@ declare module Microsoft.Maps.SpatialMath.Geometry { export function centroid(shape: IPrimitive | IPrimitive[]): Location; /** - * Calculates an approximate concave hull that best fits the data. + * Calculates an approximate concave hull that best fits the data. * A concave hull is a shape that represents that a possible concave geometry that encloses all shapes in the specified data set. - * If a single unique Location is in the data set, a Pushpin is returned. If only two unique Locations are provided, or if all Locations form a line, a Polyline is returned. + * If a single unique Location is in the data set, a Pushpin is returned. If only two unique Locations are provided, or if all Locations form a line, a Polyline is returned. * If 3 or more unique Locations are in the data set a Polygon, or array of Polygons will be returned. * @param shapes Shape(s) whose Location(s) or Location(s) are to be used to generate a concave hull. * @param allowMultiPolygons A boolean indicating if the resulting concave hull can be a MultiPolygon. Default: false * @param allowHoles A boolean indicating if the polygons in the resulting concave hull can have holes in them. Default: false * @param options A set of polygon options to apply to the generated shape. - * @returns An approximate concave hull that best fits the data. - * If a single unique Location is in the data set, a Pushpin is returned. If only two unique Locations are provided, or if all Locations form a line, a Polyline is returned. + * @returns An approximate concave hull that best fits the data. + * If a single unique Location is in the data set, a Pushpin is returned. If only two unique Locations are provided, or if all Locations form a line, a Polyline is returned. * If 3 or more unique Locations are in the data set a Polygon, or array of Polygons will be returned. */ export function concaveHull(shapes: Location | IPrimitive | (Location | IPrimitive)[], allowMultiPolygons?: boolean, allowHoles?: boolean, options?: IPolygonOptions): IPrimitive | IPrimitive[]; /** - * Given two shapes, determines if the first one contains the second one + * Given two shapes, determines if the first one contains the second one * (or, the second shape is a subset of the first shape) or not. * @param shapeA The first shape to test against the second. * @param shapeB The second shape to test against the first. @@ -386,7 +379,7 @@ declare module Microsoft.Maps.SpatialMath.Geometry { export function delaunayTriangles(shapes: Location | IPrimitive | (Location | IPrimitive)[], options?: IPolygonOptions): Polygon[]; /** - * Returns an object that represents area of an initial shape subtracted by the overlapping area of a second shape. + * Returns an object that represents area of an initial shape subtracted by the overlapping area of a second shape. * @param shapeA The first shape. * @param shapeB The second shape to subtract from the first. * @returns A set of shapes that represent the area of the first shape that is not overlapped by the second shape. @@ -394,17 +387,17 @@ declare module Microsoft.Maps.SpatialMath.Geometry { export function difference(shapeA: IPrimitive | IPrimitive[], shapeB: IPrimitive | IPrimitive[]): IPrimitive | IPrimitive[]; /** - * Calculates the approximate shortest distance between any two shapes. + * Calculates the approximate shortest distance between any two shapes. * @param shapeA The first shape to calculate the distance from. * @param shapeB The second shape to calculate the distance to. * @param units Unit of distance measurement. Default: Meters - * @param highAccuracy If set to true, uses the more accurate Vincenty algorithm for calcuating distances. Otherwise the faster Haversine formula is used. + * @param highAccuracy If set to true, uses the more accurate Vincenty algorithm for calcuating distances. Otherwise the faster Haversine formula is used. * @returns The shorested distance between the shapes in the specified units. */ export function distance(shapeA: Location | IPrimitive | (Location | IPrimitive)[], shapeB: Location | IPrimitive | (Location | IPrimitive)[], units?: DistanceUnits, highAccuracy?: boolean): number; /** - * Returns an object that represents the area where two shapes intersect. + * Returns an object that represents the area where two shapes intersect. * @param shapeA The first shape. * @param shapeB The second shape. * @returns A set of shapes that represents the area where two shapes intersect. @@ -420,10 +413,10 @@ declare module Microsoft.Maps.SpatialMath.Geometry { export function intersects(shapeA: Location | IPrimitive | (Location | IPrimitive)[], shapeB: Location | IPrimitive | (Location | IPrimitive)[]): boolean; /** - * Tests to see if the shape is valid and meets the requirements of an SQL Geography type and other OGC compliant systems. Polylines & Polygons can't be self intersecting. For Polygons, + * Tests to see if the shape is valid and meets the requirements of an SQL Geography type and other OGC compliant systems. Polylines & Polygons can't be self intersecting. For Polygons, * coordinates in an exterior rings have a counter-clockwise orientation, while holes have a clockwise orientation. * @param shape The shape to test for validity. - * @returns Returns a boolean indicting if the specified shape(s) is valid or not. + * @returns Returns a boolean indicting if the specified shape(s) is valid or not. */ export function isValid(shape: IPrimitive | IPrimitive[]): boolean; @@ -431,13 +424,13 @@ declare module Microsoft.Maps.SpatialMath.Geometry { * Calculates the distance between all Locations in a shape. If the shape is a polygon, the length of the perimeter of all rings is calculated. * @param shape The shape to calculate the length of. * @param units Unit of distance measurement. Default: Meters - * @param highAccuracy If set to true, uses the more accurate Vincenty algorithm for calcuating distances. Otherwise the faster Haversine formula is used. + * @param highAccuracy If set to true, uses the more accurate Vincenty algorithm for calcuating distances. Otherwise the faster Haversine formula is used. * @returns The distance between all Locations in a polyline or the perimeter of a ploygon on the surface of a earth in the specifed units. */ export function calculateLength(shape: IPrimitive | IPrimitive[], units ?: DistanceUnits, highAccuracy ?: boolean): number; /** - * Takes a shape and returns a copy of it that meets the requirements of an SQL Geography type and other OGC compliant systems. Polylines & Polygons can't be self intersecting. For Polygons, + * Takes a shape and returns a copy of it that meets the requirements of an SQL Geography type and other OGC compliant systems. Polylines & Polygons can't be self intersecting. For Polygons, * coordinates in an exterior rings have a counter-clockwise orientation, while holes have a clockwise orientation. * @param shape The shape to make valid. * @returns Valiated version of the provided shape. May be a different shape type than what was provided. i.e. A polygon may be broken up into an array of polygons (MultiPolygon). @@ -446,12 +439,12 @@ declare module Microsoft.Maps.SpatialMath.Geometry { /** * Calculates the nearest Location objects between to shapes that lie on the shapes. - * If the shapes do not overlap, this calculates a location on each shape that is closest to the other shape. + * If the shapes do not overlap, this calculates a location on each shape that is closest to the other shape. * If the shapes overlap, a location that is within the intersection area of the shapes will be added twice to an array, once for each shape, and returned. * @param shapeA The first shape. * @param shapeB The second shape. - * @returns An array of two Location objects that represent the nearest points between two shapes. - * The Location objects are in the same order as the input shapes. + * @returns An array of two Location objects that represent the nearest points between two shapes. + * The Location objects are in the same order as the input shapes. * Returns null if nearest points were unable to be computed. */ export function nearestLocations(shapeA: Location | IPrimitive | (Location | IPrimitive)[], shapeB: Location | IPrimitive | (Location | IPrimitive)[]): Location[]; @@ -460,7 +453,7 @@ declare module Microsoft.Maps.SpatialMath.Geometry { * Reduces the resolution of a shape using the Douglas-Peucker algorithm. * @param shape The shape to reduce the resolution of. * @param tolerance A tolerance distance in meters used by the reduction algorithms. - * @returns A version of the specified shape that has been reduced. + * @returns A version of the specified shape that has been reduced. */ export function reduce(shape: IPrimitive | IPrimitive[], tolerance: number): IPrimitive | IPrimitive[]; @@ -502,7 +495,7 @@ declare module Microsoft.Maps.SpatialMath.Geometry { /** * Returns an object that represents all points that are either in one shape instance or another, but not those points that lie in both instances. - * "Sym" stands for Symmetric. symDifference is an OGC standard name for this calculation used in most spatial math libraries, including SQL. + * "Sym" stands for Symmetric. symDifference is an OGC standard name for this calculation used in most spatial math libraries, including SQL. * @param shapeA The first shape. * @param shapeB The second shape. * @returns A shape that represents the symetric difference between two shapes. @@ -518,7 +511,7 @@ declare module Microsoft.Maps.SpatialMath.Geometry { export function union(shapeA: IPrimitive | IPrimitive[], shapeB: IPrimitive | IPrimitive[]): IPrimitive | IPrimitive[]; /** - * Performs a union operation on a set of shapes. + * Performs a union operation on a set of shapes. * If a shape doesn't overlap with the rest, the returned result will be an array of shapes containing this shape and the union of the rest. * @param shapes An array of shapes to union together. * @returns A shape that represents the union of all specified shapes. @@ -526,10 +519,10 @@ declare module Microsoft.Maps.SpatialMath.Geometry { export function unionAggregate(shapes: IPrimitive[]): IPrimitive | IPrimitive[]; /** - * Creates a Voronoi diagram from the Location objects of the provided shapes. The diagram is returned as an array of Polygons. + * Creates a Voronoi diagram from the Location objects of the provided shapes. The diagram is returned as an array of Polygons. * If a clip region is specified, the diagram will be clipped accordingly. * @param shapes Location(s) of shape(s) or Location(s) to generate a Voronoi diagram. - * @param clipRegion A region to clip the voronoi diagram to. + * @param clipRegion A region to clip the voronoi diagram to. * @param options A set of polygon options to apply to the generated shape. * @returns An array of polygons that form a Voronoi diagram. */ diff --git a/types/bingmaps/Traffic.d.ts b/types/bingmaps/Traffic.d.ts index 46f508128f..1c78256053 100644 --- a/types/bingmaps/Traffic.d.ts +++ b/types/bingmaps/Traffic.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - /** * Adds a traffic incident and flow data to the map. * @requires The Microsoft.Maps.Traffic module. diff --git a/types/bingmaps/UNUSED_FILES.txt b/types/bingmaps/UNUSED_FILES.txt deleted file mode 100644 index b0c81f8c63..0000000000 --- a/types/bingmaps/UNUSED_FILES.txt +++ /dev/null @@ -1,13 +0,0 @@ -Autosuggest.d.ts -Clustering.d.ts -Contour.d.ts -DataBinning.d.ts -Directions.d.ts -DrawingTools.d.ts -GeoJson.d.ts -HeatMapLayer.d.ts -Search.d.ts -SpatialDataService.d.ts -SpatialMath.d.ts -Traffic.d.ts -WellKnownText.d.ts \ No newline at end of file diff --git a/types/bingmaps/WellKnownText.d.ts b/types/bingmaps/WellKnownText.d.ts index 1a0670ae1c..51c42203ce 100644 --- a/types/bingmaps/WellKnownText.d.ts +++ b/types/bingmaps/WellKnownText.d.ts @@ -1,10 +1,3 @@ -// Type definitions for Microsoft.Maps 8.0 (Change set e6d7cc4) -// Project: https://github.com/Microsoft/Bing-Maps-V8-TypeScript-Definitions -// Definitions by: Ricky Brundritt -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - declare module Microsoft.Maps { /** * Class responsible for readon/writing geo data in well known text format diff --git a/types/bingmaps/index.d.ts b/types/bingmaps/index.d.ts index 919b7df62f..b629e3b903 100644 --- a/types/bingmaps/index.d.ts +++ b/types/bingmaps/index.d.ts @@ -3,15 +3,29 @@ // Definitions by: Ricky Brundritt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + /** * The Bing Maps V8 developer API. */ declare module Microsoft.Maps { - + ////////////////////////////////////////////// /// Custom Map Styles ////////////////////////////////////////////// - + /** The styles options that can be applied to map elements. */ export interface IMapElementStyle { /** @@ -67,7 +81,7 @@ declare module Microsoft.Maps { export interface ISettingsStyle { /** A hex color value that all land is first flushed to before things are drawn on it. */ landColor?: string; - + /** Specifies whether or not to draw elevation shading on the map. */ shadedReliefVisible?: boolean; } @@ -123,7 +137,7 @@ declare module Microsoft.Maps { /** A school or other educational building. */ educationBuilding?: IMapElementStyle; - /** Restaurant, café, etc. */ + /** Restaurant, caf�, etc. */ foodPoint?: IMapElementStyle; /** Area of forest land. */ @@ -155,7 +169,7 @@ declare module Microsoft.Maps { /** A building which provides medical services. */ medicalBuilding?: IMapElementStyle; - + /** A military area. */ military?: IMapElementStyle; @@ -218,7 +232,7 @@ declare module Microsoft.Maps { /** Area of a stadium. */ stadium?: IMapElementStyle; - + /** A street. */ street?: IMapElementStyle; @@ -270,7 +284,7 @@ declare module Microsoft.Maps { /** The version of the style syntax used. */ version: string; } - + ////////////////////////////////////////////// /// Enumerations ////////////////////////////////////////////// @@ -361,7 +375,7 @@ declare module Microsoft.Maps { /** Contains enum to show how pixels are defined. */ export enum PixelReference { - /** The pixel is defined relative to the map control’s root element, where the top left corner of the map control is (0, 0). */ + /** The pixel is defined relative to the map control�s root element, where the top left corner of the map control is (0, 0). */ control, /** The pixel is defined relative to the page, where the top left corner of the HTML page is (0, 0). */ @@ -385,7 +399,7 @@ declare module Microsoft.Maps { /** * The subdivision name within the country or region for an address. This element is also commonly treated as the first order administrative - * subdivision. An example is a US state, such as “Oregon”. + * subdivision. An example is a US state, such as �Oregon�. */ adminDistrict: string; @@ -395,16 +409,16 @@ declare module Microsoft.Maps { /** A string specifying the two-letter ISO country code. */ countryRegionISO2: string; - /** The second, third, or fourth order subdivision within a country, dependency, or region. An example is a US county, such as “King”. */ + /** The second, third, or fourth order subdivision within a country, dependency, or region. An example is a US county, such as �King�. */ district: string; /** A nicely formatted address string for the result. */ formattedAddress: string; - /** The locality, such as the primary city, that corresponds to an address. An example is “Seattle”. */ + /** The locality, such as the primary city, that corresponds to an address. An example is �Seattle�. */ locality: string; - /** The post code, postal code, or ZIP code of an address. An example is a US ZIP code, such as “98152”. */ + /** The post code, postal code, or ZIP code of an address. An example is a US ZIP code, such as �98152�. */ postalCode: string; } @@ -470,14 +484,14 @@ declare module Microsoft.Maps { export interface ILayer { } - /** + /** * @deprecated use IMouseEventArgs - * A LayerMouseEventArgs object is returned by many the mouse event handlers attached to a Layer. + * A LayerMouseEventArgs object is returned by many the mouse event handlers attached to a Layer. */ export interface ILayerMouseEventArgs { - /** + /** * @deprecated use target - * The IPrimitive shape (pushpin, polyline, polygon) that the event occurred on. + * The IPrimitive shape (pushpin, polyline, polygon) that the event occurred on. */ primitive: IPrimitive; } @@ -498,13 +512,13 @@ declare module Microsoft.Maps { */ htmlContent?: string; - /** The location on the map where the infobox’s anchor is attached. */ + /** The location on the map where the infobox�s anchor is attached. */ location?: Location; - /** The maximium size that the infobox height can expand to based on it’s content. Default: 126 **/ + /** The maximium size that the infobox height can expand to based on it�s content. Default: 126 **/ maxHeight?: number; - /** The maximium size that the infobox width can expand to based on it’s content. Default: 256 **/ + /** The maximium size that the infobox width can expand to based on it�s content. Default: 256 **/ maxWidth?: number; /** @@ -599,7 +613,7 @@ declare module Microsoft.Maps { /** Custom map styles used to modify the look and feel of the base map. */ customMapStyle?: ICustomMapStyle; - /** A boolean value indicating whether to disable the user’s ability to control the using the keyboard. Default: false */ + /** A boolean value indicating whether to disable the user�s ability to control the using the keyboard. Default: false */ disableKeyboardInput?: boolean; /** A boolean value indicating if mousing over the map type selector should open it or not. Default: true */ @@ -670,14 +684,14 @@ declare module Microsoft.Maps { navigationBarOrientation?: NavigationBarOrientation; /** - * A boolean value indicating whether to display the “breadcrumb control”. The breadcrumb control shows the current center location’s geography hierarchy. + * A boolean value indicating whether to display the �breadcrumb control�. The breadcrumb control shows the current center location�s geography hierarchy. * The default value is false. Requires the showLocateMeButton map option to be set to true. The breadcrumb control displays best when the width of the map * is at least 400 pixels. */ showBreadcrumb?: boolean; /** - * A boolean value indicating whether to show the map navigation control. Default: true This property can only be set when using the Map constructor. + * A boolean value indicating whether to show the map navigation control. Default: true�This property can only be set when using the Map constructor. */ showDashboard?: boolean; @@ -783,7 +797,7 @@ declare module Microsoft.Maps { /** The object that triggered the event. */ target: Map | IPrimitive; - /** The type of the object that the event is attached to. Valid values include the following: ‘map’, 'layer', ‘polygon’, ‘polyline’, or ‘pushpin’ */ + /** The type of the object that the event is attached to. Valid values include the following: �map�, 'layer', �polygon�, �polyline�, or �pushpin� */ targetType: string; /** @@ -1034,7 +1048,7 @@ declare module Microsoft.Maps { * When using a string, the uriConstructor will allow you to specify placeholders that will be replaced with the tiles value (i.e. {quadkey}). * See the Tile URL Parameters section for a list of supported parameters. * Besides using formatted tile URLs, you can also specify a callback function as the uriConstructor. This is useful if you need to be able to - * build custom tile URL’s that may require some additional calculations for a tile. + * build custom tile URL�s that may require some additional calculations for a tile. */ uriConstructor: string | ((tile: PyramidTileId) => string); } @@ -1109,7 +1123,7 @@ declare module Microsoft.Maps { export class AnimatedTileLayer { /** * @contstructor - * @param options Options that define how to animate between the specified tile layers. + * @param options Options that define how to animate between the specified tile layers. */ constructor(options?: IAnimatedTileLayerOptions); @@ -1351,7 +1365,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported events: * click, dblclick, maptypechanged, mousedown, mousemove, mouseout, mouseover, mouseup, mousewheel, rightclick, viewchange, viewchangeend, viewchangestart - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: Map, eventName: string, handler: (eventArg?: IMouseEventArgs | IMapTypeChangeEventArgs) => void): IHandlerId; @@ -1361,7 +1375,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * changed, click, dblclick, drag, dragend, dragstart, mousedown, mouseout, mouseover, mouseup - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: Pushpin, eventName: string, handler: (eventArg?: IMouseEventArgs | IPrimitiveChangedEventArgs) => void): IHandlerId; @@ -1371,7 +1385,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * changed, click, dblclick, mousedown, mouseout, mouseover, mouseup - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: Polyline | Polygon, eventName: string, handler: (eventArg?: IMouseEventArgs | IPrimitiveChangedEventArgs) => void): IHandlerId; @@ -1381,7 +1395,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * click, infoboxChanged, mouseenter, mouseleave - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: Infobox, eventName: string, handler: (eventArg?: IInfoboxEventArgs) => void): IHandlerId; @@ -1391,7 +1405,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * click, dblclick, mousedown, mouseout, mouseover, mouseup, rightclick - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: Layer, eventName: string, handler: (eventArg?: IMouseEventArgs) => void): IHandlerId; @@ -1400,9 +1414,9 @@ declare module Microsoft.Maps { * Attaches the handler for the event that is thrown by the target. Use the return object to remove the handler using the removeHandler method. * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: - * • entityadded - * • entityremoved - * @param handler The callback function to handle the event when triggered. + * � entityadded + * � entityremoved + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: EntityCollection, eventName: string, handler: (eventArg?: IEntityCollectionChangedEventArgs) => void): IHandlerId; @@ -1411,7 +1425,7 @@ declare module Microsoft.Maps { * Attaches the handler for the event that is thrown by the target. Use the return object to remove the handler using the removeHandler method. * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addHandler(target: any, eventName: string, handler: (eventArg?: any) => void): IHandlerId; @@ -1452,7 +1466,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * click, infoboxChanged, mouseenter, mouseleave - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. */ export function addOne(target: Infobox, eventName: string, handler: (eventArg?: IInfoboxEventArgs) => void): void; @@ -1469,8 +1483,8 @@ declare module Microsoft.Maps { * Attaches the handler for the event that is thrown by the target, but only triggers the handler the first once after being attached. * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: - * • entityadded - * • entityremoved + * � entityadded + * � entityremoved * @param handler The callback function to handle the event when triggered. */ export function addOne(target: EntityCollection, eventName: string, handler: (eventArg?: IEntityCollectionChangedEventArgs) => void): void; @@ -1525,7 +1539,7 @@ declare module Microsoft.Maps { * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: * click, infoboxChanged, mouseenter, mouseleave - * @param handler The callback function to handle the event when triggered. + * @param handler The callback function to handle the event when triggered. * @returns The handler id. */ export function addThrottledHandler(target: Infobox, eventName: string, handler: (eventArg?: IInfoboxEventArgs) => void): IHandlerId; @@ -1545,8 +1559,8 @@ declare module Microsoft.Maps { * Attaches the handler for the event that is thrown by the target, where the minimum interval between events (in milliseconds) is specified as a parameter. * @param target The object to attach the event to; Map, IPrimitive, Infobox, Layer, DrawingTools, DrawingManager, DirectionsManager, etc. * @param eventName The type of event to attach. Supported Events: - * • entityadded - * • entityremoved + * � entityadded + * � entityremoved * @param handler The callback function to handle the event when triggered. * @param throttleInterval throttle interval (in ms) * @returns The handler id. @@ -1569,7 +1583,7 @@ declare module Microsoft.Maps { /** * Checks if the target has any attached event handler. - * @param target The object to check if an event is attached to it. + * @param target The object to check if an event is attached to it. * @param eventName The name of the event to check to see is attached. * @returns A boolean indicating if the specified event type is attached to the object. */ @@ -1650,7 +1664,7 @@ declare module Microsoft.Maps { public getHtmlContent(): string; /** - * Gets the location on the map where the infobox’s anchor is attached. + * Gets the location on the map where the infobox�s anchor is attached. * @returns The location of the infobox. */ public getLocation(): Location; @@ -1783,7 +1797,7 @@ declare module Microsoft.Maps { /** * Gets an array of shapes that are in the layer. This can be used to iterate over the individual shapes. - * @returns An array of shapes that are in the layer. + * @returns An array of shapes that are in the layer. */ public getPrimitives(): IPrimitive[]; @@ -1871,7 +1885,7 @@ declare module Microsoft.Maps { public remove(layer: ILayer): void; /** - * Removes a layer from the map at the specified index in the collection. + * Removes a layer from the map at the specified index in the collection. * @param idx The index of the layer to remove. */ public removeAt(idx: number): void; @@ -2093,7 +2107,7 @@ declare module Microsoft.Maps { constructor(parentElement: string | HTMLElement, options: IMapLoadOptions); /** - * Gets the streetside panorama information closest to the specified bounding box and returns using a success callback function. + * Gets the streetside panorama information closest to the specified bounding box and returns using a success callback function. * This information can then be used to set the map view to that streetside panorama. */ public static getClosestPanorama(bounds: LocationRect, success: (panoramaInfo: IPanoramaInfo) => void, missingCoverage: () => void): void; @@ -2336,7 +2350,7 @@ declare module Microsoft.Maps { /** * Decodes a collection of locations from a compressed string. * @param value Compressed string to decode. - * @returns An array of locations that have been decoded from the compressed string. + * @returns An array of locations that have been decoded from the compressed string. */ public static decode(value: string): Location[]; @@ -2632,7 +2646,7 @@ declare module Microsoft.Maps { } /** - * Used to represent the location of a map tile in the quadkey tile pyramid system used by the map. + * Used to represent the location of a map tile in the quadkey tile pyramid system used by the map. * If using a tile source where the uriConstructor property is set to a callback function, that callback function will recieve * an instance of the PyramidTileId class. */ @@ -2674,7 +2688,7 @@ declare module Microsoft.Maps { public static areEqual(tileId1: PyramidTileId, tileId2: PyramidTileId): boolean; /** - * Generates a PyramidTileId from a quadkey tile id string. + * Generates a PyramidTileId from a quadkey tile id string. * @param quadkey The quadkey tile id string to convert into a PyramidTileId object. * @param width The tile's width in pixels. Default value: 256 * @param height The tile's height in pixels. Default value: 256 @@ -2685,7 +2699,7 @@ declare module Microsoft.Maps { /** Provides static functions for generating random test data. */ export class TestDataGenerator { /** - * Generates a random hex or rgba color string. + * Generates a random hex or rgba color string. * @param withAlpha A boolean indicating if the color should have an alpha value or not. if set to true, a rgba value will be returned with an alpha value of 0.5. * @returns A css color string, hex or rgba. */ diff --git a/types/bingmaps/tsconfig.json b/types/bingmaps/tsconfig.json index ecb179959d..421876221b 100644 --- a/types/bingmaps/tsconfig.json +++ b/types/bingmaps/tsconfig.json @@ -19,6 +19,19 @@ }, "files": [ "index.d.ts", + "Autosuggest.d.ts", + "Clustering.d.ts", + "Contour.d.ts", + "DataBinning.d.ts", + "Directions.d.ts", + "DrawingTools.d.ts", + "GeoJson.d.ts", + "HeatMapLayer.d.ts", + "Search.d.ts", + "SpatialDataService.d.ts", + "SpatialMath.d.ts", + "Traffic.d.ts", + "WellKnownText.d.ts", "bingmaps-tests.ts" ] } \ No newline at end of file diff --git a/types/bingmaps/tslint.json b/types/bingmaps/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bingmaps/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bintrees/tslint.json b/types/bintrees/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bintrees/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bip21/tslint.json b/types/bip21/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bip21/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bip38/bip38-tests.ts b/types/bip38/bip38-tests.ts new file mode 100644 index 0000000000..c48fc9597b --- /dev/null +++ b/types/bip38/bip38-tests.ts @@ -0,0 +1,30 @@ +import * as bip38 from 'bip38'; + +const myWifString = '5KN7MzqK5wt2TP1fQCYyHBtDrXdJuXbUzm4A9rKAteGu3Qi5CVR'; + +// Result from wif.decode for testing +const decoded = { + version: 48, + privateKey: Buffer.from('12345678901234567890123456789012'), + compressed: true +}; + +// Test encrypt without progressCallback +const encryptedKey = bip38.encrypt(decoded.privateKey, decoded.compressed, 'TestingOneTwoThree'); + +// Test encrypt with progressCallback +bip38.encrypt(decoded.privateKey, decoded.compressed, 'TestingOneTwoThree', (status: bip38.ProgressStatus) => { + status.current; + status.total; + status.percent; +}); + +// Test decrypt without progressCallback +const decryptedKey = bip38.decrypt(encryptedKey, 'TestingOneTwoThree'); + +// Test decrypt with progressCallback +bip38.decrypt(encryptedKey, 'TestingOneTwoThree', (status: bip38.ProgressStatus) => { + status.current; + status.total; + status.percent; +}); diff --git a/types/bip38/index.d.ts b/types/bip38/index.d.ts new file mode 100644 index 0000000000..8842c6a241 --- /dev/null +++ b/types/bip38/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for bip38 2.0 +// Project: https://github.com/bitcoinjs/bip38 +// Definitions by: Satana Charuwichitratana +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +// Note: When there is @types/scryptsy, ProgressStatus and ScryptParams should be referred from the definition instead +export interface ProgressStatus { + current: number; + total: number; + percent: number; +} +export interface ScryptParams { + N: number; + r: number; + p: number; +} + +export function decrypt(string: string, passphrase: string, + progressCallback?: (status: ProgressStatus) => void, + scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean }; + +export function decryptECMult(buffer: Buffer, passphrase: string, + progressCallback?: (status: ProgressStatus) => void, + scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean }; + +export function decryptRaw(buffer: Buffer, passphrase: string, + progressCallback?: (status: ProgressStatus) => void, + scryptParams?: ScryptParams): { privateKey: Buffer, compressed: boolean }; + +export function encrypt(buffer: Buffer, compressed: boolean, passphrase: string, + progressCallback?: (status: ProgressStatus) => void, + scryptParams?: ScryptParams): string; + +export function encryptRaw(buffer: Buffer, compressed: boolean, passphrase: string, + progressCallback?: (status: ProgressStatus) => void, + scryptParams?: ScryptParams): Buffer; + +export function verify(string: string): boolean; diff --git a/types/bip38/tsconfig.json b/types/bip38/tsconfig.json new file mode 100644 index 0000000000..6ce875b1d1 --- /dev/null +++ b/types/bip38/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", + "bip38-tests.ts" + ] +} diff --git a/types/bip38/tslint.json b/types/bip38/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/bip38/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/bip39/bip39-tests.ts b/types/bip39/bip39-tests.ts new file mode 100644 index 0000000000..1ec9611bb8 --- /dev/null +++ b/types/bip39/bip39-tests.ts @@ -0,0 +1,14 @@ +import * as bip39 from 'bip39'; + +// Test generate a random mnemonic +const mnemonic: string = bip39.generateMnemonic(); + +// Test generate a random mnemonic with strength +bip39.generateMnemonic(64); + +// Test mnemonic to seed +const seedHex: string = bip39.mnemonicToSeedHex('basket actual'); +const seed: Buffer = bip39.mnemonicToSeed('basket actual'); + +// Test validation +bip39.validateMnemonic(mnemonic); diff --git a/types/bip39/index.d.ts b/types/bip39/index.d.ts new file mode 100644 index 0000000000..a5d58cf961 --- /dev/null +++ b/types/bip39/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for bip39 2.4 +// Project: https://github.com/bitcoinjs/bip39 +// Definitions by: Satana Charuwichitratana +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export const wordlists: { + EN: string[]; + JA: string[]; + chinese_simplified: string[]; + chinese_traditional: string[]; + english: string[]; + french: string[]; + italian: string[]; + japanese: string[]; + spanish: string[]; +}; + +export function entropyToMnemonic(entropyHex: string, wordlist?: string[]): string; + +export function generateMnemonic(strength?: number, rng?: (size: number) => Buffer, wordlist?: string[]): string; + +export function mnemonicToEntropy(mnemonic: string, wordlist?: string[]): string; + +export function mnemonicToSeed(mnemonic: string, password?: string): Buffer; + +export function mnemonicToSeedHex(mnemonic: string, password?: string): string; + +export function validateMnemonic(mnemonic: string, wordlist?: string[]): boolean; diff --git a/types/bip39/tsconfig.json b/types/bip39/tsconfig.json new file mode 100644 index 0000000000..d44c1197ad --- /dev/null +++ b/types/bip39/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", + "bip39-tests.ts" + ] +} diff --git a/types/bip39/tslint.json b/types/bip39/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/bip39/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/bit-array/tslint.json b/types/bit-array/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bit-array/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index 868659e6b6..669c00d77a 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -1,62 +1,43 @@ import bigi = require('bigi'); import bitcoin = require('bitcoinjs-lib'); -declare const it: any; -declare const describe: any; -declare const assert: any; +// For testing only +function rng() { + return new Buffer('12345678901234567890123456789012'); +} -describe('bitcoinjs-lib (basic)', () => { - it('can generate a random bitcoin address', () => { - // for testing only - function rng() { return new Buffer('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'); } +// Generate a random bitcoin address +const keyPair1 = bitcoin.ECPair.makeRandom({rng}); +const address = keyPair1.getAddress(); +keyPair1.toWIF(); - // generate random keyPair - const keyPair = bitcoin.ECPair.makeRandom({ rng }); - const address = keyPair.getAddress(); +// Generate an address from a SHA256 hash +const hash = bitcoin.crypto.sha256(Buffer.from('correct horse battery staple', 'utf8')); +const d = bigi.fromBuffer(hash); +const keyPair2 = new bitcoin.ECPair(d); - assert.strictEqual(address, '1F5VhMHukdnUES9kfXqzPzMeF1GPHKiF64'); - }); +// Generate a random keypair for alternative networks +const keyPair3 = bitcoin.ECPair.makeRandom({network: bitcoin.networks.litecoin, rng}); +keyPair3.toWIF(); +keyPair3.getAddress(); +const network = keyPair3.getNetwork(); - it('can generate an address from a SHA256 hash', () => { - const hash = bitcoin.crypto.sha256(Buffer.from('correct horse battery staple', 'utf8')); - const d = bigi.fromBuffer(hash); +// Test TransactionBuilder and Transaction +const txb = new bitcoin.TransactionBuilder(); +txb.addInput('aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31', 0); +txb.addOutput(Buffer.from('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 'utf8'), 15000); +txb.sign(0, keyPair1); +const tx = txb.build(); +tx.toHex(); +tx.hasWitnesses(); +tx.hashForWitnessV0(1, new Buffer('12345678901234567890123456789012'), 2, 3); - const keyPair = new bitcoin.ECPair(d); - const address = keyPair.getAddress(); - - assert.strictEqual(address, '1C7zdTfnkzmr13HfA2vNm5SJYRK6nEKyq8'); - }); - - it('can generate a random keypair for alternative networks', () => { - // for testing only - function rng() { return new Buffer('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'); } - - const litecoin = bitcoin.networks.litecoin; - - const keyPair = bitcoin.ECPair.makeRandom({ network: litecoin, rng }); - const wif = keyPair.toWIF(); - const address = keyPair.getAddress(); - - assert.strictEqual(address, 'LZJSxZbjqJ2XVEquqfqHg1RQTDdfST5PTn'); - assert.strictEqual(wif, 'T7A4PUSgTDHecBxW1ZiYFrDNRih2o7M8Gf9xpoCgudPF9gDiNvuS'); - }); - - it('can import an address via WIF', () => { - const keyPair = bitcoin.ECPair.fromWIF('Kxr9tQED9H44gCmp6HAdmemAzU3n84H3dGkuWTKvE23JgHMW8gct', bitcoin.networks.testnet); - const address = keyPair.getAddress(); - - assert.strictEqual(address, '19AAjaTUbRjQCMuVczepkoPswiZRhjtg31'); - }); - - it('can create a Transaction', () => { - const keyPair = bitcoin.ECPair.fromWIF('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy', bitcoin.networks.testnet); - const tx = new bitcoin.TransactionBuilder(); - - tx.addInput('aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31', 0); - tx.addOutput(Buffer.from('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 'utf8'), 15000); - tx.sign(0, keyPair); - - // tslint:disable-next-line:max-line-length - assert.strictEqual(tx.build().toHex(), '0100000001313eb630b128102b60241ca895f1d0ffca2170d5a0990e094f2182c102ab94aa000000006b483045022100aefbcf847900b01dd3e3debe054d3b6d03d715d50aea8525f5ea3396f168a1fb022013d181d05b15b90111808b22ef4f9ebe701caf2ab48db269691fdf4e9048f4f60121029f50f51d63b345039a290c94bffd3180c99ed659ff6ea6b1242bca47eb93b59fffffffff01983a0000000000001976a914ad618cf4333b3b248f9744e8e81db2964d0ae39788ac00000000'); - }); -}); +// Test functions in address +const rsBase58Check = bitcoin.address.fromBase58Check(address); +const rsBech32 = bitcoin.address.fromBech32(address); +const rsOutputScript = bitcoin.address.fromOutputScript(new Buffer('12345678901234567890123456789012')); +const rsOutputScriptWithNetwork = bitcoin.address.fromOutputScript(new Buffer('12345678901234567890123456789012'), network); +bitcoin.address.toBase58Check(rsBase58Check.hash, rsBase58Check.version); +bitcoin.address.toBech32(rsBech32.data, rsBech32.version, rsBech32.prefix); +bitcoin.address.toOutputScript(address); +bitcoin.address.toOutputScript(address, network); diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 796758715d..c7d1acc899 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -1,21 +1,24 @@ -// Type definitions for bitcoinjs-lib 3.0 +// Type definitions for bitcoinjs-lib 3.3 // Project: https://github.com/bitcoinjs/bitcoinjs-lib // Definitions by: Mohamed Hegazy // Daniel // Ron Buckton +// Satana Charuwichitratana +// Youssef GHOUBACH // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Declaration file initially generated by dts-gen for bitcoinjs-lib 3.0.3 // based on the flow version found at https://github.com/flowtype/flow-typed/blob/master/definitions/npm/bitcoinjs-lib_v2.x.x/flow_v0.17.x-/bitcoinjs-lib_v2.x.x.js /// -import BigInteger = require("bigi"); -export interface Output { +import BigInteger = require('bigi'); + +export interface Out { script: Buffer; value: number; } -export interface Input { +export interface In { script: Buffer; hash: Buffer; index: number; @@ -62,10 +65,12 @@ export class Block { } export class ECPair { - constructor(d: BigInteger, Q?: null | undefined, options?: { compressed?: boolean, network?: Network }); + constructor(d: BigInteger, Q?: null, options?: { compressed?: boolean, network?: Network }); constructor(d: null | undefined, Q: any, options?: { compressed?: boolean, network?: Network }); // Q should be ECPoint, but not sure how to define such type + d: BigInteger; + getAddress(): string; getNetwork(): Network; @@ -150,8 +155,8 @@ export class HDNode { export class Transaction { version: number; locktime: number; - ins: Input[]; - outs: Output[]; + ins: In[]; + outs: Out[]; constructor(); addInput(hash: Buffer, index: number, sequence?: number, scriptSig?: Buffer): number; @@ -166,22 +171,32 @@ export class Transaction { getId(): string; + /** @since 3.0.0 */ hasWitnesses(): boolean; hashForSignature(inIndex: number, prevOutScript: Buffer, hashType: number): Buffer; + /** @since 3.0.0 */ hashForWitnessV0(inIndex: number, prevOutScript: Buffer, value: number, hashType: number): Buffer; isCoinbase(): boolean; setInputScript(index: number, scriptSig: Buffer): void; + /** @since 3.0.0 */ setWitness(index: number, witness: any, ...args: any[]): void; + /** @since 3.0.0 */ toBuffer(buffer?: Buffer, initialOffset?: number): Buffer; toHex(): string; + /** @since 3.1.0 */ + virtualSize(): number; + + /** @since 3.1.0 */ + weight(): number; + static ADVANCED_TRANSACTION_FLAG: number; static ADVANCED_TRANSACTION_MARKER: number; @@ -203,21 +218,25 @@ export class Transaction { static isCoinbaseHash(buffer: Buffer): boolean; } +export interface Input { + pubKeys: Buffer[]; + signatures: Buffer[]; + prevOutScript: Buffer; + prevOutType: string; + signType: string; + signScript: Buffer; + witness: boolean; +} + export class TransactionBuilder { tx: Transaction; - inputs: Array<{ pubKeys: Buffer[], - signatures: Buffer[], - prevOutScript: Buffer, - prevOutType: string, - signType: string, - signScript: Buffer, - witness: boolean} >; + inputs: Input[]; constructor(network?: Network, maximumFeeRate?: number); addInput(txhash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number; - addOutput(scriptPubKey: Buffer, value: number): number; + addOutput(scriptPubKey: Buffer | string, value: number): number; build(): Transaction; @@ -227,6 +246,7 @@ export class TransactionBuilder { setVersion(version: number): void; + /** @since 3.0.0 */ sign(vin: number, keyPair: ECPair, redeemScript?: Buffer, hashType?: number, witnessValue?: number, witnessScript?: Buffer): void; static fromTransaction(transaction: Transaction, network: Network): TransactionBuilder; @@ -361,10 +381,16 @@ export const opcodes: { export namespace address { function fromBase58Check(address: string): { hash: Buffer, version: number }; - function fromOutputScript(outputScript: Buffer, network?: Network): Buffer; + /** @since 3.2.0 */ + function fromBech32(address: string): { data: Buffer, prefix: string, version: number }; + + function fromOutputScript(outputScript: Buffer, network?: Network): string; function toBase58Check(hash: Buffer, version: number): string; + /** @since 3.2.0 */ + function toBech32(data: Buffer, version: number, prefix: string): string; + function toOutputScript(address: string, network?: Network): Buffer; } @@ -535,7 +561,7 @@ export namespace script { output: { check(script: Buffer): boolean; decode(buffer: Buffer): Buffer; - encode(data: Buffer[]): Buffer; + encode(data: Buffer): Buffer; }; }; } diff --git a/types/bitcoinjs-lib/tslint.json b/types/bitcoinjs-lib/tslint.json index 3db14f85ea..f93cf8562a 100644 --- a/types/bitcoinjs-lib/tslint.json +++ b/types/bitcoinjs-lib/tslint.json @@ -1 +1,3 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json" +} diff --git a/types/bitwise-xor/tslint.json b/types/bitwise-xor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bitwise-xor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bl/tslint.json b/types/bl/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bl/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blazy/tslint.json b/types/blazy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blazy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blessed/blessed-tests.ts b/types/blessed/blessed-tests.ts index b143703b18..c5f857146f 100644 --- a/types/blessed/blessed-tests.ts +++ b/types/blessed/blessed-tests.ts @@ -1,150 +1,138 @@ -import * as blessed from 'blessed' +import * as blessed from "blessed"; +import { readFileSync } from "fs"; let screen: blessed.Widgets.Screen = null; // https://github.com/chjj/blessed/blob/master/test/widget-autopad.js screen = blessed.screen({ - dump: __dirname + '/logs/autopad.log', + dump: __dirname + "/logs/autopad.log", smartCSR: true, autoPadding: true, warnings: true }); -var box1 = blessed.box({ +const box1 = blessed.box({ parent: screen, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line' + border: "line" }); -var box2 = blessed.box({ +const box2 = blessed.box({ parent: box1, top: 0, left: 0, width: 10, height: 5, - border: 'line' + border: "line" }); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-bigtext.js screen = blessed.screen({ - dump: __dirname + '/logs/bigtext.log', + dump: __dirname + "/logs/bigtext.log", smartCSR: true, warnings: true }); -var box = blessed.bigtext({ +const box3 = blessed.bigtext({ parent: screen, - content: 'Hello', + content: "Hello", shrink: true, - width: '80%', + width: "80%", // height: '80%', - height: 'shrink', + height: "shrink", // width: 'shrink', - border: 'line', - fch: ' ', - ch: '\u2592', + border: "line", + fch: " ", + ch: "\u2592", style: { - fg: 'red', - bg: 'blue', + fg: "red", + bg: "blue", bold: false } }); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-csr.js screen = blessed.screen({ - dump: __dirname + '/logs/csr.log', + dump: __dirname + "/logs/csr.log", smartCSR: true, warnings: true }); +const lorem = readFileSync(__dirname + "/git.diff", "utf8"); -var lorem = require('fs').readFileSync(__dirname + '/git.diff', 'utf8'); - -var cleanSides = screen.cleanSides; +const cleanSides = screen.cleanSides; function expectClean(value: any) { - screen.cleanSides = function(el: blessed.widget.Element) { - var ret = cleanSides.apply(this, arguments); + screen.cleanSides = function(el: blessed.Widgets.BlessedElement) { + const ret = cleanSides.apply(this, arguments); if (ret !== value) { - throw new Error('Failed. Expected ' - + value + ' from cleanSides. Got ' - + ret + '.'); + throw new Error(`Failed. Expected ${value} from cleanSides. Got ${ret}.`); } return ret; }; } -var btext = blessed.box({ +const btext = blessed.box({ parent: screen, - left: 'center', - top: 'center', - width: '80%', - height: '80%', + left: "center", + top: "center", + width: "80%", + height: "80%", style: { - bg: 'green' + bg: "green" }, - border: 'line', - content: 'CSR should still work.' + border: "line", + content: "CSR should still work." }); -let _oscroll = btext.scroll; -btext.scroll = function(offset, always) { +btext.scroll = (offset, always) => { expectClean(true); - return _oscroll(offset, always); }; -var text = blessed.scrollabletext({ +const text = blessed.scrollabletext({ parent: screen, content: lorem, - border: 'line', - left: 'center', - top: 'center', + border: "line", + left: "center", + top: "center", draggable: true, - width: '50%', - height: '50%', + width: "50%", + height: "50%", mouse: true, keys: true, vi: true }); -_oscroll = text.scroll; text.scroll = function(offset, always) { - var el = this; - var value = true; + const el = this; + let value = true; if (el.left < 0) value = true; if (el.top < 0) value = false; if (el.left + el.width > screen.width) value = true; if (el.top + el.height > screen.height) value = false; expectClean(value); - return _oscroll(offset, always); }; text.focus(); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-dock-noborder.js screen = blessed.screen({ - dump: __dirname + '/logs/dock.log', + dump: __dirname + "/logs/dock.log", smartCSR: true, dockBorders: true, warnings: true @@ -154,85 +142,85 @@ blessed.box({ parent: screen, left: -1, top: -1, - width: '50%+1', - height: '50%+1', - border: 'line', - content: 'Foo' + width: "50%+1", + height: "50%+1", + border: "line", + content: "Foo" }); blessed.box({ parent: screen, - left: '50%-1', + left: "50%-1", top: -1, - width: '50%+3', - height: '50%+1', - content: 'Bar', - border: 'line' + width: "50%+3", + height: "50%+1", + content: "Bar", + border: "line" }); blessed.box({ parent: screen, left: -1, - top: '50%-1', - width: '50%+1', - height: '50%+3', - border: 'line', - content: 'Foo' + top: "50%-1", + width: "50%+1", + height: "50%+3", + border: "line", + content: "Foo" }); -blessed.listtable({ - parent: screen, - left: '50%-1', - top: '50%-1', - width: '50%+3', - height: '50%+3', - border: 'line', - align: 'center', - tags: true, - keys: true, - vi: true, - mouse: true, - style: { - header: { - fg: 'blue', - bold: true - }, - cell: { - fg: 'magenta', - selected: { - bg: 'blue' +blessed + .listtable({ + parent: screen, + left: "50%-1", + top: "50%-1", + width: "50%+3", + height: "50%+3", + border: "line", + align: "center", + tags: true, + keys: true, + vi: true, + mouse: true, + style: { + header: { + fg: "blue", + bold: true + }, + cell: { + fg: "magenta", + selected: { + bg: "blue" + } } - } - }, - data: [ - [ 'Animals', 'Foods', 'Times', 'Numbers' ], - [ 'Elephant', 'Apple', '1:00am', 'One' ], - [ 'Bird', 'Orange', '2:15pm', 'Two' ], - [ 'T-Rex', 'Taco', '8:45am', 'Three' ], - [ 'Mouse', 'Cheese', '9:05am', 'Four' ] - ] -}).focus(); + }, + data: [ + ["Animals", "Foods", "Times", "Numbers"], + ["Elephant", "Apple", "1:00am", "One"], + ["Bird", "Orange", "2:15pm", "Two"], + ["T-Rex", "Taco", "8:45am", "Three"], + ["Mouse", "Cheese", "9:05am", "Four"] + ] + }) + .focus(); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://raw.githubusercontent.com/chjj/blessed/master/example/simple-form.js -var form = blessed.form({ +const form = blessed.form({ parent: screen, keys: true, left: 0, top: 0, width: 30, height: 4, - bg: 'green', - content: 'Submit or cancel?' + bg: "green", + content: "Submit or cancel?" }); -var submit = blessed.button({ +const submit = blessed.button({ parent: form, mouse: true, keys: true, @@ -243,20 +231,20 @@ var submit = blessed.button({ left: 10, top: 2, shrink: true, - name: 'submit', - content: 'submit', + name: "submit", + content: "submit", style: { - bg: 'blue', + bg: "blue", focus: { - bg: 'red' + bg: "red" }, hover: { - bg: 'red' + bg: "red" } } }); -var cancel = blessed.button({ +const cancel = blessed.button({ parent: form, mouse: true, keys: true, @@ -267,15 +255,15 @@ var cancel = blessed.button({ left: 20, top: 2, shrink: true, - name: 'cancel', - content: 'cancel', + name: "cancel", + content: "cancel", style: { - bg: 'blue', + bg: "blue", focus: { - bg: 'red' + bg: "red" }, hover: { - bg: 'red' + bg: "red" } } }); @@ -283,314 +271,306 @@ var cancel = blessed.button({ // https://github.com/chjj/blessed/blob/master/test/widget-layout.js screen = blessed.screen({ - dump: __dirname + '/logs/layout.log', + dump: __dirname + "/logs/layout.log", smartCSR: true, autoPadding: true, warnings: true }); -var layout = blessed.layout({ +const layout = blessed.layout({ parent: screen, - top: 'center', - left: 'center', - width: '50%', - height: '50%', - border: 'line', - layout: process.argv[2] === 'grid' ? 'grid' : 'inline', + top: "center", + left: "center", + width: "50%", + height: "50%", + border: "line", + layout: process.argv[2] === "grid" ? "grid" : "inline", style: { - bg: 'red', + bg: "red", border: { - fg: 'blue' + fg: "blue" } } }); -var box1 = blessed.box({ +blessed.box({ parent: layout, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line', - content: '1' + border: "line", + content: "1" }); -var box2 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '2' + border: "line", + content: "2" }); -var box3 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '3' + border: "line", + content: "3" }); -var box4 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '4' + border: "line", + content: "4" }); -var box5 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '5' + border: "line", + content: "5" }); -var box6 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '6' + border: "line", + content: "6" }); -var box7 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '7' + border: "line", + content: "7" }); -var box8 = blessed.box({ +blessed.box({ parent: layout, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line', - content: '8' + border: "line", + content: "8" }); -var box9 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '9' + border: "line", + content: "9" }); -var box10 = blessed.box({ +blessed.box({ parent: layout, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line', - content: '10' + border: "line", + content: "10" }); -var box11 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '11' + border: "line", + content: "11" }); -var box12 = blessed.box({ +const box12 = blessed.box({ parent: layout, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line', - content: '12' + border: "line", + content: "12" }); -if (process.argv[2] !== 'grid') { - for (var i = 0; i < 10; i++) { +if (process.argv[2] !== "grid") { + for (let i = 0; i < 10; i++) { blessed.box({ parent: layout, // width: i % 2 === 0 ? 10 : 20, // height: i % 2 === 0 ? 5 : 10, width: Math.random() > 0.5 ? 10 : 20, height: Math.random() > 0.5 ? 5 : 10, - border: 'line', - content: (i + 1 + 12) + '' + border: "line", + content: String(i + 1 + 12) }); } } -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-form.js screen = blessed.screen({ - dump: __dirname + '/logs/form.log', + dump: __dirname + "/logs/form.log", warnings: true }); -type FormData = { - radio1: boolean; - radio2: boolean; - text: string; - check: boolean; -}; +interface FormData { + radio1: boolean; + radio2: boolean; + text: string; + check: boolean; +} -var form2 = blessed.form({ +const form2 = blessed.form({ parent: screen, mouse: true, keys: true, vi: true, left: 0, top: 0, - width: '100%', - //height: 12, + width: "100%", style: { - bg: 'green', + bg: "green", border: { - inverse: true + inverse: true }, scrollbar: { inverse: true } }, - content: 'foobar', + content: "foobar", scrollable: true, scrollbar: { - ch: ' ' + ch: " " } - //alwaysScroll: true }); -form2.on('submit', (data) => { +form2.on("submit", data => { output.setContent(JSON.stringify(data, null, 2)); screen.render(); }); -form2.key('d', function() { +form2.key("d", () => { form2.scroll(1, true); screen.render(); }); -form2.key('u', function() { +form2.key("u", () => { form2.scroll(-1, true); screen.render(); }); -var set = blessed.radioset({ +const set = blessed.radioset({ parent: form2, left: 1, top: 1, shrink: true, - //padding: 1, - //content: 'f', style: { - bg: 'magenta' + bg: "magenta" } }); -var radio1 = blessed.radiobutton({ +const radio1 = blessed.radiobutton({ parent: set, mouse: true, keys: true, shrink: true, style: { - bg: 'magenta' + bg: "magenta" }, height: 1, left: 0, top: 0, - name: 'radio1', - content: 'radio1' + name: "radio1", + content: "radio1" }); -var radio2 = blessed.radiobutton({ +const radio2 = blessed.radiobutton({ parent: set, mouse: true, keys: true, shrink: true, style: { - bg: 'magenta' + bg: "magenta" }, height: 1, left: 15, top: 0, - name: 'radio2', - content: 'radio2' + name: "radio2", + content: "radio2" }); -var text2 = blessed.textbox({ +const text2 = blessed.textbox({ parent: form2, mouse: true, keys: true, style: { - bg: 'blue' + bg: "blue" }, height: 1, width: 20, left: 1, top: 3, - name: 'text' + name: "text" }); -text2.on('focus', function() { - text2.readInput(); -}); +text2.on("focus", () => text2.readInput()); -var check = blessed.checkbox({ +const check = blessed.checkbox({ parent: form2, mouse: true, keys: true, shrink: true, style: { - bg: 'magenta' + bg: "magenta" }, height: 1, left: 28, top: 1, - name: 'check', - content: 'check' + name: "check", + content: "check" }); -var check2 = blessed.checkbox({ +const check2 = blessed.checkbox({ parent: form2, mouse: true, keys: true, shrink: true, style: { - bg: 'magenta' + bg: "magenta" }, height: 1, left: 28, top: 14, - name: 'foooooooo2', - content: 'foooooooo2' + name: "foooooooo2", + content: "foooooooo2" }); -var submit = blessed.button({ +const submit2 = blessed.button({ parent: form2, mouse: true, keys: true, @@ -601,69 +581,67 @@ var submit = blessed.button({ }, left: 29, top: 3, - name: 'submit', - content: 'submit', + name: "submit", + content: "submit", style: { - bg: 'blue', + bg: "blue", focus: { - bg: 'red' + bg: "red" } } }); -submit.on('press', function() { - form2.submit(); -}); +submit.on("press", () => form2.submit()); -var box1 = blessed.box({ +const box5 = blessed.box({ parent: form2, left: 1, top: 10, height: 10, width: 10, - content: 'one', + content: "one", style: { - bg: 'cyan' + bg: "cyan" } }); -var box2 = blessed.box({ - parent: box1, +const box6 = blessed.box({ + parent: box5, left: 1, top: 2, height: 8, width: 9, - content: 'two', + content: "two", style: { - bg: 'magenta' + bg: "magenta" } }); -var box3 = blessed.box({ - parent: box2, +const box7 = blessed.box({ + parent: box6, left: 1, top: 2, height: 6, width: 8, - content: 'three', + content: "three", style: { - bg: 'yellow' + bg: "yellow" } }); -var box4 = blessed.box({ - parent: box3, +blessed.box({ + parent: box7, left: 1, top: 2, height: 4, width: 7, - content: 'four', + content: "four", style: { - bg: 'blue' + bg: "blue" } }); -var output = blessed.scrollabletext({ +const output = blessed.scrollabletext({ parent: form2, mouse: true, keys: true, @@ -672,26 +650,24 @@ var output = blessed.scrollabletext({ height: 5, right: 0, style: { - bg: 'red' + bg: "red" }, - content: 'foobar' + content: "foobar" }); -var bottom = blessed.line({ +const bottom = blessed.line({ parent: form2, - type: 'line', - orientation: 'horizontal', + type: "line", + orientation: "horizontal", left: 0, right: 0, top: 50, style: { - fg: 'blue' + fg: "blue" } }); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); form2.focus(); @@ -702,70 +678,68 @@ screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-table.js screen = blessed.screen({ - dump: __dirname + '/logs/table.log', + dump: __dirname + "/logs/table.log", autoPadding: false, fullUnicode: true, warnings: true }); -var DU = '杜'; -var JUAN = '鹃'; +const DU = "杜"; +const JUAN = "鹃"; -var table = blessed.table({ - //parent: screen, - top: 'center', - left: 'center', +const table = blessed.table({ + // parent: screen, + top: "center", + left: "center", data: null, - border: 'line', - align: 'center', + border: "line", + align: "center", tags: true, - //width: '80%', - width: 'shrink', + // width: '80%', + width: "shrink", style: { border: { - fg: 'red' + fg: "red" }, header: { - fg: 'blue', + fg: "blue", bold: true }, cell: { - fg: 'magenta' + fg: "magenta" } } }); -var data1 = [ - [ 'Animals', 'Foods', 'Times' ], - [ 'Elephant', 'Apple', '1:00am' ], - [ 'Bird', 'Orange', '2:15pm' ], - [ 'T-Rex', 'Taco', '8:45am' ], - [ 'Mouse', 'Cheese', '9:05am' ] +const data1 = [ + ["Animals", "Foods", "Times"], + ["Elephant", "Apple", "1:00am"], + ["Bird", "Orange", "2:15pm"], + ["T-Rex", "Taco", "8:45am"], + ["Mouse", "Cheese", "9:05am"] ]; -data1[1][0] = '{red-fg}' + data1[1][0] + '{/red-fg}'; -data1[2][0] += ' (' + DU + JUAN + ')'; +data1[1][0] = `{red-fg} ${data1[1][0]} {/red-fg}`; +data1[2][0] += ` (${DU}${JUAN})`; -var data2 = [ - [ 'Animals', 'Foods', 'Times', 'Numbers' ], - [ 'Elephant', 'Apple', '1:00am', 'One' ], - [ 'Bird', 'Orange', '2:15pm', 'Two' ], - [ 'T-Rex', 'Taco', '8:45am', 'Three' ], - [ 'Mouse', 'Cheese', '9:05am', 'Four' ] +const data2 = [ + ["Animals", "Foods", "Times", "Numbers"], + ["Elephant", "Apple", "1:00am", "One"], + ["Bird", "Orange", "2:15pm", "Two"], + ["T-Rex", "Taco", "8:45am", "Three"], + ["Mouse", "Cheese", "9:05am", "Four"] ]; -data2[1][0] = '{red-fg}' + data2[1][0] + '{/red-fg}'; -data2[2][0] += ' (' + DU + JUAN + ')'; +data2[1][0] = `{red-fg} ${data2[1][0]} {/red-fg}`; +data2[2][0] += ` (${DU}${JUAN})`; -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); table.setData(data2); screen.append(table); screen.render(); -setTimeout(function() { +setTimeout(() => { table.setData(data1); screen.render(); }, 3000); diff --git a/types/blessed/index.d.ts b/types/blessed/index.d.ts index abbc31d295..9098648240 100644 --- a/types/blessed/index.d.ts +++ b/types/blessed/index.d.ts @@ -1,2836 +1,3033 @@ -// Type definitions for blessed 0.1.5 +// Type definitions for blessed 0.1 // Project: https://github.com/chjj/blessed -// Definitions by: bryn austin bellomy +// Definitions by: Bryn Austin Bellomy , Steve Kellock // Definitions: https://github.com/borisyankov/DefinitelyTyped +// TypeScript Version: 2.1 -/// +/// -import { EventEmitter } from 'events'; +import { EventEmitter } from "events"; import * as stream from "stream"; import * as child_process from "child_process"; -declare namespace Blessed { - export class BlessedProgram { - hideCursor: () => void; - move: any; - showCursor: any; - } +export class BlessedProgram { + hideCursor: () => void; + move: any; + showCursor: any; +} - export module Widgets { +export namespace Widgets { + namespace Types { + type TTopLeft = string | number | "center"; - export module Types { + type TPosition = string | number; - export type TTopLeft = string | number | "center"; + type TMouseAction = "mousedown" | "mouseup" | "mousemove"; - export type TPosition = string | number; - - export type TMouseAction = "mousedown" | "mouseup" | "mousemove"; - - export type TStyle = { - type?: string; - bg?: string; - fg?: string; - ch?: string; - bold?: boolean; - underline?: boolean; - blink?: boolean; - inverse?: boolean; - invisible?: boolean; - transparent?: boolean; - border?: "line" | "bg" | TBorder; - hover?: boolean; - focus?: boolean; - label?: string; - track?: {bg?: string; fg?: string;}; - scrollbar?: {bg?: string; fg?: string;}; - } - - export type TBorder = { - /** - * Type of border (line or bg). bg by default. - */ - type?: "line" | "bg"; - /** - * Character to use if bg type, default is space. - */ - ch?: string; - /** - * Border foreground and background, must be numbers (-1 for default). - */ - bg?: number; - fg?: number; - /** - * Border attributes. - */ - bold?: string; - underline?: string; - } - - export type TCursor = { - /** - * Have blessed draw a custom cursor and hide the terminal cursor (experimental). - */ - artificial: boolean; - /** - * Shape of the cursor. Can be: block, underline, or line. - */ - shape: boolean; - /** - * Whether the cursor blinks. - */ - blink: boolean; - /** - * Color of the color. Accepts any valid color value (null is default). - */ - color: string; - } - - export type TAlign = "left" | "center" | "right"; - - export type ListbarCommand = { - key: string; - callback: () => void; - }; - - export type TImage = { - /** - * Pixel width. - */ - width: number; - /** - * Pixel height. - */ - height: number; - /** - * Image bitmap. - * */ - bmp: any; - /** - * Image cellmap (bitmap scaled down to cell size). - */ - cellmap: any; - }; - - export type Cursor = { - /** - * Have blessed draw a custom cursor and hide the terminal cursor (experimental). - */ - artificial: boolean; - /** - * Shape of the cursor. Can be: block, underline, or line. - */ - shape: boolean; - /** - * Whether the cursor blinks. - */ - blink: boolean; - /** - * Color of the color. Accepts any valid color value (null is default). - */ - color: string; - } - } - - export module Events { - - export interface IMouseEventArg { - x: number; - y: number; - action: Types.TMouseAction; - } - - export interface IKeyEventArg { - full: string; - name: string; - shift: boolean; - ctrl: boolean; - meta: boolean; - sequence: string; - } - } - - export interface NodeChildProcessExecOptions { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - } - - export interface IDestroyable { - destroy(): void; - } - - export interface IOptions { - } - - export interface IHasOptions { - options: T; - } - - export interface TputsOptions extends IOptions { - terminal?: string; - extended?: boolean; - debug?: boolean; - termcap?: string; - terminfoFile?: string; - terminfoPrefix?: string; - termcapFile?: string; - } - - export class Tput implements IHasOptions { - constructor(opts: TputsOptions); - - // ** properties ** // - - /** - * Original options object. - */ - options: TputsOptions; - - debug: boolean; - padding: boolean; - extended: boolean; - printf: boolean; - termcap: string; - terminfoPrefix: string; - terminfoFile: string; - termcapFile: string; - error: Error; - terminal: string; - - setup(): void; - term(is: any): boolean; - readTerminfo(term: string): string; - parseTerminfo(data: any, file: string): { - header: { - dataSize: number; - headerSize: number; - magicNumber: boolean; - namesSize: number; - boolCount: number; - numCount: number; - strCount: number; - strTableSize: number; - extended: { - dataSize: number; - headerSize: number; - boolCount: number; - numCount: number; - strCount: number; - strTableSize: number; - lastStrTableOffset: number; - } - } - name: string; - names: string[]; - desc: string; - bools: Object; - numbers: Object; - strings: Object; - }; - } - - export interface IDestroyable { - destroy(): void; - } - - export interface INodeOptions extends IOptions { - name?: string; - screen?: Screen; - parent?: Node; - children?: Node[]; - focusable?: boolean; - } - - export abstract class Node extends EventEmitter implements IHasOptions, IDestroyable { - constructor(options: INodeOptions); - - // ** properties ** // - - focusable: boolean; - - /** - * Original options object. - */ - options: INodeOptions; - - /** - * An object for any miscellanous user data. - */ - data: {[index: string]: any;}; - /** - * An object for any miscellanous user data. - */ - _: {[index: string]: any;}; - /** - * An object for any miscellanous user data. - */ - $: {[index: string]: any;}; - /** - * Type of the node (e.g. box). - */ - type: string; - /** - * Render index (document order index) of the last render call. - */ - index: number; - /** - * Parent screen. - */ - screen: Screen; - /** - * Parent node. - */ - parent: Node; - /** - * Array of node's children. - */ - children: Node[]; - - // ** methods ** // - - /** - * Prepend a node to this node's children. - */ - prepend(node: Node): void; - /** - * Append a node to this node's children. - */ - append(node: Node): void; - /** - * Remove child node from node. - */ - remove(node: Node): void; - /** - * Insert a node to this node's children at index i. - */ - insert(node: Node, index: number): void; - /** - * Insert a node to this node's children before the reference node. - */ - insertBefore(node: Node, refNode: Node): void; - /** - * Insert a node from node after the reference node. - */ - insertAfter(node: Node, refNode: Node): void; - /** - * Remove node from its parent. - */ - detach(): void; - /** - * Remove node from its parent. - */ - free(): void; - /** - * Remove node from its parent. - */ - forDescendants(iter: Function, s: any): void; - /** - * Remove node from its parent. - */ - forAncestors(iter: Function, s: any): void; - /** - * Remove node from its parent. - */ - collectDescendants(s: any): void; - /** - * Remove node from its parent. - */ - collectAncestors(s: any): void; - /** - * Remove node from its parent. - */ - emitDescendants(): void; - /** - * Remove node from its parent. - */ - emitAncestors(): void; - /** - * Remove node from its parent. - */ - hasDescendant(target: Node): void; - /** - * Remove node from its parent. - */ - hasAncestor(target: Node): boolean; - /** - * Remove node from its parent. - */ - destroy(): void; - /** - * Emit event for element, and recursively emit same event for all descendants. - */ - emitDescendants(type: string, ...args: any[]): void; - /** - * Get user property with a potential default value. - */ - get(name: string, def: T): T; - /** - * Set user property to value. - */ - set(name: string, value: T): void; - - // ** events ** // - - on(event: string, listener: Function): this; - /** - * Received when node is added to a parent. - */ - on(event: "adopt", callback: (arg: Node) => void): this; - /** - * Received when node is removed from it's current parent. - */ - on(event: "remove", callback: (arg: Node) => void): this; - /** - * Received when node gains a new parent. - */ - on(event: "reparent", callback: (arg: Node) => void): this; - /** - * Received when node is attached to the screen directly or somewhere in its ancestry. - */ - on(event: "attach", callback: (arg: Node) => void): this; - /** - * Received when node is detached from the screen directly or somewhere in its ancestry. - */ - on(event: "detach", callback: (arg: Node) => void): this; - } - - export class NodeWithEvents extends Node { - // ** methods ** // - - /** - * Bind a keypress listener for a specific key. - */ - key(name: string | string[], listener: Function): void; - /** - * Bind a keypress listener for a specific key once. - */ - onceKey(name: string, listener: Function): void; - /** - * Remove a keypress listener for a specific key. - */ - unkey(name: string, listener: Function): void; - removeKey(name: string, listener: Function): void; - - // ** events ** // - - on(event: string, listener: Function): this; - /** - * Received on screen resize. - */ - on(event: "resize", callback: () => void): this; - /** - * Received on mouse events. - */ - on(event: "mouse", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mouseout", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mouseover", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mousedown", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mouseup", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mousewheel", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "wheeldown", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "wheelup", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mousemove", callback: (arg: Events.IMouseEventArg) => void): this; - /** - * Received on key events. - */ - on(event: "keypress", callback: (ch: string, key: Events.IKeyEventArg) => void): this; - /** - * Global events received for all elements. - */ - on(event: "element click", callback: (arg: Screen) => void): this; - on(event: "element mouseover", callback: (arg: Screen) => void): this; - on(event: "element mouseout", callback: (arg: Screen) => void): this; - on(event: "element mouseup", callback: (arg: Screen) => void): this; - /** - * Received on key event for [name]. - */ - //on(event: "key", callback: (arg: BlessedScreen) => void): this; - /** - * Received when the terminal window focuses/blurs. Requires a terminal supporting the - * focus protocol and focus needs to be passed to program.enableMouse(). - */ - on(event: "focus", callback: (arg: Screen) => void): this; - /** - * Received when the terminal window focuses/blurs. Requires a terminal supporting the - * focus protocol and focus needs to be passed to program.enableMouse(). - */ - on(event: "blur", callback: (arg: Screen) => void): this; - /** - * Received before render. - */ - on(event: "prerender", callback: () => void): this; - /** - * Received on render. - */ - on(event: "render", callback: () => void): this; - /** - * Received when blessed notices something untoward (output is not a tty, terminfo not found, etc). - */ - on(event: "warning", callback: (text: string) => void): this; - /** - * Received when the screen is destroyed (only useful when using multiple screens). - */ - on(event: "destroy", callback: () => void): this; - /** - * Received when the element is moved. - */ - on(event: "move", callback: () => void): this; - /** - * Element was clicked (slightly smarter than mouseup). - */ - on(event: "click", callback: (arg: Screen) => void): this; - /** - * Received when element is shown. - */ - on(event: "show", callback: () => void): this; - /** - * Received when element becomes hidden. - */ - on(event: "hide", callback: () => void): this; - - on(event: "set content", callback: () => void): this; - on(event: "parsed content", callback: () => void): this; - } - - export interface IScreenOptions extends INodeOptions { - /** - * The blessed Program to be associated with. Will be automatically instantiated if none is provided. - */ - program?: BlessedProgram; - /** - * Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with - * uniform cells to their sides). This is known to cause flickering with elements that are not full-width, - * however, it is more optimal for terminal rendering. - */ - smartCSR?: boolean; - /** - * Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR, - * but may cause flickering depending on what is on each side of the element. - */ - fastCSR?: boolean; - /** - * Attempt to perform back_color_erase optimizations for terminals that support it. It will also work - * with terminals that don't support it, but only on lines with the default background color. As it - * stands with the current implementation, it's uncertain how much terminal performance this adds at - * the cost of overhead within node. - */ - useBCE?: boolean; - /** - * Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300). - */ - resizeTimeout?: number; - /** - * The width of tabs within an element's content. - */ - tabSize?: number; - /** - * Automatically position child elements with border and padding in mind (NOTE: this is a recommended - * option. It may become default in the future). - */ - autoPadding?: boolean; - - cursor?: Types.TCursor; - - /** - * Create a log file. See log method. - */ - log?: (...msg: any[]) => void; - /** - * Dump all output and input to desired file. Can be used together with log option if set as a boolean. - */ - dump?: string; - /** - * Debug mode. Enables usage of the debug method. Also creates a debug console which will display when - * pressing F12. It will display all log and debug messages. - */ - debug?: (...msg: string[]) => void; - /** - * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful - * for creating a key that will always exit no matter whether the keys are locked. - */ - ignoreLocked?: boolean; - /** - * Automatically "dock" borders with other elements instead of overlapping, depending on position - * (experimental). For example: These border-overlapped elements: - */ - dockBorders?: boolean; - /** - * Normally, dockable borders will not dock if the colors or attributes are different. This option - * will allow them to dock regardless. It may produce some odd looking multi-colored borders though. - */ - ignoreDockContrast?: boolean; - /** - * Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode - * combining characters. This allows you to display text above the basic multilingual plane. This - * is behind an option because it may affect performance slightly negatively. Without this option - * enabled, all double-width, surrogate pair, and combining characters will be replaced by '??', - * '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply - * removes them from an element's content if iTerm2 is detected). - */ - fullUnicode?: boolean; - /** - * Send focus events after mouse is enabled. - */ - sendFocus?: boolean; - /** - * Display warnings (such as the output not being a TTY, similar to ncurses). - */ - warnings?: boolean; - /** - * Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page. - * If value is true unicode is forced. If value is false non-unicode is forced (default: null). - */ - forceUnicode?: boolean; - /** - * Input and output streams. process.stdin/process.stdout by default, however, it could be a - * net.Socket if you want to make a program that runs over telnet or something of that nature. - * */ - input?: stream.Writable; - /** - * Input and output streams. process.stdin/process.stdout by default, however, it could be a - * net.Socket if you want to make a program that runs over telnet or something of that nature. - * */ - output?: stream.Readable; - /** - * The blessed Tput object (only available if you passed tput: true to the Program constructor.) - */ - tput?: Tput; - /** - * Top of the focus history stack. - */ - focused?: BlessedElement; - /** - * Width of the screen (same as program.cols). - */ - width?: Types.TPosition; - /** - * Height of the screen (same as program.rows). - */ - height?: Types.TPosition; - /** - * Same as screen.width. - */ - cols?: number; - /** - * Same as screen.height. - */ - rows?: number; - /** - * Relative top offset, always zero. - */ - top?: Types.TTopLeft; - /** - * Relative left offset, always zero. - */ - left?: Types.TTopLeft; - /** - * Relative right offset, always zero. - */ - right?: Types.TPosition; - /** - * Relative bottom offset, always zero. - */ - bottom?: Types.TPosition; - /** - * Absolute top offset, always zero. - */ - atop?: Types.TTopLeft; - /** - * Absolute left offset, always zero. - */ - aleft?: Types.TTopLeft; - /** - * Absolute right offset, always zero. - */ - aright?: Types.TPosition; - /** - * Absolute bottom offset, always zero. - */ - abottom?: Types.TPosition; - /** - * Whether the focused element grabs all keypresses. - */ - grabKeys?: any; - /** - * Prevent keypresses from being received by any element. - */ - lockKeys?: boolean; - /** - * The currently hovered element. Only set if mouse events are bound. - */ - hover?: any; - /** - * Set or get terminal name. Set calls screen.setTerminal() internally. - */ - terminal?: string; - /** - * Set or get window title. - */ - title?: string; - } - - export class Screen extends NodeWithEvents implements IHasOptions { - constructor(opts: IScreenOptions); - - // ** properties ** // - cleanSides: any; - - /** - * Original options object. - */ - options: IScreenOptions; - - /** - * The blessed Program to be associated with. Will be automatically instantiated if none is provided. - */ - program: BlessedProgram; - /** - * Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with - * uniform cells to their sides). This is known to cause flickering with elements that are not full-width, - * however, it is more optimal for terminal rendering. - */ - smartCSR: boolean; - /** - * Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR, - * but may cause flickering depending on what is on each side of the element. - */ - fastCSR: boolean; - /** - * Attempt to perform back_color_erase optimizations for terminals that support it. It will also work - * with terminals that don't support it, but only on lines with the default background color. As it - * stands with the current implementation, it's uncertain how much terminal performance this adds at - * the cost of overhead within node. - */ - useBCE: boolean; - /** - * Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300). - */ - resizeTimeout: number; - /** - * The width of tabs within an element's content. - */ - tabSize: number; - /** - * Automatically position child elements with border and padding in mind (NOTE: this is a recommended - * option. It may become default in the future). - */ - autoPadding: boolean; - - cursor: Types.TCursor; - - /** - * Dump all output and input to desired file. Can be used together with log option if set as a boolean. - */ - dump: string; - /** - * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful - * for creating a key that will always exit no matter whether the keys are locked. - */ - ignoreLocked: boolean; - /** - * Automatically "dock" borders with other elements instead of overlapping, depending on position - * (experimental). For example: These border-overlapped elements: - */ - dockBorders: boolean; - /** - * Normally, dockable borders will not dock if the colors or attributes are different. This option - * will allow them to dock regardless. It may produce some odd looking multi-colored borders though. - */ - ignoreDockContrast: boolean; - /** - * Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode - * combining characters. This allows you to display text above the basic multilingual plane. This - * is behind an option because it may affect performance slightly negatively. Without this option - * enabled, all double-width, surrogate pair, and combining characters will be replaced by '??', - * '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply - * removes them from an element's content if iTerm2 is detected). - */ - fullUnicode: boolean; - /** - * Send focus events after mouse is enabled. - */ - sendFocus: boolean; - /** - * Display warnings (such as the output not being a TTY, similar to ncurses). - */ - warnings: boolean; - /** - * Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page. - * If value is true unicode is forced. If value is false non-unicode is forced (default: null). - */ - forceUnicode: boolean; - /** - * Input and output streams. process.stdin/process.stdout by default, however, it could be a - * net.Socket if you want to make a program that runs over telnet or something of that nature. - * */ - input: stream.Writable; - /** - * Input and output streams. process.stdin/process.stdout by default, however, it could be a - * net.Socket if you want to make a program that runs over telnet or something of that nature. - * */ - output: stream.Readable; - /** - * The blessed Tput object (only available if you passed tput: true to the Program constructor.) - */ - tput: Tput; - /** - * Top of the focus history stack. - */ - focused: BlessedElement; - /** - * Width of the screen (same as program.cols). - */ - width: Types.TPosition; - /** - * Height of the screen (same as program.rows). - */ - height: Types.TPosition; - /** - * Same as screen.width. - */ - cols: number; - /** - * Same as screen.height. - */ - rows: number; - /** - * Relative top offset, always zero. - */ - top: Types.TTopLeft; - /** - * Relative left offset, always zero. - */ - left: Types.TTopLeft; - /** - * Relative right offset, always zero. - */ - right: Types.TPosition; - /** - * Relative bottom offset, always zero. - */ - bottom: Types.TPosition; - /** - * Absolute top offset, always zero. - */ - atop: Types.TTopLeft; - /** - * Absolute left offset, always zero. - */ - aleft: Types.TTopLeft; - /** - * Absolute right offset, always zero. - */ - aright: Types.TPosition; - /** - * Absolute bottom offset, always zero. - */ - abottom: Types.TPosition; - /** - * Whether the focused element grabs all keypresses. - */ - grabKeys: any; - /** - * Prevent keypresses from being received by any element. - */ - lockKeys: boolean; - /** - * The currently hovered element. Only set if mouse events are bound. - */ - hover: any; - /** - * Set or get terminal name. Set calls screen.setTerminal() internally. - */ - terminal: string; - /** - * Set or get window title. - */ - title: string; - - // ** methods ** // - - /** - * Write string to the log file if one was created. - */ - log(...msg: any[]): void; - /** - * Same as the log method, but only gets called if the debug option was set. - */ - debug(...msg: string[]): void; - /** - * Allocate a new pending screen buffer and a new output screen buffer. - */ - alloc(): void; - /** - * Reallocate the screen buffers and clear the screen. - */ - realloc(): void; - /** - * Draw the screen based on the contents of the screen buffer. - */ - draw(start: number, end: number): void; - /** - * Render all child elements, writing all data to the screen buffer and drawing the screen. - */ - render(): void; - /** - * Clear any region on the screen. - */ - clearRegion(x1: number, x2: number, y1: number, y2: number): void; - /** - * Fill any region with a character of a certain attribute. - */ - fillRegion(attr: string, ch: string, x1: number, x2: number, y1: number, y2: number): void; - /** - * Focus element by offset of focusable elements. - */ - focusOffset(offset: number): any; - /** - * Focus previous element in the index. - */ - focusPrevious(): void; - /** - * Focus next element in the index. - */ - focusNext(): void; - /** - * Push element on the focus stack (equivalent to screen.focused = el). - */ - focusPush(element: BlessedElement): void; - /** - * Pop element off the focus stack. - */ - focusPop(): BlessedElement; - /** - * Save the focused element. - */ - saveFocus(): BlessedElement; - /** - * Restore the saved focused element. - */ - restoreFocus(): BlessedElement; - /** - * "Rewind" focus to the last visible and attached element. - */ - rewindFocus(): BlessedElement; - /** - * Spawn a process in the foreground, return to blessed app after exit. - */ - spawn(file: string, args: string[], options: NodeChildProcessExecOptions): child_process.ChildProcess; - /** - * Spawn a process in the foreground, return to blessed app after exit. Executes callback on error or exit. - */ - exec(file: string, args: string[], options: NodeChildProcessExecOptions, callback: Function): child_process.ChildProcess; - /** - * Read data from text editor. - */ - readEditor(options: any, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - readEditor(callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - /** - * Set effects based on two events and attributes. - */ - setEffects(el: BlessedElement, fel: BlessedElement, over: any, out: any, effects: any, temp: any): void; - /** - * Insert a line into the screen (using csr: this bypasses the output buffer). - */ - insertLine(n: number, y: number, top: number, bottom: number): void; - /** - * Delete a line from the screen (using csr: this bypasses the output buffer). - */ - deleteLine(n: number, y: number, top: number, bottom: number): void; - /** - * Insert a line at the bottom of the screen. - */ - insertBottom(top: number, bottom: number): void; - /** - * Insert a line at the top of the screen. - */ - insertTop(top: number, bottom: number): void; - /** - * Delete a line at the bottom of the screen. - */ - deleteBottom(top: number, bottom: number): void; - /** - * Delete a line at the top of the screen. - */ - deleteTop(top: number, bottom: number): void; - /** - * Enable mouse events for the screen and optionally an element (automatically called when a form of - * on('mouse') is bound). - */ - enableMouse(el: BlessedElement): void; - enableMouse(): void; - /** - * Enable keypress events for the screen and optionally an element (automatically called when a form of - * on('keypress') is bound). - */ - enableKeys(el: BlessedElement): void; - enableKeys(): void; - /** - * Enable key and mouse events. Calls bot enableMouse and enableKeys. - */ - enableInput(el: BlessedElement): void; - enableInput(): void; - /** - * Attempt to copy text to clipboard using iTerm2's proprietary sequence. Returns true if successful. - */ - copyToClipboard(text: string): void; - /** - * Attempt to change cursor shape. Will not work in all terminals (see artificial cursors for a solution - * to this). Returns true if successful. - */ - cursorShape(shape: boolean, blink: boolean): any; - /** - * Attempt to change cursor color. Returns true if successful. - */ - cursorColor(color: string): void; - /** - * Attempt to reset cursor. Returns true if successful. - */ - cursorReset(): void; - /** - * Take an SGR screenshot of the screen within the region. Returns a string containing only - * characters and SGR codes. Can be displayed by simply echoing it in a terminal. - */ - screenshot(xi: number, xl: number, yi: number, yl: number): string; - screenshot(): void; - /** - * Destroy the screen object and remove it from the global list. Also remove all global events relevant - * to the screen object. If all screen objects are destroyed, the node process is essentially reset - * to its initial state. - */ - destroy(): void; - /** - * Reset the terminal to term. Reloads terminfo. - */ - setTerminal(term: string): void; - } - - export interface Padding { - left?: number; - right?: number; - top?: number; - bottom?: number; - } - - export class PositionCoords { - xi: number; - xl: number; - yi: number; - yl: number; - } - - export interface Position { - left: number | string; - right: number | string; - top: number | string; - bottom: number | string; - } - - export interface Border { - /** - * Type of border (line or bg). bg by default. - */ - type?: "line" | "bg"; - /** - * Character to use if bg type, default is space. - */ - ch?: string; - /** - * Border foreground and background, must be numbers (-1 for default). - */ - bg?: number; - fg?: number; - /** - * Border attributes. - */ - bold?: string; - underline?: string; - } - - export interface ElementOptions extends INodeOptions { - tags?: boolean; - - fg?: string; - bg?: string; - bold?: string; - underline?: string; - - style?: any; - /** - * Border object, see below. - */ - border?: Border | "line" | "bg"; - /** - * Element's text content. - */ - content?: string; - /** - * Element is clickable. - */ - clickable?: boolean; - /** - * Element is focusable and can receive key input. - */ - input?: boolean; - keyable?: boolean; - /** - * Element is focused. - */ - focused?: BlessedElement; - /** - * Whether the element is hidden. - */ - hidden?: boolean; - /** - * A simple text label for the element. - */ - label?: string; - /** - * A floating text label for the element which appears on mouseover. - */ - hoverText?: string; - /** - * Text alignment: left, center, or right. - */ - align?: "left" | "center" | "right"; - /** - * Vertical text alignment: top, middle, or bottom. - */ - valign?: "top" | "middle" | "bottom"; - /** - * Shrink/flex/grow to content and child elements. Width/height during render. - */ - shrink?: boolean; - /** - * Amount of padding on the inside of the element. Can be a number or an object containing - * the properties: left, right, top, and bottom. - */ - padding?: number | Padding; - - top?: Types.TTopLeft; - left?: Types.TTopLeft; - right?: Types.TPosition; - bottom?: Types.TPosition; - - /** - * Width/height of the element, can be a number, percentage (0-100%), or keyword (half or shrink). - * Percentages can also have offsets (50%+1, 50%-1). - */ - width?: number | string; - /** - * Offsets of the element relative to its parent. Can be a number, percentage (0-100%), or - * keyword (center). right and bottom do not accept keywords. Percentages can also have - * offsets (50%+1, 50%-1). - */ - height?: number | string; - /** - * Can contain the above options. - */ - position?: Position; - /** - * Whether the element is scrollable or not. - */ - scrollable?: boolean; - /** - * Background character (default is whitespace ). - */ - ch?: string; - /** - * Allow the element to be dragged with the mouse. - */ - draggable?: boolean; - /** - * Draw a translucent offset shadow behind the element. - */ - shadow?: boolean; - } - - export interface Coords { - xl: number; - xi: number; - yl: number; - yi: number; - base: number; - _contentEnd: {x: number; y: number;}; - notop: Types.TTopLeft; - noleft: Types.TTopLeft; - noright: Types.TPosition; - nobot: Types.TPosition; - } - - export interface LabelOptions { - text: string; - side: Types.TAlign; - } - - // TODO: scrollable - Note: If the scrollable option is enabled, Element inherits all methods from ScrollableBox. - export abstract class BlessedElement extends NodeWithEvents implements IHasOptions { - constructor(opts: ElementOptions); - - // ** properties ** // - - /** - * Original options object. - */ - options: ElementOptions; - /** - * Name of the element. Useful for form submission. - */ - name: string; - /** - * Border object. - */ - border: Border; - - style: any; - position: Position; - content: string; - hidden: boolean; - visible: boolean; - detached: boolean; - /** - * Border foreground and background, must be numbers (-1 for default). - */ - bg: number; - fg: number; - /** - * Border attributes. - */ - bold: string; - underline: string; - /** - * Calculated width. - */ - width: number | string; - /** - * Calculated height. - */ - height: number | string; - /** - * Calculated relative top offset.*/ - top: Types.TTopLeft; - /** - * Calculated relative left offset. - */ - left: Types.TTopLeft; - /** - * Calculated relative right offset. - */ - right: Types.TPosition; - /** - * Calculated relative bottom offset. - */ - bottom: Types.TPosition; - /** - * Calculated absolute top offset. - */ - atop: Types.TTopLeft; - /** - * Calculated absolute left offset. - */ - aleft: Types.TTopLeft; - /** - * Calculated absolute right offset. - */ - aright: Types.TPosition; - /** - * Calculated absolute bottom offset. - */ - abottom: Types.TPosition; - - /** - * Whether the element is draggable. Set to true to allow dragging. - */ - draggable: boolean; - - itop: Types.TTopLeft; - ileft: Types.TTopLeft; - iheight: Types.TPosition; - iwidth: Types.TPosition; - - /** - * Calculated relative top offset. - */ - rtop: Types.TTopLeft; - /** - * Calculated relative left offset. - */ - rleft: Types.TTopLeft; - /** - * Calculated relative right offset. - */ - rright: Types.TPosition; - /** - * Calculated relative bottom offset. - */ - rbottom: Types.TPosition; - - lpos: PositionCoords; - - // ** methods ** // - - /** - * Write content and children to the screen buffer. - */ - render(): Coords; - /** - * Hide element.*/ - hide(): void; - /** - * Show element. - */ - show(): void; - /** - * Toggle hidden/shown. - */ - toggle(): void; - /** - * Focus element. - */ - focus(): void; - /** - * Same asel.on('screen', ...) except this will automatically keep track of which listeners - * are bound to the screen object. For use with removeScreenEvent(), free(), and destroy(). - */ - onScreenEvent(type: string, handler: Function): void; - /** - * Same asel.removeListener('screen', ...) except this will automatically keep track of which - * listeners are bound to the screen object. For use with onScreenEvent(), free(), and destroy(). - */ - removeScreenEvent(type: string, handler: Function): void; - /** - * Free up the element. Automatically unbind all events that may have been bound to the screen - * object. This prevents memory leaks. For use with onScreenEvent(), removeScreenEvent(), - * and destroy(). - */ - free(): void; - /** - * Same as the detach() method, except this will automatically call free() and unbind any screen - * events to prevent memory leaks. for use with onScreenEvent(), removeScreenEvent(), and free(). - */ - destroy(): void; - /** - * Set the z-index of the element (changes rendering order). - */ - setIndex(z: number): void; - /** - * Put the element in front of its siblings.*/ - setFront(): void; - /** - * Put the element in back of its siblings. - */ - setBack(): void; - /** - * text/options - Set the label text for the top-left corner. Example options: {text:'foo',side:'left'} - */ - setLabel(arg: string | LabelOptions): void; - /** - * Remove the label completely. - */ - removeLabel(): any; - /** - * text/options - Set a hover text box to follow the cursor. Similar to the "title" DOM attribute - * in the browser. Example options: {text:'foo'} - */ - setHover(arg: string | LabelOptions): void; - /** - * Remove the hover label completely. - */ - removeHover(): void; - /** - * Enable mouse events for the element (automatically called when a form of on('mouse') is bound). - */ - enableMouse(): void; - /** - * Enable keypress events for the element (automatically called when a form of on('keypress') is bound). - */ - enableKeys(): void; - /** - * Enable key and mouse events. Calls bot enableMouse and enableKeys. - */ - enableInput(): void; - /** - * Enable dragging of the element. - */ - enableDrag(): void; - /** - * Disable dragging of the element. - */ - disableDrag(): void; - /** - * Take an SGR screenshot of the screen within the region. Returns a string containing only - * characters and SGR codes. Can be displayed by simply echoing it in a terminal. - */ - screenshot(xi: number, xl: number, yi: number, yl: number): string; - screenshot(): void; - - /* - Content Methods - - Methods for dealing with text content, line by line. Useful for writing a text editor, - irc client, etc. - - Note: All of these methods deal with pre-aligned, pre-wrapped text. If you use deleteTop() - on a box with a wrapped line at the top, it may remove 3-4 "real" lines (rows) depending - on how long the original line was. - - The lines parameter can be a string or an array of strings. The line parameter must - be a string. - */ - - /** - * Set the content. Note: When text is input, it will be stripped of all non-SGR - * escape codes, tabs will be replaced with 8 spaces, and tags will be replaced - * with SGR codes (if enabled). - */ - setContent(text: string): void; - /** - * Return content, slightly different from el.content. Assume the above formatting. - */ - getContent(): string; - /** - * Similar to setContent, but ignore tags and remove escape codes. - */ - setText(text: string): void; - /** - * Similar to getContent, but return content with tags and escape codes removed. - */ - getText(): string; - /** - * Insert a line into the box's content. - */ - insertLine(i: number, lines: string | string[]): void; - /** - * Delete a line from the box's content. - */ - deleteLine(i: number): void; - /** - * Get a line from the box's content. - */ - getLine(i: number): string; - /** - * Get a line from the box's content from the visible top. - */ - getBaseLine(i: number): string; - /** - * Set a line in the box's content. - */ - setLine(i: number, line: string | string[]): void; - /** - * Set a line in the box's content from the visible top. - */ - setBaseLine(i: number, line: string | string[]): void; - /** - * Clear a line from the box's content. - */ - clearLine(i: number): void; - /** - * Clear a line from the box's content from the visible top. - */ - clearBaseLine(i: number): void; - /** - * Insert a line at the top of the box. - */ - insertTop(lines: string | string[]): void; - /** - * Insert a line at the bottom of the box. - */ - insertBottom(lines: string | string[]): void; - /** - * Delete a line at the top of the box. - */ - deleteTop(): void; - /** - * Delete a line at the bottom of the box. - */ - deleteBottom(): void; - /** - * Unshift a line onto the top of the content. - */ - unshiftLine(lines: string | string[]): void; - /** - * Shift a line off the top of the content. - */ - shiftLine(i: number): void; - /** - * Push a line onto the bottom of the content. - */ - pushLine(lines: string | string[]): void; - /** - * Pop a line off the bottom of the content. - */ - popLine(i: number): string; - /** - * An array containing the content lines. - */ - getLines(): string[]; - /** - * An array containing the lines as they are displayed on the screen. - */ - getScreenLines(): string[]; - /** - * Get a string's displayed width, taking into account double-width, surrogate pairs, - * combining characters, tags, and SGR escape codes. - */ - strWidth(text: string): string; - - // ** events ** // - } - - export interface ScrollableBoxOptions extends ElementOptions { - /** - * A limit to the childBase. Default is Infinity. - */ - baseLimit?: number; - /** - * A option which causes the ignoring of childOffset. This in turn causes the - * childBase to change every time the element is scrolled. - */ - alwaysScroll?: boolean; - /** - * Object enabling a scrollbar. - * Style of the scrollbar track if present (takes regular style options). - */ - scrollbar?: { style?: any; track?: any; ch?: string; } - } - - export interface ScrollableTextOptions extends ScrollableBoxOptions { - /** - * Whether to enable automatic mouse support for this element. - * Use pre-defined mouse events (right-click for editor). - */ - mouse?: boolean | (() => void); - /** - * Use pre-defined keys (i or enter for insert, e for editor, C-e for editor while inserting). - */ - keys?: string | string[] | boolean; - /** - * Use vi keys with the keys option. - */ - vi?: boolean; - } - - export interface BoxOptions extends ScrollableTextOptions { - bindings?: any; - } - - /** - * DEPRECATED - Use Box with the scrollable option instead. A box with scrollable content. - */ - export class ScrollableBoxElement extends BlessedElement { - /** - * The offset of the top of the scroll content. - */ - childBase: number; - /** - * The offset of the chosen item/line. - */ - childOffset: number; - - /** - * Scroll the content by a relative offset. - */ - scroll(offset: number, always?: boolean): void; - /** - * Scroll the content to an absolute index. - */ - scrollTo(index: number): void; - /** - * Same as scrollTo. - */ - setScroll(index: number): void; - /** - * Set the current scroll index in percentage (0-100). - */ - setScrollPerc(perc: number): void; - /** - * Get the current scroll index in lines. - */ - getScroll(): number; - /** - * Get the actual height of the scrolling area. - */ - getScrollHeight(): number; - /** - * Get the current scroll index in percentage. - */ - getScrollPerc(): number; - /** - * Reset the scroll index to its initial state. - */ - resetScroll(): void; - - on(event: string, listener: Function): this; - /** - * Received when the element is scrolled. - */ - on(event: "scroll", callback: () => void): this; - } - - /** - * DEPRECATED - Use Box with the scrollable and alwaysScroll options instead. - * A scrollable text box which can display and scroll text, as well as handle - * pre-existing newlines and escape codes. - */ - export class ScrollableTextElement extends ScrollableBoxElement { - } - - /** - * A box element which draws a simple box containing content or other elements. - */ - export class BoxElement extends ScrollableTextElement implements IHasOptions { - constructor(opts: BoxOptions); - - /** - * Original options object. - */ - options: BoxOptions; - } - - export interface TextOptions extends ElementOptions { - /** - * Fill the entire line with chosen bg until parent bg ends, even if there - * is not enough text to fill the entire width. - */ - fill?: boolean; - /** - * Text alignment: left, center, or right. - */ - align?: Types.TAlign; - } - - /** - * An element similar to Box, but geared towards rendering simple text elements. - */ - export class TextElement extends BlessedElement implements IHasOptions { - constructor(opts: TextOptions); - - /** - * Original options object. - */ - options: TextOptions; - } - - /** - * A simple line which can be line or bg styled. - */ - export interface LineOptions extends BoxOptions { - /** - * Can be vertical or horizontal. - */ - orientation?: "vertical" | "horizontal"; - /** - * Treated the same as a border object. (attributes can be contained in style). - */ + interface TStyle { type?: string; bg?: string; fg?: string; ch?: string; + bold?: boolean; + underline?: boolean; + blink?: boolean; + inverse?: boolean; + invisible?: boolean; + transparent?: boolean; + border?: "line" | "bg" | TBorder; + hover?: boolean; + focus?: boolean; + label?: string; + track?: { bg?: string; fg?: string }; + scrollbar?: { bg?: string; fg?: string }; } - /** - * A simple line which can be line or bg styled. - */ - export class LineElement extends BoxElement implements IHasOptions { - constructor(opts: LineOptions); + interface TBorder { + /** + * Type of border (line or bg). bg by default. + */ + type?: "line" | "bg"; /** - * Original options object. - */ - options: LineOptions; + * Character to use if bg type, default is space. + */ + ch?: string; + + /** + * Border foreground and background, must be numbers (-1 for default). + */ + bg?: number; + fg?: number; + + /** + * Border attributes. + */ + bold?: string; + underline?: string; } - export interface BigTextOptions extends BoxOptions { + interface TCursor { /** - * bdf->json font file to use (see ttystudio for instructions on compiling BDFs to JSON). - */ - font?: string; + * Have blessed draw a custom cursor and hide the terminal cursor (experimental). + */ + artificial: boolean; + /** - * bdf->json bold font file to use (see ttystudio for instructions on compiling BDFs to JSON). - */ - fontBold?: string; + * Shape of the cursor. Can be: block, underline, or line. + */ + shape: "block" | "underline" | "line"; + /** - * foreground character. (default: ' ') - */ - fch?: string; + * Whether the cursor blinks. + */ + blink: boolean; + + /** + * Color of the color. Accepts any valid color value (null is default). + */ + color: string; } - /** - * A box which can render content drawn as 8x14 cell characters using the terminus font. - */ - export class BigTextElement extends BoxElement implements IHasOptions { - constructor(opts: BigTextOptions); + type TAlign = "left" | "center" | "right"; - /** - * Original options object. - */ - options: BigTextOptions; + interface ListbarCommand { + key: string; + callback(): void; } - export interface ListElementStyle { - selected?: any; - item?: any; + interface TImage { + /** + * Pixel width. + */ + width: number; + + /** + * Pixel height. + */ + height: number; + + /** + * Image bitmap. + */ + bmp: any; + + /** + * Image cellmap (bitmap scaled down to cell size). + */ + cellmap: any; } - export interface ListOptions extends BoxOptions { + interface Cursor { /** - * Style for a selected item. Style for an unselected item. - */ - style?: TStyle; - /** - * An array of strings which become the list's items. - */ - items?: string[]; - /** - * A function that is called when vi mode is enabled and the key / is pressed. This function accepts a - * callback function which should be called with the search string. The search string is then used to - * jump to an item that is found in items. - */ - search?: () => void; - /** - * Whether the list is interactive and can have items selected (Default: true). - */ - interactive?: boolean; - /** - * Whether to automatically override tags and invert fg of item when selected (Default: true). - */ - invertSelected?: boolean; - } - - export class ListElement extends BoxElement implements IHasOptions> { - constructor(opts: ListOptions); - - /** - * Original options object. - */ - options: ListOptions; - - /** - * Add an item based on a string. - */ - add(text: string): void; - /** - * Add an item based on a string. - */ - addItem(text: string): void; - /** - * Removes an item from the list. Child can be an element, index, or string. - */ - removeItem(child: BlessedElement): BlessedElement; - /** - * Push an item onto the list. - * */ - pushItem(child: BlessedElement): number; - /** - * Pop an item off the list. - * */ - popItem(): BlessedElement; - /** - * Unshift an item onto the list. - */ - unshiftItem(child: BlessedElement): number; - /** - * Shift an item off the list. - * */ - shiftItem(): BlessedElement; - /** - * Inserts an item to the list. Child can be an element, index, or string. - */ - insertItem(i: number, child: BlessedElement): void; - /** - * Returns the item element. Child can be an element, index, or string. - */ - getItem(child: BlessedElement): BlessedElement; - /** - * Set item to content. - */ - setItem(child: BlessedElement, content: BlessedElement | string): void; - /** - * Remove and insert items to the list. - * */ - spliceItem(i: number, n: number, ...items: BlessedElement[]): void; - /** - * Clears all items from the list. - * */ - clearItems(): void; - /** - * Sets the list items to multiple strings. - */ - setItems(items: BlessedElement[]): void; - /** - * Returns the item index from the list. Child can be an element, index, or string. - */ - getItemIndex(child: BlessedElement): number; - /** - * Select an index of an item. - * */ - select(index: number): void; - /** - * Select item based on current offset. - * */ - move(offset: number): void; - /** - * Select item above selected. - * */ - up(amount: number): void; - /** - * Select item below selected. - */ - down(amount: number): void; - /** - * Show/focus list and pick an item. The callback is executed with the result. - */ - pick(callback: () => void): void; - /** - * Find an item based on its text content. - */ - fuzzyFind(arg: string | RegExp | (() => void)): void; - - // ** events ** // + * Have blessed draw a custom cursor and hide the terminal cursor (experimental). + */ + artificial: boolean; - on(event: string, listener: Function): this; - /** - * Received when an item is selected. - */ - on(event: "select", callback: (item: BoxElement, index: number) => void): this; - /** - * List was canceled (when esc is pressed with the keys option). - */ - on(event: "cancel", callback: () => void): this; - /** - * Either a select or a cancel event was received. - */ - on(event: "action", callback: () => void): this; - - on(event: "create item", callback: () => void): this; - on(event: "add item", callback: () => void): this; - on(event: "remove item", callback: () => void): this; - on(event: "insert item", callback: () => void): this; - on(event: "set items", callback: () => void): this; - on(event: "select item", callback: (item: BlessedElement, index: number) => void): this; - } - - export interface FileManagerOptions extends ListOptions { - /** - * Current working directory. - */ - cwd?: string; - } - - export class FileManagerElement extends ListElement implements IHasOptions { - constructor(opts: FileManagerOptions); - - /** - * Original options object. - */ - options: FileManagerOptions; /** - * Current working directory. - */ - cwd: string; + * Shape of the cursor. Can be: block, underline, or line. + */ + shape: boolean; /** - * Refresh the file list (perform a readdir on cwd and update the list items). - */ - refresh(cwd:string, callback: () => void): void; - refresh(callback: () => void): void; - refresh(): void; - /** - * Pick a single file and return the path in the callback. - */ - pick(cwd:string, callback: () => void): void; - pick(callback: () => void): void; - /** - * Reset back to original cwd. - */ - reset(cwd:string, callback: () => void): void; - reset(callback: () => void): void; - reset(): void; - - // ** events ** // - - on(event: string, listener: Function): this; - /** - * Received when an item is selected. - */ - on(event: "cd", callback: (file: string, cwd: string) => void): this; - /** - * Received when an item is selected. - */ - on(event: "file", callback: (file: string) => void): this; - - on(event: "error", callback: (err: any, file: string) => void): this; - on(event: "refresh", callback: () => void): this; - } - - export interface StyleListTable extends ListElementStyle { - /** - * Header style. - */ - header?: any; - /** - * Cell style. - */ - cell?: any; - } - - export interface ListTableOptions extends ListOptions { - /** - * Array of array of strings representing rows. - */ - rows?: string[]; - data?: string[][]; - /** - * Spaces to attempt to pad on the sides of each cell. 2 by default: one space on each side - * (only useful if the width is shrunken). - */ - pad?: number; - /** - * Do not draw inner cells. - */ - noCellBorders?: boolean; - - style?: StyleListTable; - } - - export class ListTableElement extends ListElement implements IHasOptions { - constructor(opts: ListTableOptions); - - /** - * Original options object. - */ - options: ListTableOptions; - - /** - * Set rows in table. Array of arrays of strings. - * @example: - * - * table.setData([ - [ 'Animals', 'Foods' ], - [ 'Elephant', 'Apple' ], - [ 'Bird', 'Orange' ] - ]); - */ - setRows(rows: string[][]): void; - /** - * Set rows in table. Array of arrays of strings. - * @example: - * - * table.setData([ - [ 'Animals', 'Foods' ], - [ 'Elephant', 'Apple' ], - [ 'Bird', 'Orange' ] - ]); - */ - setData(rows: string[][]): void; - } - - export interface ListbarOptions extends BoxOptions { - style?: ListElementStyle; - /** - * Set buttons using an object with keys as titles of buttons, containing of objects - * containing keys of keys and callback. - */ - commands: Types.ListbarCommand[]; - items: Types.ListbarCommand[]; - /** - * Automatically bind list buttons to keys 0-9. - */ - autoCommandKeys: boolean; - } - - export class ListbarElement extends BoxElement implements IHasOptions { - constructor(opts: ListbarOptions); - - /** - * Original options object. - */ - options: ListbarOptions; - - /** - * Set commands (see commands option above). - */ - setItems(commands: Types.ListbarCommand[]): void; - /** - * Append an item to the bar. - */ - add(item: Types.ListbarCommand, callback: () => void): void; - /** - * Append an item to the bar. - */ - addItem(item: Types.ListbarCommand, callback: () => void): void; - /** - * Append an item to the bar. - */ - appendItem(item: Types.ListbarCommand, callback: () => void): void; - /** - * Select an item on the bar. - */ - select(offset: number): void; - /** - * Remove item from the bar. - */ - removeItem(child: BlessedElement): void; - /** - * Move relatively across the bar. - */ - move(offset: number): void; - /** - * Move left relatively across the bar. - */ - moveLeft(offset: number): void; - /** - * Move right relatively across the bar. - */ - moveRight(offset: number): void; - /** - * Select button and execute its callback. - */ - selectTab(index: number): void; - - // ** events ** // - - on(event: string, listener: Function): this; - - on(event: "set items", callback: () => void): this; - on(event: "remove item", callback: () => void): this; - on(event: "select tab", callback: () => void): this; - } - - export interface FormOptions extends BoxOptions { - /** - * Allow default keys (tab, vi keys, enter). - */ - keys?: any; - /** - * Allow vi keys. - */ - vi?: boolean; - } - - export class FormElement extends BoxElement implements IHasOptions { - constructor(opts: FormOptions); - - /** - * Original options object. - */ - options: FormOptions; - /** - * Last submitted data. - */ - submission: TFormData; - - /** - * Focus next form element. - */ - focusNext(): void; - /** - * Focus previous form element. - */ - focusPrevious(): void; - /** - * Submit the form. - */ - submit(): void; - /** - * Discard the form. - */ - cancel(): void; - /** - * Clear the form. - */ - reset(): void; - - // ** events ** // - - on(event: string, listener: Function): this; - /** - * Form is submitted. Receives a data object. - */ - on(event: "submit", callback: (out: TFormData) => void): this; - /** - * Form is discarded. - */ - on(event: "cancel", callback: () => void): this; - /** - * Form is cleared. - */ - on(event: "reset", callback: () => void): this; - } - - export interface InputOptions extends BoxOptions { } - - export abstract class InputElement extends BoxElement { - constructor(opts: InputOptions); - } - - /** - * A box which allows multiline text input. - */ - export interface TextareaOptions extends InputOptions { - /** - * Call readInput() when the element is focused. Automatically unfocus. - */ - inputOnFocus?: boolean; - } - - export class TextareaElement extends InputElement implements IHasOptions { - constructor(opts: TextareaOptions); - - /** - * Original options object. - */ - options: TextareaOptions; - - /** - * The input text. read-only. - */ - value: string; - - /** - * Submit the textarea (emits submit). - */ - submit(): void; - /** - * Cancel the textarea (emits cancel). - */ - cancel(): void; - /** - * Grab key events and start reading text from the keyboard. Takes a callback which receives - * the final value. - */ - readInput(callback?: (err: any, value?: string) => void): void; - /** - * Grab key events and start reading text from the keyboard. Takes a callback which receives - * the final value. - */ - input(callback: (err: any, value?: string) => void): void; - /** - * Grab key events and start reading text from the keyboard. Takes a callback which receives - * the final value. - */ - setInput(callback: (err: any, value?: string) => void): void; - /** - * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which - * receives the final value. - */ - readEditor(callback: (err: any, value?: string) => void): void; - /** - * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which - * receives the final value. - */ - editor(callback: (err: any, value?: string) => void): void; - /** - * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which - * receives the final value. - */ - setEditor(callback: (err: any, value?: string) => void): void; - /** - * The same as this.value, for now. - */ - getValue(): string; - /** - * Clear input. - */ - clearValue(): void; - /** - * Set value. - */ - setValue(text: string): void; - - // ** events ** // - - on(event: string, listener: Function): this; - - on(event: "error", callback: (err: any) => void): this; - - /** - * Value is submitted (enter). - */ - on(event: "submit", callback: (value: any) => void): this; - /** - * Value is discared (escape). - */ - on(event: "cancel", callback: (value: any) => void): this; - /** - * Either submit or cancel. - */ - on(event: "action", callback: (value: any) => void): this; - } - - export interface TextboxOptions extends TextareaOptions { - /** - * Completely hide text. - */ - secret?: boolean; - /** - * Replace text with asterisks (*). - */ - censor?: boolean; - } - - export class TextboxElement extends TextareaElement implements IHasOptions { - constructor(opts: TextboxOptions); - - /** - * Original options object. - */ - options: TextboxOptions; - - /** - * Completely hide text. - */ - secret: boolean; - /** - * Replace text with asterisks (*). - */ - censor: boolean; - } - - export interface ButtonOptions extends BoxOptions { } - - export class ButtonElement extends InputElement implements IHasOptions { - constructor(opts: ButtonOptions); - - /** - * Original options object. - */ - options: ButtonOptions; - - /** - * Press button. Emits press. - */ - press(): void; - - on(event: string, listener: Function): this; - - on(event: "press", callback: () => void): this; - } - - export interface CheckboxOptions extends BoxOptions { - /** - * whether the element is checked or not. - * */ - checked?: boolean; - /** - * enable mouse support. - * */ - mouse?: boolean; - } - - /** - * A checkbox which can be used in a form element. - * */ - export class CheckboxElement extends InputElement implements IHasOptions { - constructor(options?: CheckboxOptions); - - /** - * Original options object. - */ - options: CheckboxOptions; - - /** - * the text next to the checkbox (do not use setcontent, use `check.text = ''`). - * */ - text: string; - /** - * whether the element is checked or not. - * */ - checked: boolean; - /** - * same as `checked`. - * */ - value: boolean; - - /** - * check the element. - * */ - check(): void; - /** - * uncheck the element. - * */ - uncheck(): void; - /** - * toggle checked state. - * */ - toggle(): void; - } - - export interface RadioSetOptions extends BoxOptions { } - - /** - * An element wrapping RadioButtons. RadioButtons within this element will be mutually exclusive - * with each other. - * */ - export abstract class RadioSetElement extends BoxElement { - constructor(opts: RadioSetOptions); - } - - export interface RadioButtonOptions extends BoxOptions { } - - /** - * A radio button which can be used in a form element. - */ - export abstract class RadioButtonElement extends CheckboxElement { - constructor(opts: RadioButtonOptions); - } - - export interface PromptOptions extends BoxOptions { } - - /** - * A prompt box containing a text input, okay, and cancel buttons (automatically hidden). - */ - export class PromptElement extends BoxElement implements IHasOptions { - constructor(opts: PromptOptions); - - options: PromptOptions; - - /** - * Show the prompt and wait for the result of the textbox. Set text and initial value. - */ - input(text: string, value: string, callback: (err: any, value: string) => void): void; - setInput(text: string, value: string, callback: (err: any, value: string) => void): void; - readInput(text: string, value: string, callback: (err: any, value: string) => void): void; - } - - export interface QuestionOptions extends BoxOptions { } - - /** - * A question box containing okay and cancel buttons (automatically hidden). - */ - export class QuestionElement extends BoxElement implements IHasOptions { - constructor(opts: QuestionOptions); - - options: QuestionOptions; - - /** - * Ask a question. callback will yield the result. - */ - ask(question: string, callback: (err: any, value: string) => void): void; - } - - export interface MessageOptions extends BoxOptions { } - - /** - * A box containing a message to be displayed (automatically hidden). - */ - export class MessageElement extends BoxElement implements IHasOptions { - constructor(opts: MessageOptions); - - options: MessageOptions; - - /** - * Display a message for a time (default is 3 seconds). Set time to 0 for a perpetual message that is dismissed on keypress. - */ - log(text: string, time: number, callback: (err: any) => void): void; - log(text: string, callback: (err: any) => void): void; - display(text: string, time: number, callback: (err: any) => void): void; - display(text: string, callback: (err: any) => void): void; - - /** - * Display an error in the same way. - */ - error(text: string, time: number, callback: () => void): void; - error(text: string, callback: () => void): void; - } - - export interface LoadingOptions extends BoxOptions { } - - /** - * A box with a spinning line to denote loading (automatically hidden). - */ - export class LoadingElement extends BoxElement implements IHasOptions { - constructor(opts: LoadingOptions); - - options: LoadingOptions; - - /** - * Display the loading box with a message. Will lock keys until stop is called. - */ - load(text: string): void; - /** - * Hide loading box. Unlock keys. - */ - stop(): void; - } - - export interface ProgressBarOptions extends BoxOptions { - /** - * can be `horizontal` or `vertical`. - * */ - orientation: string; - /** - * the character to fill the bar with (default is space). - * */ - pch: string; - /** - * the amount filled (0 - 100). - * */ - filled: number; - /** - * same as `filled`. - * */ - value: number; - /** - * enable key support. - * */ - keys: boolean; - /** - * enable mouse support. - * */ - mouse: boolean; - } - - /** - * A progress bar allowing various styles. This can also be used as a form input. - */ - export class ProgressBarElement extends InputElement implements IHasOptions { - constructor(options?: ProgressBarOptions); - - options: ProgressBarOptions; - - /** - * progress the bar by a fill amount. - * */ - progress(amount:number): void; - /** - * set progress to specific amount. - * */ - setProgress(amount:number): void; - /** - * reset the bar. - * */ - reset(): void; - - on(event: string, listener: Function): this; - /** - * Bar was reset. - */ - on(event: "reset", callback: () => void): this; - /** - * Bar has completely filled. - */ - on(event: "complete", callback: () => void): this; - } - - export interface LogOptions extends ScrollableTextOptions { - /** - * amount of scrollback allowed. default: Infinity. - * */ - scrollback?: number; - /** - * scroll to bottom on input even if the user has scrolled up. default: false. - * */ - scrollOnInput?: boolean; - } - - /** - * A log permanently scrolled to the bottom. - * */ - export class Log extends ScrollableTextElement implements IHasOptions { - constructor(options?: LogOptions); - - options: LogOptions; - - /** - * amount of scrollback allowed. default: Infinity. - * */ - scrollback: number; - /** - * scroll to bottom on input even if the user has scrolled up. default: false. - * */ - scrollOnInput: boolean; - - /** - * add a log line. - * */ - log(text:string): void; - /** - * add a log line. - * */ - add(text:string): void; - } - - export interface TableOptions extends BoxOptions { - /** - * array of array of strings representing rows (same as `data`). - * */ - rows?: string[][]; - /** - * array of array of strings representing rows (same as `rows`). - * */ - data?: string[][]; - /** - * spaces to attempt to pad on the sides of each cell. `2` by default: one space on each side (only useful if the width is shrunken). - * */ - pad?: number; - /** - * do not draw inner cells. - * */ - noCellBorders?: boolean; - /** - * fill cell borders with the adjacent background color. - * */ - fillCellBorders?: boolean; - } - - /** - * A stylized table of text elements. - * */ - export class TableElement extends BoxElement implements IHasOptions { - constructor(opts: TableOptions); - - options: TableOptions; - - /** - * set rows in table. array of arrays of strings. - * */ - setData(rows: string[][]): void; - /** - * set rows in table. array of arrays of strings. - * */ - setRows(rows: string[][]): void; - } - - export interface TerminalOptions extends BoxOptions { - /** - * handler for input data. - * */ - handler?: (userInput:Buffer) => void; - /** - * name of shell. $SHELL by default. - * */ - shell?:string; - /** - * args for shell. - * */ - args?:any; - /** - * can be line, underline, and block. - * */ - cursor?: 'line'|'underline'|'block'; - - terminal?: string; - - /** - * Object for process env. - */ - env?: any; - } - - export class TerminalElement extends BoxElement implements IHasOptions { - constructor(opts: TerminalOptions); - - options: TerminalOptions; - - /** - * reference to the headless term.js terminal. - * */ - term: any; - /** - * reference to the pty.js pseudo terminal. - * */ - pty: any; - - /** - * write data to the terminal. - * */ - write(data:string): void; - - /** - * nearly identical to `element.screenshot`, however, the specified region includes the terminal's _entire_ scrollback, rather than just what is visible on the screen. - * */ - screenshot(xi?:number, xl?:number, yi?:number, yl?:number): string; - } - - export interface ImageOptions extends BoxOptions { - /** - * path to image. - * */ - file: string; - /** - * path to w3mimgdisplay. if a proper w3mimgdisplay path is not given, blessed will search the entire disk for the binary. - * */ - type: "ansi" | "overlay" | "w3m"; - } - - /** - * Display an image in the terminal (jpeg, png, gif) using w3mimgdisplay. Requires w3m to be installed. X11 required: works in xterm, urxvt, and possibly other terminals. - * */ - export class ImageElement extends BoxElement implements IHasOptions { - constructor(options?: ImageOptions); - - options: ImageOptions; - } - - export interface ANSIImageOptions extends BoxOptions { - /** - * URL or path to PNG/GIF file. Can also be a buffer. - * */ - file: string; - /** - * Scale cellmap down (0-1.0) from its original pixel width/height (Default: 1.0). - * */ - scale: number; - - /** - * This differs from other element's width or height in that only one of them is needed: blessed will maintain the aspect ratio of the image as it scales down to the proper number of cells. NOTE: PNG/GIF's are always automatically shrunken to size (based on scale) if a width or height is not given. - * */ - width: number | string; - height: number | string; - - /** - * Add various "density" ASCII characters over the rendering to give the image more detail, similar to libcaca/libcucul (the library mplayer uses to display videos in the terminal). - */ - ascii: string; - - /** - * Whether to animate if the image is an APNG/animating GIF. If false, only display the first frame or IDAT (Default: true). - */ - animate: boolean; - - /** - * Set the speed of animation. Slower: 0.0-1.0. Faster: 1-1000. It cannot go faster than 1 frame per millisecond, so 1000 is the fastest. (Default: 1.0) - */ - speed: number; - - /** - * mem or cpu. If optimizing for memory, animation frames will be rendered to bitmaps as the animation plays, using less memory. Optimizing for cpu will precompile all bitmaps beforehand, which may be faster, but might also OOM the process on large images. (Default: mem). - */ - optimization: "mem" | "cpu"; - } - - /** - * Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. - * */ - export class ANSIImageElement extends BoxElement implements IHasOptions { - constructor(options?:ANSIImageOptions); - - options: ANSIImageOptions; - - /** - * Image object from the png reader. - */ - img: Types.TImage; - - /** - * set the image in the box to a new path. - * */ - setImage(img: string, callback: () => void): void; - /** - * clear the current image. - * */ - clearImage(callback: () => void): void; - /** - * Play animation if it has been paused or stopped. - */ - play(): void; - /** - * Pause animation. - */ - pause(): void; - /** - * Stop animation. - */ - stop(): void; - } - - export interface OverlayImageOptions extends BoxOptions { - /** - * Path to image. - */ - file: string; - /** - * Render the file as ANSI art instead of using w3m to overlay Internally uses the ANSIImage element. See the ANSIImage element for more information/options. (Default: true). - */ - ansi: boolean; - /** - * Path to w3mimgdisplay. If a proper w3mimgdisplay path is not given, blessed will search the entire disk for the binary. - */ - w3m: string; - /** - * Whether to search /usr, /bin, and /lib for w3mimgdisplay (Default: true). - */ - search: string; - } - - /** - * Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. - * */ - export class OverlayImageElement extends BoxElement implements IHasOptions { - constructor(options?: OverlayImageOptions); - - options: OverlayImageOptions; - - /** - * set the image in the box to a new path. - * */ - setImage(img: string, callback: () => void): void; - /** - * clear the current image. - * */ - clearImage(callback: () => void): void; - /** - * get the size of an image file in pixels. - * */ - imageSize(img:string, callback: () => void): void; - /** - * get the size of the terminal in pixels. - * */ - termSize(callback: () => void): void; - /** - * get the pixel to cell ratio for the terminal. - * */ - getPixelRatio(callback: () => void): void; - } - - export interface VideoOptions extends BoxOptions { - /** - * Video to play. - */ - file: string; - /** - * Start time in seconds. - */ - start: number; - } - - export class VideoElement extends BoxElement implements IHasOptions { - constructor(options?: VideoOptions); - - options: VideoOptions; - - /** - * The terminal element running mplayer or mpv. - */ - tty: any; - } - - export interface LayoutOptions extends ElementOptions { - /** - * A callback which is called right before the children are iterated over to be rendered. Should return an - * iterator callback which is called on each child element: iterator(el, i). - */ - renderer?: () => void; - - /** - * Using the default renderer, it provides two layouts: inline, and grid. inline is the default and will render - * akin to inline-block. grid will create an automatic grid based on element dimensions. The grid cells' - * width and height are always determined by the largest children in the layout. - */ - layout: "inline" | "inline-block" | "grid"; - } - - export class LayoutElement extends BlessedElement implements IHasOptions { - constructor(options?: LayoutOptions); - - options: LayoutOptions; - - /** - * A callback which is called right before the children are iterated over to be rendered. Should return an - * iterator callback which is called on each child element: iterator(el, i). - */ - renderer(coords: PositionCoords): void; - /** - * Check to see if a previous child element has been rendered and is visible on screen. This is only useful - * for checking child elements that have already been attempted to be rendered! see the example below. - */ - isRendered(el: BlessedElement): boolean; - /** - * Get the last rendered and visible child element based on an index. This is useful for basing the position - * of the current child element on the position of the last child element. - */ - getLast(i: number): Element; - /** - * Get the last rendered and visible child element coords based on an index. This is useful for basing the position - * of the current child element on the position of the last child element. See the example below. - */ - getLastCoords(i: number): PositionCoords; - } + * Whether the cursor blinks. + */ + blink: boolean; - export class Program { /** - Wrap the given text in terminal formatting codes corresponding to the given attribute - name. The `attr` string can be of the form `red fg` or `52 bg` where `52` is a 0-255 - integer color number. - */ - text (text:string, attr:string): string; + * Color of the color. Accepts any valid color value (null is default). + */ + color: string; } } - export module widget { - export class Element extends Widgets.BlessedElement { } - export class Node extends Widgets.Node { } - export class Screen extends Widgets.Screen { } + namespace Events { + interface IMouseEventArg { + x: number; + y: number; + action: Types.TMouseAction; + } - export class Box extends Widgets.BoxElement { } - export class ScrollableBox extends Widgets.ScrollableBoxElement { } - export class ScrollableText extends Widgets.ScrollableTextElement { } - export class Text extends Widgets.BoxElement { } - export class Line extends Widgets.LineElement { } - export class BigText extends Widgets.BigTextElement { } - export class List extends Widgets.ListElement { } - export class FileManager extends Widgets.FileManagerElement { } - export class ListTable extends Widgets.ListTableElement { } - export class ListBar extends Widgets.ListbarElement { } - export class Form extends Widgets.FormElement { } - export class Textarea extends Widgets.TextareaElement { } - export class Button extends Widgets.ButtonElement { } - export class Checkbox extends Widgets.CheckboxElement { } - export class RadioSet extends Widgets.RadioSetElement { } - export class RadioButton extends Widgets.RadioButtonElement { } - - export class Prompt extends Widgets.PromptElement { } - export class question extends Widgets.QuestionElement { } - export class Message extends Widgets.MessageElement { } - export class Loading extends Widgets.LoadingElement { } - - export class ProgressBar extends Widgets.ProgressBarElement { } - export class Terminal extends Widgets.TerminalElement { } + interface IKeyEventArg { + full: string; + name: string; + shift: boolean; + ctrl: boolean; + meta: boolean; + sequence: string; + } } - export function screen(options?: Widgets.IScreenOptions): Widgets.Screen; + interface NodeChildProcessExecOptions { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + } - export function box(options?: Widgets.BoxOptions): Widgets.BoxElement; - export function text(options?: Widgets.TextOptions): Widgets.TextElement; - export function line(options?: Widgets.LineOptions): Widgets.LineElement; - export function scrollablebox(options?: Widgets.BoxOptions): Widgets.BoxElement; - export function scrollabletext(options?: Widgets.BoxOptions): Widgets.BoxElement; - export function bigtext(options?: Widgets.BigTextOptions): Widgets.BigTextElement; - export function list(options?: Widgets.ListOptions): Widgets.ListElement; - export function filemanager(options?: Widgets.FileManagerOptions): Widgets.FileManagerElement; - export function listtable(options?: Widgets.ListTableOptions): Widgets.ListTableElement; - export function listbar(options?: Widgets.ListbarOptions): Widgets.ListbarElement; - export function form(options?: Widgets.FormOptions): Widgets.FormElement; - export function input(options?: Widgets.InputOptions): Widgets.InputElement; - export function textarea(options?: Widgets.TextareaOptions): Widgets.TextareaElement; - export function textbox(options?: Widgets.TextboxOptions): Widgets.TextboxElement; - export function button(options?: Widgets.ButtonOptions): Widgets.ButtonElement; - export function checkbox(options?: Widgets.CheckboxOptions): Widgets.CheckboxElement; - export function radioset(options?: Widgets.RadioSetOptions): Widgets.RadioSetElement; - export function radiobutton(options?: Widgets.RadioButtonOptions): Widgets.RadioButtonElement; + interface IDestroyable { + destroy(): void; + } - export function table(options?: Widgets.TableOptions): Widgets.TableElement; + interface IOptions {} - export function prompt(options?: Widgets.PromptOptions): Widgets.PromptElement; - export function question(options?: Widgets.QuestionOptions): Widgets.QuestionElement; - export function message(options?: Widgets.MessageOptions): Widgets.MessageElement; - export function loading(options?: Widgets.LoadingOptions): Widgets.LoadingElement; + interface IHasOptions { + options: T; + } - export function progressbar(options?: Widgets.ProgressBarOptions): Widgets.ProgressBarElement; - export function terminal(options?: Widgets.TerminalOptions): Widgets.TerminalElement; + interface TputsOptions extends IOptions { + terminal?: string; + extended?: boolean; + debug?: boolean; + termcap?: string; + terminfoFile?: string; + terminfoPrefix?: string; + termcapFile?: string; + } - export function layout(options?: Widgets.LayoutOptions): Widgets.LayoutElement; + class Tput implements IHasOptions { + constructor(opts: TputsOptions); - export function escape(item: any): any; - export const colors: { - match: (hexColor: string) => string + /** + * Original options object. + */ + options: TputsOptions; + + debug: boolean; + padding: boolean; + extended: boolean; + printf: boolean; + termcap: string; + terminfoPrefix: string; + terminfoFile: string; + termcapFile: string; + error: Error; + terminal: string; + + setup(): void; + term(is: any): boolean; + readTerminfo(term: string): string; + parseTerminfo( + data: any, + file: string + ): { + header: { + dataSize: number; + headerSize: number; + magicNumber: boolean; + namesSize: number; + boolCount: number; + numCount: number; + strCount: number; + strTableSize: number; + extended: { + dataSize: number; + headerSize: number; + boolCount: number; + numCount: number; + strCount: number; + strTableSize: number; + lastStrTableOffset: number; + }; + }; + name: string; + names: string[]; + desc: string; + bools: any; + numbers: any; + strings: any; + }; + } + + interface IDestroyable { + destroy(): void; + } + + interface INodeOptions extends IOptions { + name?: string; + screen?: Screen; + parent?: Node; + children?: Node[]; + focusable?: boolean; + } + + type NodeEventType = + /** Received when node is added to a parent. */ + | "adopt" + /** Received when node is removed from it's current parent. */ + | "remove" + /** Received when node gains a new parent. */ + | "reparent" + /** Received when node is attached to the screen directly or somewhere in its ancestry. */ + | "attach" + /** Received when node is detached from the screen directly or somewhere in its ancestry. */ + | "detach"; + + abstract class Node extends EventEmitter implements IHasOptions, IDestroyable { + constructor(options: INodeOptions); + + focusable: boolean; + + /** + * Original options object. + */ + options: INodeOptions; + + /** + * An object for any miscellanous user data. + */ + data: { [index: string]: any }; + + /** + * An object for any miscellanous user data. + */ + _: { [index: string]: any }; + + /** + * An object for any miscellanous user data. + */ + $: { [index: string]: any }; + + /** + * Type of the node (e.g. box). + */ + type: string; + + /** + * Render index (document order index) of the last render call. + */ + index: number; + + /** + * Parent screen. + */ + screen: Screen; + + /** + * Parent node. + */ + parent: Node; + + /** + * Array of node's children. + */ + children: Node[]; + + /** + * Prepend a node to this node's children. + */ + prepend(node: Node): void; + + /** + * Append a node to this node's children. + */ + append(node: Node): void; + + /** + * Remove child node from node. + */ + remove(node: Node): void; + + /** + * Insert a node to this node's children at index i. + */ + insert(node: Node, index: number): void; + + /** + * Insert a node to this node's children before the reference node. + */ + insertBefore(node: Node, refNode: Node): void; + + /** + * Insert a node from node after the reference node. + */ + insertAfter(node: Node, refNode: Node): void; + + /** + * Remove node from its parent. + */ + detach(): void; + free(): void; + forDescendants(iter: (node: Node) => void, s: any): void; + forAncestors(iter: (node: Node) => void, s: any): void; + collectDescendants(s: any): void; + collectAncestors(s: any): void; + + /** + * Emit event for element, and recursively emit same event for all descendants. + */ + emitDescendants(type?: string, ...args: any[]): void; + emitAncestors(): void; + hasDescendant(target: Node): void; + hasAncestor(target: Node): boolean; + destroy(): void; + + /** + * Get user property with a potential default value. + */ + get(name: string, def: T): T; + + /** + * Set user property to value. + */ + set(name: string, value: any): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: NodeEventType, callback: (arg: Node) => void): this; + } + + type NodeScreenEventType = + /** + * Received when the terminal window focuses/blurs. Requires a terminal supporting the + * focus protocol and focus needs to be passed to program.enableMouse(). + */ + | "focus" + /** + * Received when the terminal window focuses/blurs. Requires a terminal supporting the + * focus protocol and focus needs to be passed to program.enableMouse(). + */ + | "blur" + /** + * Element was clicked (slightly smarter than mouseup). + */ + | "click" + | "element click" + | "element mouseover" + | "element mouseout" + | "element mouseup"; + + type NodeMouseEventType = + | "mouse" + | "mouseout" + | "mouseover" + | "mousedown" + | "mouseup" + | "mousewheel" + | "wheeldown" + | "wheelup" + | "mousemove"; + + type NodeGenericEventType = + /** Received on screen resize. */ + | "resize" + /** Received before render. */ + | "prerender" + /** Received on render. */ + | "render" + /** Received when the screen is destroyed (only useful when using multiple screens). */ + | "destroy" + /** Received when the element is moved. */ + | "move" + /** Received when element is shown. */ + | "show" + /** Received when element becomes hidden. */ + | "hide" + | "set content" + | "parsed content"; + + class NodeWithEvents extends Node { + /** + * Bind a keypress listener for a specific key. + */ + key(name: string | string[], listener: (ch: any, key: Events.IKeyEventArg) => void): void; + + /** + * Bind a keypress listener for a specific key once. + */ + onceKey(name: string, listener: (ch: any, key: Events.IKeyEventArg) => void): void; + + /** + * Remove a keypress listener for a specific key. + */ + unkey(name: string, listener: (ch: any, key: Events.IKeyEventArg) => void): void; + removeKey(name: string, listener: (ch: any, key: Events.IKeyEventArg) => void): void; + + on(event: string, listener: (ch: any, key: Events.IKeyEventArg) => void): this; + /** Received on mouse events. */ + on(event: NodeMouseEventType, callback: (arg: Events.IMouseEventArg) => void): this; + /** Received on key events. */ + on(event: "keypress", callback: (ch: string, key: Events.IKeyEventArg) => void): this; + on(event: NodeScreenEventType, callback: (arg: Screen) => void): this; + /** Received when blessed notices something untoward (output is not a tty, terminfo not found, etc). */ + on(event: "warning", callback: (text: string) => void): this; + on(event: NodeGenericEventType, callback: () => void): this; + } + + interface IScreenOptions extends INodeOptions { + /** + * The blessed Program to be associated with. Will be automatically instantiated if none is provided. + */ + program?: BlessedProgram; + + /** + * Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with + * uniform cells to their sides). This is known to cause flickering with elements that are not full-width, + * however, it is more optimal for terminal rendering. + */ + smartCSR?: boolean; + + /** + * Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR, + * but may cause flickering depending on what is on each side of the element. + */ + fastCSR?: boolean; + + /** + * Attempt to perform back_color_erase optimizations for terminals that support it. It will also work + * with terminals that don't support it, but only on lines with the default background color. As it + * stands with the current implementation, it's uncertain how much terminal performance this adds at + * the cost of overhead within node. + */ + useBCE?: boolean; + + /** + * Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300). + */ + resizeTimeout?: number; + + /** + * The width of tabs within an element's content. + */ + tabSize?: number; + + /** + * Automatically position child elements with border and padding in mind (NOTE: this is a recommended + * option. It may become default in the future). + */ + autoPadding?: boolean; + + cursor?: Types.TCursor; + + /** + * Create a log file. See log method. + */ + log?(...msg: any[]): void; + + /** + * Dump all output and input to desired file. Can be used together with log option if set as a boolean. + */ + dump?: string; + + /** + * Debug mode. Enables usage of the debug method. Also creates a debug console which will display when + * pressing F12. It will display all log and debug messages. + */ + debug?(...msg: string[]): void; + + /** + * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful + * for creating a key that will always exit no matter whether the keys are locked. + */ + ignoreLocked?: boolean; + + /** + * Automatically "dock" borders with other elements instead of overlapping, depending on position + * (experimental). For example: These border-overlapped elements: + */ + dockBorders?: boolean; + + /** + * Normally, dockable borders will not dock if the colors or attributes are different. This option + * will allow them to dock regardless. It may produce some odd looking multi-colored borders though. + */ + ignoreDockContrast?: boolean; + + /** + * Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode + * combining characters. This allows you to display text above the basic multilingual plane. This + * is behind an option because it may affect performance slightly negatively. Without this option + * enabled, all double-width, surrogate pair, and combining characters will be replaced by '??', + * '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply + * removes them from an element's content if iTerm2 is detected). + */ + fullUnicode?: boolean; + + /** + * Send focus events after mouse is enabled. + */ + sendFocus?: boolean; + + /** + * Display warnings (such as the output not being a TTY, similar to ncurses). + */ + warnings?: boolean; + + /** + * Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page. + * If value is true unicode is forced. If value is false non-unicode is forced (default: null). + */ + forceUnicode?: boolean; + + /** + * Input and output streams. process.stdin/process.stdout by default, however, it could be a + * net.Socket if you want to make a program that runs over telnet or something of that nature. + */ + input?: stream.Writable; + + /** + * Input and output streams. process.stdin/process.stdout by default, however, it could be a + * net.Socket if you want to make a program that runs over telnet or something of that nature. + */ + output?: stream.Readable; + + /** + * The blessed Tput object (only available if you passed tput: true to the Program constructor.) + */ + tput?: Tput; + + /** + * Top of the focus history stack. + */ + focused?: BlessedElement; + + /** + * Width of the screen (same as program.cols). + */ + width?: Types.TPosition; + + /** + * Height of the screen (same as program.rows). + */ + height?: Types.TPosition; + + /** + * Same as screen.width. + */ + cols?: number; + + /** + * Same as screen.height. + */ + rows?: number; + + /** + * Relative top offset, always zero. + */ + top?: Types.TTopLeft; + + /** + * Relative left offset, always zero. + */ + left?: Types.TTopLeft; + + /** + * Relative right offset, always zero. + */ + right?: Types.TPosition; + + /** + * Relative bottom offset, always zero. + */ + bottom?: Types.TPosition; + + /** + * Absolute top offset, always zero. + */ + atop?: Types.TTopLeft; + + /** + * Absolute left offset, always zero. + */ + aleft?: Types.TTopLeft; + + /** + * Absolute right offset, always zero. + */ + aright?: Types.TPosition; + + /** + * Absolute bottom offset, always zero. + */ + abottom?: Types.TPosition; + + /** + * Whether the focused element grabs all keypresses. + */ + grabKeys?: any; + + /** + * Prevent keypresses from being received by any element. + */ + lockKeys?: boolean; + + /** + * The currently hovered element. Only set if mouse events are bound. + */ + hover?: any; + + /** + * Set or get terminal name. Set calls screen.setTerminal() internally. + */ + terminal?: string; + + /** + * Set or get window title. + */ + title?: string; + } + + class Screen extends NodeWithEvents implements IHasOptions { + constructor(opts: IScreenOptions); + + cleanSides: any; + + /** + * Original options object. + */ + options: IScreenOptions; + + /** + * The blessed Program to be associated with. Will be automatically instantiated if none is provided. + */ + program: BlessedProgram; + + /** + * Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with + * uniform cells to their sides). This is known to cause flickering with elements that are not full-width, + * however, it is more optimal for terminal rendering. + */ + smartCSR: boolean; + + /** + * Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR, + * but may cause flickering depending on what is on each side of the element. + */ + fastCSR: boolean; + + /** + * Attempt to perform back_color_erase optimizations for terminals that support it. It will also work + * with terminals that don't support it, but only on lines with the default background color. As it + * stands with the current implementation, it's uncertain how much terminal performance this adds at + * the cost of overhead within node. + */ + useBCE: boolean; + + /** + * Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300). + */ + resizeTimeout: number; + + /** + * The width of tabs within an element's content. + */ + tabSize: number; + + /** + * Automatically position child elements with border and padding in mind (NOTE: this is a recommended + * option. It may become default in the future). + */ + autoPadding: boolean; + + cursor: Types.TCursor; + + /** + * Dump all output and input to desired file. Can be used together with log option if set as a boolean. + */ + dump: string; + + /** + * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful + * for creating a key that will always exit no matter whether the keys are locked. + */ + ignoreLocked: boolean; + + /** + * Automatically "dock" borders with other elements instead of overlapping, depending on position + * (experimental). For example: These border-overlapped elements: + */ + dockBorders: boolean; + + /** + * Normally, dockable borders will not dock if the colors or attributes are different. This option + * will allow them to dock regardless. It may produce some odd looking multi-colored borders though. + */ + ignoreDockContrast: boolean; + + /** + * Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode + * combining characters. This allows you to display text above the basic multilingual plane. This + * is behind an option because it may affect performance slightly negatively. Without this option + * enabled, all double-width, surrogate pair, and combining characters will be replaced by '??', + * '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply + * removes them from an element's content if iTerm2 is detected). + */ + fullUnicode: boolean; + + /** + * Send focus events after mouse is enabled. + */ + sendFocus: boolean; + + /** + * Display warnings (such as the output not being a TTY, similar to ncurses). + */ + warnings: boolean; + + /** + * Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page. + * If value is true unicode is forced. If value is false non-unicode is forced (default: null). + */ + forceUnicode: boolean; + + /** + * Input and output streams. process.stdin/process.stdout by default, however, it could be a + * net.Socket if you want to make a program that runs over telnet or something of that nature. + */ + input: stream.Writable; + + /** + * Input and output streams. process.stdin/process.stdout by default, however, it could be a + * net.Socket if you want to make a program that runs over telnet or something of that nature. + */ + output: stream.Readable; + + /** + * The blessed Tput object (only available if you passed tput: true to the Program constructor.) + */ + tput: Tput; + + /** + * Top of the focus history stack. + */ + focused: BlessedElement; + + /** + * Width of the screen (same as program.cols). + */ + width: Types.TPosition; + + /** + * Height of the screen (same as program.rows). + */ + height: Types.TPosition; + + /** + * Same as screen.width. + */ + cols: number; + + /** + * Same as screen.height. + */ + rows: number; + + /** + * Relative top offset, always zero. + */ + top: Types.TTopLeft; + + /** + * Relative left offset, always zero. + */ + left: Types.TTopLeft; + + /** + * Relative right offset, always zero. + */ + right: Types.TPosition; + + /** + * Relative bottom offset, always zero. + */ + bottom: Types.TPosition; + + /** + * Absolute top offset, always zero. + */ + atop: Types.TTopLeft; + + /** + * Absolute left offset, always zero. + */ + aleft: Types.TTopLeft; + + /** + * Absolute right offset, always zero. + */ + aright: Types.TPosition; + + /** + * Absolute bottom offset, always zero. + */ + abottom: Types.TPosition; + + /** + * Whether the focused element grabs all keypresses. + */ + grabKeys: any; + + /** + * Prevent keypresses from being received by any element. + */ + lockKeys: boolean; + + /** + * The currently hovered element. Only set if mouse events are bound. + */ + hover: any; + + /** + * Set or get terminal name. Set calls screen.setTerminal() internally. + */ + terminal: string; + + /** + * Set or get window title. + */ + title: string; + + /** + * Write string to the log file if one was created. + */ + log(...msg: any[]): void; + + /** + * Same as the log method, but only gets called if the debug option was set. + */ + debug(...msg: string[]): void; + + /** + * Allocate a new pending screen buffer and a new output screen buffer. + */ + alloc(): void; + + /** + * Reallocate the screen buffers and clear the screen. + */ + realloc(): void; + + /** + * Draw the screen based on the contents of the screen buffer. + */ + draw(start: number, end: number): void; + + /** + * Render all child elements, writing all data to the screen buffer and drawing the screen. + */ + render(): void; + + /** + * Clear any region on the screen. + */ + clearRegion(x1: number, x2: number, y1: number, y2: number): void; + + /** + * Fill any region with a character of a certain attribute. + */ + fillRegion(attr: string, ch: string, x1: number, x2: number, y1: number, y2: number): void; + + /** + * Focus element by offset of focusable elements. + */ + focusOffset(offset: number): any; + + /** + * Focus previous element in the index. + */ + focusPrevious(): void; + + /** + * Focus next element in the index. + */ + focusNext(): void; + + /** + * Push element on the focus stack (equivalent to screen.focused = el). + */ + focusPush(element: BlessedElement): void; + + /** + * Pop element off the focus stack. + */ + focusPop(): BlessedElement; + + /** + * Save the focused element. + */ + saveFocus(): BlessedElement; + + /** + * Restore the saved focused element. + */ + restoreFocus(): BlessedElement; + + /** + * "Rewind" focus to the last visible and attached element. + */ + rewindFocus(): BlessedElement; + + /** + * Spawn a process in the foreground, return to blessed app after exit. + */ + spawn(file: string, args: string[], options: NodeChildProcessExecOptions): child_process.ChildProcess; + + /** + * Spawn a process in the foreground, return to blessed app after exit. Executes callback on error or exit. + */ + exec( + file: string, + args: string[], + options: NodeChildProcessExecOptions, + callback: (...args: any[]) => void + ): child_process.ChildProcess; + + /** + * Read data from text editor. + */ + readEditor(options: any, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + readEditor(callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + /** + * Set effects based on two events and attributes. + */ + setEffects(el: BlessedElement, fel: BlessedElement, over: any, out: any, effects: any, temp: any): void; + + /** + * Insert a line into the screen (using csr: this bypasses the output buffer). + */ + insertLine(n: number, y: number, top: number, bottom: number): void; + + /** + * Delete a line from the screen (using csr: this bypasses the output buffer). + */ + deleteLine(n: number, y: number, top: number, bottom: number): void; + + /** + * Insert a line at the bottom of the screen. + */ + insertBottom(top: number, bottom: number): void; + + /** + * Insert a line at the top of the screen. + */ + insertTop(top: number, bottom: number): void; + + /** + * Delete a line at the bottom of the screen. + */ + deleteBottom(top: number, bottom: number): void; + + /** + * Delete a line at the top of the screen. + */ + deleteTop(top: number, bottom: number): void; + + /** + * Enable mouse events for the screen and optionally an element (automatically called when a form of + * on('mouse') is bound). + */ + enableMouse(el?: BlessedElement): void; + + /** + * Enable keypress events for the screen and optionally an element (automatically called when a form of + * on('keypress') is bound). + */ + enableKeys(el?: BlessedElement): void; + + /** + * Enable key and mouse events. Calls bot enableMouse and enableKeys. + */ + enableInput(el?: BlessedElement): void; + + /** + * Attempt to copy text to clipboard using iTerm2's proprietary sequence. Returns true if successful. + */ + copyToClipboard(text: string): void; + + /** + * Attempt to change cursor shape. Will not work in all terminals (see artificial cursors for a solution + * to this). Returns true if successful. + */ + cursorShape(shape: boolean, blink: boolean): any; + + /** + * Attempt to change cursor color. Returns true if successful. + */ + cursorColor(color: string): void; + + /** + * Attempt to reset cursor. Returns true if successful. + */ + cursorReset(): void; + + /** + * Take an SGR screenshot of the screen within the region. Returns a string containing only + * characters and SGR codes. Can be displayed by simply echoing it in a terminal. + */ + screenshot(xi: number, xl: number, yi: number, yl: number): string; + screenshot(): void; + + /** + * Destroy the screen object and remove it from the global list. Also remove all global events relevant + * to the screen object. If all screen objects are destroyed, the node process is essentially reset + * to its initial state. + */ + destroy(): void; + + /** + * Reset the terminal to term. Reloads terminfo. + */ + setTerminal(term: string): void; + } + + interface Padding { + left?: number; + right?: number; + top?: number; + bottom?: number; + } + + class PositionCoords { + xi: number; + xl: number; + yi: number; + yl: number; + } + + interface Position { + left: number | string; + right: number | string; + top: number | string; + bottom: number | string; + } + + interface Border { + /** + * Type of border (line or bg). bg by default. + */ + type?: "line" | "bg"; + + /** + * Character to use if bg type, default is space. + */ + ch?: string; + + /** + * Border foreground and background, must be numbers (-1 for default). + */ + bg?: number; + fg?: number; + + /** + * Border attributes. + */ + bold?: string; + underline?: string; + } + + interface ElementOptions extends INodeOptions { + tags?: boolean; + + fg?: string; + bg?: string; + bold?: string; + underline?: string; + + style?: any; + + /** + * Border object, see below. + */ + border?: Border | "line" | "bg"; + + /** + * Element's text content. + */ + content?: string; + + /** + * Element is clickable. + */ + clickable?: boolean; + + /** + * Element is focusable and can receive key input. + */ + input?: boolean; + keyable?: boolean; + + /** + * Element is focused. + */ + focused?: BlessedElement; + + /** + * Whether the element is hidden. + */ + hidden?: boolean; + + /** + * A simple text label for the element. + */ + label?: string; + + /** + * A floating text label for the element which appears on mouseover. + */ + hoverText?: string; + + /** + * Text alignment: left, center, or right. + */ + align?: "left" | "center" | "right"; + + /** + * Vertical text alignment: top, middle, or bottom. + */ + valign?: "top" | "middle" | "bottom"; + + /** + * Shrink/flex/grow to content and child elements. Width/height during render. + */ + shrink?: boolean; + + /** + * Amount of padding on the inside of the element. Can be a number or an object containing + * the properties: left, right, top, and bottom. + */ + padding?: number | Padding; + + top?: Types.TTopLeft; + left?: Types.TTopLeft; + right?: Types.TPosition; + bottom?: Types.TPosition; + + /** + * Width/height of the element, can be a number, percentage (0-100%), or keyword (half or shrink). + * Percentages can also have offsets (50%+1, 50%-1). + */ + width?: number | string; + + /** + * Offsets of the element relative to its parent. Can be a number, percentage (0-100%), or + * keyword (center). right and bottom do not accept keywords. Percentages can also have + * offsets (50%+1, 50%-1). + */ + height?: number | string; + + /** + * Can contain the above options. + */ + position?: Position; + + /** + * Whether the element is scrollable or not. + */ + scrollable?: boolean; + + /** + * Background character (default is whitespace ). + */ + ch?: string; + + /** + * Allow the element to be dragged with the mouse. + */ + draggable?: boolean; + + /** + * Draw a translucent offset shadow behind the element. + */ + shadow?: boolean; + } + + interface Coords { + xl: number; + xi: number; + yl: number; + yi: number; + base: number; + _contentEnd: { x: number; y: number }; + notop: Types.TTopLeft; + noleft: Types.TTopLeft; + noright: Types.TPosition; + nobot: Types.TPosition; + } + + interface LabelOptions { + text: string; + side: Types.TAlign; + } + + // TODO: scrollable - Note: If the scrollable option is enabled, Element inherits all methods from ScrollableBox. + abstract class BlessedElement extends NodeWithEvents implements IHasOptions { + constructor(opts: ElementOptions); + + /** + * Original options object. + */ + options: ElementOptions; + + /** + * Name of the element. Useful for form submission. + */ + name: string; + + /** + * Border object. + */ + border: Border; + + style: any; + position: Position; + content: string; + hidden: boolean; + visible: boolean; + detached: boolean; + + /** + * Border foreground and background, must be numbers (-1 for default). + */ + bg: number; + fg: number; + + /** + * Border attributes. + */ + bold: string; + underline: string; + + /** + * Calculated width. + */ + width: number | string; + + /** + * Calculated height. + */ + height: number | string; + + /** + * Calculated relative top offset. + */ + top: Types.TTopLeft; + + /** + * Calculated relative left offset. + */ + left: Types.TTopLeft; + + /** + * Calculated relative right offset. + */ + right: Types.TPosition; + + /** + * Calculated relative bottom offset. + */ + bottom: Types.TPosition; + + /** + * Calculated absolute top offset. + */ + atop: Types.TTopLeft; + + /** + * Calculated absolute left offset. + */ + aleft: Types.TTopLeft; + + /** + * Calculated absolute right offset. + */ + aright: Types.TPosition; + + /** + * Calculated absolute bottom offset. + */ + abottom: Types.TPosition; + + /** + * Whether the element is draggable. Set to true to allow dragging. + */ + draggable: boolean; + + itop: Types.TTopLeft; + ileft: Types.TTopLeft; + iheight: Types.TPosition; + iwidth: Types.TPosition; + + /** + * Calculated relative top offset. + */ + rtop: Types.TTopLeft; + + /** + * Calculated relative left offset. + */ + rleft: Types.TTopLeft; + + /** + * Calculated relative right offset. + */ + rright: Types.TPosition; + + /** + * Calculated relative bottom offset. + */ + rbottom: Types.TPosition; + + lpos: PositionCoords; + + /** + * Write content and children to the screen buffer. + */ + render(): Coords; + + /** + * Hide element. + */ + hide(): void; + + /** + * Show element. + */ + show(): void; + + /** + * Toggle hidden/shown. + */ + toggle(): void; + + /** + * Focus element. + */ + focus(): void; + + /** + * Same asel.on('screen', ...) except this will automatically keep track of which listeners + * are bound to the screen object. For use with removeScreenEvent(), free(), and destroy(). + */ + onScreenEvent(type: string, handler: (...args: any[]) => void): void; + + /** + * Same asel.removeListener('screen', ...) except this will automatically keep track of which + * listeners are bound to the screen object. For use with onScreenEvent(), free(), and destroy(). + */ + removeScreenEvent(type: string, handler: (...args: any[]) => void): void; + + /** + * Free up the element. Automatically unbind all events that may have been bound to the screen + * object. This prevents memory leaks. For use with onScreenEvent(), removeScreenEvent(), + * and destroy(). + */ + free(): void; + + /** + * Same as the detach() method, except this will automatically call free() and unbind any screen + * events to prevent memory leaks. for use with onScreenEvent(), removeScreenEvent(), and free(). + */ + destroy(): void; + + /** + * Set the z-index of the element (changes rendering order). + */ + setIndex(z: number): void; + + /** + * Put the element in front of its siblings. + */ + setFront(): void; + + /** + * Put the element in back of its siblings. + */ + setBack(): void; + + /** + * text/options - Set the label text for the top-left corner. Example options: {text:'foo',side:'left'} + */ + setLabel(arg: string | LabelOptions): void; + + /** + * Remove the label completely. + */ + removeLabel(): any; + + /** + * text/options - Set a hover text box to follow the cursor. Similar to the "title" DOM attribute + * in the browser. Example options: {text:'foo'} + */ + setHover(arg: string | LabelOptions): void; + + /** + * Remove the hover label completely. + */ + removeHover(): void; + + /** + * Enable mouse events for the element (automatically called when a form of on('mouse') is bound). + */ + enableMouse(): void; + + /** + * Enable keypress events for the element (automatically called when a form of on('keypress') is bound). + */ + enableKeys(): void; + + /** + * Enable key and mouse events. Calls bot enableMouse and enableKeys. + */ + enableInput(): void; + + /** + * Enable dragging of the element. + */ + enableDrag(): void; + + /** + * Disable dragging of the element. + */ + disableDrag(): void; + + /** + * Take an SGR screenshot of the screen within the region. Returns a string containing only + * characters and SGR codes. Can be displayed by simply echoing it in a terminal. + */ + screenshot(xi: number, xl: number, yi: number, yl: number): string; + screenshot(): void; + + /* + Content Methods + + Methods for dealing with text content, line by line. Useful for writing a text editor, + irc client, etc. + + Note: All of these methods deal with pre-aligned, pre-wrapped text. If you use deleteTop() + on a box with a wrapped line at the top, it may remove 3-4 "real" lines (rows) depending + on how long the original line was. + + The lines parameter can be a string or an array of strings. The line parameter must + be a string. + */ + + /** + * Set the content. Note: When text is input, it will be stripped of all non-SGR + * escape codes, tabs will be replaced with 8 spaces, and tags will be replaced + * with SGR codes (if enabled). + */ + setContent(text: string): void; + + /** + * Return content, slightly different from el.content. Assume the above formatting. + */ + getContent(): string; + + /** + * Similar to setContent, but ignore tags and remove escape codes. + */ + setText(text: string): void; + + /** + * Similar to getContent, but return content with tags and escape codes removed. + */ + getText(): string; + + /** + * Insert a line into the box's content. + */ + insertLine(i: number, lines: string | string[]): void; + + /** + * Delete a line from the box's content. + */ + deleteLine(i: number): void; + + /** + * Get a line from the box's content. + */ + getLine(i: number): string; + + /** + * Get a line from the box's content from the visible top. + */ + getBaseLine(i: number): string; + + /** + * Set a line in the box's content. + */ + setLine(i: number, line: string | string[]): void; + + /** + * Set a line in the box's content from the visible top. + */ + setBaseLine(i: number, line: string | string[]): void; + + /** + * Clear a line from the box's content. + */ + clearLine(i: number): void; + + /** + * Clear a line from the box's content from the visible top. + */ + clearBaseLine(i: number): void; + + /** + * Insert a line at the top of the box. + */ + insertTop(lines: string | string[]): void; + + /** + * Insert a line at the bottom of the box. + */ + insertBottom(lines: string | string[]): void; + + /** + * Delete a line at the top of the box. + */ + deleteTop(): void; + + /** + * Delete a line at the bottom of the box. + */ + deleteBottom(): void; + + /** + * Unshift a line onto the top of the content. + */ + unshiftLine(lines: string | string[]): void; + + /** + * Shift a line off the top of the content. + */ + shiftLine(i: number): void; + + /** + * Push a line onto the bottom of the content. + */ + pushLine(lines: string | string[]): void; + + /** + * Pop a line off the bottom of the content. + */ + popLine(i: number): string; + + /** + * An array containing the content lines. + */ + getLines(): string[]; + + /** + * An array containing the lines as they are displayed on the screen. + */ + getScreenLines(): string[]; + + /** + * Get a string's displayed width, taking into account double-width, surrogate pairs, + * combining characters, tags, and SGR escape codes. + */ + strWidth(text: string): string; + } + + interface ScrollableBoxOptions extends ElementOptions { + /** + * A limit to the childBase. Default is Infinity. + */ + baseLimit?: number; + + /** + * A option which causes the ignoring of childOffset. This in turn causes the + * childBase to change every time the element is scrolled. + */ + alwaysScroll?: boolean; + + /** + * Object enabling a scrollbar. + * Style of the scrollbar track if present (takes regular style options). + */ + scrollbar?: { style?: any; track?: any; ch?: string }; + } + + interface ScrollableTextOptions extends ScrollableBoxOptions { + /** + * Whether to enable automatic mouse support for this element. + * Use pre-defined mouse events (right-click for editor). + */ + mouse?: boolean | (() => void); + + /** + * Use pre-defined keys (i or enter for insert, e for editor, C-e for editor while inserting). + */ + keys?: string | string[] | boolean; + + /** + * Use vi keys with the keys option. + */ + vi?: boolean; + } + + interface BoxOptions extends ScrollableTextOptions { + bindings?: any; + } + + /** + * DEPRECATED - Use Box with the scrollable option instead. A box with scrollable content. + */ + class ScrollableBoxElement extends BlessedElement { + /** + * The offset of the top of the scroll content. + */ + childBase: number; + + /** + * The offset of the chosen item/line. + */ + childOffset: number; + + /** + * Scroll the content by a relative offset. + */ + scroll(offset: number, always?: boolean): void; + + /** + * Scroll the content to an absolute index. + */ + scrollTo(index: number): void; + + /** + * Same as scrollTo. + */ + setScroll(index: number): void; + + /** + * Set the current scroll index in percentage (0-100). + */ + setScrollPerc(perc: number): void; + + /** + * Get the current scroll index in lines. + */ + getScroll(): number; + + /** + * Get the actual height of the scrolling area. + */ + getScrollHeight(): number; + + /** + * Get the current scroll index in percentage. + */ + getScrollPerc(): number; + + /** + * Reset the scroll index to its initial state. + */ + resetScroll(): void; + + on(event: string, listener: (...args: any[]) => void): this; + + /** + * Received when the element is scrolled. + */ + on(event: "scroll", callback: () => void): this; + } + + /** + * DEPRECATED - Use Box with the scrollable and alwaysScroll options instead. + * A scrollable text box which can display and scroll text, as well as handle + * pre-existing newlines and escape codes. + */ + class ScrollableTextElement extends ScrollableBoxElement {} + + /** + * A box element which draws a simple box containing content or other elements. + */ + class BoxElement extends ScrollableTextElement implements IHasOptions { + constructor(opts: BoxOptions); + + /** + * Original options object. + */ + options: BoxOptions; + } + + interface TextOptions extends ElementOptions { + /** + * Fill the entire line with chosen bg until parent bg ends, even if there + * is not enough text to fill the entire width. + */ + fill?: boolean; + + /** + * Text alignment: left, center, or right. + */ + align?: Types.TAlign; + } + + /** + * An element similar to Box, but geared towards rendering simple text elements. + */ + class TextElement extends BlessedElement implements IHasOptions { + constructor(opts: TextOptions); + + /** + * Original options object. + */ + options: TextOptions; + } + + /** + * A simple line which can be line or bg styled. + */ + interface LineOptions extends BoxOptions { + /** + * Can be vertical or horizontal. + */ + orientation?: "vertical" | "horizontal"; + + /** + * Treated the same as a border object. (attributes can be contained in style). + */ + type?: string; + bg?: string; + fg?: string; + ch?: string; + } + + /** + * A simple line which can be line or bg styled. + */ + class LineElement extends BoxElement implements IHasOptions { + constructor(opts: LineOptions); + + /** + * Original options object. + */ + options: LineOptions; + } + + interface BigTextOptions extends BoxOptions { + /** + * bdf->json font file to use (see ttystudio for instructions on compiling BDFs to JSON). + */ + font?: string; + + /** + * bdf->json bold font file to use (see ttystudio for instructions on compiling BDFs to JSON). + */ + fontBold?: string; + + /** + * foreground character. (default: ' ') + */ + fch?: string; + } + + /** + * A box which can render content drawn as 8x14 cell characters using the terminus font. + */ + class BigTextElement extends BoxElement implements IHasOptions { + constructor(opts: BigTextOptions); + + /** + * Original options object. + */ + options: BigTextOptions; + } + + interface ListElementStyle { + selected?: any; + item?: any; + } + + interface ListOptions extends BoxOptions { + /** + * Style for a selected item. Style for an unselected item. + */ + style?: TStyle; + + /** + * An array of strings which become the list's items. + */ + items?: string[]; + + /** + * A function that is called when vi mode is enabled and the key / is pressed. This function accepts a + * callback function which should be called with the search string. The search string is then used to + * jump to an item that is found in items. + */ + search?(err: any, value?: string): void; + + /** + * Whether the list is interactive and can have items selected (Default: true). + */ + interactive?: boolean; + + /** + * Whether to automatically override tags and invert fg of item when selected (Default: true). + */ + invertSelected?: boolean; + } + + type ListElementEventType = + /** List was canceled (when esc is pressed with the keys option). */ + | "cancel" + /** Either a select or a cancel event was received. */ + | "action" + | "create item" + | "add item" + | "remove item" + | "insert item" + | "set items"; + + class ListElement extends BoxElement implements IHasOptions> { + constructor(opts: ListOptions); + + /** + * Original options object. + */ + options: ListOptions; + + /** + * Add an item based on a string. + */ + add(text: string): void; + + /** + * Add an item based on a string. + */ + addItem(text: string): void; + + /** + * Removes an item from the list. Child can be an element, index, or string. + */ + removeItem(child: BlessedElement): BlessedElement; + + /** + * Push an item onto the list. + */ + pushItem(child: BlessedElement): number; + + /** + * Pop an item off the list. + */ + popItem(): BlessedElement; + + /** + * Unshift an item onto the list. + */ + unshiftItem(child: BlessedElement): number; + + /** + * Shift an item off the list. + */ + shiftItem(): BlessedElement; + + /** + * Inserts an item to the list. Child can be an element, index, or string. + */ + insertItem(i: number, child: BlessedElement): void; + + /** + * Returns the item element. Child can be an element, index, or string. + */ + getItem(child: BlessedElement): BlessedElement; + + /** + * Set item to content. + */ + setItem(child: BlessedElement, content: BlessedElement | string): void; + + /** + * Remove and insert items to the list. + */ + spliceItem(i: number, n: number, ...items: BlessedElement[]): void; + + /** + * Clears all items from the list. + */ + clearItems(): void; + + /** + * Sets the list items to multiple strings. + */ + setItems(items: BlessedElement[]): void; + + /** + * Returns the item index from the list. Child can be an element, index, or string. + */ + getItemIndex(child: BlessedElement): number; + + /** + * Select an index of an item. + */ + select(index: number): void; + + /** + * Select item based on current offset. + */ + move(offset: number): void; + + /** + * Select item above selected. + */ + up(amount: number): void; + + /** + * Select item below selected. + */ + down(amount: number): void; + + /** + * Show/focus list and pick an item. The callback is executed with the result. + */ + pick(callback: () => void): void; + + /** + * Find an item based on its text content. + */ + fuzzyFind(arg: string | RegExp | (() => void)): void; + + on(event: string, listener: (...args: any[]) => void): this; + /** Received when an item is selected. */ + on(event: "select", callback: (item: BoxElement, index: number) => void): this; + on(event: ListElementEventType, callback: () => void): this; + on(event: "select item", callback: (item: BlessedElement, index: number) => void): this; + } + + interface FileManagerOptions extends ListOptions { + /** + * Current working directory. + */ + cwd?: string; + } + + class FileManagerElement extends ListElement implements IHasOptions { + constructor(opts: FileManagerOptions); + + /** + * Original options object. + */ + options: FileManagerOptions; + + /** + * Current working directory. + */ + cwd: string; + + /** + * Refresh the file list (perform a readdir on cwd and update the list items). + */ + refresh(cwd: string, callback: () => void): void; + refresh(callback?: () => void): void; + + /** + * Pick a single file and return the path in the callback. + */ + pick(cwd: string, callback: () => void): void; + pick(callback: () => void): void; + + /** + * Reset back to original cwd. + */ + reset(cwd: string, callback: () => void): void; + reset(callback?: () => void): void; + + on(event: string, listener: (...args: any[]) => void): this; + /** Received when an item is selected. */ + on(event: "cd", callback: (file: string, cwd: string) => void): this; + /** Received when an item is selected. */ + on(event: "file", callback: (file: string) => void): this; + on(event: "error", callback: (err: any, file: string) => void): this; + on(event: "refresh", callback: () => void): this; + } + + interface StyleListTable extends ListElementStyle { + /** + * Header style. + */ + header?: any; + + /** + * Cell style. + */ + cell?: any; + } + + interface ListTableOptions extends ListOptions { + /** + * Array of array of strings representing rows. + */ + rows?: string[]; + data?: string[][]; + + /** + * Spaces to attempt to pad on the sides of each cell. 2 by default: one space on each side + * (only useful if the width is shrunken). + */ + pad?: number; + + /** + * Do not draw inner cells. + */ + noCellBorders?: boolean; + + style?: StyleListTable; + } + + class ListTableElement extends ListElement implements IHasOptions { + constructor(opts: ListTableOptions); + + /** + * Original options object. + */ + options: ListTableOptions; + + /** + * Set rows in table. Array of arrays of strings. + * @example: + * + * table.setData([ + * [ 'Animals', 'Foods' ], + * [ 'Elephant', 'Apple' ], + * [ 'Bird', 'Orange' ] + * ]); + */ + setRows(rows: string[][]): void; + + /** + * Set rows in table. Array of arrays of strings. + * @example: + * + * table.setData([ + * [ 'Animals', 'Foods' ], + * [ 'Elephant', 'Apple' ], + * [ 'Bird', 'Orange' ] + * ]); + */ + setData(rows: string[][]): void; + } + + interface ListbarOptions extends BoxOptions { + style?: ListElementStyle; + + /** + * Set buttons using an object with keys as titles of buttons, containing of objects + * containing keys of keys and callback. + */ + commands: Types.ListbarCommand[]; + items: Types.ListbarCommand[]; + + /** + * Automatically bind list buttons to keys 0-9. + */ + autoCommandKeys: boolean; + } + + class ListbarElement extends BoxElement implements IHasOptions { + constructor(opts: ListbarOptions); + + /** + * Original options object. + */ + options: ListbarOptions; + + /** + * Set commands (see commands option above). + */ + setItems(commands: Types.ListbarCommand[]): void; + + /** + * Append an item to the bar. + */ + add(item: Types.ListbarCommand, callback: () => void): void; + + /** + * Append an item to the bar. + */ + addItem(item: Types.ListbarCommand, callback: () => void): void; + + /** + * Append an item to the bar. + */ + appendItem(item: Types.ListbarCommand, callback: () => void): void; + + /** + * Select an item on the bar. + */ + select(offset: number): void; + + /** + * Remove item from the bar. + */ + removeItem(child: BlessedElement): void; + + /** + * Move relatively across the bar. + */ + move(offset: number): void; + + /** + * Move left relatively across the bar. + */ + moveLeft(offset: number): void; + + /** + * Move right relatively across the bar. + */ + moveRight(offset: number): void; + + /** + * Select button and execute its callback. + */ + selectTab(index: number): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "set items" | "remove item" | "select tab", callback: () => void): this; + } + + interface FormOptions extends BoxOptions { + /** + * Allow default keys (tab, vi keys, enter). + */ + keys?: any; + + /** + * Allow vi keys. + */ + vi?: boolean; + } + + class FormElement extends BoxElement implements IHasOptions { + constructor(opts: FormOptions); + + /** + * Original options object. + */ + options: FormOptions; + + /** + * Last submitted data. + */ + submission: TFormData; + + /** + * Focus next form element. + */ + focusNext(): void; + + /** + * Focus previous form element. + */ + focusPrevious(): void; + + /** + * Submit the form. + */ + submit(): void; + + /** + * Discard the form. + */ + cancel(): void; + + /** + * Clear the form. + */ + reset(): void; + + on(event: string, listener: (...args: any[]) => void): this; + /** Form is submitted. Receives a data object. */ + on(event: "submit", callback: (out: TFormData) => void): this; + on(event: "cancel" | "reset", callback: () => void): this; + } + + interface InputOptions extends BoxOptions {} + + abstract class InputElement extends BoxElement { + constructor(opts: InputOptions); + } + + /** + * A box which allows multiline text input. + */ + interface TextareaOptions extends InputOptions { + /** + * Call readInput() when the element is focused. Automatically unfocus. + */ + inputOnFocus?: boolean; + } + + type TextareaElementEventType = + /** Value is an error. */ + | "error" + /** Value is submitted (enter). */ + | "submit" + /** Value is discared (escape). */ + | "cancel" + /** Either submit or cancel. */ + | "action"; + + class TextareaElement extends InputElement implements IHasOptions { + constructor(opts: TextareaOptions); + + /** + * Original options object. + */ + options: TextareaOptions; + + /** + * The input text. read-only. + */ + value: string; + + /** + * Submit the textarea (emits submit). + */ + submit(): void; + + /** + * Cancel the textarea (emits cancel). + */ + cancel(): void; + + /** + * Grab key events and start reading text from the keyboard. Takes a callback which receives + * the final value. + */ + readInput(callback?: (err: any, value?: string) => void): void; + + /** + * Grab key events and start reading text from the keyboard. Takes a callback which receives + * the final value. + */ + input(callback: (err: any, value?: string) => void): void; + + /** + * Grab key events and start reading text from the keyboard. Takes a callback which receives + * the final value. + */ + setInput(callback: (err: any, value?: string) => void): void; + + /** + * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which + * receives the final value. + */ + readEditor(callback: (err: any, value?: string) => void): void; + + /** + * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which + * receives the final value. + */ + editor(callback: (err: any, value?: string) => void): void; + + /** + * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which + * receives the final value. + */ + setEditor(callback: (err: any, value?: string) => void): void; + + /** + * The same as this.value, for now. + */ + getValue(): string; + + /** + * Clear input. + */ + clearValue(): void; + + /** + * Set value. + */ + setValue(text: string): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: TextareaElementEventType, callback: (err: any) => void): this; + } + + interface TextboxOptions extends TextareaOptions { + /** + * Completely hide text. + */ + secret?: boolean; + + /** + * Replace text with asterisks (*). + */ + censor?: boolean; + } + + class TextboxElement extends TextareaElement implements IHasOptions { + constructor(opts: TextboxOptions); + + /** + * Original options object. + */ + options: TextboxOptions; + + /** + * Completely hide text. + */ + secret: boolean; + + /** + * Replace text with asterisks (*). + */ + censor: boolean; + } + + interface ButtonOptions extends BoxOptions {} + + class ButtonElement extends InputElement implements IHasOptions { + constructor(opts: ButtonOptions); + + /** + * Original options object. + */ + options: ButtonOptions; + + /** + * Press button. Emits press. + */ + press(): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "press", callback: () => void): this; + } + + interface CheckboxOptions extends BoxOptions { + /** + * whether the element is checked or not. + */ + checked?: boolean; + + /** + * enable mouse support. + */ + mouse?: boolean; + } + + /** + * A checkbox which can be used in a form element. + */ + class CheckboxElement extends InputElement implements IHasOptions { + constructor(options?: CheckboxOptions); + + /** + * Original options object. + */ + options: CheckboxOptions; + + /** + * the text next to the checkbox (do not use setcontent, use `check.text = ''`). + */ + text: string; + + /** + * whether the element is checked or not. + */ + checked: boolean; + + /** + * same as `checked`. + */ + value: boolean; + + /** + * check the element. + */ + check(): void; + + /** + * uncheck the element. + */ + uncheck(): void; + + /** + * toggle checked state. + */ + toggle(): void; + } + + interface RadioSetOptions extends BoxOptions {} + + /** + * An element wrapping RadioButtons. RadioButtons within this element will be mutually exclusive + * with each other. + */ + abstract class RadioSetElement extends BoxElement { + constructor(opts: RadioSetOptions); + } + + interface RadioButtonOptions extends BoxOptions {} + + /** + * A radio button which can be used in a form element. + */ + abstract class RadioButtonElement extends CheckboxElement { + constructor(opts: RadioButtonOptions); + } + + interface PromptOptions extends BoxOptions {} + + /** + * A prompt box containing a text input, okay, and cancel buttons (automatically hidden). + */ + class PromptElement extends BoxElement implements IHasOptions { + constructor(opts: PromptOptions); + + options: PromptOptions; + + /** + * Show the prompt and wait for the result of the textbox. Set text and initial value. + */ + input(text: string, value: string, callback: (err: any, value: string) => void): void; + setInput(text: string, value: string, callback: (err: any, value: string) => void): void; + readInput(text: string, value: string, callback: (err: any, value: string) => void): void; + } + + interface QuestionOptions extends BoxOptions {} + + /** + * A question box containing okay and cancel buttons (automatically hidden). + */ + class QuestionElement extends BoxElement implements IHasOptions { + constructor(opts: QuestionOptions); + + options: QuestionOptions; + + /** + * Ask a question. callback will yield the result. + */ + ask(question: string, callback: (err: any, value: string) => void): void; + } + + interface MessageOptions extends BoxOptions {} + + /** + * A box containing a message to be displayed (automatically hidden). + */ + class MessageElement extends BoxElement implements IHasOptions { + constructor(opts: MessageOptions); + + options: MessageOptions; + + /** + * Display a message for a time (default is 3 seconds). Set time to 0 for a + * perpetual message that is dismissed on keypress. + */ + log(text: string, time: number, callback: (err: any) => void): void; + log(text: string, callback: (err: any) => void): void; + display(text: string, time: number, callback: (err: any) => void): void; + display(text: string, callback: (err: any) => void): void; + + /** + * Display an error in the same way. + */ + error(text: string, time: number, callback: () => void): void; + error(text: string, callback: () => void): void; + } + + interface LoadingOptions extends BoxOptions {} + + /** + * A box with a spinning line to denote loading (automatically hidden). + */ + class LoadingElement extends BoxElement implements IHasOptions { + constructor(opts: LoadingOptions); + + options: LoadingOptions; + + /** + * Display the loading box with a message. Will lock keys until stop is called. + */ + load(text: string): void; + + /** + * Hide loading box. Unlock keys. + */ + stop(): void; + } + + interface ProgressBarOptions extends BoxOptions { + /** + * can be `horizontal` or `vertical`. + */ + orientation: string; + + /** + * the character to fill the bar with (default is space). + */ + pch: string; + + /** + * the amount filled (0 - 100). + */ + filled: number; + + /** + * same as `filled`. + */ + value: number; + + /** + * enable key support. + */ + keys: boolean; + + /** + * enable mouse support. + */ + mouse: boolean; + } + + /** + * A progress bar allowing various styles. This can also be used as a form input. + */ + class ProgressBarElement extends InputElement implements IHasOptions { + constructor(options?: ProgressBarOptions); + + options: ProgressBarOptions; + + /** + * progress the bar by a fill amount. + */ + progress(amount: number): void; + + /** + * set progress to specific amount. + */ + setProgress(amount: number): void; + + /** + * reset the bar. + */ + reset(): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "reset" | "complete", callback: () => void): this; + } + + interface LogOptions extends ScrollableTextOptions { + /** + * amount of scrollback allowed. default: Infinity. + */ + scrollback?: number; + + /** + * scroll to bottom on input even if the user has scrolled up. default: false. + */ + scrollOnInput?: boolean; + } + + /** + * A log permanently scrolled to the bottom. + */ + class Log extends ScrollableTextElement implements IHasOptions { + constructor(options?: LogOptions); + + options: LogOptions; + + /** + * amount of scrollback allowed. default: Infinity. + */ + scrollback: number; + + /** + * scroll to bottom on input even if the user has scrolled up. default: false. + */ + scrollOnInput: boolean; + + /** + * add a log line. + */ + log(text: string): void; + + /** + * add a log line. + */ + add(text: string): void; + } + + interface TableOptions extends BoxOptions { + /** + * array of array of strings representing rows (same as `data`). + */ + rows?: string[][]; + + /** + * array of array of strings representing rows (same as `rows`). + */ + data?: string[][]; + + /** + * spaces to attempt to pad on the sides of each cell. `2` by default: one space on each side (only useful if the width is shrunken). + */ + pad?: number; + + /** + * do not draw inner cells. + */ + noCellBorders?: boolean; + + /** + * fill cell borders with the adjacent background color. + */ + fillCellBorders?: boolean; + } + + /** + * A stylized table of text elements. + */ + class TableElement extends BoxElement implements IHasOptions { + constructor(opts: TableOptions); + + options: TableOptions; + + /** + * set rows in table. array of arrays of strings. + */ + setData(rows: string[][]): void; + + /** + * set rows in table. array of arrays of strings. + */ + setRows(rows: string[][]): void; + } + + interface TerminalOptions extends BoxOptions { + /** + * handler for input data. + */ + handler?(userInput: Buffer): void; + + /** + * name of shell. $SHELL by default. + */ + shell?: string; + + /** + * args for shell. + */ + args?: any; + + /** + * can be line, underline, and block. + */ + cursor?: "line" | "underline" | "block"; + + terminal?: string; + + /** + * Object for process env. + */ + env?: any; + } + + class TerminalElement extends BoxElement implements IHasOptions { + constructor(opts: TerminalOptions); + + options: TerminalOptions; + + /** + * reference to the headless term.js terminal. + */ + term: any; + + /** + * reference to the pty.js pseudo terminal. + */ + pty: any; + + /** + * write data to the terminal. + */ + write(data: string): void; + + /** + * nearly identical to `element.screenshot`, however, the specified region includes the terminal's + * _entire_ scrollback, rather than just what is visible on the screen. + */ + screenshot(xi?: number, xl?: number, yi?: number, yl?: number): string; + } + + interface ImageOptions extends BoxOptions { + /** + * path to image. + */ + file: string; + + /** + * path to w3mimgdisplay. if a proper w3mimgdisplay path is not given, blessed will search the + * entire disk for the binary. + */ + type: "ansi" | "overlay" | "w3m"; + } + + /** + * Display an image in the terminal (jpeg, png, gif) using w3mimgdisplay. Requires w3m to be installed. + * X11 required: works in xterm, urxvt, and possibly other terminals. + */ + class ImageElement extends BoxElement implements IHasOptions { + constructor(options?: ImageOptions); + + options: ImageOptions; + } + + interface ANSIImageOptions extends BoxOptions { + /** + * URL or path to PNG/GIF file. Can also be a buffer. + */ + file: string; + + /** + * Scale cellmap down (0-1.0) from its original pixel width/height (Default: 1.0). + */ + scale: number; + + /** + * This differs from other element's width or height in that only one + * of them is needed: blessed will maintain the aspect ratio of the image + * as it scales down to the proper number of cells. NOTE: PNG/GIF's are + * always automatically shrunken to size (based on scale) if a width or + * height is not given. + */ + width: number | string; + height: number | string; + + /** + * Add various "density" ASCII characters over the rendering to give the + * image more detail, similar to libcaca/libcucul (the library mplayer uses + * to display videos in the terminal). + */ + ascii: string; + + /** + * Whether to animate if the image is an APNG/animating GIF. If false, only + * display the first frame or IDAT (Default: true). + */ + animate: boolean; + + /** + * Set the speed of animation. Slower: 0.0-1.0. Faster: 1-1000. It cannot go + * faster than 1 frame per millisecond, so 1000 is the fastest. (Default: 1.0) + */ + speed: number; + + /** + * mem or cpu. If optimizing for memory, animation frames will be rendered to + * bitmaps as the animation plays, using less memory. Optimizing for cpu will + * precompile all bitmaps beforehand, which may be faster, but might also OOM + * the process on large images. (Default: mem). + */ + optimization: "mem" | "cpu"; + } + + /** + * Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. + */ + class ANSIImageElement extends BoxElement implements IHasOptions { + constructor(options?: ANSIImageOptions); + + options: ANSIImageOptions; + + /** + * Image object from the png reader. + */ + img: Types.TImage; + + /** + * set the image in the box to a new path. + */ + setImage(img: string, callback: () => void): void; + + /** + * clear the current image. + */ + clearImage(callback: () => void): void; + + /** + * Play animation if it has been paused or stopped. + */ + play(): void; + + /** + * Pause animation. + */ + pause(): void; + + /** + * Stop animation. + */ + stop(): void; + } + + interface OverlayImageOptions extends BoxOptions { + /** + * Path to image. + */ + file: string; + + /** + * Render the file as ANSI art instead of using w3m to overlay Internally uses the + * ANSIImage element. See the ANSIImage element for more information/options. (Default: true). + */ + ansi: boolean; + + /** + * Path to w3mimgdisplay. If a proper w3mimgdisplay path is not given, blessed will + * search the entire disk for the binary. + */ + w3m: string; + + /** + * Whether to search /usr, /bin, and /lib for w3mimgdisplay (Default: true). + */ + search: string; + } + + /** + * Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. + */ + class OverlayImageElement extends BoxElement implements IHasOptions { + constructor(options?: OverlayImageOptions); + + options: OverlayImageOptions; + + /** + * set the image in the box to a new path. + */ + setImage(img: string, callback: () => void): void; + + /** + * clear the current image. + */ + clearImage(callback: () => void): void; + + /** + * get the size of an image file in pixels. + */ + imageSize(img: string, callback: () => void): void; + + /** + * get the size of the terminal in pixels. + */ + termSize(callback: () => void): void; + + /** + * get the pixel to cell ratio for the terminal. + */ + getPixelRatio(callback: () => void): void; + } + + interface VideoOptions extends BoxOptions { + /** + * Video to play. + */ + file: string; + + /** + * Start time in seconds. + */ + start: number; + } + + class VideoElement extends BoxElement implements IHasOptions { + constructor(options?: VideoOptions); + + options: VideoOptions; + + /** + * The terminal element running mplayer or mpv. + */ + tty: any; + } + + interface LayoutOptions extends ElementOptions { + /** + * A callback which is called right before the children are iterated over to be rendered. Should return an + * iterator callback which is called on each child element: iterator(el, i). + */ + renderer?(): void; + + /** + * Using the default renderer, it provides two layouts: inline, and grid. inline is the default and will render + * akin to inline-block. grid will create an automatic grid based on element dimensions. The grid cells' + * width and height are always determined by the largest children in the layout. + */ + layout: "inline" | "inline-block" | "grid"; + } + + class LayoutElement extends BlessedElement implements IHasOptions { + constructor(options?: LayoutOptions); + + options: LayoutOptions; + + /** + * A callback which is called right before the children are iterated over to be rendered. Should return an + * iterator callback which is called on each child element: iterator(el, i). + */ + renderer(coords: PositionCoords): void; + + /** + * Check to see if a previous child element has been rendered and is visible on screen. This is only useful + * for checking child elements that have already been attempted to be rendered! see the example below. + */ + isRendered(el: BlessedElement): boolean; + + /** + * Get the last rendered and visible child element based on an index. This is useful for basing the position + * of the current child element on the position of the last child element. + */ + getLast(i: number): BlessedElement; + + /** + * Get the last rendered and visible child element coords based on an index. This is useful for basing the position + * of the current child element on the position of the last child element. See the example below. + */ + getLastCoords(i: number): PositionCoords; + } + + class Program { + /** + * Wrap the given text in terminal formatting codes corresponding to the given attribute + * name. The `attr` string can be of the form `red fg` or `52 bg` where `52` is a 0-255 + * integer color number. + */ + text(text: string, attr: string): string; } } -export = Blessed; +export namespace widget { + class Terminal extends Widgets.TerminalElement {} +} + +export function screen(options?: Widgets.IScreenOptions): Widgets.Screen; +export function box(options?: Widgets.BoxOptions): Widgets.BoxElement; +export function text(options?: Widgets.TextOptions): Widgets.TextElement; +export function line(options?: Widgets.LineOptions): Widgets.LineElement; +export function scrollablebox(options?: Widgets.BoxOptions): Widgets.BoxElement; +export function scrollabletext(options?: Widgets.BoxOptions): Widgets.BoxElement; +export function bigtext(options?: Widgets.BigTextOptions): Widgets.BigTextElement; +export function list(options?: Widgets.ListOptions): Widgets.ListElement; +export function filemanager(options?: Widgets.FileManagerOptions): Widgets.FileManagerElement; +export function listtable(options?: Widgets.ListTableOptions): Widgets.ListTableElement; +export function listbar(options?: Widgets.ListbarOptions): Widgets.ListbarElement; +export function form(options?: Widgets.FormOptions): Widgets.FormElement; +export function input(options?: Widgets.InputOptions): Widgets.InputElement; +export function textarea(options?: Widgets.TextareaOptions): Widgets.TextareaElement; +export function textbox(options?: Widgets.TextboxOptions): Widgets.TextboxElement; +export function button(options?: Widgets.ButtonOptions): Widgets.ButtonElement; +export function checkbox(options?: Widgets.CheckboxOptions): Widgets.CheckboxElement; +export function radioset(options?: Widgets.RadioSetOptions): Widgets.RadioSetElement; +export function radiobutton(options?: Widgets.RadioButtonOptions): Widgets.RadioButtonElement; +export function table(options?: Widgets.TableOptions): Widgets.TableElement; +export function prompt(options?: Widgets.PromptOptions): Widgets.PromptElement; +export function question(options?: Widgets.QuestionOptions): Widgets.QuestionElement; +export function message(options?: Widgets.MessageOptions): Widgets.MessageElement; +export function loading(options?: Widgets.LoadingOptions): Widgets.LoadingElement; +export function log(options?: Widgets.LogOptions): Widgets.Log; +export function progressbar(options?: Widgets.ProgressBarOptions): Widgets.ProgressBarElement; +export function terminal(options?: Widgets.TerminalOptions): Widgets.TerminalElement; +export function layout(options?: Widgets.LayoutOptions): Widgets.LayoutElement; +export function escape(item: any): any; + +export const colors: { + match(hexColor: string): string; +}; diff --git a/types/blessed/tslint.json b/types/blessed/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blessed/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blissfuljs/tslint.json b/types/blissfuljs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blissfuljs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blob-stream/tslint.json b/types/blob-stream/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blob-stream/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blob-to-buffer/blob-to-buffer-tests.ts b/types/blob-to-buffer/blob-to-buffer-tests.ts new file mode 100644 index 0000000000..21d9508469 --- /dev/null +++ b/types/blob-to-buffer/blob-to-buffer-tests.ts @@ -0,0 +1,6 @@ +import blobToBuffer = require("blob-to-buffer"); + +blobToBuffer(new Blob(), (error, buffer) => { + console.log(error); + console.log(buffer); +}); diff --git a/types/blob-to-buffer/index.d.ts b/types/blob-to-buffer/index.d.ts new file mode 100644 index 0000000000..8c8156963e --- /dev/null +++ b/types/blob-to-buffer/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for blob-to-buffer 1.2 +// Project: https://github.com/feross/blob-to-buffer +// Definitions by: nrlquaker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare function blobToBuffer(blob: Blob, callback: (error: any, buffer: Buffer) => void): void; +declare namespace blobToBuffer {} +export = blobToBuffer; diff --git a/types/blob-to-buffer/tsconfig.json b/types/blob-to-buffer/tsconfig.json new file mode 100644 index 0000000000..2421ce2493 --- /dev/null +++ b/types/blob-to-buffer/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", + "blob-to-buffer-tests.ts" + ] +} diff --git a/types/blob-to-buffer/tslint.json b/types/blob-to-buffer/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/blob-to-buffer/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/blob-util/index.d.ts b/types/blob-util/index.d.ts index 9ab6cb4b5f..7710734bf2 100644 --- a/types/blob-util/index.d.ts +++ b/types/blob-util/index.d.ts @@ -14,59 +14,43 @@ export function createBlob(parts: any[], options?: { type: string }): Blob; /** * Shim for URL.createObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4). - * - * @param blob */ export function createObjectURL(blob: Blob): string; /** * Shim for URL.revokeObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4). - * - * @param url */ export function revokeObjectURL(url: string): void; /** * Convert a Blob to a binary string. - * - * @param blob */ export function blobToBinaryString(blob: Blob): Promise; /** * Convert a binary string to a Blob. - * - * @param binary * @param type the content type */ export function binaryStringToBlob(binary: string, type?: string): Promise; /** * Convert a Blob to a base-64 string. - * - * @param blob */ export function blobToBase64String(blob: Blob): Promise; /** * Convert a base-64 string to a Blob. - * - * @param base64 * @param type the content type */ export function base64StringToBlob(base64: string, type?: string): Promise; /** * Convert a data URL string (e.g. `'data:image/png;base64,iVBORw0KG...'`) to a Blob. - * - * @param dataURL */ export function dataURLToBlob(dataURL: string): Promise; /** * Convert a Blob to a data URL string (e.g. `'data:image/png;base64,iVBORw0KG...'`). - * - * @param blob */ export function blobToDataURL(blob: Blob): Promise; @@ -75,7 +59,6 @@ export function blobToDataURL(blob: Blob): Promise; * * Note: this will coerce the image to the desired content type, and it will only paint the first frame of an animated GIF. * - * @param src * @param type the content type (optional, defaults to 'image/png') * @param crossOrigin for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors * @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp' @@ -85,7 +68,6 @@ export function imgSrcToDataURL(src: string, type?: string, crossOrigin?: string /** * Convert a canvas to a Blob. * - * @param src * @param type the content type (optional, defaults to 'image/png') * @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp' */ @@ -96,7 +78,6 @@ export function canvasToBlob(canvas: HTMLCanvasElement, type?: string, quality?: * * Note: this will coerce the image to the desired content type, and it will only paint the first frame of an animated GIF. * - * @param src * @param type the content type (optional, defaults to 'image/png') * @param crossOrigin for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors * @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp' @@ -106,14 +87,11 @@ export function imgSrcToBlob(src: string, type?: string, crossOrigin?: string, q /** * Convert an ArrayBuffer to a Blob. * - * @param arrayBuff * @param type the content type */ export function arrayBufferToBlob(arrayBuff: ArrayBuffer, type?: string): Promise; /** * Convert a Blob to an ArrayBuffer. - * - * @param blob */ export function blobToArrayBuffer(blob: Blob): Promise; diff --git a/types/blocks/tslint.json b/types/blocks/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blocks/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blue-tape/tslint.json b/types/blue-tape/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blue-tape/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bluebird-global/tslint.json b/types/bluebird-global/tslint.json index 1d81af2349..31bf31d881 100644 --- a/types/bluebird-global/tslint.json +++ b/types/bluebird-global/tslint.json @@ -6,6 +6,7 @@ "array-type": false, "unified-signatures": false, "ban-types": false, + "no-redundant-undefined": false, "no-unnecessary-generics": false } } diff --git a/types/bluebird-retry/bluebird-retry-tests.ts b/types/bluebird-retry/bluebird-retry-tests.ts index eb3260a007..e9beaf5562 100644 --- a/types/bluebird-retry/bluebird-retry-tests.ts +++ b/types/bluebird-retry/bluebird-retry-tests.ts @@ -1,13 +1,13 @@ import Promise = require('bluebird'); import retry = require('bluebird-retry'); -function promiseSuccess(text:string) { +function promiseSuccess(text: string) { return Promise.resolve(text); -}; +} -var count = 0; +let count = 0; function myfunc() { - console.log('myfunc called ' + (++count) + ' times'); + console.log(`myfunc called ${++count} times`); if (count < 3) { throw new Error('i fail the first two times'); } else { @@ -16,18 +16,17 @@ function myfunc() { } retry(myfunc) - .done(function(result) { console.log(result); } ); + .done(result => { console.log(result); }); - -//Options example +// Options example function logFail() { console.log(new Date().toISOString()); throw new Error('bail'); } -var options:retry.Options = { +const options: retry.Options = { max_tries: 4, interval: 500 }; -retry(logFail, options); \ No newline at end of file +retry(logFail, options); diff --git a/types/bluebird-retry/index.d.ts b/types/bluebird-retry/index.d.ts index 97d756524b..358c75936d 100644 --- a/types/bluebird-retry/index.d.ts +++ b/types/bluebird-retry/index.d.ts @@ -1,17 +1,15 @@ -// Type definitions for bluebird-retry +// Type definitions for bluebird-retry 0.11 // Project: https://github.com/jut-io/bluebird-retry // Definitions by: Pascal Vomhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// - import Promise = require('bluebird'); declare function retry(func: (param: T) => void, options?: retry.Options): Promise; declare namespace retry { - export interface Options { + interface Options { interval?: number; backoff?: number; max_interval?: number; @@ -22,7 +20,6 @@ declare namespace retry { context?: any; args?: any; } - } export = retry; diff --git a/types/react-chartjs-2/tslint.json b/types/bluebird-retry/tslint.json similarity index 100% rename from types/react-chartjs-2/tslint.json rename to types/bluebird-retry/tslint.json diff --git a/types/bluebird/bluebird-tests.ts b/types/bluebird/bluebird-tests.ts index 4a5ce00e15..c9c09221e8 100644 --- a/types/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -20,7 +20,6 @@ let exp: RegExp; let anyArr: any[]; let strArr: string[]; let numArr: number[]; -let voidVar: void; // - - - - - - - - - - - - - - - - - @@ -80,8 +79,7 @@ let voidProm: Promise; let fooProm: Promise; let barProm: Promise; -let barOrVoidProm: Promise; -let fooOrBarProm: Promise; +let fooOrBarProm: Promise; let bazProm: Promise; // - - - - - - - - - - - - - - - - - @@ -220,12 +218,14 @@ barProm = fooProm.then((value: Foo) => { }, (reason: any) => { return barProm; }); -barOrVoidProm = fooProm.then((value: Foo) => { +// $ExpectType Bluebird +fooProm.then((value: Foo) => { return bar; }, (reason: any) => { return; }); -barOrVoidProm = fooProm.then((value: Foo) => { +// $ExpectType Bluebird +fooProm.then((value: Foo) => { return bar; }, (reason: any) => { return voidProm; @@ -241,43 +241,51 @@ barProm = barProm.then((value: Bar) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooProm = fooProm.catch((reason: any) => { +// $ExpectType Bluebird +fooProm.catch((reason: any) => { return; }); -fooProm = fooProm.caught((reason: any) => { +// $ExpectType Bluebird +fooProm.caught((reason: any) => { return; }); -fooProm = fooProm.catch((error: any) => { +// $ExpectType Bluebird +fooProm.catch((error: any) => { return true; }, (reason: any) => { return; }); -fooProm = fooProm.caught((error: any) => { +// $ExpectType Bluebird +fooProm.caught((error: any) => { return true; }, (reason: any) => { return; }); -fooProm = fooProm.catch((reason: any) => { +// $ExpectType Bluebird +fooProm.catch((reason: any) => { return voidProm; }); - -fooProm = fooProm.caught((reason: any) => { +// $ExpectType Bluebird +fooProm.caught((reason: any) => { return voidProm; }); -fooProm = fooProm.catch((error: any) => { +// $ExpectType Bluebird +fooProm.catch((error: any) => { return true; }, (reason: any) => { return voidProm; }); -fooProm = fooProm.caught((error: any) => { +// $ExpectType Bluebird +fooProm.caught((error: any) => { return true; }, (reason: any) => { return voidProm; }); -fooProm = fooProm.catch((reason: any) => { +// $ExpectType Bluebird +fooProm.catch((reason: any) => { // tslint:disable-line:void-return // handle multiple valid return types simultaneously if (foo === null) { return; @@ -308,16 +316,20 @@ fooOrBarProm = fooProm.caught((error: any) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooProm = fooProm.catch(Error, (reason: any) => { +// $ExpectType Bluebird +fooProm.catch(Error, (reason: any) => { return; }); -fooProm = fooProm.catch(Promise.CancellationError, (reason: any) => { +// $ExpectType Bluebird +fooProm.catch(Promise.CancellationError, (reason: any) => { return; }); -fooProm = fooProm.caught(Error, (reason: any) => { +// $ExpectType Bluebird +fooProm.caught(Error, (reason: any) => { return; }); -fooProm = fooProm.caught(Promise.CancellationError, (reason: any) => { +// $ExpectType Bluebird +fooProm.caught(Promise.CancellationError, (reason: any) => { return; }); @@ -339,61 +351,78 @@ fooOrBarProm = fooProm.caught(Promise.CancellationError, (reason: any) => { class CustomError extends Error { customField: number; } -fooProm = fooProm.catch(CustomError, reason => { +// $ExpectType Bluebird +fooProm.catch(CustomError, reason => { let a: number = reason.customField; }); -{ - class CustomErrorWithConstructor extends Error { - constructor(public arg1: boolean, public arg2: number) { - super(); - } +class CustomErrorWithConstructor extends Error { + arg1: boolean; + arg2: number; + constructor(arg1: boolean, arg2: number) { + super(); + this.arg1 = arg1; + this.arg2 = arg2; } - fooProm = fooProm.catch(CustomErrorWithConstructor, reason => { - let a: boolean = reason.arg1; - let b: number = reason.arg2; - }); } +// $ExpectType Bluebird +fooProm.catch(CustomErrorWithConstructor, reason => { + let a: boolean = reason.arg1; + let b: number = reason.arg2; +}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ - class CustomError1 extends Error {} - class CustomError2 extends Error {} - class CustomError3 extends Error {} - class CustomError4 extends Error {} - class CustomError5 extends Error {} +class CustomError1 extends Error {} +class CustomError2 extends Error {} +class CustomError3 extends Error {} +class CustomError4 extends Error {} +class CustomError5 extends Error {} - fooProm = fooProm.catch(CustomError1, error => {}); - fooProm = fooProm.catch(CustomError1, CustomError2, error => {}); - fooProm = fooProm.catch(CustomError1, CustomError2, CustomError3, error => {}); - fooProm = fooProm.catch(CustomError1, CustomError2, CustomError3, CustomError4, error => {}); - fooProm = fooProm.catch(CustomError1, CustomError2, CustomError3, CustomError4, CustomError5, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, CustomError2, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, CustomError2, CustomError3, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, CustomError2, CustomError3, CustomError4, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, CustomError2, CustomError3, CustomError4, CustomError5, error => {}); - const booPredicate1 = (error: CustomError1) => true; - const booPredicate2 = (error: [number]) => true; - const booPredicate3 = (error: string) => true; - const booPredicate4 = (error: object) => true; - const booPredicate5 = (error: any) => true; +const booPredicate1 = (error: CustomError1) => true; +const booPredicate2 = (error: [number]) => true; +const booPredicate3 = (error: string) => true; +const booPredicate4 = (error: object) => true; +const booPredicate5 = (error: any) => true; - fooProm = fooProm.catch(booPredicate1, error => {}); - fooProm = fooProm.catch(booPredicate1, booPredicate2, error => {}); - fooProm = fooProm.catch(booPredicate1, booPredicate2, booPredicate3, error => {}); - fooProm = fooProm.catch(booPredicate1, booPredicate2, booPredicate3, booPredicate4, error => {}); - fooProm = fooProm.catch(booPredicate1, booPredicate2, booPredicate3, booPredicate4, booPredicate5, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, booPredicate2, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, booPredicate2, booPredicate3, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, booPredicate2, booPredicate3, booPredicate4, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, booPredicate2, booPredicate3, booPredicate4, booPredicate5, error => {}); - const booObject1 = new CustomError1(); - const booObject2 = [400, 500]; - const booObject3 = ["Error1", "Error2"]; - const booObject4 = {code: 400}; - const booObject5: any = null; +const booObject1 = new CustomError1(); +const booObject2 = [400, 500]; +const booObject3 = ["Error1", "Error2"]; +const booObject4 = {code: 400}; +const booObject5: any = null; - fooProm = fooProm.catch(booObject1, error => {}); - fooProm = fooProm.catch(booObject1, booObject2, error => {}); - fooProm = fooProm.catch(booObject1, booObject2, booObject3, error => {}); - fooProm = fooProm.catch(booObject1, booObject2, booObject3, booObject4, error => {}); - fooProm = fooProm.catch(booObject1, booObject2, booObject3, booObject4, booObject5, error => {}); -} +// $ExpectType Bluebird +fooProm.catch(booObject1, error => {}); +// $ExpectType Bluebird +fooProm.catch(booObject1, booObject2, error => {}); +// $ExpectType Bluebird +fooProm.catch(booObject1, booObject2, booObject3, error => {}); +// $ExpectType Bluebird +fooProm.catch(booObject1, booObject2, booObject3, booObject4, error => {}); +// $ExpectType Bluebird +fooProm.catch(booObject1, booObject2, booObject3, booObject4, booObject5, error => {}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -433,23 +462,27 @@ fooProm = fooProm.bind(obj); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -voidVar = fooProm.done((value: Foo) => { +// $ExpectType void +fooProm.done((value: Foo) => { return bar; }, (reason: any) => { return bar; }); -voidVar = fooProm.done((value: Foo) => { +// $ExpectType void +fooProm.done((value: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -voidVar = fooProm.done((value: Foo) => { +// $ExpectType void +fooProm.done((value: Foo) => { return barThen; }, (reason: any) => { return barThen; }); -voidVar = fooProm.done((value: Foo) => { +// $ExpectType void +fooProm.done((value: Foo) => { return barThen; }); @@ -508,7 +541,8 @@ fooProm = fooProm.nodeify((err: any, foo?: Foo) => { }, { spread: true }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -voidVar = fooProm.cancel(); +// $ExpectType void +fooProm.cancel(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -520,11 +554,10 @@ bool = fooProm.isResolved(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -anyProm = fooProm.call(str); -anyProm = fooProm.call(str, 1, 2, 3); +anyProm = fooProm.call("foo"); +anyProm = fooProm.call("foo", 1, 2, 3); -// TODO enable get() test when implemented -// barProm = fooProm.get(str); +voidProm = fooProm.get("foo").then((method) => { str = method(); }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -542,7 +575,7 @@ fooProm = fooProm.thenThrow(err); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.catchReturn(bar); +fooOrBarProm = fooProm.return(foo).catchReturn(bar); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -790,15 +823,15 @@ asyncfunc = Promise.promisify(f); asyncfunc = Promise.promisify(f, obj); obj = Promise.promisifyAll(obj); -anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback)); -anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback)); -anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback), {multiArgs : true}); -anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback), {multiArgs : true}); +anyProm = Promise.fromNode(nodeCallbackFunc); +anyProm = Promise.fromNode(nodeCallbackFuncErrorOnly); +anyProm = Promise.fromNode(nodeCallbackFunc, {multiArgs : true}); +anyProm = Promise.fromNode(nodeCallbackFuncErrorOnly, {multiArgs : true}); -anyProm = Promise.fromCallback(callback => nodeCallbackFunc(callback)); -anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback)); -anyProm = Promise.fromCallback(callback => nodeCallbackFunc(callback), {multiArgs : true}); -anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback), {multiArgs : true}); +anyProm = Promise.fromCallback(nodeCallbackFunc); +anyProm = Promise.fromCallback(nodeCallbackFuncErrorOnly); +anyProm = Promise.fromCallback(nodeCallbackFunc, {multiArgs : true}); +anyProm = Promise.fromCallback(nodeCallbackFuncErrorOnly, {multiArgs : true}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -812,14 +845,11 @@ function defaultFilter(name: string, func: (...args: any[]) => any) { function DOMPromisifier(originalMethod: (...args: any[]) => any) { // return a function - return function promisified() { - let args = [].slice.call(arguments); - // Needed so that the original method can be called with the correct receiver - let self = this; + return function promisified(this: object, ...args: any[]) { // which returns a promise return new Promise((resolve, reject) => { args.push(resolve, reject); - originalMethod.apply(self, args); + originalMethod.apply(this, args); }); }; } diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index d88d4d704b..b28f821e12 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -35,6 +35,8 @@ * THE SOFTWARE. */ +type CatchFilter = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E); + declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. @@ -43,283 +45,124 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { constructor(callback: (resolve: (thenableOrResult?: R | PromiseLike) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); /** - * Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. + * Promises/A+ `.then()`. Returns a new promise chained from this promise. + * + * The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ // Based on PromiseLike.then, but returns a Bluebird instance. then(onFulfill?: (value: R) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike): Bluebird; // For simpler signature help. - then(onfulfilled?: ((value: R) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Bluebird; + then( + onfulfilled?: ((value: R) => TResult1 | PromiseLike) | null, + onrejected?: ((reason: any) => TResult2 | PromiseLike) | null + ): Bluebird; /** - * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. + * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. + * + * Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. * * Alias `.caught();` for compatibility with earlier ECMAScript version. */ - catch(onReject?: (error: any) => R | PromiseLike | void | PromiseLike): Bluebird; - caught(onReject?: (error: any) => R | PromiseLike | void | PromiseLike): Bluebird; - catch(onReject?: (error: any) => U | PromiseLike): Bluebird; - caught(onReject?: (error: any) => U | PromiseLike): Bluebird; + catch(onReject: (error: any) => R | PromiseLike): Bluebird; + catch(onReject: ((error: any) => U | PromiseLike) | undefined | null): Bluebird; /** - * This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called. + * This extends `.catch` to work more like catch-clauses in languages like Java or C#. * - * This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called. + * Instead of manually checking `instanceof` or `.name === "SomeError"`, + * you may specify a number of error constructors which are eligible for this catch handler. + * The catch handler that is first met that has eligible constructors specified, is the one that will be called. + * + * This method also supports predicate-based filters. + * If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. + * The return result of the predicate will be used determine whether the error handler should be called. * * Alias `.caught();` for compatibility with earlier ECMAScript version. - * - * TODO: disallow non-objects */ - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + filter5: CatchFilter, + onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike, ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike | void | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + filter5: CatchFilter, onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, + onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike, ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; + catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + filter4: CatchFilter, onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, + onReject: (error: E1 | E2 | E3) => R | PromiseLike, ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), + filter1: CatchFilter, + filter2: CatchFilter, + filter3: CatchFilter, onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, + filter1: CatchFilter, + filter2: CatchFilter, + onReject: (error: E1 | E2) => R | PromiseLike, ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), + filter1: CatchFilter, + filter2: CatchFilter, onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, + filter1: CatchFilter, + onReject: (error: E1) => R | PromiseLike, ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; catch( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), + filter1: CatchFilter, onReject: (error: E1) => U | PromiseLike, ): Bluebird; + /** + * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. + * + * Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. + * + * Alias `.caught();` for compatibility with earlier ECMAScript version. + */ + caught: Bluebird["catch"]; + /** * Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections. */ error(onReject: (reason: any) => U | PromiseLike): Bluebird; /** - * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler. + * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. + * + * There are special semantics for `.finally()` in that the final value cannot be modified from the handler. * * Alias `.lastly();` for compatibility with earlier ECMAScript version. */ @@ -328,7 +171,9 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { lastly(handler: () => U | PromiseLike): Bluebird; /** - * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. + * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. + * + * Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. */ bind(thisArg: any): Bluebird; @@ -344,7 +189,6 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like `.catch()` but rethrows the error - * TODO: disallow non-objects */ tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; @@ -394,7 +238,11 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { timeout(ms: number, message?: string | Error): Bluebird; /** - * Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success. + * Register a node-style callback on this promise. + * + * When this promise is is either fulfilled or rejected, + * the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. + * The error argument will be `null` in case of success. * If the `callback` argument is not a function, this method does not do anything. */ nodeify(callback: (err: any, value?: R) => void, options?: Bluebird.SpreadOption): this; @@ -457,7 +305,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * */ - call(propertyName: string, ...args: any[]): Bluebird; + call(propertyName: keyof R, ...args: any[]): Bluebird; /** * This is a convenience method for doing: @@ -468,9 +316,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * */ - // TODO: Use "type property type" once it's there - // @see https://github.com/Microsoft/TypeScript/issues/1295 - get(key: string | number): Bluebird; + get(key: U): Bluebird; /** * Convenience method for: @@ -486,8 +332,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * Alias `.thenReturn();` for compatibility with earlier ECMAScript version. */ return(): Bluebird; - thenReturn(): Bluebird; return(value: U): Bluebird; + thenReturn(): Bluebird; thenReturn(value: U): Bluebird; /** @@ -502,8 +348,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias `.thenThrow();` for compatibility with earlier ECMAScript version. */ - throw(reason: Error): Bluebird; - thenThrow(reason: Error): Bluebird; + throw(reason: Error): Bluebird; + thenThrow(reason: Error): Bluebird; /** * Convenience method for: @@ -515,40 +361,39 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.catchReturn()` - * TODO: disallow non-objects */ - catchReturn(value: U): Bluebird; + catchReturn(value: U): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, + ): Bluebird; + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + ): Bluebird; + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + ): Bluebird; + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + ): Bluebird; + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; + ): Bluebird; /** * Convenience method for: @@ -559,38 +404,37 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * * Same limitations apply as with `.catchReturn()`. - * TODO: disallow non-objects */ catchThrow(reason: Error): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; @@ -683,7 +527,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise. * - * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. Otherwise it is passed as is as the first argument for the function call. + * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. + * Otherwise it is passed as is as the first argument for the function call. * * Alias for `attempt();` for compatibility with earlier ECMAScript version. */ @@ -691,7 +536,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static attempt(fn: () => R | PromiseLike): Bluebird; /** - * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. + * Returns a new function that wraps the given function `fn`. + * The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. * This method is convenient when a function can sometimes return synchronously or throw synchronously. */ static method(fn: (arg1: A1) => R | PromiseLike): (arg1: A1) => Bluebird; @@ -710,8 +556,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Create a promise that is rejected with the given `reason`. */ - static reject(reason: any): Bluebird; - static reject(reason: any): Bluebird; + static reject(reason: any): Bluebird; /** * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). @@ -719,7 +564,10 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static defer(): Bluebird.Resolver; /** - * Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. + * Cast the given `value` to a trusted promise. + * + * If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. + * If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. */ static cast(value: R | PromiseLike): Bluebird; @@ -734,7 +582,10 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static is(value: any): boolean; /** - * Call this right after the library is loaded to enabled long stack traces. Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. + * Call this right after the library is loaded to enabled long stack traces. + * + * Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. + * Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. */ static longStackTraces(): void; @@ -747,27 +598,52 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static delay(ms: number): Bluebird; /** - * Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. + * Returns a function that will wrap the given `nodeFunction`. + * + * Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. + * The node function should conform to node.js convention of accepting a callback as last argument and + * calling that callback with error as the first argument and success value on the second argument. * * If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them. * * If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`. */ - static promisify(func: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): () => Bluebird; - static promisify(func: (arg1: A1, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; + static promisify( + func: (callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): () => Bluebird; + static promisify( + func: (arg1: A1, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1) => Bluebird; + static promisify( + func: (arg1: A1, arg2: A2, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1, arg2: A2) => Bluebird; + static promisify( + func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; + static promisify( + func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; + static promisify( + func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; static promisify(nodeFunction: (...args: any[]) => void, options?: Bluebird.PromisifyOptions): (...args: any[]) => Bluebird; /** - * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name postfixed with `Async`. Returns the input object. + * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. * - * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. + * The promisified method name will be the original method name postfixed with `Async`. Returns the input object. + * + * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, + * if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. */ // TODO how to model promisifyAll? - static promisifyAll(target: object, options?: Bluebird.PromisifyAllOptions): object; + static promisifyAll(target: T, options?: Bluebird.PromisifyAllOptions): T; /** * Returns a promise that is resolved by a node style callback function. @@ -778,19 +654,50 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static fromCallback(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; /** - * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. + * Returns a function that can use `yield` to run asynchronous code synchronously. + * + * This feature requires the support of generators which are drafted in the next version of the language. + * Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. */ // TODO: After https://github.com/Microsoft/TypeScript/issues/2983 is implemented, we can use // the return type propagation of generators to automatically infer the return type T. - static coroutine(generatorFunction: () => IterableIterator, options?: Bluebird.CoroutineOptions): () => Bluebird; - static coroutine(generatorFunction: (a1: A1) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird; + static coroutine( + generatorFunction: () => IterableIterator, + options?: Bluebird.CoroutineOptions + ): () => Bluebird; + static coroutine( + generatorFunction: (a1: A1) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird; + /** * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers. * @@ -799,7 +706,19 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static onPossiblyUnhandledRejection(handler: (reason: any) => any): void; /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason. + * Add handler as the handler to call when there is a possibly unhandled rejection. + * The default handler logs the error stack to stderr or console.error in browsers. + * + * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. + * + * Note: this hook is specific to the bluebird instance its called on, application developers should use global rejection events. + */ + static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird) => void): void; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. + * The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. + * If any promise in the array rejects, the returned promise is rejected with the rejection reason. */ // TODO enable more overloads // array with promises of different types @@ -809,44 +728,47 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static all(values: [PromiseLike | T1, PromiseLike | T2]): Bluebird<[T1, T2]>; static all(values: [PromiseLike | T1]): Bluebird<[T1]>; // array with values - static all(values: PromiseLike | R>> | Array | R>): Bluebird; + static all(values: PromiseLike | R>> | Iterable | R>): Bluebird; /** - * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason. + * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. * - * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. + * The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. + * If any promise in the object rejects, the returned promise is rejected with the rejection reason. + * + * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. + * All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. * * *The original object is not modified.* */ - // trusted promise for map - static props(map: PromiseLike | V>>): Bluebird>; + // map + static props(map: PromiseLike | V>> | Map | V>): Bluebird>; // trusted promise for object static props(object: PromiseLike>): Bluebird; // tslint:disable-line:unified-signatures - // map - static props(map: Map | V>): Bluebird>; // tslint:disable-line:unified-signatures // object static props(object: Bluebird.ResolvableProps): Bluebird; // tslint:disable-line:unified-signatures /** * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. */ - static any(values: PromiseLike | R>> | Array | R>): Bluebird; + static any(values: PromiseLike | R>> | Iterable | R>): Bluebird; /** * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. * * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. */ - static race(values: PromiseLike | R>> | Array | R>): Bluebird; + static race(values: PromiseLike | R>> | Iterable | R>): Bluebird; /** - * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. + * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). + * When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. * * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. * * *The original array is not modified.* */ - static some(values: PromiseLike | R>> | Array | R>, count: number): Bluebird; + static some(values: PromiseLike | R>> | Iterable | R>, count: number): Bluebird; /** * Promise.join( @@ -855,60 +777,112 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * ) -> Promise * For coordinating multiple concurrent discrete promises. * - * Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array. This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply + * Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array. + * This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply */ - static join(arg1: A1 | PromiseLike, handler: (arg1: A1) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, handler: (arg1: A1, arg2: A2) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, arg4: A4 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, arg4: A4 | PromiseLike, arg5: A5 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): Bluebird; + static join( + arg1: A1 | PromiseLike, + handler: (arg1: A1) => R | PromiseLike + ): Bluebird; + static join( + arg1: A1 | PromiseLike, + arg2: A2 | PromiseLike, + handler: (arg1: A1, arg2: A2) => R | PromiseLike + ): Bluebird; + static join( + arg1: A1 | PromiseLike, + arg2: A2 | PromiseLike, + arg3: A3 | PromiseLike, + handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike + ): Bluebird; + static join( + arg1: A1 | PromiseLike, + arg2: A2 | PromiseLike, + arg3: A3 | PromiseLike, + arg4: A4 | PromiseLike, + handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike + ): Bluebird; + static join( + arg1: A1 | PromiseLike, + arg2: A2 | PromiseLike, + arg3: A3 | PromiseLike, + arg4: A4 | PromiseLike, + arg5: A5 | PromiseLike, + handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike + ): Bluebird; // variadic array /** @deprecated use .all instead */ static join(...values: Array>): Bluebird; /** - * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * If any promise in the input array is rejected the returned promise is rejected as well. * * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. * * *The original array is not modified.* */ - static map(values: PromiseLike | R>> | Array | R>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + static map( + values: PromiseLike | R>> | Iterable | R>, + mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, + options?: Bluebird.ConcurrencyOption + ): Bluebird; /** - * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * If any promise in the input array is rejected the returned promise is rejected as well. * * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. * - * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* + * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. + * If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* */ - static reduce(values: PromiseLike | R>> | Array | R>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; + static reduce( + values: PromiseLike | R>> | Iterable | R>, + reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, + initialValue?: U + ): Bluebird; /** - * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * If any promise in the input array is rejected the returned promise is rejected as well. * * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. * * *The original array is not modified. */ - static filter(values: PromiseLike | R>> | Array | R>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; + static filter( + values: PromiseLike | R>> | Iterable | R>, + filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, + option?: Bluebird.ConcurrencyOption + ): Bluebird; /** - * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. + * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. + * Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. * - * Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. + * Resolves to the original array unmodified, this method is meant to be used for side effects. + * If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. */ - static each(values: PromiseLike | R>> | Array | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + static each( + values: PromiseLike | R>> | Iterable | R>, + iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike + ): Bluebird; /** * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. * - * Returns a promise for an array that contains the values returned by the iterator function in their respective positions. The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. This results in a mapSeries kind of utility but it can also be used simply as a side effect iterator similar to Array#forEach. + * Returns a promise for an array that contains the values returned by the iterator function in their respective positions. + * The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. + * This results in a mapSeries kind of utility but it can also be used simply as a side effect iterator similar to Array#forEach. * * If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well. */ - static mapSeries(values: PromiseLike | R>> | Array | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + static mapSeries( + values: PromiseLike | R>> | Iterable | R>, + iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike + ): Bluebird; /** * A meta method used to specify the disposer method that cleans up a resource when using `Promise.using`. @@ -927,19 +901,21 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * will be called when the promise returned by the callback passed to using has settled. The disposer is * necessary because there is no standard interface in node for disposing resources. */ - static using(disposer: Bluebird.Disposer, executor: (transaction: R) => PromiseLike): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2) => PromiseLike): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, disposer3: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike): Bluebird; - - /** - * Add handler as the handler to call when there is a possibly unhandled rejection. - * The default handler logs the error stack to stderr or console.error in browsers. - * - * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. - * - * Note: this hook is specific to the bluebird instance its called on, application developers should use global rejection events. - */ - static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird) => void): void; + static using( + disposer: Bluebird.Disposer, + executor: (transaction: R) => PromiseLike + ): Bluebird; + static using( + disposer: Bluebird.Disposer, + disposer2: Bluebird.Disposer, + executor: (transaction1: R1, transaction2: R2 + ) => PromiseLike): Bluebird; + static using( + disposer: Bluebird.Disposer, + disposer2: Bluebird.Disposer, + disposer3: Bluebird.Disposer, + executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike + ): Bluebird; /** * Configure long stack traces, warnings, monitoring and cancellation. @@ -986,11 +962,11 @@ declare namespace Bluebird { context?: any; multiArgs?: boolean; } - interface PromisifyAllOptions extends PromisifyOptions { + interface PromisifyAllOptions extends PromisifyOptions { suffix?: string; filter?(name: string, func: (...args: any[]) => any, target?: any, passesDefaultFilter?: boolean): boolean; // The promisifier gets a reference to the original method and should return a function which returns a promise - promisifier?(originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird): () => PromiseLike; + promisifier?(this: T, originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird): () => PromiseLike; } interface CoroutineOptions { yieldHandler(value: any): any; @@ -1014,7 +990,7 @@ declare namespace Bluebird { /** * Signals that an operation has been aborted or cancelled. The default reason used by `.cancel`. */ - class CancellationError extends Error {} + class CancellationError extends Error { } /** * A collection of errors. `AggregateError` is an array-like object, with numeric indices and a `.length` property. @@ -1049,12 +1025,12 @@ declare namespace Bluebird { /** * returned by `Bluebird.disposer()`. */ - class Disposer {} + class Disposer { } /** @deprecated Use PromiseLike directly. */ type Thenable = PromiseLike; - type ResolvableProps = object & { [K in keyof T]: PromiseLike | T[K] }; + type ResolvableProps = object & {[K in keyof T]: PromiseLike | T[K]}; interface Resolver { /** @@ -1074,7 +1050,8 @@ declare namespace Bluebird { reject(reason: any): void; /** - * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. + * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. + * The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. * * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. */ diff --git a/types/bluebird/tsconfig.json b/types/bluebird/tsconfig.json index 94fc104c8f..909dae3771 100644 --- a/types/bluebird/tsconfig.json +++ b/types/bluebird/tsconfig.json @@ -9,9 +9,9 @@ "es6" ], "noImplicitAny": true, - "noImplicitThis": false, + "noImplicitThis": true, "strictNullChecks": false, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +20,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/bluebird/tslint.json b/types/bluebird/tslint.json index 44da6a5d92..6abaaba4e3 100644 --- a/types/bluebird/tslint.json +++ b/types/bluebird/tslint.json @@ -1,12 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "max-line-length": [true, 490], - "no-unnecessary-callback-wrapper": false, + "max-line-length": [true, 280], "no-unnecessary-generics": false, - "no-void-expression": false, - "prefer-const": false, - "void-return": false + "prefer-const": false } } diff --git a/types/bluebird/v1/tslint.json b/types/bluebird/v1/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bluebird/v1/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bluebird/v2/tslint.json b/types/bluebird/v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bluebird/v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blueimp-md5/tslint.json b/types/blueimp-md5/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blueimp-md5/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/body-parser/index.d.ts b/types/body-parser/index.d.ts index 2056c89b22..b1485770a1 100644 --- a/types/body-parser/index.d.ts +++ b/types/body-parser/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/expressjs/body-parser // Definitions by: Santi Albo , Vilic Vane , Jonathan Häberle , Gevik Babakhani , Tomasz Łaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index bb817d3074..dca8d5fad2 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bookshelfjs v0.9.3 +// Type definitions for bookshelfjs v0.9.4 // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,7 +17,7 @@ interface Bookshelf extends Bookshelf.Events { Collection: typeof Bookshelf.Collection; plugin(name: string | string[] | Function, options?: any): Bookshelf; - transaction(callback: (transaction: knex.Transaction) => BlueBird): BlueBird; + transaction(callback: (transaction: knex.Transaction) => PromiseLike): BlueBird; } declare function Bookshelf(knex: knex): Bookshelf; diff --git a/types/bookshelf/tslint.json b/types/bookshelf/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bookshelf/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/boolify-string/tslint.json b/types/boolify-string/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/boolify-string/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/boom/boom-tests.ts b/types/boom/boom-tests.ts index 1819be25cb..f989128b4e 100644 --- a/types/boom/boom-tests.ts +++ b/types/boom/boom-tests.ts @@ -1,11 +1,10 @@ import Boom = require('boom'); -import * as Hapi from 'hapi'; // 4xx and data type const badRequestError = Boom.badRequest('message', {some: 'data'}); badRequestError.data.some; -const badRequestError2: Boom.BoomError = Boom.badImplementation('message'); +const badRequestError2: Boom.Boom = Boom.badImplementation('message'); const unauthorizedError1 = Boom.unauthorized('message', 'scheme', {some: 'attribute'}); unauthorizedError1.output.payload.attributes === { some: 'attribute', error: 'message' }; @@ -25,125 +24,131 @@ unauthorizedError4.output.headers === { 'WWW-Authenticate': 'scheme some="attrib const paymentRequiredError = Boom.paymentRequired('message', {some: 'data'}); paymentRequiredError.data.some; -const paymentRequiredError2: Boom.BoomError = Boom.paymentRequired('message'); +const paymentRequiredError2: Boom.Boom = Boom.paymentRequired('message'); const forbiddenError = Boom.forbidden('message', {some: 'data'}); forbiddenError.data.some; -const forbiddenError2: Boom.BoomError = Boom.forbidden('message'); +const forbiddenError2: Boom.Boom = Boom.forbidden('message'); const notFoundError = Boom.notFound('message', {some: 'data'}); notFoundError.data.some; -const notFoundError2: Boom.BoomError = Boom.notFound('message'); +const notFoundError2: Boom.Boom = Boom.notFound('message'); const methodNotAllowedError = Boom.methodNotAllowed('message', {some: 'data'}); methodNotAllowedError.data.some; -const methodNotAllowedError2: Boom.BoomError = Boom.methodNotAllowed('message'); +const methodNotAllowedError2: Boom.Boom = Boom.methodNotAllowed('message'); const notAcceptableError = Boom.notAcceptable('message', {some: 'data'}); notAcceptableError.data.some; -const notAcceptableError2: Boom.BoomError = Boom.notAcceptable('message'); +const notAcceptableError2: Boom.Boom = Boom.notAcceptable('message'); const proxyAuthRequiredError = Boom.proxyAuthRequired('message', {some: 'data'}); proxyAuthRequiredError.data.some; -const proxyAuthRequiredError2: Boom.BoomError = Boom.proxyAuthRequired('message'); +const proxyAuthRequiredError2: Boom.Boom = Boom.proxyAuthRequired('message'); const clientTimeoutError = Boom.clientTimeout('message', {some: 'data'}); clientTimeoutError.data.some; -const clientTimeoutError2: Boom.BoomError = Boom.clientTimeout('message'); +const clientTimeoutError2: Boom.Boom = Boom.clientTimeout('message'); const conflictError = Boom.conflict('message', {some: 'data'}); conflictError.data.some; const resourceGoneError = Boom.resourceGone('message', {some: 'data'}); resourceGoneError.data.some; -const resourceGoneError2: Boom.BoomError = Boom.resourceGone('message'); +const resourceGoneError2: Boom.Boom = Boom.resourceGone('message'); const lengthRequiredError = Boom.lengthRequired('message', {some: 'data'}); lengthRequiredError.data.some; -const lengthRequiredError2: Boom.BoomError = Boom.lengthRequired('message'); +const lengthRequiredError2: Boom.Boom = Boom.lengthRequired('message'); const preconditionFailedError = Boom.preconditionFailed('message', {some: 'data'}); preconditionFailedError.data.some; -const preconditionFailedError2: Boom.BoomError = Boom.preconditionFailed('message'); +const preconditionFailedError2: Boom.Boom = Boom.preconditionFailed('message'); const entityTooLargeError = Boom.entityTooLarge('message', {some: 'data'}); entityTooLargeError.data.some; -const entityTooLargeError2: Boom.BoomError = Boom.lengthRequired('message'); +const entityTooLargeError2: Boom.Boom = Boom.lengthRequired('message'); const uriTooLongError = Boom.uriTooLong('message', {some: 'data'}); uriTooLongError.data.some; -const uriTooLongError2: Boom.BoomError = Boom.uriTooLong('message'); +const uriTooLongError2: Boom.Boom = Boom.uriTooLong('message'); const unsupportedMediaTypeError = Boom.unsupportedMediaType('message', {some: 'data'}); unsupportedMediaTypeError.data.some; -const unsupportedMediaTypeError2: Boom.BoomError = Boom.unsupportedMediaType('message'); +const unsupportedMediaTypeError2: Boom.Boom = Boom.unsupportedMediaType('message'); const rangeNotSatisfiableError = Boom.rangeNotSatisfiable('message', {some: 'data'}); rangeNotSatisfiableError.data.some; -const rangeNotSatisfiableError2: Boom.BoomError = Boom.rangeNotSatisfiable('message'); +const rangeNotSatisfiableError2: Boom.Boom = Boom.rangeNotSatisfiable('message'); const expectationFailedError = Boom.expectationFailed('message', {some: 'data'}); expectationFailedError.data.some; -const expectationFailedError2: Boom.BoomError = Boom.expectationFailed('message'); +const expectationFailedError2: Boom.Boom = Boom.expectationFailed('message'); const teapotError = Boom.teapot('message', {some: 'data'}); teapotError.data.some; -const teapotError2: Boom.BoomError = Boom.teapot('message'); +const teapotError2: Boom.Boom = Boom.teapot('message'); const badDataError = Boom.badData('message', {some: 'data'}); badDataError.data.some; -const badDataError2: Boom.BoomError = Boom.badData('message'); +const badDataError2: Boom.Boom = Boom.badData('message'); const lockedError = Boom.locked('message', {some: 'data'}); lockedError.data.some; -const lockedError2: Boom.BoomError = Boom.locked('message'); +const lockedError2: Boom.Boom = Boom.locked('message'); const preconditionRequiredError = Boom.preconditionRequired('message', {some: 'data'}); preconditionRequiredError.data.some; -const preconditionRequiredError2: Boom.BoomError = Boom.preconditionRequired('message'); +const preconditionRequiredError2: Boom.Boom = Boom.preconditionRequired('message'); const tooManyRequestsError = Boom.tooManyRequests('message', {some: 'data'}); tooManyRequestsError.data.some; -const tooManyRequestsError2: Boom.BoomError = Boom.tooManyRequests('message'); +const tooManyRequestsError2: Boom.Boom = Boom.tooManyRequests('message'); const illegalError = Boom.illegal('message', {some: 'data'}); illegalError.data.some; -const illegalError2: Boom.BoomError = Boom.illegal('message'); +const illegalError2: Boom.Boom = Boom.illegal('message'); // 5xx and data type const badImplementationError = Boom.badImplementation('message', {some: 'data'}); badImplementationError.data.some; -const badImplementationError2: Boom.BoomError = Boom.badImplementation('message'); +const badImplementationError2: Boom.Boom = Boom.badImplementation('message'); const internalError = Boom.internal('message', {some: 'data'}); internalError.data.some; -const internalError2: Boom.BoomError = Boom.internal('message'); +const internalError2: Boom.Boom = Boom.internal('message'); const notImplementedError = Boom.notImplemented('message', {some: 'data'}); notImplementedError.data.some; -const notImplementedError2: Boom.BoomError = Boom.notImplemented('message'); +const notImplementedError2: Boom.Boom = Boom.notImplemented('message'); const badGatewayError = Boom.badGateway('message', {some: 'data'}); badGatewayError.data.some; -const badGatewayError2: Boom.BoomError = Boom.badGateway('message'); +const badGatewayError2: Boom.Boom = Boom.badGateway('message'); const serverUnavailableError = Boom.serverUnavailable('message', {some: 'data'}); serverUnavailableError.data.some; -const serverUnavailableError2: Boom.BoomError = Boom.serverUnavailable('message'); +const serverUnavailableError2: Boom.Boom = Boom.serverUnavailable('message'); const gatewayTimeoutError = Boom.gatewayTimeout('message', {some: 'data'}); gatewayTimeoutError.data.some; -const gatewayTimeoutError2: Boom.BoomError = Boom.gatewayTimeout('message'); +const gatewayTimeoutError2: Boom.Boom = Boom.gatewayTimeout('message'); -// boomify, wrap, and create -const boomifiedError = Boom.boomify(new Error('test'), { statusCode: 400, message: 'some message' }) +// boomify +const boomifiedError = Boom.boomify(new Error('test'), { statusCode: 400, message: 'some message' }); -const wrappedError = Boom.wrap(new Error('test'), 400, 'some message'); +// isBoom -const error1 = Boom.create(500, 'Internal server error', { timestamp: Date.now() }); -error1.data.timestamp; -const error2: Boom.BoomError = Boom.create(500, 'Internal server error'); +const isBoomError = new Boom.Boom('test') + +Boom.isBoom(isBoomError); + +// constructor + +const constructorError: Boom.Boom = new Boom.Boom('test'); + +constructorError.message; // type widen asserting @@ -169,11 +174,11 @@ interface CustomPayload extends Boom.Payload { * Test assignment of custom error data: */ const errorWithData = Boom.badImplementation('', { custom1: 'test', customType: 'Custom1', isCustom: true } as CustomData1); -const errorWithNoExplicitDataType: Boom.BoomError = errorWithData; // can assign to error without explicit data type -const errorWithExplicitType: Boom.BoomError = errorWithData; // can assign to union data type -const errorWithConcreteCustomData: Boom.BoomError = errorWithData; // can assign to concrete data type +const errorWithNoExplicitDataType: Boom.Boom = errorWithData; // can assign to error without explicit data type +const errorWithExplicitType: Boom.Boom = errorWithData; // can assign to union data type +const errorWithConcreteCustomData: Boom.Boom = errorWithData; // can assign to concrete data type // assignment to CustomData2 would not be possible -// const errorWithConcreteCustomData2: Boom.BoomError = errorWithData; +// const errorWithConcreteCustomData2: Boom.Boom = errorWithData; // Some complex error data types for testing purposes: interface CustomDataBase { diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index 8025a7ddab..89ca580561 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for boom 4.3 +// Type definitions for boom 7.1.1 // Project: https://github.com/hapijs/boom // Definitions by: Igor Rogatty // AJP // Jinesh Shah +// Timon van Spronsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 export = Boom; @@ -14,7 +15,9 @@ declare namespace Boom { * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: * @see {@link https://github.com/hapijs/boom#boom} */ - export interface BoomError extends Error { + export class Boom extends Error { + /** Creates a new Boom object using the provided message and then calling boomify() to decorate the error with the Boom properties. */ + constructor(message?: string | Error, options?: Options); /** isBoom - if true, indicates this is a Boom object instance. */ isBoom: boolean; /** isServer - convenience bool indicating status code >= 500. */ @@ -31,6 +34,21 @@ declare namespace Boom { data: Data; } + interface Options { + /** statusCode - the HTTP status code. Defaults to 500 if no status code is already set. */ + statusCode?: number; + /** data - additional error information (assigned to error.data). */ + data?: Data; + /** decorate - an option with extra properties to set on the error object. */ + decorate?: object; + /** ctor - constructor reference used to crop the exception call stack output. */ + ctor?: any; + /** message - error message string. If the error already has a message, the provided message is added as a prefix. Defaults to no message. */ + message?: string; + /** override - if false, the err provided is a Boom object, and a statusCode or message are provided, the values are ignored. Defaults to true (apply the provided statusCode and message options to the error regardless of its type, Error or Boom object). */ + override?: boolean; + } + export interface Output { /** statusCode - the HTTP status code (typically 4xx or 5xx). */ statusCode: number; @@ -55,32 +73,20 @@ declare namespace Boom { // Excluded this to aid typing of the other values. See tests for example casting to a custom interface to manipulate the payload // [anyContent: string]: any; } - + /** * Decorates an error with the boom properties * @param error the error object to wrap. If error is already a boom object, it defaults to overriding the object with the new status code and message. * @param options optional additional options * @see {@link https://github.com/hapijs/boom#boomifyerror-options} */ - export function boomify(error: Error, options?: { statusCode?: number, message?: string, override?: boolean }): BoomError; + export function boomify(error: Error, options?: { statusCode?: number, message?: string, override?: boolean }): Boom; /** - * Decorates an error with the boom properties - * @param error the error object to wrap. If error is already a boom object, returns back the same object. - * @param statusCode optional HTTP status code. Defaults to 500. - * @param message optional message string. If the error already has a message, it adds the message as a prefix. Defaults to no message. - * @see {@link https://github.com/hapijs/boom#wraperror-statuscode-message} + * Identifies whether an error is a Boom object. Same as calling instanceof Boom. + * @param error the error object to identify. */ - export function wrap(error: Error, statusCode?: number, message?: string): BoomError; - - /** - * Generates an Error object with the boom decorations - * @param statusCode an HTTP error code number. Must be greater or equal 400. - * @param message optional message string. - * @param data additional error data set to error.data property. - * @see {@link https://github.com/hapijs/boom#createstatuscode-message-data} - */ - export function create(statusCode: number, message?: string, data?: Data): BoomError; + export function isBoom(error: Error): boolean // 4xx /** @@ -89,7 +95,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadrequestmessage-data} */ - export function badRequest(message?: string, data?: Data): BoomError; + export function badRequest(message?: string, data?: Data): Boom; /** * Returns a 401 Unauthorized error @@ -100,10 +106,10 @@ declare namespace Boom { * @param attributes an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when scheme is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the attributes key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. null and undefined will be replaced with an empty string. If attributes is set, message will be used as the 'error' segment of the 'WWW-Authenticate' header. If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object. * @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ - export function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): BoomError; - export function unauthorized(message?: string, scheme?: string[]): BoomError; - export function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): BoomError; - export function unauthorized(message?: null, scheme?: string[]): BoomError; + export function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): Boom; + export function unauthorized(message?: string, scheme?: string[]): Boom; + export function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): Boom; + export function unauthorized(message?: null, scheme?: string[]): Boom; /** * Returns a 402 Payment Required error @@ -111,7 +117,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompaymentrequiredmessage-data} */ - export function paymentRequired(message?: string, data?: Data): BoomError; + export function paymentRequired(message?: string, data?: Data): Boom; /** * Returns a 403 Forbidden error @@ -119,7 +125,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomforbiddenmessage-data} */ - export function forbidden(message?: string, data?: Data): BoomError; + export function forbidden(message?: string, data?: Data): Boom; /** * Returns a 404 Not Found error @@ -127,7 +133,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotfoundmessage-data} */ - export function notFound(message?: string, data?: Data): BoomError; + export function notFound(message?: string, data?: Data): Boom; /** * Returns a 405 Method Not Allowed error @@ -136,7 +142,7 @@ declare namespace Boom { * @param allow optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. * @see {@link https://github.com/hapijs/boom#boommethodnotallowedmessage-data-allow} */ - export function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): BoomError; + export function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): Boom; /** * Returns a 406 Not Acceptable error @@ -144,7 +150,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotacceptablemessage-data} */ - export function notAcceptable(message?: string, data?: Data): BoomError; + export function notAcceptable(message?: string, data?: Data): Boom; /** * Returns a 407 Proxy Authentication Required error @@ -152,7 +158,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomproxyauthrequiredmessage-data} */ - export function proxyAuthRequired(message?: string, data?: Data): BoomError; + export function proxyAuthRequired(message?: string, data?: Data): Boom; /** * Returns a 408 Request Time-out error @@ -160,7 +166,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomclienttimeoutmessage-data} */ - export function clientTimeout(message?: string, data?: Data): BoomError; + export function clientTimeout(message?: string, data?: Data): Boom; /** * Returns a 409 Conflict error @@ -168,7 +174,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomconflictmessage-data} */ - export function conflict(message?: string, data?: Data): BoomError; + export function conflict(message?: string, data?: Data): Boom; /** * Returns a 410 Gone error @@ -176,7 +182,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomresourcegonemessage-data} */ - export function resourceGone(message?: string, data?: Data): BoomError; + export function resourceGone(message?: string, data?: Data): Boom; /** * Returns a 411 Length Required error @@ -184,7 +190,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlengthrequiredmessage-data} */ - export function lengthRequired(message?: string, data?: Data): BoomError; + export function lengthRequired(message?: string, data?: Data): Boom; /** * Returns a 412 Precondition Failed error @@ -192,7 +198,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionfailedmessage-data} */ - export function preconditionFailed(message?: string, data?: Data): BoomError; + export function preconditionFailed(message?: string, data?: Data): Boom; /** * Returns a 413 Request Entity Too Large error @@ -200,7 +206,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomentitytoolargemessage-data} */ - export function entityTooLarge(message?: string, data?: Data): BoomError; + export function entityTooLarge(message?: string, data?: Data): Boom; /** * Returns a 414 Request-URI Too Large error @@ -208,7 +214,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomuritoolongmessage-data} */ - export function uriTooLong(message?: string, data?: Data): BoomError; + export function uriTooLong(message?: string, data?: Data): Boom; /** * Returns a 415 Unsupported Media Type error @@ -216,7 +222,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomunsupportedmediatypemessage-data} */ - export function unsupportedMediaType(message?: string, data?: Data): BoomError; + export function unsupportedMediaType(message?: string, data?: Data): Boom; /** * Returns a 416 Requested Range Not Satisfiable error @@ -224,7 +230,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomrangenotsatisfiablemessage-data} */ - export function rangeNotSatisfiable(message?: string, data?: Data): BoomError; + export function rangeNotSatisfiable(message?: string, data?: Data): Boom; /** * Returns a 417 Expectation Failed error @@ -232,7 +238,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomexpectationfailedmessage-data} */ - export function expectationFailed(message?: string, data?: Data): BoomError; + export function expectationFailed(message?: string, data?: Data): Boom; /** * Returns a 418 I'm a Teapot error @@ -240,7 +246,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomteapotmessage-data} */ - export function teapot(message?: string, data?: Data): BoomError; + export function teapot(message?: string, data?: Data): Boom; /** * Returns a 422 Unprocessable Entity error @@ -248,7 +254,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombaddatamessage-data} */ - export function badData(message?: string, data?: Data): BoomError; + export function badData(message?: string, data?: Data): Boom; /** * Returns a 423 Locked error @@ -256,7 +262,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomlockedmessage-data} */ - export function locked(message?: string, data?: Data): BoomError; + export function locked(message?: string, data?: Data): Boom; /** * Returns a 428 Precondition Required error @@ -264,7 +270,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boompreconditionrequiredmessage-data} */ - export function preconditionRequired(message?: string, data?: Data): BoomError; + export function preconditionRequired(message?: string, data?: Data): Boom; /** * Returns a 429 Too Many Requests error @@ -272,7 +278,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomtoomanyrequestsmessage-data} */ - export function tooManyRequests(message?: string, data?: Data): BoomError; + export function tooManyRequests(message?: string, data?: Data): Boom; /** * Returns a 451 Unavailable For Legal Reasons error @@ -280,7 +286,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomillegalmessage-data} */ - export function illegal(message?: string, data?: Data): BoomError; + export function illegal(message?: string, data?: Data): Boom; // 5xx /** @@ -290,7 +296,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - export function badImplementation(message?: string, data?: Data): BoomError; + export function badImplementation(message?: string, data?: Data): Boom; /** * Returns a 500 Internal Server Error error @@ -299,7 +305,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} */ - export function internal(message?: string, data?: Data): BoomError; + export function internal(message?: string, data?: Data): Boom; /** * Returns a 501 Not Implemented error with your error message to the user @@ -307,7 +313,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomnotimplementedmessage-data} */ - export function notImplemented(message?: string, data?: Data): BoomError; + export function notImplemented(message?: string, data?: Data): Boom; /** * Returns a 502 Bad Gateway error with your error message to the user @@ -315,7 +321,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boombadgatewaymessage-data} */ - export function badGateway(message?: string, data?: Data): BoomError; + export function badGateway(message?: string, data?: Data): Boom; /** * Returns a 503 Service Unavailable error with your error message to the user @@ -323,7 +329,7 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomserverunavailablemessage-data} */ - export function serverUnavailable(message?: string, data?: Data): BoomError; + export function serverUnavailable(message?: string, data?: Data): Boom; /** * Returns a 504 Gateway Time-out error with your error message to the user @@ -331,5 +337,5 @@ declare namespace Boom { * @param data optional additional error data. * @see {@link https://github.com/hapijs/boom#boomgatewaytimeoutmessage-data} */ - export function gatewayTimeout(message?: string, data?: Data): BoomError; + export function gatewayTimeout(message?: string, data?: Data): Boom; } diff --git a/types/boom/tslint.json b/types/boom/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/boom/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/boom/v3/tslint.json b/types/boom/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/boom/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/boom/v4/boom-tests.ts b/types/boom/v4/boom-tests.ts new file mode 100644 index 0000000000..1819be25cb --- /dev/null +++ b/types/boom/v4/boom-tests.ts @@ -0,0 +1,193 @@ +import Boom = require('boom'); +import * as Hapi from 'hapi'; + +// 4xx and data type + +const badRequestError = Boom.badRequest('message', {some: 'data'}); +badRequestError.data.some; +const badRequestError2: Boom.BoomError = Boom.badImplementation('message'); + +const unauthorizedError1 = Boom.unauthorized('message', 'scheme', {some: 'attribute'}); +unauthorizedError1.output.payload.attributes === { some: 'attribute', error: 'message' }; +unauthorizedError1.output.headers === { 'WWW-Authenticate': 'scheme some="attribute", error="message"' }; + +const unauthorizedError2 = Boom.unauthorized('message', ['scheme']); +unauthorizedError2.output.payload.attributes === undefined; +unauthorizedError2.output.headers === { 'WWW-Authenticate': 'scheme' }; + +const unauthorizedError3 = Boom.unauthorized(null, 'scheme', 'attribute'); +unauthorizedError3.output.payload.attributes === 'attribute'; +unauthorizedError3.output.headers === { 'WWW-Authenticate': 'scheme attribute' }; + +const unauthorizedError4 = Boom.unauthorized(null, 'scheme', {some: 'attribute'}); +unauthorizedError4.output.payload.attributes === { some: 'attribute' }; +unauthorizedError4.output.headers === { 'WWW-Authenticate': 'scheme some="attribute"' }; + +const paymentRequiredError = Boom.paymentRequired('message', {some: 'data'}); +paymentRequiredError.data.some; +const paymentRequiredError2: Boom.BoomError = Boom.paymentRequired('message'); + +const forbiddenError = Boom.forbidden('message', {some: 'data'}); +forbiddenError.data.some; +const forbiddenError2: Boom.BoomError = Boom.forbidden('message'); + +const notFoundError = Boom.notFound('message', {some: 'data'}); +notFoundError.data.some; +const notFoundError2: Boom.BoomError = Boom.notFound('message'); + +const methodNotAllowedError = Boom.methodNotAllowed('message', {some: 'data'}); +methodNotAllowedError.data.some; +const methodNotAllowedError2: Boom.BoomError = Boom.methodNotAllowed('message'); + +const notAcceptableError = Boom.notAcceptable('message', {some: 'data'}); +notAcceptableError.data.some; +const notAcceptableError2: Boom.BoomError = Boom.notAcceptable('message'); + +const proxyAuthRequiredError = Boom.proxyAuthRequired('message', {some: 'data'}); +proxyAuthRequiredError.data.some; +const proxyAuthRequiredError2: Boom.BoomError = Boom.proxyAuthRequired('message'); + +const clientTimeoutError = Boom.clientTimeout('message', {some: 'data'}); +clientTimeoutError.data.some; +const clientTimeoutError2: Boom.BoomError = Boom.clientTimeout('message'); + +const conflictError = Boom.conflict('message', {some: 'data'}); +conflictError.data.some; + +const resourceGoneError = Boom.resourceGone('message', {some: 'data'}); +resourceGoneError.data.some; +const resourceGoneError2: Boom.BoomError = Boom.resourceGone('message'); + +const lengthRequiredError = Boom.lengthRequired('message', {some: 'data'}); +lengthRequiredError.data.some; +const lengthRequiredError2: Boom.BoomError = Boom.lengthRequired('message'); + +const preconditionFailedError = Boom.preconditionFailed('message', {some: 'data'}); +preconditionFailedError.data.some; +const preconditionFailedError2: Boom.BoomError = Boom.preconditionFailed('message'); + +const entityTooLargeError = Boom.entityTooLarge('message', {some: 'data'}); +entityTooLargeError.data.some; +const entityTooLargeError2: Boom.BoomError = Boom.lengthRequired('message'); + +const uriTooLongError = Boom.uriTooLong('message', {some: 'data'}); +uriTooLongError.data.some; +const uriTooLongError2: Boom.BoomError = Boom.uriTooLong('message'); + +const unsupportedMediaTypeError = Boom.unsupportedMediaType('message', {some: 'data'}); +unsupportedMediaTypeError.data.some; +const unsupportedMediaTypeError2: Boom.BoomError = Boom.unsupportedMediaType('message'); + +const rangeNotSatisfiableError = Boom.rangeNotSatisfiable('message', {some: 'data'}); +rangeNotSatisfiableError.data.some; +const rangeNotSatisfiableError2: Boom.BoomError = Boom.rangeNotSatisfiable('message'); + +const expectationFailedError = Boom.expectationFailed('message', {some: 'data'}); +expectationFailedError.data.some; +const expectationFailedError2: Boom.BoomError = Boom.expectationFailed('message'); + +const teapotError = Boom.teapot('message', {some: 'data'}); +teapotError.data.some; +const teapotError2: Boom.BoomError = Boom.teapot('message'); + +const badDataError = Boom.badData('message', {some: 'data'}); +badDataError.data.some; +const badDataError2: Boom.BoomError = Boom.badData('message'); + +const lockedError = Boom.locked('message', {some: 'data'}); +lockedError.data.some; +const lockedError2: Boom.BoomError = Boom.locked('message'); + +const preconditionRequiredError = Boom.preconditionRequired('message', {some: 'data'}); +preconditionRequiredError.data.some; +const preconditionRequiredError2: Boom.BoomError = Boom.preconditionRequired('message'); + +const tooManyRequestsError = Boom.tooManyRequests('message', {some: 'data'}); +tooManyRequestsError.data.some; +const tooManyRequestsError2: Boom.BoomError = Boom.tooManyRequests('message'); + +const illegalError = Boom.illegal('message', {some: 'data'}); +illegalError.data.some; +const illegalError2: Boom.BoomError = Boom.illegal('message'); + +// 5xx and data type + +const badImplementationError = Boom.badImplementation('message', {some: 'data'}); +badImplementationError.data.some; +const badImplementationError2: Boom.BoomError = Boom.badImplementation('message'); + +const internalError = Boom.internal('message', {some: 'data'}); +internalError.data.some; +const internalError2: Boom.BoomError = Boom.internal('message'); + +const notImplementedError = Boom.notImplemented('message', {some: 'data'}); +notImplementedError.data.some; +const notImplementedError2: Boom.BoomError = Boom.notImplemented('message'); + +const badGatewayError = Boom.badGateway('message', {some: 'data'}); +badGatewayError.data.some; +const badGatewayError2: Boom.BoomError = Boom.badGateway('message'); + +const serverUnavailableError = Boom.serverUnavailable('message', {some: 'data'}); +serverUnavailableError.data.some; +const serverUnavailableError2: Boom.BoomError = Boom.serverUnavailable('message'); + +const gatewayTimeoutError = Boom.gatewayTimeout('message', {some: 'data'}); +gatewayTimeoutError.data.some; +const gatewayTimeoutError2: Boom.BoomError = Boom.gatewayTimeout('message'); + +// boomify, wrap, and create +const boomifiedError = Boom.boomify(new Error('test'), { statusCode: 400, message: 'some message' }) + +const wrappedError = Boom.wrap(new Error('test'), 400, 'some message'); + +const error1 = Boom.create(500, 'Internal server error', { timestamp: Date.now() }); +error1.data.timestamp; +const error2: Boom.BoomError = Boom.create(500, 'Internal server error'); + +// type widen asserting + +const unauthorizedError = Boom.unauthorized() as Error; + +// status code and reformat + +const error = Boom.badRequest('Cannot feed after midnight'); +error.output.statusCode = 499; // Assign a custom error code +error.reformat(); + +/** + * Add a custom key to the payload + */ + +interface CustomPayload extends Boom.Payload { + custom: string; +} + +(error.output.payload as CustomPayload).custom = 'abc_123'; + +/** + * Test assignment of custom error data: + */ +const errorWithData = Boom.badImplementation('', { custom1: 'test', customType: 'Custom1', isCustom: true } as CustomData1); +const errorWithNoExplicitDataType: Boom.BoomError = errorWithData; // can assign to error without explicit data type +const errorWithExplicitType: Boom.BoomError = errorWithData; // can assign to union data type +const errorWithConcreteCustomData: Boom.BoomError = errorWithData; // can assign to concrete data type +// assignment to CustomData2 would not be possible +// const errorWithConcreteCustomData2: Boom.BoomError = errorWithData; + +// Some complex error data types for testing purposes: +interface CustomDataBase { + isCustom: true; +} + +interface CustomData1 extends CustomDataBase { + customType: 'Custom1'; + custom1: string; +} + +interface CustomData2 extends CustomDataBase { + customType: 'Custom2'; + custom2: string; +} + +type CustomData = CustomData1 | CustomData2; diff --git a/types/boom/v4/index.d.ts b/types/boom/v4/index.d.ts new file mode 100644 index 0000000000..76cd2d6b46 --- /dev/null +++ b/types/boom/v4/index.d.ts @@ -0,0 +1,335 @@ +// Type definitions for boom 4.3 +// Project: https://github.com/hapijs/boom +// Definitions by: Igor Rogatty +// AJP +// Jinesh Shah +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export = Boom; + +declare namespace Boom { + + /** + * boom provides a set of utilities for returning HTTP errors. Each utility returns a Boom error response object (instance of Error) which includes the following properties: + * @see {@link https://github.com/hapijs/boom#boom} + */ + export interface BoomError extends Error { + /** isBoom - if true, indicates this is a Boom object instance. */ + isBoom: boolean; + /** isServer - convenience bool indicating status code >= 500. */ + isServer: boolean; + /** message - the error message. */ + message: string; + /** output - the formatted response. Can be directly manipulated after object construction to return a custom error response. Allowed root keys: */ + output: Output; + /** reformat() - rebuilds error.output using the other object properties. */ + reformat: () => string; + /** "If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object." mentioned in @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} */ + isMissing?: boolean; + /** https://github.com/hapijs/boom#createstatuscode-message-data and https://github.com/hapijs/boom/blob/v4.3.0/lib/index.js#L99 */ + data: Data; + } + + export interface Output { + /** statusCode - the HTTP status code (typically 4xx or 5xx). */ + statusCode: number; + /** headers - an object containing any HTTP headers where each key is a header name and value is the header content. (Limited value type to string https://github.com/hapijs/boom/issues/151 ) */ + headers: {[index: string]: string}; + /** payload - the formatted object used as the response payload (stringified). Can be directly manipulated but any changes will be lost if reformat() is called. Any content allowed and by default includes the following content: */ + payload: Payload; + } + + export interface Payload { + /** statusCode - the HTTP status code, derived from error.output.statusCode. */ + statusCode: number; + /** error - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from statusCode. */ + error: string; + /** message - the error message derived from error.message. */ + message: string; + /** + * "Every key/value pair will be included ... in the response payload under the attributes key." + * [see docs](https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes) + */ + attributes?: any; + // Excluded this to aid typing of the other values. See tests for example casting to a custom interface to manipulate the payload + // [anyContent: string]: any; + } + + /** + * Decorates an error with the boom properties + * @param error the error object to wrap. If error is already a boom object, it defaults to overriding the object with the new status code and message. + * @param options optional additional options + * @see {@link https://github.com/hapijs/boom#boomifyerror-options} + */ + export function boomify(error: Error, options?: { statusCode?: number, message?: string, override?: boolean }): BoomError; + + /** + * Decorates an error with the boom properties + * @param error the error object to wrap. If error is already a boom object, returns back the same object. + * @param statusCode optional HTTP status code. Defaults to 500. + * @param message optional message string. If the error already has a message, it adds the message as a prefix. Defaults to no message. + * @see {@link https://github.com/hapijs/boom#wraperror-statuscode-message} + */ + export function wrap(error: Error, statusCode?: number, message?: string): BoomError; + + /** + * Generates an Error object with the boom decorations + * @param statusCode an HTTP error code number. Must be greater or equal 400. + * @param message optional message string. + * @param data additional error data set to error.data property. + * @see {@link https://github.com/hapijs/boom#createstatuscode-message-data} + */ + export function create(statusCode: number, message?: string, data?: Data): BoomError; + + // 4xx + /** + * Returns a 400 Bad Request error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boombadrequestmessage-data} + */ + export function badRequest(message?: string, data?: Data): BoomError; + + /** + * Returns a 401 Unauthorized error + * @param message optional message. + * @param scheme can be one of the following: + * * an authentication scheme name + * * an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. + * @param attributes an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when scheme is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the attributes key. Alternatively value can be a string which is use to set the value of the scheme, for example setting the token value for negotiate header. If string is used message parameter must be null. null and undefined will be replaced with an empty string. If attributes is set, message will be used as the 'error' segment of the 'WWW-Authenticate' header. If message is unset, the 'error' segment of the header will not be present and isMissing will be true on the error object. + * @see {@link https://github.com/hapijs/boom#boomunauthorizedmessage-scheme-attributes} + */ + export function unauthorized(message?: string, scheme?: string, attributes?: {[index: string]: string}): BoomError; + export function unauthorized(message?: string, scheme?: string[]): BoomError; + export function unauthorized(message?: null, scheme?: string, attributes?: {[index: string]: string} | string): BoomError; + export function unauthorized(message?: null, scheme?: string[]): BoomError; + + /** + * Returns a 402 Payment Required error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boompaymentrequiredmessage-data} + */ + export function paymentRequired(message?: string, data?: Data): BoomError; + + /** + * Returns a 403 Forbidden error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomforbiddenmessage-data} + */ + export function forbidden(message?: string, data?: Data): BoomError; + + /** + * Returns a 404 Not Found error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomnotfoundmessage-data} + */ + export function notFound(message?: string, data?: Data): BoomError; + + /** + * Returns a 405 Method Not Allowed error + * @param message optional message. + * @param data optional additional error data. + * @param allow optional string or array of strings (to be combined and separated by ', ') which is set to the 'Allow' header. + * @see {@link https://github.com/hapijs/boom#boommethodnotallowedmessage-data-allow} + */ + export function methodNotAllowed(message?: string, data?: Data, allow?: string | string[]): BoomError; + + /** + * Returns a 406 Not Acceptable error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomnotacceptablemessage-data} + */ + export function notAcceptable(message?: string, data?: Data): BoomError; + + /** + * Returns a 407 Proxy Authentication Required error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomproxyauthrequiredmessage-data} + */ + export function proxyAuthRequired(message?: string, data?: Data): BoomError; + + /** + * Returns a 408 Request Time-out error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomclienttimeoutmessage-data} + */ + export function clientTimeout(message?: string, data?: Data): BoomError; + + /** + * Returns a 409 Conflict error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomconflictmessage-data} + */ + export function conflict(message?: string, data?: Data): BoomError; + + /** + * Returns a 410 Gone error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomresourcegonemessage-data} + */ + export function resourceGone(message?: string, data?: Data): BoomError; + + /** + * Returns a 411 Length Required error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomlengthrequiredmessage-data} + */ + export function lengthRequired(message?: string, data?: Data): BoomError; + + /** + * Returns a 412 Precondition Failed error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boompreconditionfailedmessage-data} + */ + export function preconditionFailed(message?: string, data?: Data): BoomError; + + /** + * Returns a 413 Request Entity Too Large error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomentitytoolargemessage-data} + */ + export function entityTooLarge(message?: string, data?: Data): BoomError; + + /** + * Returns a 414 Request-URI Too Large error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomuritoolongmessage-data} + */ + export function uriTooLong(message?: string, data?: Data): BoomError; + + /** + * Returns a 415 Unsupported Media Type error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomunsupportedmediatypemessage-data} + */ + export function unsupportedMediaType(message?: string, data?: Data): BoomError; + + /** + * Returns a 416 Requested Range Not Satisfiable error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomrangenotsatisfiablemessage-data} + */ + export function rangeNotSatisfiable(message?: string, data?: Data): BoomError; + + /** + * Returns a 417 Expectation Failed error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomexpectationfailedmessage-data} + */ + export function expectationFailed(message?: string, data?: Data): BoomError; + + /** + * Returns a 418 I'm a Teapot error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomteapotmessage-data} + */ + export function teapot(message?: string, data?: Data): BoomError; + + /** + * Returns a 422 Unprocessable Entity error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boombaddatamessage-data} + */ + export function badData(message?: string, data?: Data): BoomError; + + /** + * Returns a 423 Locked error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomlockedmessage-data} + */ + export function locked(message?: string, data?: Data): BoomError; + + /** + * Returns a 428 Precondition Required error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boompreconditionrequiredmessage-data} + */ + export function preconditionRequired(message?: string, data?: Data): BoomError; + + /** + * Returns a 429 Too Many Requests error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomtoomanyrequestsmessage-data} + */ + export function tooManyRequests(message?: string, data?: Data): BoomError; + + /** + * Returns a 451 Unavailable For Legal Reasons error + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomillegalmessage-data} + */ + export function illegal(message?: string, data?: Data): BoomError; + + // 5xx + /** + * Returns a 500 Internal Server Error error + * Only 500 errors will hide your message from the end user. Your message is recorded in the server log. + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} + */ + export function badImplementation(message?: string, data?: Data): BoomError; + + /** + * Returns a 500 Internal Server Error error + * Only 500 errors will hide your message from the end user. Your message is recorded in the server log. + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boombadimplementationmessage-data---alias-internal} + */ + export function internal(message?: string, data?: Data): BoomError; + + /** + * Returns a 501 Not Implemented error with your error message to the user + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomnotimplementedmessage-data} + */ + export function notImplemented(message?: string, data?: Data): BoomError; + + /** + * Returns a 502 Bad Gateway error with your error message to the user + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boombadgatewaymessage-data} + */ + export function badGateway(message?: string, data?: Data): BoomError; + + /** + * Returns a 503 Service Unavailable error with your error message to the user + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomserverunavailablemessage-data} + */ + export function serverUnavailable(message?: string, data?: Data): BoomError; + + /** + * Returns a 504 Gateway Time-out error with your error message to the user + * @param message optional message. + * @param data optional additional error data. + * @see {@link https://github.com/hapijs/boom#boomgatewaytimeoutmessage-data} + */ + export function gatewayTimeout(message?: string, data?: Data): BoomError; +} diff --git a/types/boom/v4/tsconfig.json b/types/boom/v4/tsconfig.json new file mode 100644 index 0000000000..58f1109eee --- /dev/null +++ b/types/boom/v4/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "boom": [ + "boom/v4" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "boom-tests.ts" + ] +} diff --git a/types/boom/v4/tslint.json b/types/boom/v4/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/boom/v4/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootbox/index.d.ts b/types/bootbox/index.d.ts index 850eb18c25..dfdf0de871 100644 --- a/types/bootbox/index.d.ts +++ b/types/bootbox/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Bootbox 4.4.0 // Project: https://github.com/makeusabrew/bootbox -// Definitions by: Vincent Bortone , Kon Pik , Anup Kattel , Dominik Schroeter , Troy McKinnon , Stanny Nuytkens +// Definitions by: Vincent Bortone , Kon Pik , Anup Kattel , Dominik Schroeter , Troy McKinnon , Stanny Nuytkens , Soner Köksal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -23,7 +23,7 @@ interface BootboxBaseOptions { /** Bootbox options available for custom modals */ interface BootboxDialogOptions extends BootboxBaseOptions { - message: string | Element; + message: JQuery|any[]|Element|DocumentFragment|Text|string|((index: number, html: string) => string|Element|JQuery); } /** Bootbox options available for alert modals */ diff --git a/types/bootbox/tslint.json b/types/bootbox/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootbox/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootpag/tslint.json b/types/bootpag/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootpag/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-datepicker/tslint.json b/types/bootstrap-datepicker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-datepicker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-fileinput/index.d.ts b/types/bootstrap-fileinput/index.d.ts index 8a7df2dbbc..61a53b12bb 100644 --- a/types/bootstrap-fileinput/index.d.ts +++ b/types/bootstrap-fileinput/index.d.ts @@ -6,10 +6,14 @@ /// -interface JQuery { - fileinput: (options?: BootstrapFileInput.FileInputOptions) => JQuery; -} +export = BootstrapFileInput; +export as namespace BootstrapFileInput; +declare global { + interface JQuery { + fileinput: (options?: BootstrapFileInput.FileInputOptions) => JQuery; + } +} declare module BootstrapFileInput { interface FileInputOptions { @@ -19,6 +23,11 @@ declare module BootstrapFileInput { The locale JS file for the language code must be defined as mentioned in the translations section: http://plugins.krajee.com/file-input#translations */ language?: string; + + /** + * Theming + */ + theme?: string; /** Whether to display the file caption. Defaults to true. diff --git a/types/bootstrap-fileinput/tslint.json b/types/bootstrap-fileinput/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-fileinput/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-maxlength/tslint.json b/types/bootstrap-maxlength/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-maxlength/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-notify/index.d.ts b/types/bootstrap-notify/index.d.ts index 0517b62cf8..540f200d9c 100644 --- a/types/bootstrap-notify/index.d.ts +++ b/types/bootstrap-notify/index.d.ts @@ -6,10 +6,7 @@ /// -/* tslint:disable: interface-name no-any */ - interface JQueryStatic { - /* tslint:enable: interface-name */ notify(message: string): NotifyReturn; notify(opts: NotifyOptions, settings?: NotifySettings): NotifyReturn; notifyDefaults(settings: NotifySettings): void; diff --git a/types/bootstrap-notify/tslint.json b/types/bootstrap-notify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-notify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-select/tslint.json b/types/bootstrap-select/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-select/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-slider/bootstrap-slider-tests.ts b/types/bootstrap-slider/bootstrap-slider-tests.ts index 2073a3de9d..9b2a1a2014 100644 --- a/types/bootstrap-slider/bootstrap-slider-tests.ts +++ b/types/bootstrap-slider/bootstrap-slider-tests.ts @@ -90,6 +90,56 @@ $(() => { $('#ex16a').slider({ min: 0, max: 10, value: 0, focus: true }); $('#ex16b').slider({ min: 0, max: 10, value: [0, 10], focus: true }); + $("#ex17a").slider({ + min: 0, + max: 10, + value: 0, + tooltip_position: 'bottom' + }); + $("#ex17b").slider({ + min: 0, + max: 10, + value: 0, + orientation: 'vertical', + tooltip_position: 'left' + }); + + $("#ex18a").slider({ + min: 0, + max: 10, + value: 5, + labelledby: 'ex18-label-1' + }); + $("#ex18b").slider({ + min: 0, + max: 10, + value: [3, 6], + labelledby: ['ex18-label-2a', 'ex18-label-2b'] + }); + + $('#ex22').slider({ + id: 'slider22', + min: 0, + max: 20, + step: 1, + value: 14, + rangeHighlights: [{ start: 2, end: 5, class: "category1" }, + { start: 7, end: 8, class: "category2" }, + { start: 17, end: 19 }, + { start: 17, end: 24 }, + { start: -3, end: 19 }]}); + + $("#ex23").slider({ + ticks: [0, 1, 2, 3, 4], + ticks_positions: [0, 30, 60, 70, 90, 100], + ticks_snap_bounds: 200, + formatter(value) { + return 'Current value: ' + value; + }, + ticks_tooltip: true, + step: 0.01 + }); + // examples from https://github.com/seiyria/bootstrap-slider/blob/master/README.md { diff --git a/types/bootstrap-slider/index.d.ts b/types/bootstrap-slider/index.d.ts index 557c7aa5ad..5559e12f12 100644 --- a/types/bootstrap-slider/index.d.ts +++ b/types/bootstrap-slider/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bootstrap-slider.js 9.8 +// Type definitions for bootstrap-slider.js 9.9 // Project: https://github.com/seiyria/bootstrap-slider // Definitions by: Daniel Beckwith // Leonard Thieu @@ -7,6 +7,19 @@ /// +interface RangeHighlight { + class?: string; + start?: number; + end?: number; +} + +type SliderEventType = 'slide' | + 'slideStart' | + 'slideStop' | + 'change' | + 'slideEnabled' | + 'slideDisabled'; + interface SliderOptions { /** * Default: '' @@ -63,6 +76,14 @@ interface SliderOptions { * if false show one tootip if true show two tooltips one for each handler */ tooltip_split?: boolean; + /** + * Default: null + * Position of tooltip, relative to slider. Accepts 'top'/'bottom' for + * horizontal sliders and 'left'/'right' for vertically orientated sliders. + * Default positions are 'top' for horizontal and 'right' for vertical + * slider. + */ + tooltip_position?: 'top' | 'bottom' | 'left' | 'right'; /** * Default: 'round' * handle shape. Accepts: 'round', 'square', 'triangle' or 'custom' @@ -73,6 +94,10 @@ interface SliderOptions { * whether or not the slider should be reversed */ reversed?: boolean; + /** + * Default: 'auto' + */ + rtl?: boolean | 'auto'; /** * Default: true * whether or not the slider is initially enabled @@ -111,16 +136,34 @@ interface SliderOptions { * Used to define the snap bounds of a tick. Snaps to the tick if value is within these bounds. */ ticks_snap_bounds?: number; + /** + * Default: false + * Used to allow for a user to hover over a given tick to see it's value. + * Useful if custom formatter passed in + */ + ticks_tooltip?: boolean; /** * Default: 'linear' * Set to 'logarithmic' to use a logarithmic scale. */ - scale?: string; + scale?: 'linear' | 'logarithmic'; /** * Default: false * Focus the appropriate slider handle after a value change. */ focus?: boolean; + /** + * Default: null + * ARIA labels for the slider handle's, Use array for multiple values in a + * range slider. + */ + labelledby?: string | string[]; + /** + * Default: [] + * Defines a range array that you want to highlight, for example: + * [{'start':val1, 'end': val2, 'class': 'optionalAdditionalClassName'}]. + */ + rangeHighlights?: RangeHighlight[]; } interface JQuery { @@ -134,7 +177,6 @@ interface SliderPlugin { (methodName: string, ...args: any[]): TJQuery; /** * Creates a slider from the current element. - * @param options */ (options?: SliderOptions): TJQuery; } @@ -163,11 +205,12 @@ declare class Slider { /** * Set a new value for the slider. If optional triggerSlideEvent parameter is true, 'slide' events will be triggered. * If optional triggerChangeEvent parameter is true, 'change' events will be triggered. - * @param newValue - * @param triggerSlideEvent - * @param triggerChangeEvent */ setValue(newValue: number, triggerSlideEvent?: boolean, triggerChangeEvent?: boolean): this; + /** + * Get the div slider element + */ + getElement(): HTMLDivElement; /** * Properly clean up and remove the slider instance */ @@ -180,25 +223,34 @@ declare class Slider { * Enables the slider */ enable(): this; + /** + * Toggles the slider between enabled and disabled + */ + toggle(): this; /** * Returns true if enabled, false if disabled */ isEnabled(): boolean; /** * Updates the slider's attributes - * @param attribute - * @param value */ setAttribute(attribute: string, value: any): this; /** * Get the slider's attributes - * @param attribute */ getAttribute(attribute: string): any; /** * Refreshes the current slider */ refresh(): this; + /** + * When the slider event eventType is triggered, the callback function will be invoked + */ + on(eventType: SliderEventType, callback: (val: number | undefined) => void): this; + /** + * Removes the callback function from the slider event eventType + */ + off(eventType: SliderEventType, callback: (val: number | undefined) => void): void; /** * Renders the tooltip again, after initialization. Useful in situations when the slider and tooltip are initially hidden. */ diff --git a/types/bootstrap-switch/tslint.json b/types/bootstrap-switch/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-switch/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-table/tslint.json b/types/bootstrap-table/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-table/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-touchspin/tslint.json b/types/bootstrap-touchspin/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-touchspin/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap.paginator/tslint.json b/types/bootstrap.paginator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap.paginator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap.timepicker/tslint.json b/types/bootstrap.timepicker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap.timepicker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap.v3.datetimepicker/index.d.ts b/types/bootstrap.v3.datetimepicker/index.d.ts index 7b1d3877ba..c588943afd 100644 --- a/types/bootstrap.v3.datetimepicker/index.d.ts +++ b/types/bootstrap.v3.datetimepicker/index.d.ts @@ -24,7 +24,8 @@ export interface Datetimepicker { clear(): void; /** Returns the component's model current date, a moment object or null if not set. */ date(): moment.Moment; - /** Takes string, Date, moment, null parameter and sets the components model current moment to it. + /** + * Takes string, Date, moment, null parameter and sets the components model current moment to it. * Passing a null value unsets the components model current moment. * Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration. * Throws: @@ -36,14 +37,16 @@ export interface Datetimepicker { date(date: moment.Moment | Date | string | null): void; /** Destroys the widget and removes all attached event listeners */ destroy(): void; - /** Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden. + /** + * Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden. * Emits: * - dp.hide - if the widget was visible before that call */ disable(): void; /** Enables the input element, the component is attached to, by removing disabled attribute from it. */ enable(): void; - /** Hides the widget + /** + * Hides the widget * Emits: * - dp.hide - if the widget was visible before that call */ @@ -55,13 +58,15 @@ export interface Datetimepicker { options(): DatetimepickerOptions; /** Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component. */ options(options: DatetimepickerOptions): void; - /** Shows the widget + /** + * Shows the widget * Emits: * - dp.show - if the widget was hidden before that call * - dp.change - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value */ show(): void; - /** Shows or hides the widget + /** + * Shows or hides the widget * Emits: * - dp.hide - if the widget is hidden after the toggle call * - dp.show - if the widget is show after the toggle call @@ -90,7 +95,8 @@ export interface Datetimepicker { * IMPORTANT! Throws exception if not set explicitly https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1459 */ daysOfWeekDisabled(): number[]; - /** Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array. + /** + * Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array. * This has lower priority over the options.minDate, options.maxDate, options.disabledDates and options.enabledDates configuration settings. * Emits: * - dp.change - if the currently selected moment falls in the values passed on the daysOfWeek parameter. @@ -133,13 +139,15 @@ export interface Datetimepicker { * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. */ disabledHours(value: boolean | number[]): void; - /** Returns the options.disabledTimeIntervals option, or... not exactly + /** + * Returns the options.disabledTimeIntervals option, or... not exactly * IMPORTANT! Creates an object from the options.disabledTimeIntervals with the keys being numbers, the values being the moment arrays. * eg { "0": [, ], "1": [...] } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1498 */ disabledTimeIntervals(): boolean | moment.Moment[][]; - /** Disables time selection between the given moments + /** + * Disables time selection between the given moments * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] */ disabledTimeIntervals(value: boolean | moment.Moment[][]): void; @@ -148,7 +156,8 @@ export interface Datetimepicker { * NOTES: probably should be: enabledDates(): boolean | Array; see: DatetimepickerOptions */ enabledDates(): boolean | any; - /** Takes an array of values and allows the user to select only from those days. + /** + * Takes an array of values and allows the user to select only from those days. * Setting this takes precedence over options.minDate, options.maxDate configuration. * Also calling this function removes the configuration of options.disabledDates if such exist. * Note: These values are matched with Day granularity. @@ -174,7 +183,8 @@ export interface Datetimepicker { focusOnShow(value: boolean): void; /** Returns the component's options.format string */ format(): boolean | string | moment.MomentBuiltinFormat; - /** Takes a moment.js format string and sets the components options.format. + /** + * Takes a moment.js format string and sets the components options.format. * This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function. * The parameter can also be a boolean:false in which case the format is set to the locale's L LT. * Note: this is also used to determine if the TimePicker sub component will display the hours in 12 or 24 format. (if "a" or "h" exists in the passed string then a 12 hour mode is set) @@ -184,7 +194,8 @@ export interface Datetimepicker { format(format: boolean | string | moment.MomentBuiltinFormat): void; /** Returns options.icons */ icons(): Icons; - /** Takes an Object of strings. + /** + * Takes an Object of strings. * Throws: * - TypeError - if icons parameter is not an Object */ @@ -209,14 +220,16 @@ export interface Datetimepicker { keyBinds(value: any): void; /** Returns the currently set locale of the options.locale */ locale(): string; - /** Takes a string of any valid moment locale e.g. de for German. + /** + * Takes a string of any valid moment locale e.g. de for German. * Throws: * - TypeError - if the locale is not loaded via a separate script or moment-with-locale */ locale(newLocale: string): void; /** Returns the currently set moment of the options.maxDate or false if not set */ maxDate(): moment.Moment | boolean; - /** Takes a parameter and disallows the user to select a moment that is after that moment. + /** + * Takes a parameter and disallows the user to select a moment that is after that moment. * If a boolean:false value is passed options.maxDate is cleared and there is no restriction to the maximum moment the user can select. * Note: If the parameter is before the currently selected moment the currently selected moment changes to maxDate * Throws: @@ -230,7 +243,8 @@ export interface Datetimepicker { maxDate(date: moment.Moment | Date | string | boolean): void; /** Returns the currently set moment of the options.minDate or false if not set */ minDate(): moment.Moment | boolean; - /** Takes a parameter and disallows the user to select a moment that is before that moment. + /** + * Takes a parameter and disallows the user to select a moment that is before that moment. * If a boolean:false value is passed the options.minDate parameter is cleared and there is no restriction to the miminum moment the user can select. * Note: If the parameter is after the currently selected moment the currently selected moment changes to minDate parameter * Throws: @@ -244,7 +258,8 @@ export interface Datetimepicker { minDate(date: moment.Moment | Date | string | boolean): void; /** Returns the options.parseInputDate option */ parseInputDate(): InputParser | undefined; - /** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". + /** + * Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ parseInputDate(value: InputParser): void; @@ -270,14 +285,16 @@ export interface Datetimepicker { stepping(step: number): void; /** Returns a string of options.timeZone */ timeZone(): string | null; - /** Takes a null or a string of a valid timezone. + /** + * Takes a null or a string of a valid timezone. * Throws: * - TypeError - if tooltips parameter is not a string or null */ timeZone(timeZone: string | null): void; /** Returns the options.toolbarplacement option. */ toolbarPlacement(): string; - /** Changes the placement of the toolbar where the today, clear, component switch icon are located. + /** + * Changes the placement of the toolbar where the today, clear, component switch icon are located. * See valid values at DatetimepickerOptions.toolbarplacement * Throws: * - TypeError - if the parameter is not a valid value @@ -285,14 +302,16 @@ export interface Datetimepicker { toolbarPlacement(value: string): void; /** Returns the options.tooltips option */ tooltips(): Tooltips; - /** Sets the tooltips for icons. + /** + * Sets the tooltips for icons. * Throws: * - TypeError - if tooltips parameter is not an Object */ tooltips(value: Tooltips): void; /** Returns the options.useCurrent option configuration */ useCurrent(): boolean | string; - /** Takes a boolean or string. + /** + * Takes a boolean or string. * If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) * then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. * If a false boolean is passed then no initialization happens on the input element. @@ -312,7 +331,8 @@ export interface Datetimepicker { viewDate(value: string | Date | moment.Moment | boolean): void; /** Returns the options.viewMode. */ viewMode(): string; - /** Takes a string. See valid values at DatetimepickerOptions.viewMode + /** + * Takes a string. See valid values at DatetimepickerOptions.viewMode * Throws: * - TypeError - if the parameter is not a string or not a valid value */ @@ -323,7 +343,8 @@ export interface Datetimepicker { widgetParent(widgetParent: string | JQuery | null): void; /** Returns the options.widgetPositioning object */ widgetPositioning(): WidgetPositioningOptions; - /** WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to. + /** + * WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to. * "auto" is the default value for both horizontal and vertical keys and it tries to automatically place the dropdown in a position that is visible to the user. * Usually you should not override those options unless you have a special need in your layout. */ @@ -331,7 +352,6 @@ export interface Datetimepicker { /** * JQuery plugin function. - * @param {DatetimepickerOptions} options */ (options?: DatetimepickerOptions): JQuery; @@ -343,91 +363,109 @@ export interface Datetimepicker { } export interface DatetimepickerOptions { - /** If true, the picker will show on textbox focus and icon click when used in a button group + /** + * If true, the picker will show on textbox focus and icon click when used in a button group * @default: false */ allowInputToggle?: boolean; - /** Shows the week of the year to the left of first day of the week. + /** + * Shows the week of the year to the left of first day of the week. * @default: false */ calendarWeeks?: boolean; - /** Using a Bootstraps collapse to switch between date/time pickers. + /** + * Using a Bootstraps collapse to switch between date/time pickers. * @default: true */ collapse?: boolean; - /** Disables the section of days of the week, e.g. weekends. + /** + * Disables the section of days of the week, e.g. weekends. * Accepts: array of numbers from 0-6 * @default: false */ daysOfWeekDisabled?: number[] | boolean; - /** Changes the heading of the datepicker when in "days" view. + /** + * Changes the heading of the datepicker when in "days" view. * @default: "MMMM YYYY" */ dayViewHeaderFormat?: string; - /** Will cause the date picker to stay open after a blur event. + /** + * Will cause the date picker to stay open after a blur event. * @default: false */ debug?: boolean; - /** Sets the picker default date/time. Overrides useCurrent + /** + * Sets the picker default date/time. Overrides useCurrent * @default: false */ defaultDate?: boolean | moment.Moment | Date | string; - /** Disables selection of dates in the array, e.g. holidays + /** + * Disables selection of dates in the array, e.g. holidays * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. * eg disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ disabledDates?: boolean | Array | any; - /** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days + /** + * Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. * eg disabledHours = [0, 1]; -> disabledHours will be { "0": true, "1": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ disabledHours?: boolean | number[] | any; - /** Disables time selection between the given moments + /** + * Disables time selection between the given moments * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] * @default: false */ disabledTimeIntervals?: boolean | moment.Moment[][]; - /** Disables selection of dates NOT in the array, e.g. holidays + /** + * Disables selection of dates NOT in the array, e.g. holidays * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. * eg enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ enabledDates?: boolean | Array | any; - /** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days + /** + * Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. * eg enabledHours = [0, 1]; -> enabledHours will be { "0": true, "1": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ enabledHours?: boolean | number[]; - /** Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 + /** + * Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 * @default: false */ extraFormats?: boolean | Array; - /** If false, the textbox will not be given focus when the picker is shown + /** + * If false, the textbox will not be given focus when the picker is shown * @default: true */ focusOnShow?: boolean; - /** See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. + /** + * See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. * @default: false */ format?: boolean | string | moment.MomentBuiltinFormat; /** Change the default icons for the pickers functions. */ icons?: Icons; - /** Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. + /** + * Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. * @default: false */ ignoreReadonly?: boolean; - /** Will display the picker inline without the need of a input field. This will also hide borders and shadows. + /** + * Will display the picker inline without the need of a input field. This will also hide borders and shadows. * @default: false */ inline?: boolean; - /** Allows for custom events to fire on keyboard press. + /** + * Allows for custom events to fire on keyboard press. * eg: keybinds: { * up: (widget) => console.log(widget), * "control up": (widget) => console.log(widget) @@ -435,52 +473,63 @@ export interface DatetimepickerOptions { * The widget parameter is false, if the datepicker is closed. */ keyBinds?: { [key: string]: (widget: boolean | JQuery) => void }; - /** Will cause the date picker to not revert or overwrite invalid dates. + /** + * Will cause the date picker to not revert or overwrite invalid dates. * @default: false */ keepInvalid?: boolean; - /** Will cause the date picker to stay open after selecting a date if no time components are being used. + /** + * Will cause the date picker to stay open after selecting a date if no time components are being used. * @default: false */ keepOpen?: boolean; - /** See momentjs for valid locales. You must include moment-with-locales.js or a local js file. + /** + * See momentjs for valid locales. You must include moment-with-locales.js or a local js file. * @default: moment.locale() */ locale?: string; - /** Prevents date/time selections after this date. + /** + * Prevents date/time selections after this date. * maxDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. * @default: false */ maxDate?: boolean | moment.Moment | Date | string; - /** Prevents date/time selections before this date. + /** + * Prevents date/time selections before this date. * minDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. * @default: false */ minDate?: boolean | moment.Moment | Date | string; - /** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". + /** + * Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ parseInputDate?: InputParser; - /** Show the "Clear" button in the icon toolbar. + /** + * Show the "Clear" button in the icon toolbar. * Clicking the "Clear" button will set the calendar to null. * @default: false */ showClear?: boolean; - /** Show the "Close" button in the icon toolbar. + /** + * Show the "Close" button in the icon toolbar. * Clicking the "Close" button will call hide() * @default: false */ showClose?: boolean; - /** Show the "Today" button in the icon toolbar. + /** + * Show the "Today" button in the icon toolbar. * Clicking the "Today" button will set the calendar view and set the date to now. * @default: false */ showTodayButton?: boolean; - /** Shows the picker side by side when using the time and date together. + /** + * Shows the picker side by side when using the time and date together. * @default: false */ sideBySide?: boolean; - /** Number of minutes the up/down arrow's will move the minutes value in the time picker + /** + * Number of minutes the up/down arrow's will move the minutes value in the time picker * @default: 1 */ stepping?: number; @@ -489,30 +538,36 @@ export interface DatetimepickerOptions { * @default: "" */ timeZone?: string | null; - /** Changes the placement of the icon toolbar. + /** + * Changes the placement of the icon toolbar. * @default: "default" */ toolbarPlacement?: "default" | "top" | "bottom"; /** This will change the tooltips over each icon to a custom string */ tooltips?: Tooltips; - /** On show, will set the picker to the current date/time + /** + * On show, will set the picker to the current date/time * @default: true */ useCurrent?: boolean; - /** Defines if moment should use strict date parsing when considering a date to be valid + /** + * Defines if moment should use strict date parsing when considering a date to be valid * @default: false */ useStrict?: boolean; - /** This will change the viewDate without changing or setting the selected date. + /** + * This will change the viewDate without changing or setting the selected date. * @default: false */ viewDate?: boolean | moment.Moment | Date | string; - /** The default view to display when the picker is shown. + /** + * The default view to display when the picker is shown. * Note: To limit the picker to selecting, for instance the year and month, use format: MM/YYYY * @default: "days" */ viewMode?: "decades" | "years" | "months" | "days"; - /** On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" + /** + * On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" * @default: null */ widgetParent?: string | JQuery | null; diff --git a/types/bootstrap.v3.datetimepicker/package.json b/types/bootstrap.v3.datetimepicker/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/bootstrap.v3.datetimepicker/package.json +++ b/types/bootstrap.v3.datetimepicker/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/bootstrap.v3.datetimepicker/v3/package.json b/types/bootstrap.v3.datetimepicker/v3/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/bootstrap.v3.datetimepicker/v3/package.json +++ b/types/bootstrap.v3.datetimepicker/v3/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/bootstrap.v3.datetimepicker/v3/tslint.json b/types/bootstrap.v3.datetimepicker/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap.v3.datetimepicker/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap/tslint.json b/types/bootstrap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/botvs/botvs-tests.ts b/types/botvs/botvs-tests.ts deleted file mode 100644 index 96c424c164..0000000000 --- a/types/botvs/botvs-tests.ts +++ /dev/null @@ -1,7 +0,0 @@ -_N(0, 1); -_C(() => void 0); -Sleep(1e3); -const data: botvs.Record | undefined = void 0; -console.log(data); -TA.Alligator([]); -talib.help('XML'); diff --git a/types/botvs/index.d.ts b/types/botvs/index.d.ts deleted file mode 100644 index 2eabcb98da..0000000000 --- a/types/botvs/index.d.ts +++ /dev/null @@ -1,4106 +0,0 @@ -// Type definitions for botvs 0.1 -// Project: https://www.botvs.com/ -// Definitions by: acrazing -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// - -import Highstock = require('highcharts/highstock'); - -declare global { - namespace botvs { - /** - * 订单的状态 - */ - type VOrderState = object; - - /** - * 订单的类型 - */ - type VOrderType = object; - - /** - * 仓位的类型 - */ - type VPositionType = object; - - /** - * K线周期 - */ - type VPeriod = object; - - /** - * 日志类型 - */ - type VLogType = object; - - interface ChartOptions extends Highstock.Options { - __isStock?: boolean; - } - - interface RChart { - add(series?: number, data?: number, index?: number): void; - reset(): void; - } - - interface Socket { - write(data: string, timeout?: number): number; - read(size?: number): Buffer | null; - close(): void; - } - - /** - * 标准OHLC结构, 用来画K线和指标分析用的,由GetRecords函数返回此结构数组 - */ - interface Record { - /** - * 一个时间戳, 精确到毫秒,与Javascript的 new Date().getTime() 得到的结果格式一样 - */ - Time: number; - /** - * 开盘价 - */ - Open: number; - /** - * 最高价 - */ - High: number; - /** - * 最低价 - */ - Low: number; - /** - * 收盘价 - */ - Close: number; - /** - * 成交量 - */ - Volume: number; - } - - /** - * 市场深度单 - */ - interface MarketOrder { - /** - * 价格 - */ - Price: number; - /** - * 数量 - */ - Amount: number; - } - - /** - * 市场行情 - */ - interface Ticker { - /** - * 最高价 - */ - High: number; - /** - * 最低价 - */ - Low: number; - /** - * 卖一价 - */ - Sell: number; - /** - * 买一价 - */ - Buy: number; - /** - * 最后成交价 - */ - Last: number; - /** - * 最近成交量 - */ - Volume: number; - } - - /** - * 订单结构, 由GetOrder函数返回 - */ - interface Order { - /** - * 交易单唯一标识 - */ - Id: string; - /** - * 下单价格 - */ - Price: number; - /** - * 下单数量 - */ - Amount: number; - /** - * 成交数量 - */ - DealAmount: number; - /** - * 订单状态, 参考常量里的订单状态 - */ - Status: VOrderState; - /** - * 订单类型, 参考常量里的订单类型 - */ - Type: VOrderType; - } - - /** - * 市场深度,由GetDepth函数返回 - */ - interface Depth { - /** - * 卖单数组, MarketOrder数组, 按价格从低向高排序 - */ - Asks: MarketOrder[]; - /** - * 买单数组, MarketOrder数组, 按价格从高向低排序 - */ - Bids: MarketOrder[]; - } - - /** - * 获取所有交易历史(非自己),由GetTrades函数返回 - */ - interface Trade { - /** - * Id(交易所返回的此Trade的唯一Id) - */ - Id: string; - /** - * 时间(Unix timestamp 毫秒) - */ - Time: number; - /** - * 价格 - */ - Price: number; - /** - * 数量 - */ - Amount: number; - /** - * 订单类型, 参考常量里的订单类型 - */ - Type: VOrderType; - } - - /** - * 手续费结构, 由GetFee函数返回(如国外平台bitfinex买入卖出手续费跟账户交易量相关) - */ - interface Fee { - /** - * 卖出手续费, 为一个浮点数, 如0.2表示0.2%的手续费 - */ - Sell: number; - /** - * 买入手续费, 格式同上 - */ - Buy: number; - } - - /** - * 账户信息, 由GetAccount函数返回 - */ - interface Account { - /** - * 余额(人民币或者美元, 在Poloniex交易所里BTC_ETC这样的品种, Balance就指的是BTC的数量, - * Stocks指的是ETC数量, BTC38的ETC_BTC相当于Poloniex的BTC_ETC, 指的是以BTC计价) - */ - Balance: number; - /** - * 冻结的余额 - */ - FrozenBalance: number; - /** - * BTC/LTC数量, 现货为当前可操作币的余额(去掉冻结的币), - * 期货的话为合约当前可用保证金(传统期货为此属性) - */ - Stocks: number; - /** - * 冻结的BTC/LTC数量(传统期货无此属性) - */ - FrozenStocks: number; - } - - /** - * 期货交易中的持有仓位信息, 由GetPosition()函数返回此结构数组 - */ - interface Position { - /** - * 杆杠大小, 796期货有可能为5, 10, 20三个参数, OKCoin为10或者20, - * BitVC期货和OK期货的全仓模式返回为固定的10, 因为原生API不支持 - */ - MarginLevel: number; - /** - * 持仓量, 796期货表示持币的数量, BitVC指持仓的总金额(100的倍数), - * OKCoin表示合约的份数(整数且大于1) - */ - Amount: number; - /** - * 可平量, 只有股票有此选项, 表示可以平仓的数量(股票为T+1)今日仓不能平 - */ - CanCover: number; - /** - * 仓位冻结量 - */ - FrozenAmount: number; - /** - * 持仓均价 - */ - Price: number; - /** - * 持仓浮动盈亏(数据货币单位:BTC/LTC, 传统期货单位:RMB, 股票不支持此字段, - * 注: OKCoin期货全仓情况下指实现盈余, 并非持仓盈亏, 逐仓下指持仓盈亏) - */ - Profit: number; - /** - * PD_LONG为多头仓位(CTP中用closebuy_today平仓), PD_SHORT为空头仓位(CTP用closesell_today)平仓, - * (CTP期货中)PD_LONG_YD为咋日多头仓位(用closebuy平), PD_SHORT_YD为咋日空头仓位(用closesell平) - */ - Type: VPositionType; - /** - * 商品期货为合约代码, 股票为'交易所代码_股票代码', 具体参数SetContractType的传入类型 - */ - ContractType: string; - } - - interface AsyncJob { - wait(timeout?: number): T | null | undefined; - } - - interface Exchange { - /** - * 返回交易所名称(string) - * - * @return {string} - */ - GetName(): string; - - /** - * 返回交易所自定义的标签(string) - * - * @return {string} - */ - GetLabel(): string; - - /** - * 返回交易所使用的美元的汇率, OKCoin期货返回官方提供的汇率, 该值不受SetRate影响 - * - * @return {number} - */ - GetUSDCNY(): number; - - /** - * 返回交易所使用的流通货币与人民币的汇率, 返回1表示禁用汇率转换 - * - * 汇率接口调用雅虎提供的接口, 5分钟更新一次 - * 所有函数自动经过汇率转换,如果为1指禁用汇率转换 - * - * @return {number} - */ - GetRate(): number; - - /** - * 设置交易所的流通货币的汇率, 返回设置前的汇率, 设置为1指禁用汇率转换 - * - * 比如796期货设置SetRate(6.13), 就是设定USD/EUR对CNY的汇率为6.13, 程序所有价格会自动用这个汇率计算 - * SetRate(), 如果不加参数,则恢复系统内置汇率 - * SetRate(1), 就是禁用汇率转换 - * - * @param {number} rate - */ - SetRate(rate?: number): void; - - /** - * 设置价格与品种下单量的小数位精度, 设置后会自动截断 - * - * exchange.SetPrecision(2, 3); // 设置价格小数位精度为2位, 品种下单量小数位精度为3位 - * - * @param {number} PricePrecision - * @param {number} AmountPrecision - */ - SetPrecision(PricePrecision: number, AmountPrecision: number): void; - - /** - * 返回交易所操作的货币名称(string), 传统期货CTP返回的固定为STOCK - * - * @return {string} - */ - GetCurrency(): string; - - /** - * 返回交易所操作的基础货币名称(string), BTC_CNY就返回CNY, ETH_BTC就返回BTC - * - * @return {string} - */ - GetBaseCurrency(): string; - - /** - * 返回一个Ticker结构 - * - * @return {botvs.Ticker} - */ - GetTicker(): Ticker; - - /** - * 返回一个Depth结构 - * - * @return {botvs.Depth} - */ - GetDepth(): Depth; - - /** - * 返回一个Trade数组, 按时间从低到高的顺序, 只支持数字货币(BTC/LTC) - * - * @return {botvs.Trade[]} - */ - GetTrades(): Trade[]; - - /** - * 返回一个K线历史, K线周期在创建机器人时指定, Record数组结构 - * - * 不加参数, 默认返回添加机器人时时指量的K线周期, 但也可以自定义K线周期 - * 支持: PERIOD_M1 指1分钟, PERIOD_M5 指5分钟, PERIOD_M15 指15分钟, - * PERIOD_M30 指30分钟, PERIOD_H1 指1小时, PERIOD_D1 指一天 - * - * @param {number} Period - * @return {botvs.Record[]} - */ - GetRecords(Period?: VPeriod): Record[]; - - /** - * 返回一个Account结构, 如exchange.GetAccount(), 将返回主交易所账户信息 - * - * @return {botvs.Account} - */ - GetAccount(): Account; - - /** - * 下买单, Price为买单价格,Amount为数量, 返回一个订单ID - * - * 可以跟多余的参数做为附加消息显示到日志, 如exchange.Buy(1000,0.1, "OK", 123) - * 支持现货(火币/BitVC/OKCoin/OKCoin国际/OKCoin期货/BTCChina/BitYes)市价单, 市价单价格指定为-1 - * exchange.Buy(1000), 指买市价1000元的币, BTCChina例外exchange.Buy(0.3)指市价买0.3个币 - * - * @param {number} Price - * @param {number} Amount - * @param {*[]} args - * @return {string} - 订单ID - */ - Buy(Price: number, Amount: number, ...args: any[]): string; - - /** - * 跟Buy函数一样的调用方法和场景 {@see Exchange#Buy} - * - * @param {number} Price - * @param {number} Amount - * @return {string} - */ - Sell(Price: number, Amount: number): string; - - /** - * 获取所有未完成的订单, 返回一个Order数组结构 - * - * @return {botvs.Order[]} - */ - GetOrders(): Order[]; - - /** - * 根据订单号获取订单详情, 返回一个Order结构 - * - * @param {string} orderId - * @return {botvs.Order} - */ - GetOrder(orderId: string): Order; - - /** - * 根据订单号取消一个订单, 返回true或者false - * - * @param {string} orderId - * @return {boolean} - */ - CancelOrder(orderId: string): boolean; - - /** - * 不下单, 只记录交易信息, logType可为LOG_TYPE_BUY/LOG_TYPE_SELL/LOG_TYPE_CANCEL - * - * @param {VLogType} logType - * @param {string} orderId - * @param {number} price - * @param {number} amount - */ - Log(logType: VLogType, orderId: string, price: number, amount: number): void; - - /** - * 返回币最小交易数量 - * - * @return {number} - */ - GetMinStock(): number; - - /** - * 返回一笔订单要求的最小金额(价格*数量) - * - * Bitstamp要求5美元(程序会根据汇率自动转换为人民币), 其它没有限制 - * - * @return {number} - */ - GetMinPrice(): number; - - /** - * 返回一个Fee结构 - * - * @return {botvs.Fee} - */ - GetFee(): Fee; - - /** - * 返回最后一次REST API请求返回的原始内容(字符串), 用户可以用来自己解析扩展信息 - * - * 注: 模拟测试的话,会一直返回一个空字符串, 只在真实环境下有效 - * exchange.GetAccount(); - * var obj = JSON.parse(exchange.GetRawJSON()); - * - * 传统商品期货API获取更多信息 - * exchange.GetAccount(); - * Log(exchange.GetRawJSON());//在GetAccount成功后调用, 获取更详细的账户信息, 可以用JSON.parse解析 - * 也支持GetTicker, GetDepth后的exchange.GetRawJSON(), 以及GetPosition与GetOrders,GetOrder这三个调用后的详细反馈数据 - * - * @return {string} - */ - GetRawJSON(): string; - - /** - * 多线程异步支持函数, 可以把所有支持的函数的操作变成异步并发的.(只支持数字货币交易平台) - * - * Support: GetTicker, GetDepth, GetTrades, GetRecords, GetAccount, GetOrders, GetOrder, CancelOrder, Buy, - * Sell, GetPosition var a = exchange.Go("GetTicker"); // GetTicker 异步多线程执行 var b = - * exchange.Go("GetDepth"); var c = exchange.Go("Buy", 1000, 0.1); var d = exchange.Go("GetRecords", - * PERIOD_H1); - * - * // 上面四种操作是并发多线程异步执行, 不会耗时, 立即返回的 - * - * var ticker = a.wait(); // 调用wait方法等待返回异步获取ticker结果 - * var depth = b.wait(); // 返回深度, 如果获取失败也是有可能返回null的 - * var orderId = c.wait(1000); // 返回订单号, 限定1秒超时, 超时返回undefined, 此对像可以继续调用wait等待如果上次wait超时 - * // 注意: 判断undefiend要用typeof(xx) === "undefined", 因为null==undefined在JavaScript里是成立的 - * - * var records = d.wait(); // 等待K线结果 - * var ret = d.wait(); // 这里wait了一个已经wait过且结束的异步操作, 会返回null, 并记录出错信息. - * // Python与Javascript的区别, Python的wait返回两个参数, 第一个是异步的api返回的结果, 第二个表示是异步调用是否完成 - * ret, ok = d.wait() // ok是一定返回True的, 除非策略被停止 - * ret, ok = d.wait(100) // ok返回False, 如果等待超时, 或者wait了一个已经结束的实例 - * - * @param {keyof botvs.Exchange} Method - * @param Args - * @return {botvs.AsyncJob} - */ - Go(Method: keyof Exchange, ...Args: any[]): AsyncJob; - - /** - * 调用交易所其它功能接口 - * - * 支持所有数字货币交易所 - * exchange.IO("api", "cancel_borrow", "symbol=cny&borrow_id=123"); // no need api & sign - * Detail: {@link https://www.botvs.com/bbs-topic/146} - * - * // 只支持Websocket模式(huobi, okcoin.cn, BTCC支持)与商品期货CTP协议 - * - * exchange.IO("websocket"); // 切换行情通信协议到websocket(默认为rest), Ticker, - * Depth会切换为websocket协议来更新, 商品期货CTP无需切换 - * - * - * // 切换GetTicker, GetDepth数据更新模式 - * - * exchange.IO("mode", 0); // 立即返回模式, 如果当前还没有接收到交易所最新的行情数据推送, 就立即返回旧的行情数据, - * 如果有新的数据就返回新的数据 - * - * exchange.IO("mode", 1); // 缓存模式(默认模式), - * 如果当前还没有收到交易所最新的行情数据(同上一次api获取的数据比较), 就等待接收然后再返回, 如果调用该函数之前收到了最新的行情数据, - * 就立即返回最新的数据 - * - * exchange.IO("mode", 2); // 强制更新模式, 进入等待一直到接收到交易所下一次的最新推送数据后返回 - * - * - * - * // 如果想第一时间获取最新的行情可以切换到websocket后不Sleep的立即检测数据, GetTicker, GetDepth用缓存模式进行工作 - * - * exchange.IO("websocket"); - * - * while (true) { - * Log(exchange.GetTicker()); - * } - * - * 传统商品期货扩展的IO功能 - * exchange.IO("status"); // 返回true证明与CTP服务器行情与数据的两台服务器都连接正常 - * exchange.IO("instruments"); // 返回交易所所有的合约列表{合约名: 详情}字典形式, 只支持实盘 - * exchange.IO("products"); // 返回交易所所有的产品列表{产品名: 详情}字典形式, 只支持实盘 - * exchange.IO("subscribed"); // 返回已订阅行情的合约, 格式同上, 只支持实盘 - * exchange.IO("settlement"); // 结算单查询, 不加第二个参数默认返回之前一个交易日的, - * 加参数如"20170317"指返回20170317的结算单, 只支持实盘 - * exchange.IO("wait"); // 有任何品种更新行情信息时才返回, 可带第二个参数(毫秒数)指定超时, - * 超时返回-1, 正常返回事件接收的时间(nano级), 只支持实盘 - * exchange.IO("wait_instrument"); // 有任何品种更新行情信息时才返回, 可带第二个参数(毫秒数) - * 指定超时, 超时返回空字符串, 正常返回触发事件的品种名称, 只支持实盘 - * - * @param {"api" | "usd" | "cny" | "currency" | string} Api - * @param {string} ApiName - * @param {string} Args - * @return {T} - */ - IO(Api: 'api' | 'usd' | 'cny' | 'currency' | string, ApiName?: string, Args?: string): T; - - /** - * 获取当前持仓信息 - * - * 返回一个Position数组, (BitVC和OKCoin)可以传入一个参数, 指定要获取的合约类型 - * - * @return {botvs.Position[]} - */ - GetPosition(): Position[]; - - /** - * 设置杆杠大小 - * - * 设置Buy(多单)或者Sell(空单)的杆杠大小, MarginLevel有5, 10, 20 三个可选参数 - * 796支持5,10,20,50三个选项, BitVC的LTC不支持20倍杠杆, OKCoin支持10倍和20倍 - * 如: exchange.SetMarginLevel(5) - * - * @param {number} MarginLevel - */ - SetMarginLevel(MarginLevel: number): void; - - /** - * 设置Buy或者Sell下单类型 - * - * Direction可以取buy, closebuy, sell, closesell四个参数, 传统期货多出closebuy_today,与closesell_today, 指平今仓, - * 默认为closebuy/closesell为平咋仓 对于CTP传统期货, 可以设置第二个参数"1"或者"2"或者"3", 分别指"投机", "套利", "套保", - * 不设置默认为投机 股票只支持buy与closebuy, - * 因为股票只能买跟平仓 exchange.SetMarginLevel(5); exchange.SetDirection("buy"); exchange.Buy(1000, 2); - * exchange.SetMarginLevel(5); exchange.SetDirection("closebuy"); exchange.Sell(1000, 2); - * - * 期货交易中Buy, Sell, CancelOrder和现货交易的区别 - * Buy或Sell之前需要调用SetMarginLevel和SetDirection明确操作类型 - * 数字货币796的CancelOrder之前需要调用SetDirection明确订单类型 - * 如: - * exchange.SetDirection("sell"); - * exchange.Sell(1000, 2); - * 如: - * exchange.SetDirection("buy"); - * exchange.CancelOrder(123); - * - * 数字货币BitVC期货交易中Buy, Sell, GetOrder, SetMarginLevel与796的区别 - * GetOrder里面的Amount为订单总金额, DealAmount为订单完成的金额, 不是币的个数 - * 数字货币796的CancelOrder之前需要调用SetDirection明确订单类型 - * Buy或Sell第二个参数不是币的数量而是订单的总金额(100的倍数) - * SetMarginLevel LTC不支持20倍杠杆 - * 如: - * exchange.SetContractType("week"); exchange.SetDirection("sell"); - * exchange.Sell(1000, 100), 就是以1000元一个币的价格开100元的空头 - * - * 数字货币OKCoin期货交易中Buy, Sell, GetOrder, SetMarginLevel与796的区别 - * GetOrder里面的Amount为合约数(一份合约为10$), DealAmount为订单完成的合约数, 不是币的个数 - * Buy或Sell第二个参数不是币的数量而是合约的份数(整数且大于0) - * SetMarginLevel 只支持10倍和20倍的杠杆 - * 如: 以1000元一个币的价格做空一份合约(10$的LTC或者100$的BTC): - * exchange.SetContractType("this_week"); - * exchange.SetDirection("sell"); - * exchange.Sell(1000, 1); - * - * @param {"buy" | "closebuy" | "sell" | "closesell" | "closebuy_today" | "closesell_today"} Direction - * @constructor - */ - SetDirection(Direction: 'buy' | 'closebuy' | 'sell' | 'closesell' | 'closebuy_today' | 'closesell_today'): void; - - /** - * 设置合约类型 - * - * 传统的CTP期货的ContractType就是指的合约ID, 如SetContractType("au1506") 返回合约的详细信息, 如最少一次买多少, 手续费, - * 交割时间等, - * 主力连续合约为代码为000如MA000, 只支持回测, 不支持实盘 股票合约格式为 股票代码.(SH/SZ), SH指上交所, SZ指深交所, - * 如000001.SZ就是指深交所的平安银行 商品期货与股票取消订阅合约, - * 在合约名前加上"-"前缀重新调用即可, 如SetContractType("-au1506"); 成功返回true 数字货币796支持: "week", "weekcny", - * 默认为子账户A, 要指定子账户是A还是B, - * 在合约后加"@A"或"@B", 如: "day@A" 为日合约A子账户 BitVC有week和quarter和next_week三个可选参数, OKCoin期货有this_week, - * next_week, quarter三个参数 exchange.SetContractType("week"); - * - * @param {string} ContractType - */ - SetContractType(ContractType: string): void; - } - } - - namespace TA { - /** - * 指数平滑异同平均线 - * - * MACD(数据, 快周期, 慢周期, 信号周期), 默认参数为(12, 26, 9), 返回二维数组, 分别是[DIF, DEA, MACD] - * - * @param {botvs.Record[]} Records - * @param {number} LongPeriod - * @param {number} ShortPeriod - * @param {number} SignalPeriod - * @return {[number[] , number[] , number[]]} - */ - function MACD( - Records: botvs.Record[], - LongPeriod?: number, - ShortPeriod?: number, - SignalPeriod?: number, - ): [number[], number[], number[]]; - - /** - * 随机指标 - * - * KDJ(数据, 周期1, 周期2, 周期3), 默认参数为(9, 3, 3), 返回二维数组, 分别是[K, D, J] - * - * @param {botvs.Record[]} Records - * @param {number} FirstPeriod - * @param {number} SecondPeriod - * @param {number} ThirdPeriod - * @return {[number[] , number[] , number[]]} - */ - function KDJ( - Records: botvs.Record[], - FirstPeriod?: number, - SecondPeriod?: number, - ThirdPeriod?: number, - ): [number[], number[], number[]]; - - /** - * 强弱指标 - * - * RSI(数据, 周期), 默认参数为14, 返回一个一维数组 - * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} - */ - function RSI(Records: botvs.Record[], Period?: number): number[]; - - /** - * 平均真实波幅 - * - * ATR(数据, 周期), 默认参数为14, 返回一个一维数组 - * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} - */ - function ATR(Records: botvs.Record[], Period?: number): number[]; - - /** - * 能量潮 - * - * OBV(数据), 返回一个一维数组 - * - * @param {botvs.Record[]} Records - * @return {[number[] , number[]]} - */ - function OBV(Records: botvs.Record[]): [number[], number[]]; - - /** - * 移动平均线 - * - * MA(数据, 周期), 默认参数为9, 返回一个一维数组 - * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} - */ - function MA(Records: botvs.Record[], Period?: number): number[]; - - /** - * 指数平均数指标 - * EMA(数据, 周期), 默认参数为9, 返回一个一维数组 - * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} - */ - function EMA(Records: botvs.Record[], Period?: number): number[]; - - /** - * Alligator Indicator - * - * Alligator(数据, 下颚周期,牙齿周期,上唇周期), 鳄鱼线指标, 默认参数为(13,8,5) 返回一个二维数组[下颚,牙齿,上唇] - * - * @param {botvs.Record[]} Records - * @param {number} JawPeriod - * @param {number} TeethPeriod - * @param {number} LibsPeriod - * @return {[number[] , number[] , number[]]} - */ - function Alligator( - Records: botvs.Record[], - JawPeriod?: number, - TeethPeriod?: number, - LibsPeriod?: number, - ): [number[], number[], number[]]; - - /** - * Chaikin Money Flow - * - * CMF(数据, 周期), 默认周期参数为20, 返回一个一维数组 - * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} - */ - function CMF(Records: botvs.Record[], Period?: number): number[]; - - /** - * 周期最高价 - * - * Highest(数据, 周期, 属性), 返回最近周期内的最大值(不包含当前Bar), - * 如TA.Highest(records, 30, 'High'), 如果周期为0指所有, 如属性不指定则视数据为普通数组 - * - * @param {botvs.Record[]} Records - * @param {number} Period - * @param {keyof botvs.Record} Property - * @return {number} - * @constructor - */ - function Highest(Records: botvs.Record[], Period?: number, Property?: keyof botvs.Record): number; - - /** - * 周期最低价 - * - * Lowest(数据, 周期, 属性), 同上, 求最小值 - * - * @param {botvs.Record[]} Records - * @param {number} Period - * @param {keyof botvs.Record} Property - * @return {number} - */ - function Lowest(Records: botvs.Record[], Period?: number, Property?: keyof botvs.Record): number; - } - - namespace talib { - /** - * 查询指标调用格式 - * - * Log(talib.help('MACD')); // 在回测环境下调用 - * - * @param {string} Func - * @return {string} - */ - function help(Func: string): string; - - /** - * Vector Trigonometric ACos (反余弦函数) - * - * ACOS(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function ACOS(Records: botvs.Record[] | number[]): number[]; - - /** - * Chaikin A/D Line (线随机指标) - * - * AD(Records[High,Low,Close,Volume]) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function AD(Records: botvs.Record[]): number[]; - /** - * Chaikin A/D Line (线随机指标) - * - * AD(Records[High,Low,Close,Volume]) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number[]} Volume - * @return {number[]} - */ - function AD(High: number[], Low: number[], Close: number[], Volume: number[]): number[]; - - /** - * Chaikin A/D Oscillator (佳庆指标) - * - * ADOSC(Records[High,Low,Close,Volume],Fast Period = 3,Slow Period = 10) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=3} FastPeriod - * @param {number=10} SlowPeriod - * @return {number[]} - */ - function ADOSC(Records: botvs.Record[], FastPeriod: number, SlowPeriod: number): number[]; - /** - * Chaikin A/D Oscillator (佳庆指标) - * - * ADOSC(Records[High,Low,Close,Volume],Fast Period = 3,Slow Period = 10) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number[]} Volume - * @param {number=3} FastPeriod - * @param {number=10} SlowPeriod - * @return {number[]} - */ - function ADOSC( - High: number[], - Low: number[], - Close: number[], - Volume: number[], - FastPeriod: number, - SlowPeriod: number, - ): number[]; - - /** - * Average Directional Movement Index (平均趋向指数) - * - * ADX(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function ADX(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Average Directional Movement Index (平均趋向指数) - * - * ADX(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function ADX(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * Average Directional Movement Index Rating (评估指数) - * - * ADXR(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function ADXR(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Average Directional Movement Index Rating (评估指数) - * - * ADXR(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function ADXR(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * Absolute Price Oscillator (绝对价格振荡指数) - * - * APO(Records[Close],Fast Period = 12,Slow Period = 26,MA Type = 0) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=12} FastPeriod - * @param {number=26} SlowPeriod - * @param {number=0} MAType - * @return {number[]} - */ - function APO( - Records: botvs.Record[] | number[], - FastPeriod: number, - SlowPeriod: number, - MAType: number, - ): number[]; - - /** - * Aroon (阿隆指标) - * - * AROON(Records[High,Low],Time Period = 14) = [Array(outAroonDown),Array(outAroonUp)] - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {[number[], number[]]} - */ - function AROON(Records: botvs.Record[], TimePeriod: number): [number[], number[]]; - /** - * Aroon (阿隆指标) - * - * AROON(Records[High,Low],Time Period = 14) = [Array(outAroonDown),Array(outAroonUp)] - * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {[number[], number[]]} - */ - function AROON(High: number[], Low: number[], TimePeriod: number): [number[], number[]]; - - /** - * Aroon Oscillator (阿隆震荡线) - * - * AROONOSC(Records[High,Low],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function AROONOSC(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Aroon Oscillator (阿隆震荡线) - * - * AROONOSC(Records[High,Low],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {number[]} - */ - function AROONOSC(High: number[], Low: number[], TimePeriod: number): number[]; - - /** - * Vector Trigonometric ASin (反正弦函数) - * - * ASIN(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function ASIN(Records: botvs.Record[] | number[]): number[]; - - /** - * Vector Trigonometric ATan (反正切函数) - * - * ATAN(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function ATAN(Records: botvs.Record[] | number[]): number[]; - - /** - * Average True Range (平均真实波幅) - * - * ATR(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function ATR(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Average True Range (平均真实波幅) - * - * ATR(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function ATR(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * Average Price (平均价格) - * - * AVGPRICE(Records[Open,High,Low,Close]) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function AVGPRICE(Records: botvs.Record[]): number[]; - /** - * Average Price (平均价格) - * - * AVGPRICE(Records[Open,High,Low,Close]) = Array(outReal) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function AVGPRICE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Bollinger Bands (布林带) - * - * BBANDS(Records[Close],Time Period = 5,Deviations up = 2,Deviations down = 2,MA Type = 0) = - * [Array(outRealUpperBand),Array(outRealMiddleBand),Array(outRealLowerBand)] - * - * @param {botvs.Record[]|number[]} Records - * @param {number=5} TimePeriod - * @param {number=2} Deviationsup - * @param {number=2} Deviationsdown - * @param {number=0} MAType - * @return {[number[], number[], number[]]} - */ - function BBANDS( - Records: botvs.Record[] | number[], - TimePeriod: number, - Deviationsup: number, - Deviationsdown: number, - MAType: number, - ): [number[], number[], number[]]; - - /** - * Balance Of Power (均势指标) - * - * BOP(Records[Open,High,Low,Close]) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function BOP(Records: botvs.Record[]): number[]; - /** - * Balance Of Power (均势指标) - * - * BOP(Records[Open,High,Low,Close]) = Array(outReal) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function BOP(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Commodity Channel Index (顺势指标) - * - * CCI(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function CCI(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Commodity Channel Index (顺势指标) - * - * CCI(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function CCI(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * Two Crows (K线图--两只乌鸦) - * - * CDL2CROWS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDL2CROWS(Records: botvs.Record[]): number[]; - /** - * Two Crows (K线图--两只乌鸦) - * - * CDL2CROWS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDL2CROWS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Three Black Crows (K线图--3只黑乌鸦) - * - * CDL3BLACKCROWS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDL3BLACKCROWS(Records: botvs.Record[]): number[]; - /** - * Three Black Crows (K线图--3只黑乌鸦) - * - * CDL3BLACKCROWS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDL3BLACKCROWS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Three Inside Up/Down (K线图:3内上下震荡) - * - * CDL3INSIDE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDL3INSIDE(Records: botvs.Record[]): number[]; - /** - * Three Inside Up/Down (K线图:3内上下震荡) - * - * CDL3INSIDE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDL3INSIDE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Three-Line Strike (K线图:3线震荡) - * - * CDL3LINESTRIKE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDL3LINESTRIKE(Records: botvs.Record[]): number[]; - /** - * Three-Line Strike (K线图:3线震荡) - * - * CDL3LINESTRIKE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDL3LINESTRIKE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Three Outside Up/Down (K线图:3外下震荡) - * - * CDL3OUTSIDE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDL3OUTSIDE(Records: botvs.Record[]): number[]; - /** - * Three Outside Up/Down (K线图:3外下震荡) - * - * CDL3OUTSIDE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDL3OUTSIDE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Three Stars In The South (K线图:南方三星) - * - * CDL3STARSINSOUTH(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDL3STARSINSOUTH(Records: botvs.Record[]): number[]; - /** - * Three Stars In The South (K线图:南方三星) - * - * CDL3STARSINSOUTH(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDL3STARSINSOUTH(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Three Advancing White Soldiers (K线图:三白兵) - * - * CDL3WHITESOLDIERS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDL3WHITESOLDIERS(Records: botvs.Record[]): number[]; - /** - * Three Advancing White Soldiers (K线图:三白兵) - * - * CDL3WHITESOLDIERS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDL3WHITESOLDIERS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Abandoned Baby (K线图:弃婴) - * - * CDLABANDONEDBABY(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLABANDONEDBABY(Records: botvs.Record[], Penetration: number): number[]; - /** - * Abandoned Baby (K线图:弃婴) - * - * CDLABANDONEDBABY(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLABANDONEDBABY( - Open: number[], - High: number[], - Low: number[], - Close: number[], - Penetration: number, - ): number[]; - - /** - * Advance Block (K线图:推进) - * - * CDLADVANCEBLOCK(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLADVANCEBLOCK(Records: botvs.Record[]): number[]; - /** - * Advance Block (K线图:推进) - * - * CDLADVANCEBLOCK(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLADVANCEBLOCK(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Belt-hold (K线图:带住) - * - * CDLBELTHOLD(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLBELTHOLD(Records: botvs.Record[]): number[]; - /** - * Belt-hold (K线图:带住) - * - * CDLBELTHOLD(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLBELTHOLD(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Breakaway (K线图:分离) - * - * CDLBREAKAWAY(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLBREAKAWAY(Records: botvs.Record[]): number[]; - /** - * Breakaway (K线图:分离) - * - * CDLBREAKAWAY(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLBREAKAWAY(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Closing Marubozu (K线图:收盘光头光脚) - * - * CDLCLOSINGMARUBOZU(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLCLOSINGMARUBOZU(Records: botvs.Record[]): number[]; - /** - * Closing Marubozu (K线图:收盘光头光脚) - * - * CDLCLOSINGMARUBOZU(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLCLOSINGMARUBOZU(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Concealing Baby Swallow (K线图:藏婴吞没形态) - * - * CDLCONCEALBABYSWALL(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLCONCEALBABYSWALL(Records: botvs.Record[]): number[]; - /** - * Concealing Baby Swallow (K线图:藏婴吞没形态) - * - * CDLCONCEALBABYSWALL(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLCONCEALBABYSWALL(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Counterattack (K线图:反击) - * - * CDLCOUNTERATTACK(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLCOUNTERATTACK(Records: botvs.Record[]): number[]; - /** - * Counterattack (K线图:反击) - * - * CDLCOUNTERATTACK(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLCOUNTERATTACK(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Dark Cloud Cover (K线图:乌云盖) - * - * CDLDARKCLOUDCOVER(Records[Open,High,Low,Close],Penetration = 0.5) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @param {number=0.5} Penetration - * @return {number[]} - */ - function CDLDARKCLOUDCOVER(Records: botvs.Record[], Penetration: number): number[]; - /** - * Dark Cloud Cover (K线图:乌云盖) - * - * CDLDARKCLOUDCOVER(Records[Open,High,Low,Close],Penetration = 0.5) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.5} Penetration - * @return {number[]} - */ - function CDLDARKCLOUDCOVER( - Open: number[], - High: number[], - Low: number[], - Close: number[], - Penetration: number, - ): number[]; - - /** - * Doji (K线图:十字星 ) - * - * CDLDOJI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLDOJI(Records: botvs.Record[]): number[]; - /** - * Doji (K线图:十字星 ) - * - * CDLDOJI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLDOJI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Doji Star (K线图:十字星) - * - * CDLDOJISTAR(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLDOJISTAR(Records: botvs.Record[]): number[]; - /** - * Doji Star (K线图:十字星) - * - * CDLDOJISTAR(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLDOJISTAR(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Dragonfly Doji (K线图:蜻蜓十字星) - * - * CDLDRAGONFLYDOJI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLDRAGONFLYDOJI(Records: botvs.Record[]): number[]; - /** - * Dragonfly Doji (K线图:蜻蜓十字星) - * - * CDLDRAGONFLYDOJI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLDRAGONFLYDOJI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Engulfing Pattern (K线图:吞没) - * - * CDLENGULFING(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLENGULFING(Records: botvs.Record[]): number[]; - /** - * Engulfing Pattern (K线图:吞没) - * - * CDLENGULFING(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLENGULFING(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Evening Doji Star (K线图:黄昏十字星) - * - * CDLEVENINGDOJISTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLEVENINGDOJISTAR(Records: botvs.Record[], Penetration: number): number[]; - /** - * Evening Doji Star (K线图:黄昏十字星) - * - * CDLEVENINGDOJISTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLEVENINGDOJISTAR( - Open: number[], - High: number[], - Low: number[], - Close: number[], - Penetration: number, - ): number[]; - - /** - * Evening Star (K线图:黄昏之星) - * - * CDLEVENINGSTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLEVENINGSTAR(Records: botvs.Record[], Penetration: number): number[]; - /** - * Evening Star (K线图:黄昏之星) - * - * CDLEVENINGSTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLEVENINGSTAR( - Open: number[], - High: number[], - Low: number[], - Close: number[], - Penetration: number, - ): number[]; - - /** - * Up/Down-gap side-by-side white lines (K线图:上/下间隙并排的白色线条) - * - * CDLGAPSIDESIDEWHITE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLGAPSIDESIDEWHITE(Records: botvs.Record[]): number[]; - /** - * Up/Down-gap side-by-side white lines (K线图:上/下间隙并排的白色线条) - * - * CDLGAPSIDESIDEWHITE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLGAPSIDESIDEWHITE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Gravestone Doji (K线图:墓碑十字线) - * - * CDLGRAVESTONEDOJI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLGRAVESTONEDOJI(Records: botvs.Record[]): number[]; - /** - * Gravestone Doji (K线图:墓碑十字线) - * - * CDLGRAVESTONEDOJI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLGRAVESTONEDOJI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Hammer (K线图:锤) - * - * CDLHAMMER(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLHAMMER(Records: botvs.Record[]): number[]; - /** - * Hammer (K线图:锤) - * - * CDLHAMMER(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLHAMMER(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Hanging Man (K线图:吊人) - * - * CDLHANGINGMAN(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLHANGINGMAN(Records: botvs.Record[]): number[]; - /** - * Hanging Man (K线图:吊人) - * - * CDLHANGINGMAN(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLHANGINGMAN(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Harami Pattern (K线图:阴阳线) - * - * CDLHARAMI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLHARAMI(Records: botvs.Record[]): number[]; - /** - * Harami Pattern (K线图:阴阳线) - * - * CDLHARAMI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLHARAMI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Harami Cross Pattern (K线图:交叉阴阳线) - * - * CDLHARAMICROSS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLHARAMICROSS(Records: botvs.Record[]): number[]; - /** - * Harami Cross Pattern (K线图:交叉阴阳线) - * - * CDLHARAMICROSS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLHARAMICROSS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * High-Wave Candle (K线图:长脚十字线 ) - * - * CDLHIGHWAVE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLHIGHWAVE(Records: botvs.Record[]): number[]; - /** - * High-Wave Candle (K线图:长脚十字线 ) - * - * CDLHIGHWAVE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLHIGHWAVE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Hikkake Pattern (K线图:陷阱) - * - * CDLHIKKAKE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLHIKKAKE(Records: botvs.Record[]): number[]; - /** - * Hikkake Pattern (K线图:陷阱) - * - * CDLHIKKAKE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLHIKKAKE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Modified Hikkake Pattern (K线图:改良的陷阱) - * - * CDLHIKKAKEMOD(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLHIKKAKEMOD(Records: botvs.Record[]): number[]; - /** - * Modified Hikkake Pattern (K线图:改良的陷阱) - * - * CDLHIKKAKEMOD(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLHIKKAKEMOD(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Homing Pigeon (K线图:信鸽) - * - * CDLHOMINGPIGEON(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLHOMINGPIGEON(Records: botvs.Record[]): number[]; - /** - * Homing Pigeon (K线图:信鸽) - * - * CDLHOMINGPIGEON(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLHOMINGPIGEON(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Identical Three Crows (K线图:相同的三只乌鸦) - * - * CDLIDENTICAL3CROWS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLIDENTICAL3CROWS(Records: botvs.Record[]): number[]; - /** - * Identical Three Crows (K线图:相同的三只乌鸦) - * - * CDLIDENTICAL3CROWS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLIDENTICAL3CROWS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * In-Neck Pattern (K线图:颈纹) - * - * CDLINNECK(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLINNECK(Records: botvs.Record[]): number[]; - /** - * In-Neck Pattern (K线图:颈纹) - * - * CDLINNECK(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLINNECK(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Inverted Hammer (K线图:倒锤) - * - * CDLINVERTEDHAMMER(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLINVERTEDHAMMER(Records: botvs.Record[]): number[]; - /** - * Inverted Hammer (K线图:倒锤) - * - * CDLINVERTEDHAMMER(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLINVERTEDHAMMER(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Kicking (K线图:踢) - * - * CDLKICKING(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLKICKING(Records: botvs.Record[]): number[]; - /** - * Kicking (K线图:踢) - * - * CDLKICKING(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLKICKING(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Kicking - bull/bear determined by the longer marubozu (K线图:踢牛/踢熊) - * - * CDLKICKINGBYLENGTH(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLKICKINGBYLENGTH(Records: botvs.Record[]): number[]; - /** - * Kicking - bull/bear determined by the longer marubozu (K线图:踢牛/踢熊) - * - * CDLKICKINGBYLENGTH(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLKICKINGBYLENGTH(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Ladder Bottom (K线图:梯底) - * - * CDLLADDERBOTTOM(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLLADDERBOTTOM(Records: botvs.Record[]): number[]; - /** - * Ladder Bottom (K线图:梯底) - * - * CDLLADDERBOTTOM(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLLADDERBOTTOM(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Long Legged Doji (K线图:长腿十字线) - * - * CDLLONGLEGGEDDOJI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLLONGLEGGEDDOJI(Records: botvs.Record[]): number[]; - /** - * Long Legged Doji (K线图:长腿十字线) - * - * CDLLONGLEGGEDDOJI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLLONGLEGGEDDOJI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Long Line Candle (K线图:长线) - * - * CDLLONGLINE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLLONGLINE(Records: botvs.Record[]): number[]; - /** - * Long Line Candle (K线图:长线) - * - * CDLLONGLINE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLLONGLINE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Marubozu (K线图:光头光脚 ) - * - * CDLMARUBOZU(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLMARUBOZU(Records: botvs.Record[]): number[]; - /** - * Marubozu (K线图:光头光脚 ) - * - * CDLMARUBOZU(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLMARUBOZU(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Matching Low (K线图:匹配低) - * - * CDLMATCHINGLOW(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLMATCHINGLOW(Records: botvs.Record[]): number[]; - /** - * Matching Low (K线图:匹配低) - * - * CDLMATCHINGLOW(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLMATCHINGLOW(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Mat Hold (K线图:垫住) - * - * CDLMATHOLD(Records[Open,High,Low,Close],Penetration = 0.5) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @param {number=0.5} Penetration - * @return {number[]} - */ - function CDLMATHOLD(Records: botvs.Record[], Penetration: number): number[]; - /** - * Mat Hold (K线图:垫住) - * - * CDLMATHOLD(Records[Open,High,Low,Close],Penetration = 0.5) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.5} Penetration - * @return {number[]} - */ - function CDLMATHOLD( - Open: number[], - High: number[], - Low: number[], - Close: number[], - Penetration: number, - ): number[]; - - /** - * Morning Doji Star (K线图:早晨十字星) - * - * CDLMORNINGDOJISTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLMORNINGDOJISTAR(Records: botvs.Record[], Penetration: number): number[]; - /** - * Morning Doji Star (K线图:早晨十字星) - * - * CDLMORNINGDOJISTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLMORNINGDOJISTAR( - Open: number[], - High: number[], - Low: number[], - Close: number[], - Penetration: number, - ): number[]; - - /** - * Morning Star (K线图:晨星) - * - * CDLMORNINGSTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLMORNINGSTAR(Records: botvs.Record[], Penetration: number): number[]; - /** - * Morning Star (K线图:晨星) - * - * CDLMORNINGSTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} - */ - function CDLMORNINGSTAR( - Open: number[], - High: number[], - Low: number[], - Close: number[], - Penetration: number, - ): number[]; - - /** - * On-Neck Pattern (K线图:颈型) - * - * CDLONNECK(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLONNECK(Records: botvs.Record[]): number[]; - /** - * On-Neck Pattern (K线图:颈型) - * - * CDLONNECK(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLONNECK(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Piercing Pattern (K线图:穿孔模式) - * - * CDLPIERCING(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLPIERCING(Records: botvs.Record[]): number[]; - /** - * Piercing Pattern (K线图:穿孔模式) - * - * CDLPIERCING(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLPIERCING(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Rickshaw Man (K线图:车夫) - * - * CDLRICKSHAWMAN(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLRICKSHAWMAN(Records: botvs.Record[]): number[]; - /** - * Rickshaw Man (K线图:车夫) - * - * CDLRICKSHAWMAN(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLRICKSHAWMAN(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Rising/Falling Three Methods (K线图:上升/下降三法) - * - * CDLRISEFALL3METHODS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLRISEFALL3METHODS(Records: botvs.Record[]): number[]; - /** - * Rising/Falling Three Methods (K线图:上升/下降三法) - * - * CDLRISEFALL3METHODS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLRISEFALL3METHODS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Separating Lines (K线图:分割线) - * - * CDLSEPARATINGLINES(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLSEPARATINGLINES(Records: botvs.Record[]): number[]; - /** - * Separating Lines (K线图:分割线) - * - * CDLSEPARATINGLINES(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLSEPARATINGLINES(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Shooting Star (K线图:流星) - * - * CDLSHOOTINGSTAR(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLSHOOTINGSTAR(Records: botvs.Record[]): number[]; - /** - * Shooting Star (K线图:流星) - * - * CDLSHOOTINGSTAR(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLSHOOTINGSTAR(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Short Line Candle (K线图:短线) - * - * CDLSHORTLINE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLSHORTLINE(Records: botvs.Record[]): number[]; - /** - * Short Line Candle (K线图:短线) - * - * CDLSHORTLINE(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLSHORTLINE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Spinning Top (K线图:陀螺) - * - * CDLSPINNINGTOP(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLSPINNINGTOP(Records: botvs.Record[]): number[]; - /** - * Spinning Top (K线图:陀螺) - * - * CDLSPINNINGTOP(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLSPINNINGTOP(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Stalled Pattern (K线图:停滞模式) - * - * CDLSTALLEDPATTERN(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLSTALLEDPATTERN(Records: botvs.Record[]): number[]; - /** - * Stalled Pattern (K线图:停滞模式) - * - * CDLSTALLEDPATTERN(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLSTALLEDPATTERN(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Stick Sandwich (K线图:棍子三明治) - * - * CDLSTICKSANDWICH(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLSTICKSANDWICH(Records: botvs.Record[]): number[]; - /** - * Stick Sandwich (K线图:棍子三明治) - * - * CDLSTICKSANDWICH(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLSTICKSANDWICH(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Takuri (Dragonfly Doji with very long lower shadow) (K线图:托里) - * - * CDLTAKURI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLTAKURI(Records: botvs.Record[]): number[]; - /** - * Takuri (Dragonfly Doji with very long lower shadow) (K线图:托里) - * - * CDLTAKURI(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLTAKURI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Tasuki Gap (K线图:翼隙) - * - * CDLTASUKIGAP(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLTASUKIGAP(Records: botvs.Record[]): number[]; - /** - * Tasuki Gap (K线图:翼隙) - * - * CDLTASUKIGAP(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLTASUKIGAP(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Thrusting Pattern (K线图:推模式) - * - * CDLTHRUSTING(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLTHRUSTING(Records: botvs.Record[]): number[]; - /** - * Thrusting Pattern (K线图:推模式) - * - * CDLTHRUSTING(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLTHRUSTING(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Tristar Pattern (K线图:三星模式) - * - * CDLTRISTAR(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLTRISTAR(Records: botvs.Record[]): number[]; - /** - * Tristar Pattern (K线图:三星模式) - * - * CDLTRISTAR(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLTRISTAR(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Unique 3 River (K线图:独特的3河) - * - * CDLUNIQUE3RIVER(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLUNIQUE3RIVER(Records: botvs.Record[]): number[]; - /** - * Unique 3 River (K线图:独特的3河) - * - * CDLUNIQUE3RIVER(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLUNIQUE3RIVER(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Upside Gap Two Crows (K线图:双飞乌鸦) - * - * CDLUPSIDEGAP2CROWS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLUPSIDEGAP2CROWS(Records: botvs.Record[]): number[]; - /** - * Upside Gap Two Crows (K线图:双飞乌鸦) - * - * CDLUPSIDEGAP2CROWS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLUPSIDEGAP2CROWS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Upside/Downside Gap Three Methods (K线图:上行/下行缺口三方法) - * - * CDLXSIDEGAP3METHODS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function CDLXSIDEGAP3METHODS(Records: botvs.Record[]): number[]; - /** - * Upside/Downside Gap Three Methods (K线图:上行/下行缺口三方法) - * - * CDLXSIDEGAP3METHODS(Records[Open,High,Low,Close]) = Array(outInteger) - * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function CDLXSIDEGAP3METHODS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; - - /** - * Vector Ceil (取整函数) - * - * CEIL(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function CEIL(Records: botvs.Record[] | number[]): number[]; - - /** - * Chande Momentum Oscillator (钱德动量摆动指标) - * - * CMO(Records[Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function CMO(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Vector Trigonometric Cos (余弦函数) - * - * COS(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function COS(Records: botvs.Record[] | number[]): number[]; - - /** - * Vector Trigonometric Cosh (双曲余弦值) - * - * COSH(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function COSH(Records: botvs.Record[] | number[]): number[]; - - /** - * Double Exponential Moving Average (双指数移动平均线) - * - * DEMA(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function DEMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Directional Movement Index (动向指数) - * - * DX(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function DX(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Directional Movement Index (动向指数) - * - * DX(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function DX(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * Exponential Moving Average (指数移动平均线) - * - * EMA(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function EMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Vector Arithmetic Exp (指数函数) - * - * EXP(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function EXP(Records: botvs.Record[] | number[]): number[]; - - /** - * Vector Floor (向下取整) - * - * FLOOR(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function FLOOR(Records: botvs.Record[] | number[]): number[]; - - /** - * Hilbert Transform - Dominant Cycle Period (希尔伯特变换, 主周期) - * - * HT_DCPERIOD(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function HT_DCPERIOD(Records: botvs.Record[] | number[]): number[]; - - /** - * Hilbert Transform - Dominant Cycle Phase (希尔伯特变换,主阶段) - * - * HT_DCPHASE(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function HT_DCPHASE(Records: botvs.Record[] | number[]): number[]; - - /** - * Hilbert Transform - Phasor Components (希尔伯特变换,相成分) - * - * HT_PHASOR(Records[Close]) = [Array(outInPhase),Array(outQuadrature)] - * - * @param {botvs.Record[]|number[]} Records - * @return {[number[], number[]]} - */ - function HT_PHASOR(Records: botvs.Record[] | number[]): [number[], number[]]; - - /** - * Hilbert Transform - SineWave (希尔伯特变换,正弦波) - * - * HT_SINE(Records[Close]) = [Array(outSine),Array(outLeadSine)] - * - * @param {botvs.Record[]|number[]} Records - * @return {[number[], number[]]} - */ - function HT_SINE(Records: botvs.Record[] | number[]): [number[], number[]]; - - /** - * Hilbert Transform - Instantaneous Trendline (希尔伯特变换,瞬时趋势) - * - * HT_TRENDLINE(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function HT_TRENDLINE(Records: botvs.Record[] | number[]): number[]; - - /** - * Hilbert Transform - Trend vs Cycle Mode (希尔伯特变换-趋势与周期模式) - * - * HT_TRENDMODE(Records[Close]) = Array(outInteger) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function HT_TRENDMODE(Records: botvs.Record[] | number[]): number[]; - - /** - * Kaufman Adaptive Moving Average (适应性移动平均线) - * - * KAMA(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function KAMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Linear Regression (线性回归) - * - * LINEARREG(Records[Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function LINEARREG(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Linear Regression Angle (线性回归的角度) - * - * LINEARREG_ANGLE(Records[Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function LINEARREG_ANGLE(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Linear Regression Intercept (线性回归截距) - * - * LINEARREG_INTERCEPT(Records[Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function LINEARREG_INTERCEPT(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Linear Regression Slope (线性回归斜率) - * - * LINEARREG_SLOPE(Records[Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function LINEARREG_SLOPE(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Vector Log Natural (自然对数) - * - * LN(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function LN(Records: botvs.Record[] | number[]): number[]; - - /** - * Vector Log10 (对数函数) - * - * LOG10(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function LOG10(Records: botvs.Record[] | number[]): number[]; - - /** - * Moving average (移动平均线) - * - * MA(Records[Close],Time Period = 30,MA Type = 0) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @param {number=0} MAType - * @return {number[]} - */ - function MA(Records: botvs.Record[] | number[], TimePeriod: number, MAType: number): number[]; - - /** - * Moving Average Convergence/Divergence (指数平滑移动平均线) - * - * MACD(Records[Close],Fast Period = 12,Slow Period = 26,Signal Period = 9) = - * [Array(outMACD),Array(outMACDSignal),Array(outMACDHist)] - * - * @param {botvs.Record[]|number[]} Records - * @param {number=12} FastPeriod - * @param {number=26} SlowPeriod - * @param {number=9} SignalPeriod - * @return {[number[], number[], number[]]} - */ - function MACD( - Records: botvs.Record[] | number[], - FastPeriod: number, - SlowPeriod: number, - SignalPeriod: number, - ): [number[], number[], number[]]; - - /** - * MACD with controllable MA type (MA型可控 MACD) - * - * MACDEXT(Records[Close],Fast Period = 12,Fast MA = 0,Slow Period = 26,Slow MA = 0,Signal Period = 9,Signal MA - * = - * 0) = [Array(outMACD),Array(outMACDSignal),Array(outMACDHist)] - * - * @param {botvs.Record[]|number[]} Records - * @param {number=12} FastPeriod - * @param {number=0} FastMA - * @param {number=26} SlowPeriod - * @param {number=0} SlowMA - * @param {number=9} SignalPeriod - * @param {number=0} SignalMA - * @return {[number[], number[], number[]]} - */ - function MACDEXT( - Records: botvs.Record[] | number[], - FastPeriod: number, - FastMA: number, - SlowPeriod: number, - SlowMA: number, - SignalPeriod: number, - SignalMA: number, - ): [number[], number[], number[]]; - - /** - * Moving Average Convergence/Divergence Fix 12/26 (移动平均收敛/发散修复12/26) - * - * MACDFIX(Records[Close],Signal Period = 9) = [Array(outMACD),Array(outMACDSignal),Array(outMACDHist)] - * - * @param {botvs.Record[]|number[]} Records - * @param {number=9} SignalPeriod - * @return {[number[], number[], number[]]} - */ - function MACDFIX(Records: botvs.Record[] | number[], SignalPeriod: number): [number[], number[], number[]]; - - /** - * MESA Adaptive Moving Average (MESA 移动平均线) - * - * MAMA(Records[Close],Fast Limit = 0.5,Slow Limit = 0.05) = [Array(outMAMA),Array(outFAMA)] - * - * @param {botvs.Record[]|number[]} Records - * @param {number=0.5} FastLimit - * @param {number=0.05} SlowLimit - * @return {[number[], number[]]} - */ - function MAMA(Records: botvs.Record[] | number[], FastLimit: number, SlowLimit: number): [number[], number[]]; - - /** - * Highest value over a specified period (最大值) - * - * MAX(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function MAX(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Index of highest value over a specified period (最大值索引) - * - * MAXINDEX(Records[Close],Time Period = 30) = Array(outInteger) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function MAXINDEX(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Median Price (中位数价格) - * - * MEDPRICE(Records[High,Low]) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function MEDPRICE(Records: botvs.Record[]): number[]; - /** - * Median Price (中位数价格) - * - * MEDPRICE(Records[High,Low]) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @return {number[]} - */ - function MEDPRICE(High: number[], Low: number[]): number[]; - - /** - * Money Flow Index (货币流量指数) - * - * MFI(Records[High,Low,Close,Volume],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MFI(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Money Flow Index (货币流量指数) - * - * MFI(Records[High,Low,Close,Volume],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number[]} Volume - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MFI(High: number[], Low: number[], Close: number[], Volume: number[], TimePeriod: number): number[]; - - /** - * MidPoint over period (中点) - * - * MIDPOINT(Records[Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MIDPOINT(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Midpoint Price over period (中点价格) - * - * MIDPRICE(Records[High,Low],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MIDPRICE(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Midpoint Price over period (中点价格) - * - * MIDPRICE(Records[High,Low],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MIDPRICE(High: number[], Low: number[], TimePeriod: number): number[]; - - /** - * Lowest value over a specified period (最小值) - * - * MIN(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function MIN(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Index of lowest value over a specified period (最小值索引) - * - * MININDEX(Records[Close],Time Period = 30) = Array(outInteger) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function MININDEX(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Lowest and highest values over a specified period (最小最大值) - * - * MINMAX(Records[Close],Time Period = 30) = [Array(outMin),Array(outMax)] - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {[number[], number[]]} - */ - function MINMAX(Records: botvs.Record[] | number[], TimePeriod: number): [number[], number[]]; - - /** - * Indexes of lowest and highest values over a specified period (最小最大值索引) - * - * MINMAXINDEX(Records[Close],Time Period = 30) = [Array(outMinIdx),Array(outMaxIdx)] - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {[number[], number[]]} - */ - function MINMAXINDEX(Records: botvs.Record[] | number[], TimePeriod: number): [number[], number[]]; - - /** - * Minus Directional Indicator (负向指标) - * - * MINUS_DI(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MINUS_DI(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Minus Directional Indicator (负向指标) - * - * MINUS_DI(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MINUS_DI(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * Minus Directional Movement (负向运动) - * - * MINUS_DM(Records[High,Low],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MINUS_DM(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Minus Directional Movement (负向运动) - * - * MINUS_DM(Records[High,Low],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {number[]} - */ - function MINUS_DM(High: number[], Low: number[], TimePeriod: number): number[]; - - /** - * Momentum (动量) - * - * MOM(Records[Close],Time Period = 10) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} - */ - function MOM(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Normalized Average True Range (归一化平均值范围) - * - * NATR(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function NATR(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Normalized Average True Range (归一化平均值范围) - * - * NATR(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function NATR(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * On Balance Volume (能量潮) - * - * OBV(Records[Close],Records[Volume]) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function OBV(Records: botvs.Record[]): number[]; - - /** - * On Balance Volume (能量潮) - * - * OBV(Records[Close],Records[Volume]) = Array(outReal) - * - * @param {number[]} Close - * @param {number[]} Volume - * @return {number[]} - */ - function OBV(Close: number[], Volume: number[]): number[]; - - /** - * Plus Directional Indicator (更向指示器) - * - * PLUS_DI(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function PLUS_DI(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Plus Directional Indicator (更向指示器) - * - * PLUS_DI(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function PLUS_DI(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * Plus Directional Movement (定向运动) - * - * PLUS_DM(Records[High,Low],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function PLUS_DM(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Plus Directional Movement (定向运动) - * - * PLUS_DM(Records[High,Low],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {number[]} - */ - function PLUS_DM(High: number[], Low: number[], TimePeriod: number): number[]; - - /** - * Percentage Price Oscillator (价格振荡百分比) - * - * PPO(Records[Close],Fast Period = 12,Slow Period = 26,MA Type = 0) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=12} FastPeriod - * @param {number=26} SlowPeriod - * @param {number=0} MAType - * @return {number[]} - */ - function PPO( - Records: botvs.Record[] | number[], - FastPeriod: number, - SlowPeriod: number, - MAType: number, - ): number[]; - - /** - * Rate of change : ((price/prevPrice)-1)*100 (变动率指标) - * - * ROC(Records[Close],Time Period = 10) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} - */ - function ROC(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Rate of change Percentage: (price-prevPrice)/prevPrice (价格变化率) - * - * ROCP(Records[Close],Time Period = 10) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} - */ - function ROCP(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Rate of change ratio: (price/prevPrice) (价格变化率) - * - * ROCR(Records[Close],Time Period = 10) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} - */ - function ROCR(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Rate of change ratio 100 scale: (price/prevPrice)*100 (价格变化率) - * - * ROCR100(Records[Close],Time Period = 10) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} - */ - function ROCR100(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Relative Strength Index (相对强弱指标) - * - * RSI(Records[Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function RSI(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Parabolic SAR (抛物线转向) - * - * SAR(Records[High,Low],Acceleration Factor = 0.02,AF Maximum = 0.2) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=0.02} AccelerationFactor - * @param {number=0.2} AFMaximum - * @return {number[]} - */ - function SAR(Records: botvs.Record[], AccelerationFactor: number, AFMaximum: number): number[]; - /** - * Parabolic SAR (抛物线转向) - * - * SAR(Records[High,Low],Acceleration Factor = 0.02,AF Maximum = 0.2) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number=0.02} AccelerationFactor - * @param {number=0.2} AFMaximum - * @return {number[]} - */ - function SAR(High: number[], Low: number[], AccelerationFactor: number, AFMaximum: number): number[]; - - /** - * Parabolic SAR - Extended (增强型抛物线转向) - * - * SAREXT(Records[High,Low],Start Value = 0,Offset on Reverse = 0,AF Init Long = 0.02,AF Long = 0.02,AF Max - * Long = - * 0.2,AF Init Short = 0.02,AF Short = 0.02,AF Max Short = 0.2) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=0} StartValue - * @param {number=0} OffsetonReverse - * @param {number=0.02} AFInitLong - * @param {number=0.02} AFLong - * @param {number=0.2} AFMaxLong - * @param {number=0.02} AFInitShort - * @param {number=0.02} AFShort - * @param {number=0.2} AFMaxShort - * @return {number[]} - */ - function SAREXT( - Records: botvs.Record[], - StartValue: number, - OffsetonReverse: number, - AFInitLong: number, - AFLong: number, - AFMaxLong: number, - AFInitShort: number, - AFShort: number, - AFMaxShort: number, - ): number[]; - /** - * Parabolic SAR - Extended (增强型抛物线转向) - * - * SAREXT(Records[High,Low],Start Value = 0,Offset on Reverse = 0,AF Init Long = 0.02,AF Long = 0.02,AF Max - * Long = - * 0.2,AF Init Short = 0.02,AF Short = 0.02,AF Max Short = 0.2) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number=0} StartValue - * @param {number=0} OffsetonReverse - * @param {number=0.02} AFInitLong - * @param {number=0.02} AFLong - * @param {number=0.2} AFMaxLong - * @param {number=0.02} AFInitShort - * @param {number=0.02} AFShort - * @param {number=0.2} AFMaxShort - * @return {number[]} - */ - function SAREXT( - High: number[], - Low: number[], - StartValue: number, - OffsetonReverse: number, - AFInitLong: number, - AFLong: number, - AFMaxLong: number, - AFInitShort: number, - AFShort: number, - AFMaxShort: number, - ): number[]; - - /** - * Vector Trigonometric Sin (正弦值) - * - * SIN(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function SIN(Records: botvs.Record[] | number[]): number[]; - - /** - * Vector Trigonometric Sinh (双曲正弦函数) - * - * SINH(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function SINH(Records: botvs.Record[] | number[]): number[]; - - /** - * Simple Moving Average (简单移动平均) - * - * SMA(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function SMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Vector Square Root (平方根) - * - * SQRT(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function SQRT(Records: botvs.Record[] | number[]): number[]; - - /** - * Standard Deviation (标准偏差) - * - * STDDEV(Records[Close],Time Period = 5,Deviations = 1) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=5} TimePeriod - * @param {number=1} Deviations - * @return {number[]} - */ - function STDDEV(Records: botvs.Record[] | number[], TimePeriod: number, Deviations: number): number[]; - - /** - * Stochastic (STOCH指标) - * - * STOCH(Records[High,Low,Close],Fast-K Period = 5,Slow-K Period = 3,Slow-K MA = 0,Slow-D Period = 3,Slow-D MA - * = 0) - * = [Array(outSlowK),Array(outSlowD)] - * - * @param {botvs.Record[]} Records - * @param {number=5} Fast_KPeriod - * @param {number=3} Slow_KPeriod - * @param {number=0} Slow_KMA - * @param {number=3} Slow_DPeriod - * @param {number=0} Slow_DMA - * @return {[number[], number[]]} - */ - function STOCH( - Records: botvs.Record[], - Fast_KPeriod: number, - Slow_KPeriod: number, - Slow_KMA: number, - Slow_DPeriod: number, - Slow_DMA: number, - ): [number[], number[]]; - /** - * Stochastic (STOCH指标) - * - * STOCH(Records[High,Low,Close],Fast-K Period = 5,Slow-K Period = 3,Slow-K MA = 0,Slow-D Period = 3,Slow-D MA - * = 0) - * = [Array(outSlowK),Array(outSlowD)] - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=5} Fast_KPeriod - * @param {number=3} Slow_KPeriod - * @param {number=0} Slow_KMA - * @param {number=3} Slow_DPeriod - * @param {number=0} Slow_DMA - * @return {[number[], number[]]} - */ - function STOCH( - High: number[], - Low: number[], - Close: number[], - Fast_KPeriod: number, - Slow_KPeriod: number, - Slow_KMA: number, - Slow_DPeriod: number, - Slow_DMA: number, - ): [number[], number[]]; - - /** - * Stochastic Fast (快速STOCH指标) - * - * STOCHF(Records[High,Low,Close],Fast-K Period = 5,Fast-D Period = 3,Fast-D MA = 0) = - * [Array(outFastK),Array(outFastD)] - * - * @param {botvs.Record[]} Records - * @param {number=5} Fast_KPeriod - * @param {number=3} Fast_DPeriod - * @param {number=0} Fast_DMA - * @return {[number[], number[]]} - */ - function STOCHF( - Records: botvs.Record[], - Fast_KPeriod: number, - Fast_DPeriod: number, - Fast_DMA: number, - ): [number[], number[]]; - /** - * Stochastic Fast (快速STOCH指标) - * - * STOCHF(Records[High,Low,Close],Fast-K Period = 5,Fast-D Period = 3,Fast-D MA = 0) = - * [Array(outFastK),Array(outFastD)] - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=5} Fast_KPeriod - * @param {number=3} Fast_DPeriod - * @param {number=0} Fast_DMA - * @return {[number[], number[]]} - */ - function STOCHF( - High: number[], - Low: number[], - Close: number[], - Fast_KPeriod: number, - Fast_DPeriod: number, - Fast_DMA: number, - ): [number[], number[]]; - - /** - * Stochastic Relative Strength Index (随机强弱指数) - * - * STOCHRSI(Records[Close],Time Period = 14,Fast-K Period = 5,Fast-D Period = 3,Fast-D MA = 0) = - * [Array(outFastK),Array(outFastD)] - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @param {number=5} Fast_KPeriod - * @param {number=3} Fast_DPeriod - * @param {number=0} Fast_DMA - * @return {[number[], number[]]} - */ - function STOCHRSI( - Records: botvs.Record[] | number[], - TimePeriod: number, - Fast_KPeriod: number, - Fast_DPeriod: number, - Fast_DMA: number, - ): [number[], number[]]; - - /** - * Summation (求和) - * - * SUM(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function SUM(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Triple Exponential Moving Average (T3) (三指数移动平均) - * - * T3(Records[Close],Time Period = 5,Volume Factor = 0.7) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=5} TimePeriod - * @param {number=0.7} VolumeFactor - * @return {number[]} - */ - function T3(Records: botvs.Record[] | number[], TimePeriod: number, VolumeFactor: number): number[]; - - /** - * Vector Trigonometric Tan (正切) - * - * TAN(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function TAN(Records: botvs.Record[] | number[]): number[]; - - /** - * Vector Trigonometric Tanh (双曲正切函数) - * - * TANH(Records[Close]) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} - */ - function TANH(Records: botvs.Record[] | number[]): number[]; - - /** - * Triple Exponential Moving Average (三指数移动平均) - * - * TEMA(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function TEMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * True Range (真实范围) - * - * TRANGE(Records[High,Low,Close]) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function TRANGE(Records: botvs.Record[]): number[]; - /** - * True Range (真实范围) - * - * TRANGE(Records[High,Low,Close]) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function TRANGE(High: number[], Low: number[], Close: number[]): number[]; - - /** - * Triangular Moving Average (三指数移动平均) - * - * TRIMA(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function TRIMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA (三重指数平滑平均线) - * - * TRIX(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function TRIX(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Time Series Forecast (时间序列预测) - * - * TSF(Records[Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function TSF(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - - /** - * Typical Price (典型价格) - * - * TYPPRICE(Records[High,Low,Close]) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function TYPPRICE(Records: botvs.Record[]): number[]; - /** - * Typical Price (典型价格) - * - * TYPPRICE(Records[High,Low,Close]) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function TYPPRICE(High: number[], Low: number[], Close: number[]): number[]; - - /** - * Ultimate Oscillator (极限振子) - * - * ULTOSC(Records[High,Low,Close],First Period = 7,Second Period = 14,Third Period = 28) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=7} FirstPeriod - * @param {number=14} SecondPeriod - * @param {number=28} ThirdPeriod - * @return {number[]} - */ - function ULTOSC( - Records: botvs.Record[], - FirstPeriod: number, - SecondPeriod: number, - ThirdPeriod: number, - ): number[]; - /** - * Ultimate Oscillator (极限振子) - * - * ULTOSC(Records[High,Low,Close],First Period = 7,Second Period = 14,Third Period = 28) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=7} FirstPeriod - * @param {number=14} SecondPeriod - * @param {number=28} ThirdPeriod - * @return {number[]} - */ - function ULTOSC( - High: number[], - Low: number[], - Close: number[], - FirstPeriod: number, - SecondPeriod: number, - ThirdPeriod: number, - ): number[]; - - /** - * Variance (变量定义) - * - * VAR(Records[Close],Time Period = 5,Deviations = 1) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=5} TimePeriod - * @param {number=1} Deviations - * @return {number[]} - */ - function VAR(Records: botvs.Record[] | number[], TimePeriod: number, Deviations: number): number[]; - - /** - * Weighted Close Price (加权收盘价) - * - * WCLPRICE(Records[High,Low,Close]) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @return {number[]} - */ - function WCLPRICE(Records: botvs.Record[]): number[]; - /** - * Weighted Close Price (加权收盘价) - * - * WCLPRICE(Records[High,Low,Close]) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} - */ - function WCLPRICE(High: number[], Low: number[], Close: number[]): number[]; - - /** - * Williams' %R (威廉指标) - * - * WILLR(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} - */ - function WILLR(Records: botvs.Record[], TimePeriod: number): number[]; - /** - * Williams' %R (威廉指标) - * - * WILLR(Records[High,Low,Close],Time Period = 14) = Array(outReal) - * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} - */ - function WILLR(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; - - /** - * Weighted Moving Average (加权移动平均) - * - * WMA(Records[Close],Time Period = 30) = Array(outReal) - * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} - */ - function WMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; - } - - /** - * 订单的状态: 未完成 - */ - const ORDER_STATE_PENDING: botvs.VOrderState; - - /** - * 订单的状态: 已关闭 - */ - const ORDER_STATE_CLOSED: botvs.VOrderState; - - /** - * 订单的状态: 已取消 - */ - const ORDER_STATE_CANCELED: botvs.VOrderState; - - /** - * 订单的类型: 买单 - */ - const ORDER_TYPE_BUY: botvs.VOrderType; - - /** - * 订单的类型: 卖单 - */ - const ORDER_TYPE_SELL: botvs.VOrderType; - - /** - * 多头仓位(CTP中用closebuy_today平仓) - */ - const PD_LONG: botvs.VPositionType; - - /** - * 空头仓位(CTP用closesell_today)平仓 - */ - const PD_SHORT: botvs.VPositionType; - - /** - * (CTP期货中)PD_LONG_YD为咋日多头仓位(用closebuy平 - */ - const PD_LONG_YD: botvs.VPositionType; - - /** - * 咋日空头仓位(用closesell平) - */ - const PD_SHORT_YD: botvs.VPositionType; - - /** - * 1分钟 - */ - const PERIOD_M1: botvs.VPeriod; - - /** - * 5分钟 - */ - const PERIOD_M5: botvs.VPeriod; - - /** - * 15分钟 - */ - const PERIOD_M15: botvs.VPeriod; - - /** - * 30分钟 - */ - const PERIOD_M30: botvs.VPeriod; - - /** - * 1小时 - */ - const PERIOD_H1: botvs.VPeriod; - - /** - * 1天 - */ - const PERIOD_D1: botvs.VPeriod; - - /** - * 买单日志 - */ - const LOG_TYPE_BUY: botvs.VLogType; - - /** - * 卖单日志 - */ - const LOG_TYPE_SELL: botvs.VLogType; - - /** - * 取消日志 - */ - const LOG_TYPE_CANCEL: botvs.VLogType; - - /** - * 默认主交易所对像, 添加交易平台时排列第一的交易所 - */ - const exchange: botvs.Exchange; - - /** - * 交易所数组, 如果添加多个交易所, 可以访问此变量获取交易所对像 - */ - const exchanges: botvs.Exchange[]; - - /** - * 保存一条信息到日志列表 - * - * 如果在字符串后面加上@字符则消息会进入推送队列, 推送到使用绑定的微信账号上(账户安全里绑定)(50条/小时, 1条/5秒 限制) - * 如: Log("微信你好 !@"); 或Log("微信你好, #ff0000@"); - * Log支持打印base64编码后的图片, 以"`"开头, 以"`"结尾, 如Log("`data:image/png;base64,AAAA`") - * Log支持直接打印Python的matplotlib.pyplot对象, 只要对象包含savefig方法就可以直接Log打印, 如: - * import matplotlib.pyplot as plt - * def main(): - * plt.plot([3,6,2,4,7,1]) - * Log(plt) - * - * @param {string} arg - */ - function Log(arg: string): void; - - /** - * 休眠函数 - * - * 参数为毫秒数,如Sleep(1000)为休眠一秒 - * - * @param {number} Millisecond - */ - function Sleep(Millisecond: number): void; - - /** - * 判断是否是模拟回测 - * - * 模拟回测状态返回true,实盘返回false - * - * @return {boolean} - */ - function IsVirtual(): boolean; - - /** - * 记录盈利值,这个为总盈利的值,参数类型为浮点数 - * - * @param {number} Profit - */ - function LogProfit(Profit: number): void; - - /** - * 清空所有收益日志, 可以带一个数字参数, 指定保留的条数 - * - * @param {number} reserve - */ - function LogProfitReset(reserve?: number): void; - - /** - * 清空所有日志, 可以带一个数字参数, 指定保留的条数 - * - * @param {number} reserve - */ - function LogReset(reserve?: number): void; - - /** - * 此信息不保存到日志列表里, 只更新当前机器人的状态信息, 在日志上方显示, 可多次调用, 更新状态 - * - * * LogStatus('这是一个普通的状态提示'); - * LogStatus('这是一个红色字体的状态提示 #ff0000'); - * LogStatus('这是一个多行的状态信息\n我是第二行'); - * LogStatus支持打印base64编码后的图片, 以"`"开头, 以"`"结尾, 如LogStatus("`data:image/png;base64,AAAA`") - * LogStatus支持直接传入Python的matplotlib.pyplot对象, 只要对象包含savefig方法就可以传入LogStatus, 如: - * import matplotlib.pyplot as plt - * def main(): - * plt.plot([3,6,2,4,7,1]) - * LogStatus(plt) - * var table = {type: 'table', title: '持仓信息', cols: ['列1', '列2'], rows: [ ['abc', 'def'], ['ABC', 'support color - * #ff0000']]}; LogStatus('`' + JSON.stringify(table)+'`'); // JSON序列化后两边加上`字符, 视为一个复杂消息格式(当前支持表格) - * LogStatus('第一行消息\n`' + JSON.stringify(table)+'`\n第三行消息'); - * // 表格信息也可以在多行中出现 LogStatus('`' + JSON.stringify([table, - * table])+'`'); // 支持多个表格同时显示, 将以TAB显示到一组里 - * // 也可以构造一个按钮在表格中, 策略用GetCommand接收cmd属性的内容 - * var table = { - * type: 'table', - * title: '持仓操作', - * cols: ['列1', '列2', 'Action'], - * rows: [ - * ['abc', 'def', {'type':'button', 'cmd': 'coverAll', 'name': '平仓'}], - * ] - * }; - * LogStatus('`' + JSON.stringify(table) + '`') - * // 或者构造一单独的按钮 - * LogStatus('`' + JSON.stringify({'type':'button', 'cmd': 'coverAll', 'name': '平仓'}) + '`') - * // 可以自定义按钮风格(bootstrap的按钮属性) - * LogStatus('`' + JSON.stringify({'type':'button', 'class': 'btn btn-xs btn-danger', 'cmd': 'coverAll', 'name': - * '平仓'}) + '`') - * - * @param {string} Msg - */ - function LogStatus(Msg: string): void; - - /** - * 打开或者关闭定单和出错信息的日志记录 - * - * @param {boolean} IsEnable - */ - function EnableLog(IsEnable: boolean): void; - - /** - * 图表绘图函数 - * - * 参数为可以JSON序列化的HighStocks的Highcharts.StockChart参数, 比原生的参数增加一个 - * __isStock属性, 如果指定__isStock: false, 则显示为普通图表 - * 返回对像可以调用add([series索引(如0), 数据])向指定索引的series添加数据, 调用reset() - * 清空图表数据, reset可以带一个数字参数, 指定保留的条数 - * 可以调用add([series索引(如0), 数据, 此数据在series中的索引])来更改数据 - * 可以为负数, -1指最后一个, -2是倒数第二个, 如: - * chart.add([0, 13.5, -1]), 更改series[0].data的倒数第一个点的数据 - * 支持显示多个图表, 配置时只需传入数组参数即可如: var chart = Chart([{...}, {...}, {...}]), - * 比如图表一有两个series, 图表二有一个series, 图表三有一个series, - * 那么add时指定0与1序列ID代表更新图表1的两个序列的数据, add时指定序列ID为2指图表2的第一个 - * series的数据, 指定序列3指的是图表3的第一个series的数据 HighStocks: - * http://api.highcharts.com/highstock - * - * @param {botvs.ChartOptions} options - * @return {botvs.RChart} - */ - function Chart(...options: botvs.ChartOptions[]): botvs.RChart; - - /** - * 发送邮件函数 - * - * Mail(smtpServer, smtpUsername, smtpPassword, mailTo, title, body); ret true or false - * Mail("smtp.163.com", "asdf@163.com", "password", "111@163.com", "title", "body") - * - * @param {string} smtpServer - * @param {string} smtpUsername - * @param {string} smtpPassword - * @param {string} mailTo - * @param {string} title - * @param {string} body - * @return {boolean} - */ - function Mail( - smtpServer: string, - smtpUsername: string, - smtpPassword: string, - mailTo: string, - title: string, - body: string, - ): boolean; - - /** - * 错误信息过滤 - * - * 被此正则表达式匹配的错误将不上传到日志系统, 可多次调用设置多个 - * SetErrorFilter("502:|503:|tcp|character|unexpected|network|timeout|WSARecv|Connect|GetAddr|no - * such|reset|http|received|EOF|reused"); - * - * @param {string} RegEx - */ - function SetErrorFilter(RegEx: string): void; - - /** - * 返回机器人进程ID - * - * @return {number} - */ - function GetPid(): number; - - /** - * 获取最近一次出错信息,一般无需使用,因为程序会把出错信息自动上传到日志系统 - * - * @return {string} - */ - function GetLastError(): string; - - /** - * 可保存的全局字典表 - * - * KV表, 永久保存在本地文件, 每个机器人单独一个数据库, 重启或者托管者退出后一直存在 - * K必须为数字或者字符串, 不区分大小写, V可以为任何可以JSON序列化的内容 - * _G("num", 1); // 设置一个全局变量num, 值为1 - * _G("num", "ok"); // 更改一个全局变量num, 值为字符串ok - * _G("num", null); // 删除全局变量 num - * _G("num"); // 返回全局变量num的值 - * _G(); // 返回当前机器人的ID - * _G(null); // 删除所有全局变量 - * - * @param {string} K - * @param {T} V - */ - function _G(K: string, V: T): void; - - /** - * 获取交互命令(utf-8) - * - * 获取策略交互界面发来的命令并清空, 没有命令则返回null, 返回的命令格式为 "按钮名称:参数", 如果没有参数, 则命令就是按钮名称 - * while (true) { - * var cmd = GetCommand(); - * if (cmd) { - * Log(cmd); - * } - * Sleep(1000); - * } - * - * @return {string} - */ - function GetCommand(): string | null; - - /** - * 原始的Socket访问, 支持tcp, udp, tls, unix 协议 - * - * @example - * - * ``` - * var client = Dial("tls://www.baidu.com:443"); // Dial支持tcp://, udp://, tls://, unix:// 协议, 可加一个参数指定超时的秒数 - * if (client) { - * client.write("GET / HTTP/1.1\nConnection: Closed\n\n"); // write可再跟一个数字参数指定超时, write返回成功发送的字节数 - * while (true) { - * var buf = client.read();// read可再跟一个数字参数指定超时, 返回null指出错或者超时或者socket已经关闭 - * if (!buf) { - * break; - * } - * Log(buf); - * } - * client.close(); - * } - * ``` - * - * @param {string} Address - * @param {number} Timeout - * @return {botvs.Socket} - */ - function Dial(Address: string, Timeout?: number): botvs.Socket | void; - - /** - * 网络URL访问 - * - * HttpQuery(Url, PostData, Cookies, Headers, IsReturnHeader) - * 获取一个Url的返回内容, 如果第二个参数PostData为字符串就以POST方式提交 - * 第二个参数PostData可以自定义方法比如HttpQuery('http://www.abc.com', {method:'PUT', data:'xx'}) - * 传递Cookie字符串需要第三个参数, 但不需要POST请将第二个参数置为null - * 模拟测试的时候因为无法模拟访问URL, 函数就返回固定字符串 Dummy Data - * 可以用此接口发送短信, 或者与其它API进行交互 - * HttpQuery("http://www.baidu.com/"); // Get - * HttpQuery("http://www.163.com", "xxx"); // Post - * HttpQuery("http://www.baidu.com/", null, "a=10; b=20", "User-Agent: Mobile\nContent-Type: text/html", true); - * // will return {Header: HTTP Header, Body: HTML} - * - * @param {string} Url - * @param {string | null | {method: string; data?: string}} PostData - * @param {string} Cookies - * @param {string} Headers - * @return {string} - */ - function HttpQuery( - Url: string, - PostData: string | null | { method: string, data?: string }, - Cookies: string, - Headers: string, - ): string; - function HttpQuery( - Url: string, - PostData: string | null | { method: string, data?: string }, - Cookies: string, - Headers: string, - IsReturnHeader: true, - ): { Header: string, Body: string }; - - /** - * 支持 md5/sha256/sha512/sha1 的哈希计算, 只支持实盘 - * - * 第二个参数可设置为raw/hex/base64, 分别指输出加密后的 原始内容/hex编码过的/base64编码过的 - * Log(Hash('md5', 'hex', 'hello')); - * Log(Hash('sha512', 'base64', 'hello')); - * - * @param {"md5" | "sha256" | "sha512" | "sha1"} Algo - * @param {"hex" | "base64"} OutputAlgo - * @param {string} Data - * @return {string} - */ - function Hash( - Algo: 'md5' | 'sha256' | 'sha512' | 'sha1', - OutputAlgo: 'hex' | 'base64' | 'raw', - Data: string, - ): string; - - /** - * 支持 md5/sha256/sha512/sha1 的HMAC加密计算, 只支持实盘 - * - * 第二个参数可设置为raw/hex/base64, 分别指输出加密后的 原始内容/hex编码过的/base64编码过的 - * Log(HMAC('md5', 'hex', 'hello', 'pass')); - * Log(HMAC('sha512', 'base64', 'hello', 'pass')); - * - * @param {"md5" | "sha256" | "sha512" | "sha1"} Algo - * @param {"hex" | "base64" | "raw"} OutputAlgo - * @param {string} Data - * @param {string} password - * @return {string} - */ - function HMAC( - Algo: 'md5' | 'sha256' | 'sha512' | 'sha1', - OutputAlgo: 'hex' | 'base64' | 'raw', - Data: string, - password: string, - ): string; - - /** - * 返回指定时间戳(ms)字符串, 不传任何参数就返回当前时间, - * 如_D(),或者_D(1478570053241), 默认格式为yyyy-MM-dd hh:mm:ss - * - * @param {string} timestamp - * @param {string} format - * @return {string} - */ - function _D(timestamp: string, format: string): string; - - /** - * 格式化一个浮点函数 - * - * @param {number} num - * @param {number=4} precision - * @return {string} - */ - function _N(num: number, precision?: number): string; - - /** - * 重试函数, 会一直调用指定函数到成功返回(函数返回null或者false会重试), - * 比如_C(exchange.GetTicker), 默认重试间隔为3秒, 可以调用_CDelay函数来控制重试间隔 - * 比如_CDelay(1000), 指改变_C函数重试间隔为1秒 - * - * @param {(...args: any[]) => T} func - * @param args - * @return {T} - */ - function _C(func: (...args: any[]) => T, ...args: any[]): T; - - /** - * 比如_CDelay(1000), 指改变_C函数重试间隔为1秒, 默认为3秒 - * - * @param {number} delay - */ - function _CDelay(delay: number): void; -} diff --git a/types/botvs/tsconfig.json b/types/botvs/tsconfig.json deleted file mode 100644 index 6ec444ef28..0000000000 --- a/types/botvs/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "botvs-tests.ts" - ] -} \ No newline at end of file diff --git a/types/botvs/tslint.json b/types/botvs/tslint.json deleted file mode 100644 index 71ee04c4e1..0000000000 --- a/types/botvs/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "no-unnecessary-generics": false - } -} diff --git a/types/bounce.js/tslint.json b/types/bounce.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bounce.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bowser/bowser-tests.ts b/types/bowser/bowser-tests.ts deleted file mode 100644 index 490d02a254..0000000000 --- a/types/bowser/bowser-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -bowser.msedge === true; -bowser.test(['msie']) === true; -bowser.a === bowser.c; -bowser.osversion > 10; -bowser.osversion === '10.1A'; -bowser.compareVersions(['9.0', '10']); - -bowser() === {android: true, x: true}; -bowser.check({msie: "11"}, window.navigator.userAgent); -bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent); \ No newline at end of file diff --git a/types/bowser/index.d.ts b/types/bowser/index.d.ts deleted file mode 100644 index 163342a631..0000000000 --- a/types/bowser/index.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -// Type definitions for Bowser 1.x -// Project: https://github.com/ded/bowser -// Definitions by: Paulo Cesar -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare const bowser: bowser.IBowser; -export = bowser; -export as namespace bowser; - -declare namespace bowser { - - export interface IBowserOS { - mac: boolean; - /**other than Windows Phone */ - windows: boolean; - windowsphone: boolean; - /**other than android, chromeos, webos, tizen, and sailfish */ - linux: boolean; - chromeos: boolean; - android: boolean; - /** also sets one of iphone/ipad/ipod */ - ios: boolean; - blackberry: boolean; - firefoxos: boolean; - /** may also set touchpad */ - webos: boolean; - bada: boolean; - tizen: boolean; - sailfish: boolean; - } - - export interface IBowserVersions { - chrome: boolean; - firefox: boolean; - msie: boolean; - msedge: boolean; - safari: boolean; - android: boolean; - ios: boolean; - opera: boolean; - phantom: boolean; - blackberry: boolean; - webos: boolean; - silk: boolean; - bada: boolean; - tizen: boolean; - seamonkey: boolean; - sailfish: boolean; - ucbrowser: boolean; - qupzilla: boolean; - vivaldi: boolean; - sleipnir: boolean; - kMeleon: boolean; - } - - export interface IBowserEngines { - /** IE <= 11 */ - msie: boolean; - /**Chrome 0-27, Android <4.4, iOs, BB, etc. */ - webkit: boolean; - /**Chrome >=28, Android >=4.4, Opera, etc. */ - blink: boolean; - /**Firefox, etc. */ - gecko: boolean; - /** IE > 11 */ - msedge: boolean; - /** If a tablet device is detected, the flag tablet is set instead of mobile. */ - tablet: boolean; - /** All detected mobile OSes are additionally flagged mobile, unless it's a tablet */ - mobile: boolean; - - } - - export interface IBowserGrade { - /** Grade A browser */ - a: boolean; - /** Grade C browser */ - c: boolean; - /** Grade X browser */ - x: boolean; - /**A human readable name for this browser. E.g. 'Chrome', '' */ - name: string; - /**Version number for the browser. E.g. '32.0' */ - version: string|number; - osversion: string|number; - } - - export interface IBowserDetection extends IBowserGrade, IBowserEngines, IBowserOS, IBowserVersions { } - - export interface IBowserMinVersions { - // { msie: "11", "firefox": "4" } - [index: string]: string; - } - - export interface IBowser extends IBowserDetection { - (): IBowserDetection; - test(browserList: string[]): boolean; - _detect(ua: string): IBowser; - compareVersions(versions: string[]): number; - check(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): Boolean; - isUnsupportedBrowser(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): boolean; - } - -} diff --git a/types/bowser/tsconfig.json b/types/bowser/tsconfig.json deleted file mode 100644 index 533b285bb0..0000000000 --- a/types/bowser/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bowser-tests.ts" - ] -} \ No newline at end of file diff --git a/types/box2d/index.d.ts b/types/box2d/index.d.ts index 77a132592e..d17eb2c8f6 100644 --- a/types/box2d/index.d.ts +++ b/types/box2d/index.d.ts @@ -5147,7 +5147,7 @@ declare namespace Box2D.Dynamics.Joints { /** * The pulley joint is connected to two bodies and two fixed ground points. The pulley supports a ratio such that: length1 + ratio length2 <= constant Yes, the force transmitted is scaled by the ratio. The pulley also enforces a maximum length limit on both sides. This is useful to prevent one side of the pulley hitting the top. **/ - export class b2PullyJoint extends b2Joint { + export class b2PulleyJoint extends b2Joint { /** * Get the anchor point on bodyA in world coordinates. @@ -5207,7 +5207,7 @@ declare namespace Box2D.Dynamics.Joints { /** * Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, max lengths for each side, and a pulley ratio. **/ - export class b2PullyJointDef extends b2JointDef { + export class b2PulleyJointDef extends b2JointDef { /** * The first ground anchor in world coordinates. This point never moves. diff --git a/types/box2d/tslint.json b/types/box2d/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/box2d/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/braces/braces-tests.ts b/types/braces/braces-tests.ts new file mode 100644 index 0000000000..f6a7ccd0ed --- /dev/null +++ b/types/braces/braces-tests.ts @@ -0,0 +1,10 @@ +import braces = require("braces"); + +const bracesOpts: braces.Options = { + expand: true, +}; + +let strArrResult: string[]; + +strArrResult = braces.expand('a/{x,y,z}/b'); +strArrResult = braces('a/{x,y,z}/b', bracesOpts); diff --git a/types/braces/index.d.ts b/types/braces/index.d.ts new file mode 100644 index 0000000000..880738806e --- /dev/null +++ b/types/braces/index.d.ts @@ -0,0 +1,110 @@ +// Type definitions for braces 2.3 +// Project: https://github.com/micromatch/braces +// Definitions by: vemoo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace braces { + interface Options { + /** + * Generate an "expanded" brace pattern (this option is unncessary with the `.expand` method, which does the same thing). + * + * ```js + * console.log(braces('a/{b,c}/d', {expand: true})); + * //=> [ 'a/b/d', 'a/c/d' ] + * ``` + * + * @default undefined + */ + expand?: boolean; + /** + * Enabled by default. + * + * ```js + * console.log(braces('a/{b,c}/d')); + * //=> [ 'a/(b|c)/d' ] + * ``` + * + * @default true + */ + optimize?: boolean; + /** + * Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options + * + * @default true + */ + nodupes?: boolean; + /** + * When `braces.expand()` is used, or `options.expand` is true, brace patterns will automatically be [optimized](#optionsoptimize) + * when the difference between the range minimum and range maximum exceeds the `rangeLimit`. + * This is to prevent huge ranges from freezing your application. + * + * You can set this to any number, or change `options.rangeLimit` to `Inifinity` to disable this altogether. + * + * @default 250 + * + * @example + * ```js + * // pattern exceeds the "rangeLimit", so it's optimized automatically + * console.log(braces.expand('{1..1000}')); + * //=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] + * + * // pattern does not exceed "rangeLimit", so it's NOT optimized + * console.log(braces.expand('{1..100}')); + * //=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11' ... '89', 90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] + * ``` + */ + rangeLimit?: number; + /** + * Customize range expansion. + * + * ```js + * var range = braces.expand('x{a..e}y', { + * transform: function(str) { + * return 'foo' + str; + * } + * }); + * + * console.log(range); + * //=> [ 'xfooay', 'xfooby', 'xfoocy', 'xfoody', 'xfooey' ] + * ``` + * + * @default undefined + */ + transform?: (str: string) => string; + /** + * In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + * + * Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + * + * The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) + * are defined in the given pattern, and not to try to expand them as lists. + * + * @default undefined + * + * @example + * ```js + * var braces = require('braces'); + * console.log(braces('a/b{1,3}/{x,y,z}')); + * //=> [ 'a/b(1|3)/(x|y|z)' ] + * console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true})); + * //=> [ 'a/b{1,3}/(x|y|z)' ] + * console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true})); + * //=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] + * ``` + */ + quantifiers?: boolean; + /** + * Strip backslashes that were used for escaping from the result. + * + * @default undefined + */ + unescape?: boolean; + } +} +interface Braces { + (pattern: string, options?: braces.Options): string[]; + expand(pattern: string): string[]; +} +declare const braces: Braces; +export as namespace braces; +export = braces; diff --git a/types/braces/tsconfig.json b/types/braces/tsconfig.json new file mode 100644 index 0000000000..bdacb750ad --- /dev/null +++ b/types/braces/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", + "braces-tests.ts" + ] +} \ No newline at end of file diff --git a/types/braces/tslint.json b/types/braces/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/braces/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/braft-editor/braft-editor-tests.tsx b/types/braft-editor/braft-editor-tests.tsx new file mode 100644 index 0000000000..584927e0bd --- /dev/null +++ b/types/braft-editor/braft-editor-tests.tsx @@ -0,0 +1,31 @@ +import * as React from "react"; +import * as BraftEditor from "braft-editor"; +import { + RawDraftContentState, +} from 'draft-js'; +class BraftEditorTest extends React.Component { + state = { + content: null + }; + render() { + const editorProps = { + height: 500, + initialContent: this.state.content, + onChange: this.handleChange, + onHTMLChange: this.handleHTMLChange + }; + return ( +
+ +
+ ); + } + private readonly handleChange = (content: RawDraftContentState) => { + console.log(content); + } + private readonly handleHTMLChange = (html: string) => { + console.log(html); + } +} diff --git a/types/braft-editor/index.d.ts b/types/braft-editor/index.d.ts new file mode 100644 index 0000000000..225d32722d --- /dev/null +++ b/types/braft-editor/index.d.ts @@ -0,0 +1,59 @@ +// Type definitions for braft-editor 1.1 +// Project: https://github.com/margox/braft#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as React from "react"; +import { RawDraftContentState } from 'draft-js'; +export as namespace BraftEditor; +export = BraftEditor; +declare namespace BraftEditor { + interface fontFamiliesRange { + name: string; + family: string; + } + interface editorProps { + editorState?: any; + contentFormat?: RawDraftContentState; + initialContent?: RawDraftContentState | null; + onChange?: (content: RawDraftContentState) => void; + onRawChange?: (content: RawDraftContentState) => void; + onHTMLChange?: (content: string) => void; + controls?: string[]; + extendControls?: any[]; + height?: number; + language?: string; + placeholder?: string; + viewWrapper?: string; + colors?: string[]; + fontSizes?: number[]; + fontFamilies?: fontFamiliesRange[]; + media?: { [key: string]: any }; + getContent?: (format?: string) => RawDraftContentState; + setContent?: (content: RawDraftContentState, format?: string) => void; + toggleSelectionBlockType?: (blockquote: string) => any; + toggleSelectionInlineStyle?: (style: string, stylesToBeRemoved?: string[]) => any; + insertMedias?: (medias: Array<{ type: string, name: string, url: string }>) => void; + insertText?: (text: string, replace?: boolean) => void; + toggleSelectionLink?: (href: string, target: string) => void; + toggleSelectionAlignment?: (alignment: string) => any; + toggleSelectionColor?: (hexColor: string) => void; + toggleSelectionBackgroundColor?: (hexColor: string) => void; + toggleSelectionFontSize?: (fontSize: number) => void; + toggleSelectionFontFamily?: (fontFamily: string) => void; + selectionCollapsed?: () => boolean; + selectionHasInlineStyle?: () => boolean; + getSelectionBlockType?: () => string; + getEditorState?: () => void; + forceRender?: () => void; + getDraftInstance?: () => any; + getMediaLibraryInstance?: () => any; + getSelectionInlineStyle?: () => any; + undo?: () => any; + redo?: () => any; + focus?: () => void; + blur?: () => void; + } +} +declare class BraftEditor extends React.Component { } diff --git a/types/braft-editor/tsconfig.json b/types/braft-editor/tsconfig.json new file mode 100644 index 0000000000..f04b8febfe --- /dev/null +++ b/types/braft-editor/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "braft-editor-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/react-flip-move/tslint.json b/types/braft-editor/tslint.json similarity index 100% rename from types/react-flip-move/tslint.json rename to types/braft-editor/tslint.json diff --git a/types/braintree-web/index.d.ts b/types/braintree-web/index.d.ts index 46f16e072b..bc5ca0b01f 100644 --- a/types/braintree-web/index.d.ts +++ b/types/braintree-web/index.d.ts @@ -611,12 +611,14 @@ declare namespace braintree { * @property {object} details Additional account details. * @property {string} details.cardType Type of card, ex: Visa, MasterCard. * @property {string} details.lastTwo Last two digits of card number. + * @property {string} details.lastFour Last four digits of card number. * @property {string} description A human-readable description. * @property {string} type The payment method type, always `CreditCard`. */ interface HostedFieldsAccountDetails { cardType: string; lastTwo: string; + lastFour: string; } interface HostedFieldsTokenizePayload { diff --git a/types/braintree-web/tslint.json b/types/braintree-web/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/braintree-web/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/breeze/tslint.json b/types/breeze/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/breeze/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/brorand/tslint.json b/types/brorand/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/brorand/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-bunyan/index.d.ts b/types/browser-bunyan/index.d.ts index 7edabdca26..4fedbcd780 100644 --- a/types/browser-bunyan/index.d.ts +++ b/types/browser-bunyan/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Paul Lockwood // Michael Strobel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/browser-harness/tslint.json b/types/browser-harness/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-harness/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-pack/tslint.json b/types/browser-pack/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-pack/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-report/tslint.json b/types/browser-report/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-report/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-resolve/tslint.json b/types/browser-resolve/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-resolve/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts index c20f27236a..85cd464a21 100644 --- a/types/browser-sync/browser-sync-tests.ts +++ b/types/browser-sync/browser-sync-tests.ts @@ -24,6 +24,46 @@ browserSync({ proxy: "yourlocal.dev" }); +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyReq: function(proxyReq) { + console.log(proxyReq); + } + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyReq: [ + function(proxyReq) { + console.log(proxyReq); + } + ] + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyRes: function(proxyRes, req, res) { + console.log(proxyRes); + } + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyRes: [ + function(proxyRes, req, res) { + console.log(proxyRes); + } + ] + } +}); + var config = { server: { baseDir: "./" diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index ade12d3cb6..b22054c367 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -48,6 +48,7 @@ declare namespace browserSync { * middleware - Default: undefined * reqHeaders - Default: undefined * proxyRes - Default: undefined + * proxyReq - Default: undefined */ proxy?: string | boolean | ProxyOptions; /** @@ -291,9 +292,10 @@ declare namespace browserSync { interface ProxyOptions { target?: string; middleware?: MiddlewareHandler; - ws: boolean; - reqHeaders: (config: any) => Hash; - proxyRes: (res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any; + ws?: boolean; + reqHeaders?: (config: any) => Hash; + proxyRes?: ((res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any)[] | ((res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any); + proxyReq?: ((res: http.ServerRequest) => any)[] | ((res: http.ServerRequest) => any); } interface MiddlewareHandler { diff --git a/types/browser-sync/tsconfig.json b/types/browser-sync/tsconfig.json index 98204d433a..830268a3a6 100644 --- a/types/browser-sync/tsconfig.json +++ b/types/browser-sync/tsconfig.json @@ -9,6 +9,11 @@ "strictNullChecks": false, "strictFunctionTypes": true, "baseUrl": "../", + "paths": { + "micromatch": [ + "micromatch/v2" + ] + }, "typeRoots": [ "../" ], diff --git a/types/browser-sync/tslint.json b/types/browser-sync/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-sync/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browserify/tslint.json b/types/browserify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browserify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bs58/tslint.json b/types/bs58/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bs58/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bson/index.d.ts b/types/bson/index.d.ts index 2b6a636e89..380e6e380c 100644 --- a/types/bson/index.d.ts +++ b/types/bson/index.d.ts @@ -39,6 +39,9 @@ export class Binary { constructor(buffer: Buffer, subType?: number); + /** The underlying Buffer which stores the binary data. */ + readonly buffer: Buffer; + /** The length of the binary. */ length(): number; /** Updates this binary with byte_value */ @@ -55,6 +58,9 @@ export class Code { } export class DBRef { constructor(namespace: string, oid: ObjectID, db?: string); + namespace: string; + oid: ObjectID; + db?: string; } export class Double { constructor(value: number); diff --git a/types/bson/tslint.json b/types/bson/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bson/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bucks/tslint.json b/types/bucks/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bucks/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/buffer-compare/tslint.json b/types/buffer-compare/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/buffer-compare/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/buffer-equal/tslint.json b/types/buffer-equal/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/buffer-equal/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/buffers/tslint.json b/types/buffers/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/buffers/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 5754236da8..28070ad44f 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -1,11 +1,15 @@ -// Type definitions for bull 3.0 +// Type definitions for bull 3.3 // Project: https://github.com/OptimalBits/bull // Definitions by: Bruno Grieder // Cameron Crothers // Marshall Cottrell +// Weeco +// Gabriel Terwesten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as Redis from "ioredis"; +import * as Promise from "bluebird"; /** * This is the Queue constructor. @@ -13,407 +17,585 @@ import * as Redis from "ioredis"; * 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: { - // tslint:disable:unified-signatures - (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - (queueName: string, url?: string): Bull.Queue; - new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - new (queueName: string, url?: string): Bull.Queue; - // tslint:enable:unified-signatures + (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + (queueName: string, url?: string): Bull.Queue; // tslint:disable-line unified-signatures + new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + new (queueName: string, url?: string): Bull.Queue; // tslint:disable-line unified-signatures }; declare namespace Bull { - interface QueueOptions { - /** - * Options passed directly to the `ioredis` constructor - */ - redis?: Redis.RedisOptions; - - /** - * When specified, the `Queue` will use this function to create new `ioredis` client connections. - * This is useful if you want to re-use connections. - */ - createClient?(type: 'client' | 'subscriber', redisOpts?: Redis.RedisOptions): Redis.Redis; - - /** - * Prefix to use for all redis keys - */ - prefix?: string; - - settings?: AdvancedSettings; - } - - interface AdvancedSettings { - /** - * Key expiration time for job locks - */ - lockDuration?: number; - - /** - * How often check for stalled jobs (use 0 for never checking) - */ - stalledInterval?: number; - - /** - * Max amount of times a stalled job will be re-processed - */ - maxStalledCount?: number; - - /** - * Poll interval for delayed jobs and added jobs - */ - guardInterval?: number; - - /** - * Delay before processing next job in case of internal error - */ - retryProcessDelay?: number; - } - - type DoneCallback = (error?: Error | null, value?: any) => void; - - type JobId = number | string; - - interface Job { - id: JobId; - - /** - * The custom data passed when the job was created - */ - data: any; - - /** - * Report progress on a job - */ - progress(value: any): Promise; - - /** - * Removes a job from the queue and from any lists it may be included in. - * @returns {Promise} A promise that resolves when the job is removed. - */ - remove(): Promise; - - /** - * Re-run a job that has failed. - * @returns {Promise} A promise that resolves when the job is scheduled for retry. - */ - retry(): Promise; - - /** - * Returns a promise the resolves when the job has been finished. - * TODO: Add a watchdog to check if the job has finished periodically. - * since pubsub does not give any guarantees. - */ - finished(): Promise; - - /** - * Promotes a job that is currently "delayed" to the "waiting" state and executed as soon as possible. - */ - promote(): Promise; - } - - type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; - - interface BackoffOptions { - /** - * Backoff type, which can be either `fixed` or `exponential` - */ - type: 'fixed' | 'exponential'; - - /** - * Backoff delay, in milliseconds - */ - delay: number; - } - - interface RepeatOptions { - /** - * Cron pattern specifying when the job should execute - */ - cron: string; - - /** - * Timezone - */ - tz?: string; - - /** - * End date when the repeat job should stop repeating - */ - endDate?: Date | string | number; - } - - interface JobOptions { - /** - * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). - * Note that using priorities has a slight impact on performance, so do not use it if not required - */ - priority?: number; - - /** - * An amount of miliseconds to wait until this job can be processed. - * Note that for accurate delays, both server and clients should have their clocks synchronized. [optional] - */ - delay?: number; - - /** - * The total number of attempts to try the job until it completes - */ - attempts?: number; - - /** - * Repeat job according to a cron specification - */ - repeat?: RepeatOptions; - - /** - * Backoff setting for automatic retries if the job fails - */ - backoff?: number | BackoffOptions; - - /** - * A boolean which, if true, adds the job to the right - * of the queue instead of the left (default false) - */ - lifo?: boolean; - - /** - * The number of milliseconds after which the job should be fail with a timeout error - */ - timeout?: number; - - /** - * Override the job ID - by default, the job ID is a unique - * integer, but you can use this setting to override it. - * If you use this option, it is up to you to ensure the - * jobId is unique. If you attempt to add a job with an id that - * already exists, it will not be added. - */ - jobId?: JobId; - - /** - * A boolean which, if true, removes the job when it successfully completes. - * Default behavior is to keep the job in the completed set. - */ - removeOnComplete?: boolean; - - /** - * A boolean which, if true, removes the job when it fails after all attempts - * Default behavior is to keep the job in the completed set. - */ - removeOnFail?: boolean; - } - - interface JobCounts { - wait: number; - active: number; - completed: number; - failed: number; - delayed: number; - } - - interface Queue { - /** - * Returns a promise that resolves when Redis is connected and the queue is ready to accept jobs. - * This replaces the `ready` event emitted on Queue in previous verisons. - */ - isReady(): Promise; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. - * - * concurrency: Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. - */ - process(callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - * - * concurrency: Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, callback: (job: Job) => void): Promise; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - */ - process(callback: (job: Job) => void): Promise; - - /** - * Creates a new job and adds it to the queue. - * If the queue is empty the job will be executed directly, - * otherwise it will be placed in the queue and executed as soon as possible. - */ - add(data: any, opts?: JobOptions): Promise; - - /** - * Returns a promise that resolves when the queue is paused. - * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. - * A paused queue will not process new jobs until resumed, - * but current jobs being processed will continue until they are finalized. - * - * Pausing a queue that is already paused does nothing. - */ - pause(): Promise; - - /** - * Returns a promise that resolves when the queue is resumed after being paused. - * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. - * - * Resuming a queue that is not paused does nothing. - */ - resume(): Promise; - - /** - * Returns a promise that returns the number of jobs in the queue, waiting or paused. - * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. - */ - count(): Promise; - - /** - * Empties a queue deleting all the input lists and associated jobs. - */ - empty(): Promise; - - /** - * Closes the underlying redis client. Use this to perform a graceful shutdown. - * - * `close` can be called from anywhere, with one caveat: - * if called from within a job handler the queue won't close until after the job has been processed - */ - close(): Promise; - - /** - * Returns a promise that will return the job instance associated with the jobId parameter. - * If the specified job cannot be located, the promise callback parameter will be set to null. - */ - getJob(jobId: JobId): Promise; - - /** - * Returns a promise that resolves with the job counts for the given queue - */ - getJobCounts(): Promise; - - /** - * Tells the queue remove all jobs created outside of a grace period in milliseconds. - * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. - */ - clean(grace: number, status?: JobStatus, limit?: number): Promise; - - // tslint:disable:unified-signatures - - /** - * Listens to queue events - */ - on(event: string, callback: (...args: any[]) => void): this; - - /** - * An error occured - */ - on(event: 'error', callback: ErrorEventCallback): this; - - /** - * A job has started. You can use `jobPromise.cancel()` to abort it - */ - on(event: 'active', callback: ActiveEventCallback): this; - - /** - * A job has been marked as stalled. - * This is useful for debugging job workers that crash or pause the event loop. - */ - on(event: 'stalled', callback: StalledEventCallback): this; - - /** - * A job's progress was updated - */ - on(event: 'progress', callback: ProgressEventCallback): this; - - /** - * A job successfully completed with a `result` - */ - on(event: 'completed', callback: CompletedEventCallback): this; - - /** - * A job failed with `err` as the reason - */ - on(event: 'failed', callback: FailedEventCallback): this; - - /** - * The queue has been paused - */ - on(event: 'paused', callback: EventCallback): this; - - /** - * The queue has been resumed - */ - on(event: 'resumed', callback: EventCallback): this; - - /** - * Old jobs have been cleaned from the queue. - * `jobs` is an array of jobs that were removed, and `type` is the type of those jobs. - * - * @see Queue#clean() for details - */ - on(event: 'cleaned', callback: CleanedEventCallback): this; - - // tslint:enable:unified-signatures - } - - type EventCallback = () => void; - - type ErrorEventCallback = (error: Error) => void; - - interface JobPromise { - /** - * Abort this job - */ - cancel(): void; - } - - type ActiveEventCallback = (job: Job, jobPromise?: JobPromise) => void; - - type StalledEventCallback = (job: Job) => void; - - type ProgressEventCallback = (job: Job, progress: any) => void; - - type CompletedEventCallback = (job: Job, result: any) => void; - - type FailedEventCallback = (job: Job, error: Error) => void; - - type CleanedEventCallback = (jobs: Job[], status: JobStatus) => void; + interface RateLimiter { + /** Max numbers of jobs processed */ + max: number; + /** Per duration in milliseconds */ + duration: number; + } + + interface QueueOptions { + /** + * Options passed directly to the `ioredis` constructor + */ + redis?: Redis.RedisOptions; + + /** + * When specified, the `Queue` will use this function to create new `ioredis` client connections. + * This is useful if you want to re-use connections. + */ + createClient?(type: 'client' | 'subscriber', redisOpts?: Redis.RedisOptions): Redis.Redis; + + /** + * Prefix to use for all redis keys + */ + prefix?: string; + + settings?: AdvancedSettings; + + limiter?: RateLimiter; + } + + interface AdvancedSettings { + /** + * Key expiration time for job locks + */ + lockDuration?: number; + + /** + * How often check for stalled jobs (use 0 for never checking) + */ + stalledInterval?: number; + + /** + * Max amount of times a stalled job will be re-processed + */ + maxStalledCount?: number; + + /** + * Poll interval for delayed jobs and added jobs + */ + guardInterval?: number; + + /** + * Delay before processing next job in case of internal error + */ + retryProcessDelay?: number; + } + + type DoneCallback = (error?: Error | null, value?: any) => void; + + type JobId = number | string; + + interface Job { + id: JobId; + + /** + * The custom data passed when the job was created + */ + data: any; + + /** + * Report progress on a job + */ + progress(value: any): Promise; + + /** + * Returns a promise resolving to the current job's status. + * Please take note that the implementation of this method is not very efficient, nor is + * it atomic. If your queue does have a very large quantity of jobs, you may want to + * avoid using this method. + */ + getState(): Promise; + + /** + * Update a specific job's data. Promise resolves when the job has been updated. + */ + update(data: any): Promise; + + /** + * Removes a job from the queue and from any lists it may be included in. + * The returned promise resolves when the job has been removed. + */ + remove(): Promise; + + /** + * Re-run a job that has failed. The returned promise resolves when the job + * has been scheduled for retry. + */ + retry(): Promise; + + /** + * Returns a promise that resolves to the returned data when the job has been finished. + * TODO: Add a watchdog to check if the job has finished periodically. + * since pubsub does not give any guarantees. + */ + finished(): Promise; + + /** + * Promotes a job that is currently "delayed" to the "waiting" state and executed as soon as possible. + */ + promote(): Promise; + } + + type JobStatus = 'completed' | 'wait' | 'active' | 'delayed' | 'failed'; + + interface BackoffOptions { + /** + * Backoff type, which can be either `fixed` or `exponential` + */ + type: 'fixed' | 'exponential'; + + /** + * Backoff delay, in milliseconds + */ + delay: number; + } + + interface RepeatOptions { + /** + * Cron pattern specifying when the job should execute + */ + cron: string; + + /** + * Timezone + */ + tz?: string; + + /** + * End date when the repeat job should stop repeating + */ + endDate?: Date | string | number; + } + + interface JobOptions { + /** + * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). + * Note that using priorities has a slight impact on performance, so do not use it if not required + */ + priority?: number; + + /** + * An amount of miliseconds to wait until this job can be processed. + * Note that for accurate delays, both server and clients should have their clocks synchronized. [optional] + */ + delay?: number; + + /** + * The total number of attempts to try the job until it completes + */ + attempts?: number; + + /** + * Repeat job according to a cron specification + */ + repeat?: RepeatOptions; + + /** + * Backoff setting for automatic retries if the job fails + */ + backoff?: number | BackoffOptions; + + /** + * A boolean which, if true, adds the job to the right + * of the queue instead of the left (default false) + */ + lifo?: boolean; + + /** + * The number of milliseconds after which the job should be fail with a timeout error + */ + timeout?: number; + + /** + * Override the job ID - by default, the job ID is a unique + * integer, but you can use this setting to override it. + * If you use this option, it is up to you to ensure the + * jobId is unique. If you attempt to add a job with an id that + * already exists, it will not be added. + */ + jobId?: JobId; + + /** + * A boolean which, if true, removes the job when it successfully completes. + * Default behavior is to keep the job in the completed set. + */ + removeOnComplete?: boolean; + + /** + * A boolean which, if true, removes the job when it fails after all attempts + * Default behavior is to keep the job in the completed set. + */ + removeOnFail?: boolean; + } + + interface JobCounts { + wait: number; + active: number; + completed: number; + failed: number; + delayed: number; + } + + interface JobInformation { + key: string; + name: string; + id?: string; + endDate?: number; + tz?: string; + cron: string; + next: number; + } + + interface Queue { + /** + * Returns a promise that resolves when Redis is connected and the queue is ready to accept jobs. + * This replaces the `ready` event emitted on Queue in previous verisons. + */ + isReady(): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + */ + process(callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + */ + process(callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a named processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * @param name Bull will only call the handler if the job name matches + */ + // tslint:disable-next-line:unified-signatures + process(name: string, callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * @param name Bull will only call the handler if the job name matches + */ + // tslint:disable-next-line:unified-signatures + process(name: string, callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a named processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * @param name Bull will only call the handler if the job name matches + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(name: string, concurrency: number, callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * @param name Bull will only call the handler if the job name matches + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Creates a new job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(data: any, opts?: JobOptions): Promise; + + /** + * Creates a new named job and adds it to the queue. + * If the queue is empty the job will be executed directly, + * otherwise it will be placed in the queue and executed as soon as possible. + */ + add(name: string, data: any, opts?: JobOptions): Promise; + + /** + * Returns a promise that resolves when the queue is paused. + * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. + * A paused queue will not process new jobs until resumed, + * but current jobs being processed will continue until they are finalized. + * + * Pausing a queue that is already paused does nothing. + */ + pause(): Promise; + + /** + * Returns a promise that resolves when the queue is resumed after being paused. + * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * Resuming a queue that is not paused does nothing. + */ + resume(): Promise; + + /** + * Returns a promise that returns the number of jobs in the queue, waiting or paused. + * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. + */ + count(): Promise; + + /** + * Empties a queue deleting all the input lists and associated jobs. + */ + empty(): Promise; + + /** + * Closes the underlying redis client. Use this to perform a graceful shutdown. + * + * `close` can be called from anywhere, with one caveat: + * if called from within a job handler the queue won't close until after the job has been processed + */ + close(): Promise; + + /** + * Returns a promise that will return the job instance associated with the jobId parameter. + * If the specified job cannot be located, the promise callback parameter will be set to null. + */ + getJob(jobId: JobId): Promise; + + /** + * Returns a promise that will return an array with the active jobs between start and end. + */ + getActive(start?: number, end?: number): Promise; + + /** + * Returns a promise that will return an array with the delayed jobs between start and end. + */ + getDelayed(start?: number, end?: number): Promise; + + /** + * Returns a promise that will return an array with the completed jobs between start and end. + */ + getCompleted(start?: number, end?: number): Promise; + + /** + * Returns a promise that will return an array with the failed jobs between start and end. + */ + getFailed(start?: number, end?: number): Promise; + + /** + * Returns JobInformation of repeatable jobs (ordered descending). Provide a start and/or an end + * index to limit the number of results. Start defaults to 0, end to -1 and asc to false. + */ + getRepeatableJobs(start?: number, end?: number, asc?: boolean): Promise; + + /** + * ??? + */ + nextRepeatableJob(name: string, data: any, opts: JobOptions): Promise; + + /** + * Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones + * used for the job when it was added. + */ + removeRepeatable(repeat: RepeatOptions & { jobId?: JobId }): Promise; + + /** + * Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones + * used for the job when it was added. + * + * name: The name of the to be removed job + */ + removeRepeatable(name: string, repeat: RepeatOptions & { jobId?: JobId }): Promise; + + /** + * Returns a promise that resolves with the job counts for the given queue. + */ + getJobCounts(): Promise; + + /** + * Returns a promise that resolves with the quantity of completed jobs. + */ + getCompletedCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of failed jobs. + */ + getFailedCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of delayed jobs. + */ + getDelayedCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of waiting jobs. + */ + getWaitingCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of paused jobs. + */ + getPausedCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of active jobs. + */ + getActiveCount(): Promise; + + /** + * Returns a promise that resolves to the quantity of repeatable jobs. + */ + getRepeatableCount(): Promise; + + /** + * Tells the queue remove all jobs created outside of a grace period in milliseconds. + * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. + * @param grace Grace period in milliseconds. + * @param status Status of the job to clean. Values are completed, wait, active, delayed, and failed. Defaults to completed. + * @param limit Maximum amount of jobs to clean per call. If not provided will clean all matching jobs. + */ + clean(grace: number, status?: JobStatus, limit?: number): Promise; + + /** + * Listens to queue events + */ + on(event: string, callback: (...args: any[]) => void): this; + + /** + * An error occured + */ + on(event: 'error', callback: ErrorEventCallback): this; + + /** + * A job has started. You can use `jobPromise.cancel()` to abort it + */ + on(event: 'active', callback: ActiveEventCallback): this; + + /** + * A job has been marked as stalled. + * This is useful for debugging job workers that crash or pause the event loop. + */ + on(event: 'stalled', callback: StalledEventCallback): this; + + /** + * A job's progress was updated + */ + on(event: 'progress', callback: ProgressEventCallback): this; + + /** + * A job successfully completed with a `result` + */ + on(event: 'completed', callback: CompletedEventCallback): this; + + /** + * A job failed with `err` as the reason + */ + on(event: 'failed', callback: FailedEventCallback): this; + + /** + * The queue has been paused + */ + on(event: 'paused', callback: EventCallback): this; + + /** + * The queue has been resumed + */ + on(event: 'resumed', callback: EventCallback): this; // tslint:disable-line unified-signatures + + /** + * Old jobs have been cleaned from the queue. + * `jobs` is an array of jobs that were removed, and `type` is the type of those jobs. + * + * @see Queue#clean() for details + */ + on(event: 'cleaned', callback: CleanedEventCallback): this; + } + + type EventCallback = () => void; + + type ErrorEventCallback = (error: Error) => void; + + interface JobPromise { + /** + * Abort this job + */ + cancel(): void; + } + + type ActiveEventCallback = (job: Job, jobPromise?: JobPromise) => void; + + type StalledEventCallback = (job: Job) => void; + + type ProgressEventCallback = (job: Job, progress: any) => void; + + type CompletedEventCallback = (job: Job, result: any) => void; + + type FailedEventCallback = (job: Job, error: Error) => void; + + type CleanedEventCallback = (jobs: Job[], status: JobStatus) => void; } export = Bull; diff --git a/types/bull/v2/tslint.json b/types/bull/v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bull/v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bump-regex/bump-regex-tests.ts b/types/bump-regex/bump-regex-tests.ts new file mode 100644 index 0000000000..e7a54ada8e --- /dev/null +++ b/types/bump-regex/bump-regex-tests.ts @@ -0,0 +1,22 @@ +import * as bump from 'bump-regex'; + +bump({}, (err, res) => { + if (err) {} + if (res) { + res.new; + res.prev; + } +}); + +bump('1.0.0', (err, res) => {}); + +bump({type: 'major', str: '1.0.0'}, (err, res) => {}); +bump({type: 'minor', str: '1.0.0'}, (err, res) => {}); +bump({type: 'patch', str: '1.0.0'}, (err, res) => {}); +bump({type: 'prerelease', str: '1.0.0'}, (err, res) => {}); + +bump({regex: /^.+$/, str: '1.0.0'}, (err, res) => {}); + +bump({regex: /^.+$/, global: true, str: '1.0.0'}, (err, res) => {}); + +bump({regex: /^.+$/, case: true, str: '1.0.0'}, (err, res) => {}); diff --git a/types/bump-regex/index.d.ts b/types/bump-regex/index.d.ts new file mode 100644 index 0000000000..47910b9517 --- /dev/null +++ b/types/bump-regex/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for bump-regex 2.9 +// Project: https://github.com/stevelacy/bump-regex +// Definitions by: silkentrance +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function BumpRegex(opts: string|BumpRegex.Options, cb: BumpRegex.Callback): any; + +declare namespace BumpRegex { + type Callback = (err: string|Error|null, opts?: Result) => void; + + interface Options { + key?: string; + type?: 'major' | 'minor' | 'patch' | 'prerelease'; + case?: boolean; + keys?: string[]; + global?: boolean; + version?: string; + preid?: string; + regex?: RegExp; + str?: string; + } + + interface Result extends Options { + prev: string; + new: string; + } +} + +export = BumpRegex; diff --git a/types/bump-regex/tsconfig.json b/types/bump-regex/tsconfig.json new file mode 100644 index 0000000000..001effea6a --- /dev/null +++ b/types/bump-regex/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", + "bump-regex-tests.ts" + ] +} diff --git a/types/bump-regex/tslint.json b/types/bump-regex/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/bump-regex/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/bunnymq/index.d.ts b/types/bunnymq/index.d.ts index c4c0a770e1..1adb125697 100644 --- a/types/bunnymq/index.d.ts +++ b/types/bunnymq/index.d.ts @@ -17,8 +17,8 @@ declare namespace bunnymq { /** * Handle messages from a named queue. * - * @param {string} queue A named queue. - * @param {ConsumerCallback} callback A callback. + * @param queue A named queue. + * @param callback A callback. */ consume(queue: string, callback: ConsumerCallback): void; } @@ -31,16 +31,15 @@ declare namespace bunnymq { /** * Subscriber to handle messages from a named queue. * - * @param {string} queue A named queue. - * @param {ConsumerCallback} callback A callback. + * @param queue A named queue. + * @param callback A callback. */ subscribe(queueName: string, callback: ConsumerCallback): void; /** * Publisher to send messages to a named queue. * - * @type {Producer} - * @return {Promise} The consumer response. + * @return The consumer response. */ publish(queueName: string, message: any, options?: ProducerOptions): Promise; } @@ -61,14 +60,12 @@ declare namespace bunnymq { /** * Number of fetched messages at once on the channel. * - * @type {number} */ prefetch?: number; /** * Requeue put back message into the broker if consumer crashes/trigger exception. * - * @type {boolean} */ requeue?: boolean; rpcTimeout?: number; @@ -80,9 +77,9 @@ declare namespace bunnymq { /** * Send messages to a named queue. * - * @param {string} queue A named queue. - * @param {any} message A message. - * @return {Promise} The consumer response. + * @param queue A named queue. + * @param message A message. + * @return The consumer response. */ produce(queue: string, message: any, options?: ProducerOptions): Promise; } diff --git a/types/bunyan-blackhole/index.d.ts b/types/bunyan-blackhole/index.d.ts index f8be6fc730..80b4a33fcf 100644 --- a/types/bunyan-blackhole/index.d.ts +++ b/types/bunyan-blackhole/index.d.ts @@ -2,13 +2,14 @@ // Project: https://github.com/Floby/node-bunyan-blackhole // Definitions by: Olivier Chevet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as Logger from "bunyan"; /** * Constructor. - * @param {string} [name] name of the blackhole Logger - * @return {Logger} A bunyan logger . + * @param name name of the blackhole Logger + * @return A bunyan logger . */ declare function bunyanBlackHole(name: string): Logger; export = bunyanBlackHole; diff --git a/types/bunyan-bugsnag/index.d.ts b/types/bunyan-bugsnag/index.d.ts index 9716238aab..06e13714b7 100644 --- a/types/bunyan-bugsnag/index.d.ts +++ b/types/bunyan-bugsnag/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/marnusw/bunyan-bugsnag // Definitions by: Pasi Eronen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as Logger from 'bunyan'; diff --git a/types/bunyan-config/tslint.json b/types/bunyan-config/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bunyan-config/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bunyan-format/bunyan-format-tests.ts b/types/bunyan-format/bunyan-format-tests.ts new file mode 100644 index 0000000000..3f4c2a658d --- /dev/null +++ b/types/bunyan-format/bunyan-format-tests.ts @@ -0,0 +1,5 @@ +import BunyanFormatWritable = require('bunyan-format'); + +const formatOut = new BunyanFormatWritable({ outputMode: 'short' }); + +const formatOut2 = new BunyanFormatWritable({ outputMode: 'bunyan', levelInString: true }); diff --git a/types/bunyan-format/index.d.ts b/types/bunyan-format/index.d.ts new file mode 100644 index 0000000000..06a37ba2e5 --- /dev/null +++ b/types/bunyan-format/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for bunyan-format 0.2 +// Project: https://github.com/thlorenz/bunyan-format +// Definitions by: Piotr Roszatycki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { Writable } from 'stream'; + +declare namespace BunyanFormatWritable { + interface ColorFromLevel { + [level: number]: string; + } + + interface Options { + outputMode?: 'short' | 'long' | 'simple' | 'json' | 'bunyan'; + color?: boolean; + colorFromLevel?: ColorFromLevel; + levelInString?: boolean; + jsonIndent?: string | number; + } +} + +declare class BunyanFormatWritable extends Writable { + /** Creates a writable stream that formats bunyan records written to it. */ + constructor(options: BunyanFormatWritable.Options, output?: Writable); +} + +export = BunyanFormatWritable; diff --git a/types/bunyan-format/tsconfig.json b/types/bunyan-format/tsconfig.json new file mode 100644 index 0000000000..c26359cdb6 --- /dev/null +++ b/types/bunyan-format/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", + "bunyan-format-tests.ts" + ] +} diff --git a/types/react-native-elements/tslint.json b/types/bunyan-format/tslint.json similarity index 100% rename from types/react-native-elements/tslint.json rename to types/bunyan-format/tslint.json diff --git a/types/bunyan-logentries/tslint.json b/types/bunyan-logentries/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bunyan-logentries/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bunyan-prettystream/tslint.json b/types/bunyan-prettystream/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bunyan-prettystream/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bunyan-winston-adapter/index.d.ts b/types/bunyan-winston-adapter/index.d.ts index e0c4f835d9..6798b8f1c9 100644 --- a/types/bunyan-winston-adapter/index.d.ts +++ b/types/bunyan-winston-adapter/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/gluwer/bunyan-winston-adapter // Definitions by: Steve Hipwell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as bunyan from "bunyan"; import { LoggerInstance } from "winston"; diff --git a/types/bunyan/index.d.ts b/types/bunyan/index.d.ts index 0a0c648220..4ee972d29c 100644 --- a/types/bunyan/index.d.ts +++ b/types/bunyan/index.d.ts @@ -24,8 +24,6 @@ declare class Logger extends EventEmitter { fields: any; src: boolean; - /* tslint:disable:unified-signatures */ - /** * Returns a boolean: is the `trace` level enabled? * @@ -199,8 +197,6 @@ declare class Logger extends EventEmitter { * Uses `util.format` for msg formatting. */ fatal(format: any, ...params: any[]): void; - - /* tslint:enable:unified-signatures */ } declare namespace Logger { diff --git a/types/bunyan/tslint.json b/types/bunyan/tslint.json index 09f94cd344..2204f23ff3 100644 --- a/types/bunyan/tslint.json +++ b/types/bunyan/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // ban-types needs to be disabled to support TypeScript <2.2 - "ban-types": false + "ban-types": false, + "unified-signatures": false } } diff --git a/types/busboy/tslint.json b/types/busboy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/busboy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/business-rules-engine/index.d.ts b/types/business-rules-engine/index.d.ts index a74bcf180d..d85cd49c81 100644 --- a/types/business-rules-engine/index.d.ts +++ b/types/business-rules-engine/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rsamec/form // Definitions by: Roman Samec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Source: typings/business-rules-engine/Validation.d.ts diff --git a/types/business-rules-engine/package.json b/types/business-rules-engine/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/business-rules-engine/package.json +++ b/types/business-rules-engine/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/business-rules-engine/tslint.json b/types/business-rules-engine/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/business-rules-engine/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bwip-js/tslint.json b/types/bwip-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bwip-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/byline/tslint.json b/types/byline/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/byline/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bytebuffer/index.d.ts b/types/bytebuffer/index.d.ts index 8456f28182..fca26b439f 100644 --- a/types/bytebuffer/index.d.ts +++ b/types/bytebuffer/index.d.ts @@ -120,12 +120,17 @@ declare class ByteBuffer /** * Calculates the number of UTF8 bytes of a string. */ - static calculateUTF8Byte( str: string ): number; + static calculateUTF8Bytes( str: string ): number; /** * Calculates the number of UTF8 characters of a string.JavaScript itself uses UTF- 16, so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF. */ - static calculateUTF8Char( str: string ): number; + static calculateUTF8Chars( str: string ): number; + + /** + * Calculates the number of UTF8 bytes of a string. This is an alias of ByteBuffer#calculateUTF8Bytes. + */ + static calculateString( str: string ): number; /** * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer. @@ -409,7 +414,7 @@ declare class ByteBuffer /** * Reads a zig-zag encoded 32bit base 128 variable-length integer. */ - readVarint32ZiZag( offset?: number ): number; + readVarint32ZigZag( offset?: number ): number; /** * Reads a 64bit base 128 variable-length integer. Requires Long.js. diff --git a/types/bytebuffer/tslint.json b/types/bytebuffer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bytebuffer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bytes/tslint.json b/types/bytes/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bytes/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/c3/c3-tests.ts b/types/c3/c3-tests.ts index 509678636b..8ac8a4b93e 100644 --- a/types/c3/c3-tests.ts +++ b/types/c3/c3-tests.ts @@ -619,7 +619,8 @@ function chart_bar() { width: { ratio: 0.5, // this makes bar width 50% of length between ticks max: 50 // this limits maximum width of bar to 50px - } + }, + space: 10 // this adds space between bars in bar charts // or // width: 100 // this makes bar width 100px } diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 00d1cf1840..96ecc8c488 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -8,1107 +8,1106 @@ import * as d3 from "d3"; -/* tslint:disable:export-just-namespace */ - -export = c3; export as namespace c3; -declare namespace c3 { - type PrimitiveArray = Array; - type FormatFunction = (v: any, id: string, i: number, j: number) => void; +export type PrimitiveArray = Array; +export type FormatFunction = (v: any, id: string, i: number, j: number) => void; - interface TargetIds { - ids: ArrayOrString; - } +export interface TargetIds { + ids: ArrayOrString; +} - type ArrayOrString = string[] | string; +export type ArrayOrString = string[] | string; - interface ChartConfiguration { +export interface ChartConfiguration { + /** + * The CSS selector or the element which the chart will be set to. D3 selection object can be specified. If other chart is set already, it will be replaced with the new one (only one chart + * can be set in one element). + * If this option is not specified, the chart will be generated but not be set. Instead, we can access the element by chart.element and set it by ourselves. + * Note: When chart is not binded, c3 starts observing if chart.element is binded by MutationObserver. In this case, polyfill is required in IE9 and IE10 becuase they do not support + * MutationObserver. On the other hand, if chart always will be binded, polyfill will not be required because MutationObserver will never be called. + */ + bindto?: string | HTMLElement | d3.Selection | null; + size?: { /** - * The CSS selector or the element which the chart will be set to. D3 selection object can be specified. If other chart is set already, it will be replaced with the new one (only one chart - * can be set in one element). - * If this option is not specified, the chart will be generated but not be set. Instead, we can access the element by chart.element and set it by ourselves. - * Note: When chart is not binded, c3 starts observing if chart.element is binded by MutationObserver. In this case, polyfill is required in IE9 and IE10 becuase they do not support - * MutationObserver. On the other hand, if chart always will be binded, polyfill will not be required because MutationObserver will never be called. + * The desired width of the chart element. + * If this option is not specified, the width of the chart will be calculated by the size of the parent element it's appended to. + * Note: This option should be specified if possible because it can improve its performance because some size calculations will be skipped by an explicit value. */ - bindto?: string | HTMLElement | d3.Selection | null; - size?: { - /** - * The desired width of the chart element. - * If this option is not specified, the width of the chart will be calculated by the size of the parent element it's appended to. - * Note: This option should be specified if possible because it can improve its performance because some size calculations will be skipped by an explicit value. - */ - width?: number; - /** - * The desired height of the chart element. - * If this option is not specified, the height of the chart will be calculated by the size of the parent element it's appended to. - */ - height?: number; - }; - - padding?: { - /** - * The padding on the top of the chart. - */ - top?: number; - /** - * The padding on the right of the chart. - */ - right?: number; - /** - * The padding on the bottom of the chart. - */ - bottom?: number; - /** - * The padding on the left of the chart. - */ - left?: number; - }; - - color?: { - /** - * Set custom color pattern. - */ - pattern?: string[]; - threshold?: any; // Undocumented - }; - - interaction?: { - /** - * Indicate if the chart should have interactions. - * If false is set, all of interactions (showing/hiding tooltip, selection, mouse events, etc) will be disabled. - */ - enabled?: boolean; - }; - - transition?: { - /** - * Set duration of transition (in milliseconds) for chart animation. - * Note: If 0 or null set, transition will be skipped. So, this makes initial rendering faster especially in case you have a lot of data. - */ - duration?: number; - }; - + width?: number; /** - * Set a callback to execute when the chart is initialized. - */ - oninit?(): void; - - /** - * Set a callback which is executed when the chart is rendered. Basically, this callback will be called in each time when the chart is redrawed. - */ - onrendered?(): void; - - /** - * Set a callback to execute when mouse enters the chart. - */ - onmouseover?(): void; - - /** - * Set a callback to execute when mouse leaves the chart. - */ - onmouseout?(): void; - - /** - * Set a callback to execute when user resizes the screen. - */ - onresize?(): void; - - /** - * Set a callback to execute when screen resize finished. - */ - onresized?(): void; - - data: Data; - - axis?: Axis; - - grid?: Grid; - - /** - * Show rectangles inside the chart. - * This option accepts array including object that has axis, start, end and class. The keys start, end and class are optional. - * axis must be x, y or y2. start and end should be the value where regions start and end. If not specified, the edge values will be used. If timeseries x axis, date string, Date object and - * unixtime integer can be used. If class is set, the region element will have it as class. - */ - regions?: RegionOptions[]; - - legend?: LegendOptions; - - tooltip?: TooltipOptions; - - subchart?: SubchartOptions; - - zoom?: ZoomOptions; - - point?: PointOptions; - - line?: { - /** - * Set if null data point will be connected or not. - * If true set, the region of null data will be connected without any data point. If false set, the region of null data will not be connected and get empty. - */ - connectNull?: boolean; - /** - * Change step type for step chart. 'step', 'step-before' and 'step-after' can be used. - */ - step?: { - type: string; - }; - }; - - area?: { - /** - * Set if min or max value will be 0 on area chart. - */ - zerobased?: boolean; - }; - - bar?: { - /** - * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio. - */ - width?: number | { - /** - * Set the width of each bar by ratio - */ - ratio: number, - /** - * Set max width of each bar - */ - max?: number - }; - /** - * Set if min or max value will be 0 on bar chart. - */ - zerobased?: boolean; - }; - - pie?: { - label?: { - /** - * Show or hide label on each pie piece. - */ - show?: boolean; - /** - * Set formatter for the label on each pie piece. - */ - format?(value: number, ratio: number, id: string): string; - /** - * Set threshold to show/hide labels. - */ - threshold?: number - }; - /** - * Enable or disable expanding pie pieces. - */ - expand?: boolean; - }; - - donut?: { - label?: { - /** - * Show or hide label on each donut piece. - */ - show?: boolean; - /** - * Set formatter for the label on each donut piece. - */ - format?(value: number, ratio: number, id: string): string; - /** - * Set threshold to show/hide labels. - */ - threshold?: number - }; - /** - * Enable or disable expanding pie pieces. - */ - expand?: boolean; - /** - * Set width of donut chart. - */ - width?: number; - /** - * Set title of donut chart. - */ - title?: string; - }; - - gauge?: { - label?: { - /** - * Show or hide label on gauge. - */ - show?: boolean; - /** - * Set formatter for the label on gauge. - */ - format?(value: any, ratio: number): string; - }; - /** - * Enable or disable expanding gauge. - */ - expand?: boolean; - /** - * Set min value of the gauge. - */ - min?: number; - /** - * Set max value of the gauge. - */ - max?: number; - /** - * Set units of the gauge. - */ - units?: string; - /** - * Set width of gauge chart. - */ - width?: number; - }; - - spline?: { - interpolation?: { - /** - * Set custom spline interpolation - */ - type?: 'linear' | 'linear-closed' | 'basis' | 'basis-open' | 'basis-closed' | 'bundle' | 'cardinal' | 'cardinal-open' | 'cardinal-closed' | 'monotone'; - }; - }; - } - - interface Data { - /** - * Load a CSV or JSON file from a URL. Note that this will not work if loading via the "file://" protocol as most browsers with block XMLHTTPRequests. - */ - url?: string; - /** - * Parse a JSON object for data. - */ - json?: {}; - /** - * Load data from a multidimensional array, with the first element containing the data names, the following containing related data in that order. - */ - rows?: PrimitiveArray[]; - /* - * Load data from a multidimensional array, with each element containing an array consisting of a datum name and associated data values. - */ - columns?: PrimitiveArray[]; - /** - * Used if loading JSON via data.url - */ - mimeType?: string; - /** - * Choose which JSON object keys correspond to desired data. - */ - keys?: { x?: string; value: string[]; }; - /** - * Specify the key of x values in the data. - * We can show the data with non-index x values by this option. This option is required when the type of x axis is timeseries. If this option is set on category axis, the values of the data - * on the key will be used for category names. - */ - x?: string; - /** - * Specify the keys of the x values for each data. - * This option can be used if we want to show the data that has different x values. - */ - xs?: { [key: string]: string }; - /** - * Set a format to parse string specifed as x. - * Default is %Y-%m-%d - */ - xFormat?: string; - // xLocaltime?: any; - // xSort?: any; - /** - * Set custom data name. - */ - names?: { [key: string]: string }; - /** - * Set custom data class. - * If this option is specified, the element g for the data has an additional class that has the prefix c3-target- (e.g. c3-target-additional-data1-class). - */ - classes?: { [key: string]: string }; - /** - * Set groups for the data for stacking. - */ - groups?: string[][]; - /** - * Set y axis the data related to. y and y2 can be used. - */ - axes?: { [key: string]: string }; - /** - * Set chart type at once. - * If this option is specified, the type will be applied to every data. This setting can be overwritten by data.types. - * Available Values: line, spline, step, area, area-spline, area-step, bar, scatter, pie, donut, gauge - */ - type?: string; - /** - * Set chart type for each data. - * This setting overwrites data.type setting. - */ - types?: { [key: string]: string }; - /** - * Show labels on each data points or set formatter function for data labels. - * The formatter function receives 4 arguments such as v, id, i, j and it must return a string that will be shown as the label. The arguments are: - * - v is the value of the data point where the label is shown. - * - id is the id of the data where the label is shown. - * - i is the index of the data point where the label is shown. - * - j is the sub index of the data point where the label is shown. - * Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (e.g. d3.format('$')) - */ - labels?: boolean | - { format: FormatFunction } | - { format: { [key: string]: FormatFunction } }; - /** - * Define the order of the data. - * This option changes the order of stacking the data and pieces of pie/donut. If null specified, it will be the order the data loaded. If function specified, it will be used to sort the data - * and it will recieve the data as argument. - * Available Values: desc, asc, function (data1, data2) { ... }, null - */ - order?: string | ((...data: string[]) => void); - /** - * Define regions for each data. - * The values must be an array for each data and it should include an object that has start, end, style. If start is not set, the start will be the first data point. If end is not set, the - * end will be the last data point. - * Currently this option supports only line chart and dashed style. If this option specified, the line will be dashed only in the regions. - */ - regions?: { [key: string]: any }; - /** - * Set color converter function. - * This option should a function and the specified function receives color (e.g. '#ff0000') and d that has data parameters like id, value, index, etc. And it must return a string that - * represents color (e.g. '#00ff00'). - */ - color?(color: string, d: any): string | d3.Rgb; - /** - * Set color for each data. - */ - colors?: { [key: string]: string | d3.Rgb | ((d: any) => string | d3.Rgb) }; - /** - * Hide each data when the chart appears. - * If true specified, all of data will be hidden. If multiple ids specified as an array, those will be hidden. - */ - hide?: boolean | string[]; - /** - * Set text displayed when empty data. - */ - empty?: { label: { text: string } }; - - selection?: { - enabled?: boolean; - grouped?: boolean; - multiple?: boolean; - draggable?: boolean; - isselectable?(d?: any): boolean; - }; - /** - * Set a callback for click event on each data point. - * This callback will be called when each data point clicked and will receive d and element as the arguments. - * - d is the data clicked and element is the element clicked. In this callback, this will be the Chart object. - */ - onclick?(d: any, element: any): void; - /** - * Set a callback for mouseover event on each data point. - * This callback will be called when mouse cursor moves onto each data point and will receive d as the argument. - * - d is the data where mouse cursor moves onto. In this callback, this will be the Chart object. - */ - onmouseover?(d: any, element?: any): void; - /** - * Set a callback for mouseout event on each data point. - * This callback will be called when mouse cursor moves out each data point and will receive d as the argument. - * - d is the data where mouse cursor moves out. In this callback, this will be the Chart object. - */ - onmouseout?(d: any, element?: any): void; - - onselected?(d: any, element?: any): void; - - onunselected?(d: any, element?: any): void; - } - - interface Axis { - /** - * Switch x and y axis position. - */ - rotated?: boolean; - x?: XAxisConfiguration; - y?: YAxisConfiguration; - y2?: YAxisConfiguration; - } - - interface XAxisConfiguration { - /** - * Show or hide x axis. - */ - show?: boolean; - /** - * Set type of x axis (timeseries, category, indexed) - */ - type?: string; - /** - * Set how to treat the timezone of x values. - * If true, treat x value as localtime. If false, convert to UTC internally. - */ - localtime?: boolean; - /** - * Set category names on category axis. - * This must be an array that includes category names in string. If category names are included in the date by data.x option, this is not required. - */ - categories?: string[]; - - tick?: XTickConfiguration; - /** - * Set max value of x axis range. - */ - max?: number; - /** - * Set min value of x axis range. - */ - min?: number; - /** - * Set padding for x axis. - * If this option is set, the range of x axis will increase/decrease according to the values. If no padding is needed in the ragen of x axis, 0 should be set. On category axis, this option - * will be ignored. - */ - padding?: { - left?: number; - right?: number; - }; - /** - * Set height of x axis. - * The height of x axis can be set manually by this option. If you need more space for x axis, please use this option for that. The unit is pixel. + * The desired height of the chart element. + * If this option is not specified, the height of the chart will be calculated by the size of the parent element it's appended to. */ height?: number; - /** - * Set default extent for subchart and zoom. This can be an array or function that returns an array. - */ - extent?: number[] | (() => number[]); - /** - * Set label on x axis. - * You can set x axis label and change its position by this option. string and object can be passed and we can change the poisiton by passing object that has position key. Available position - * differs according to the axis direction (vertical or horizontal). If string set, the position will be the default. - * Valid horizontal positions: inner-right (Default), inner-center, inner-left, outer-right, outer-center, outer-left - * Valid vertical positions: inner-top, inner-middle, inner-bottom, outer-top, outer-middle, outer-bottom - */ - label?: string | { text: string; position: string }; - } + }; - interface YAxisConfiguration { + padding?: { /** - * Show or hide y axis. + * The padding on the top of the chart. */ - show?: boolean; + top?: number; /** - * Show y axis inside of the chart. + * The padding on the right of the chart. */ - inner?: boolean; + right?: number; /** - * Set max value of y axis. + * The padding on the bottom of the chart. */ - max?: number; + bottom?: number; /** - * Set min value of y axis. + * The padding on the left of the chart. + */ + left?: number; + }; + + color?: { + /** + * Set custom color pattern. + */ + pattern?: string[]; + threshold?: any; // Undocumented + }; + + interaction?: { + /** + * Indicate if the chart should have interactions. + * If false is set, all of interactions (showing/hiding tooltip, selection, mouse events, etc) will be disabled. + */ + enabled?: boolean; + }; + + transition?: { + /** + * Set duration of transition (in milliseconds) for chart animation. + * Note: If 0 or null set, transition will be skipped. So, this makes initial rendering faster especially in case you have a lot of data. + */ + duration?: number; + }; + + /** + * Set a callback to execute when the chart is initialized. + */ + oninit?(): void; + + /** + * Set a callback which is executed when the chart is rendered. Basically, this callback will be called in each time when the chart is redrawed. + */ + onrendered?(): void; + + /** + * Set a callback to execute when mouse enters the chart. + */ + onmouseover?(): void; + + /** + * Set a callback to execute when mouse leaves the chart. + */ + onmouseout?(): void; + + /** + * Set a callback to execute when user resizes the screen. + */ + onresize?(): void; + + /** + * Set a callback to execute when screen resize finished. + */ + onresized?(): void; + + data: Data; + + axis?: Axis; + + grid?: Grid; + + /** + * Show rectangles inside the chart. + * This option accepts array including object that has axis, start, end and class. The keys start, end and class are optional. + * axis must be x, y or y2. start and end should be the value where regions start and end. If not specified, the edge values will be used. If timeseries x axis, date string, Date object and + * unixtime integer can be used. If class is set, the region element will have it as class. + */ + regions?: RegionOptions[]; + + legend?: LegendOptions; + + tooltip?: TooltipOptions; + + subchart?: SubchartOptions; + + zoom?: ZoomOptions; + + point?: PointOptions; + + line?: { + /** + * Set if null data point will be connected or not. + * If true set, the region of null data will be connected without any data point. If false set, the region of null data will not be connected and get empty. + */ + connectNull?: boolean; + /** + * Change step type for step chart. 'step', 'step-before' and 'step-after' can be used. + */ + step?: { + type: string; + }; + }; + + area?: { + /** + * Set if min or max value will be 0 on area chart. + */ + zerobased?: boolean; + }; + + bar?: { + /** + * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio. + */ + width?: number | { + /** + * Set the width of each bar by ratio + */ + ratio: number, + /** + * Set max width of each bar + */ + max?: number + }; + /** + * Set if min or max value will be 0 on bar chart. + */ + zerobased?: boolean; + /** + * Set space between bars in bar charts + */ + space?: number; + }; + + pie?: { + label?: { + /** + * Show or hide label on each pie piece. + */ + show?: boolean; + /** + * Set formatter for the label on each pie piece. + */ + format?(value: number, ratio: number, id: string): string; + /** + * Set threshold to show/hide labels. + */ + threshold?: number + }; + /** + * Enable or disable expanding pie pieces. + */ + expand?: boolean; + }; + + donut?: { + label?: { + /** + * Show or hide label on each donut piece. + */ + show?: boolean; + /** + * Set formatter for the label on each donut piece. + */ + format?(value: number, ratio: number, id: string): string; + /** + * Set threshold to show/hide labels. + */ + threshold?: number + }; + /** + * Enable or disable expanding pie pieces. + */ + expand?: boolean; + /** + * Set width of donut chart. + */ + width?: number; + /** + * Set title of donut chart. + */ + title?: string; + }; + + gauge?: { + label?: { + /** + * Show or hide label on gauge. + */ + show?: boolean; + /** + * Set formatter for the label on gauge. + */ + format?(value: any, ratio: number): string; + }; + /** + * Enable or disable expanding gauge. + */ + expand?: boolean; + /** + * Set min value of the gauge. */ min?: number; /** - * Change the direction of y axis. - * If true set, the direction will be from the top to the bottom. + * Set max value of the gauge. */ - inverted?: boolean; + max?: number; /** - * Set center value of y axis. + * Set units of the gauge. */ - center?: number; + units?: string; /** - * Set label on y axis. This option works in the same way as axis.x.label. - * Valid horizontal positions: inner-right (Default), inner-center, inner-left, outer-right, outer-center, outer-left - * Valid vertical positions: inner-top, inner-middle, inner-bottom, outer-top, outer-middle, outer-bottom + * Set width of gauge chart. */ - label?: string | { text: string; position: string }; - tick?: YTickConfiguration; - /** - * Set padding for y axis. - * You can set padding for y axis to create more space on the edge of the axis. This option accepts object and it can include top and bottom. top, bottom will be treated as pixels. - */ - padding?: { - top?: number; - bottom?: number; + width?: number; + }; + + spline?: { + interpolation?: { + /** + * Set custom spline interpolation + */ + type?: 'linear' | 'linear-closed' | 'basis' | 'basis-open' | 'basis-closed' | 'bundle' | 'cardinal' | 'cardinal-open' | 'cardinal-closed' | 'monotone'; }; - /** - * Set default range of y axis. This option set the default value for y axis when there is no data on init. - */ - default?: number[]; - } - - interface XTickConfiguration { - /** - * Centerise ticks on category axis - */ - centered?: boolean; - /** - * A function to format tick value. Format string is also available for timeseries data. - */ - format?: string | ((x: number | Date) => string | number); - /** - * Setting for culling ticks. - * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown. - */ - culling?: boolean | CullingConfiguration; - /** - * The number of x axis ticks to show. - * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will - * have rough second value). - */ - count?: number; - /** - * Fit x axis ticks. - * If true set, the ticks will be positioned nicely. If false set, the ticks will be positioned according to x value of the data points. - */ - fit?: boolean; - /** - * Set the x values of ticks manually. - * If this option is provided, the position of the ticks will be determined based on those values. This option works with timeseries data and the x values will be parsed accoding to the type - * of the value and data.xFormat option. - */ - values?: number[] | string[]; - /** - * Rotate x axis tick text. If you set negative value, it will rotate to opposite direction. - */ - rotate?: number; - /** - * Show x axis outer tick. - */ - outer?: boolean; - multiline?: boolean; // Undocumented - } - - interface YTickConfiguration { - /** - * Set formatter for y axis tick text. - * This option accepts d3.format object as well as a function you define. - */ - format?(x: number): string; - /** - * Show or hide outer tick. - */ - outer?: boolean; - /** - * Set the y values of ticks manually. - */ - values?: number[]; - /** - * The number of y axis ticks to show. - * The position of the ticks will be calculated precisely, so the values on the ticks will not be rounded nicely. In the case, axis.y.tick.format or axis.y.tick.values will be helpful. - */ - count?: number; - } - - interface CullingConfiguration { - /** - * The number of tick texts will be adjusted to less than this value. - */ - max: number; - } - - interface Grid { - x?: { - /** - * Show grids along x axis. - */ - show?: boolean; - /** - * Show additional grid lines along x axis. - * This option accepts array including object that has value, text, position and class. text, position and class are optional. For position, start, middle and end (default) are available. - * If x axis is category axis, value can be category name. If x axis is timeseries axis, value can be date string, Date object and unixtime integer. - */ - lines?: LineOptions[]; - }; - y?: { - /** - * Show grids along y axis. - */ - show?: boolean; - /** - * Show additional grid lines along y axis. - * This option accepts array including object that has value, text, position and class. - */ - lines?: LineOptions[]; - }; - } - - interface LineOptions { - value: number; - text?: string; - axis?: string; - position?: string; - class?: string; - } - - interface RegionOptions { - axis?: string; - start?: string | number | Date; - end?: string | number | Date; - class?: string; - } - - interface LegendOptions { - /** - * Show or hide legend. - */ - show?: boolean; - /** - * Hide legend - * If true given, all legend will be hidden. If string or array given, only the legend that has the id will be hidden. - */ - hide?: boolean | ArrayOrString; - /** - * Change the position of legend. - * Currently bottom, right and inset are supported. - */ - position?: string; - /** - * Change inset legend attributes. - * This option accepts object that has the keys anchor, x, y and step. - * anchor decides the position of the legend. These anchors are available: top-left, top-right, bottom-left, bottom-right - * x and y set the position of the legend based on the anchor. - * step defines the max step the lagend has (e.g. If 2 set and legend has 3 legend item, the legend 2 columns). - */ - inset?: { - anchor?: string; - x?: number; - y?: number; - step?: number; - }; - - item?: { - /** - * Set click event handler to the legend item. - */ - onclick?(id: any): void; - /** - * Set mouseover event handler to the legend item. - */ - onmouseover?(id: any): void; - /** - * Set mouseout event handler to the legend item. - */ - onmouseout?(id: any): void; - }; - } - - interface TooltipOptions { - /** - * Show or hide tooltip. - */ - show?: boolean; - /** - * Set if tooltip is grouped or not for the data points. - */ - grouped?: boolean; - format?: { - /** - * Set format for the title of tooltip. Specified function receives x of the data point to show. - */ - title?(x: any): string; - /** - * Set format for the name of each data in tooltip. Specified function receives name, ratio, id and index of the data point to show. ratio will be undefined if the chart is not - * donut/pie/gauge. - */ - name?(name: string, ratio: number, id: string, index: number): string; - /** - * Set format for the value of each data in tooltip. - * Specified function receives name, ratio, id and index of the data point to show. ratio will be undefined if the chart is not donut/pie/gauge. - * If undefined returned, the row of that value will be skipped. - */ - value?(value: any, ratio: number, id: string, index: number): string; - }; - /** - * Set custom position for the tooltip. This option can be used to modify the tooltip position by returning object that has top and left. - */ - position?(data: any, width: number, height: number, element: any): { top: number; left: number }; - /** - * Set custom HTML for the tooltip. - * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points. - */ - contents?(data: any, defaultTitleFormat: string, defaultValueFormat: string, color: any): string; - } - - interface SubchartOptions { - /** - * Show sub chart on the bottom of the chart. - */ - show?: boolean; - size?: { - /** - * Change the height of the subchart. - */ - height: number; - }; - /** - * Set callback for brush event. - * Specified function receives the current zoomed x domain. - */ - onbrush?(domain: any): void; - } - - interface ZoomOptions { - /** - * Enable zooming. - */ - enabled?: boolean; - /** - * Enable to rescale after zooming. If true set, y domain will be updated according to the zoomed region. - */ - rescale?: boolean; - /** - * Change zoom extent. - */ - extent?: [number, number]; - /** - * Set callback that is called when the chart is zooming. Specified function receives the zoomed domain. - */ - onzoom?(domain: any): void; - /** - * Set callback that is called when zooming starts. Specified function receives the zoom event. - */ - onzoomstart?(event: Event): void; - /** - * Set callback that is called when zooming ends. Specified function receives the zoomed domain. - */ - onzoomend?(domain: any): void; - } - - interface PointOptions { - /** - * Whether to show each point in line. - */ - show?: boolean; - /** - * The radius size of each point. - */ - r?: number | ((d: any) => number); - - focus?: { - expand: { - /** - * Whether to expand each point on focus. - */ - enabled?: boolean; - /** - * The radius size of each point on focus. - */ - r?: number - }; - }; - - select?: { - /** - * The radius size of each point on selected. - */ - r?: number; - }; - } - - interface ChartAPI { - /** - * This API highlights specified targets and fade out the others. - * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be highlighted. - */ - focus(targetIds?: ArrayOrString): void; - /** - * This API fades out specified targets and reverts the others. - * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be faded out. - */ - defocus(targetIds?: ArrayOrString): void; - /** - * This API reverts specified targets. - * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be reverted. - */ - revert(targetIds?: ArrayOrString): void; - - /** - * This API shows specified targets. - * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be shown. - * If withLegend is set true, legend will be shown together with the specified data. - */ - show(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; - /** - * This API hides specified targets. - * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be hidden. - * If withLegend is set true, legend will be hidden together with the specified data. - */ - hide(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; - /** - * This API toggles (shows or hides) specified targets. - * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles. - * If withLegend is set true, legend will be toggled together with the specified data. - */ - toggle(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; - /** - * Load data to the chart. - * If url, json, rows and columns given, the data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added. - * If classes given, the classes specifed by data.classes will be updated. classes must be Object that has target id as keys. - * If categories given, the categories specifed by axis.x.categories or data.x will be updated. categories must be Array. - * If axes given, the axes specifed by data.axes will be updated. axes must be Object that has target id as keys. - * If colors given, the colors specifed by data.colors will be updated. colors must be Object that has target id as keys. - * If type or types given, the type of targets will be updated. type must be String and types must be Object. - * If unload given, data will be unloaded before loading new data. If true given, all of data will be unloaded. If target ids given as String or Array, specified targets will be unloaded. - * If done given, the specified function will be called after data loded. - * NOTE: unload should be used if some data needs to be unloaded simultaneously. If you call unload API soon after/before load instead of unload param, chart will not be rendered properly - * because of cancel of animation. - * NOTE: done will be called after data loaded, but it's not after rendering. It's because rendering will finish after some transition and there is some time lag between loading and rendering. - */ - load(args: { - url?: string; - json?: {}; - keys?: { x?: string; value: string[]; } - rows?: PrimitiveArray[]; - columns?: PrimitiveArray[]; - names?: { [key: string]: string }; - classes?: { [key: string]: string }; - categories?: string[]; - axes?: { [key: string]: string }; - colors?: { [key: string]: string | d3.Rgb }; - type?: string; - types?: { [key: string]: string }; - unload?: boolean | ArrayOrString; - done?(): any; - }): void; - /** - * Unload data to the chart. - * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles. - * If ids given, the data that has specified target id will be unloaded. ids should be String or Array. If ids is not specified, all data will be unloaded. - * If done given, the specified function will be called after data loded. - * NOTE: If you call load API soon after/before unload, unload param of load should be used. Otherwise chart will not be rendered properly because of cancel of animation. - * NOTE: done will be called after data loaded, but it's not after rendering. It's because rendering will finish after some transition and there is some time lag between loading and rendering. - */ - unload(targetIds?: TargetIds, done?: () => any): any; - /** - * Flow data to the chart. By this API, you can append new data points to the chart. - * If json, rows and columns given, the data will be loaded. If data that has the same target id is given, the chart will be appended. Otherwise, new target will be added. One of these is - * required when calling. If json specified, keys is required as well as data.json - * If to is given, the lower x edge will move to that point. If not given, the lower x edge will move by the number of given data points. - * If length is given, the lower x edge will move by the number of this argument. - * If duration is given, the duration of the transition will be specified value. If not given, transition.duration will be used as default. - * If done is given, the specified function will be called when flow ends. - */ - flow(args: { - json?: {}; - keys?: { x?: string; value: string[]; } - rows?: PrimitiveArray[]; - columns?: PrimitiveArray[]; - to?: any; - length?: number; - duration?: number; - done?(): any; - }): void; - /** - * Change data point state to selected. By this API, you can select data points. To use this API, data.selection.enabled needs to be set true. - * @param ids Specify target ids to be selected. If this argument is not given, all targets will be the candidate. - * @param indices Specify indices to be selected. If this argument is not given, all data points will be the candidate. - * @param resetOthers If this argument is set true, the data points that are not specified by ids, indices will be unselected. - */ - select(ids?: string[], indices?: number[], resetOthers?: boolean): void; - /** - * Change data point state to unselected. By this API, you can unselect data points. To use this API, data.selection.enabled needs to be set true. - * @param ids Specify target ids to be unselected. If this argument is not given, all targets will be the candidate. - * @param indices Specify indices to be unselected. If this argument is not given, all data points will be the candidate. - */ - unselect(ids?: string[], indices?: number[]): void; - /** - * Get selected data points. By this API, you can get selected data points information. To use this API, data.selection.enabled needs to be set true. - * @param targetId You can filter the result by giving target id that you want to get. If not given, all of data points will be returned. - */ - selected(targetId?: string): Data; - /** - * Change the type of the chart. - * @param type Specify the type to be transformed. The types listed in data.type can be used. - * @param targetIds Specify targets to be transformed. If not given, all targets will be the candidate. - */ - transform(type: string, targetIds?: ArrayOrString): void; - /** - * Update groups for the targets. - * @param groups This argument needs to be an Array that includes one or more Array that includes target ids to be grouped. - */ - groups(groups: string[][]): void; - - xgrids: GridOperations; - - ygrids: GridOperations; - - regions: { - /** - * Update regions. - * @param regions Regions will be replaced with this argument. The format of this argument is the same as regions. - */ - (regions: any[]): void; - /** - * Add new region. This API adds new region instead of replacing like regions. - * @param grids New region will be added. The format of this argument is the same as regions and it's possible to give an Object if only one region will be added. - */ - add(regions: any[] | {}): void; - /** - * Remove regions. This API removes regions. - * @param args This argument should include classes. If classes is given, the regions that have one of the specified classes will be removed. If args is not given, all of regions will be - * removed. - */ - remove(args?: { value?: number | string; class?: string }): void; - }; - - data: { - /** - * Get data loaded in the chart. - * @param targetIds If this argument is given, this API returns the specified target data. If this argument is not given, all of data will be returned. - */ - (targetIds?: ArrayOrString): Data; - /** - * Get data shown in the chart. - * @param targetIds If this argument is given, this API filters the data with specified target ids. If this argument is not given, all shown data will be returned. - */ - shown(targetIds?: ArrayOrString): Data; - /** - * Get values of the data loaded in the chart. - * @param targetIds This API returns the values of specified target. If this argument is not given, null will be retruned. - */ - values(targetIds?: ArrayOrString): any[]; - /** - * Get and set names of the data loaded in the chart. - * @param names If this argument is given, the names of data will be updated. If not given, the current names will be returned. The format of this argument is the same as data.names. - */ - names(names?: { [key: string]: string }): { [key: string]: string }; - /** - * Get and set colors of the data loaded in the chart. - * @param colors If this argument is given, the colors of data will be updated. If not given, the current colors will be returned. The format of this argument is the same as data.colors. - */ - colors(colors?: { [key: string]: string | d3.Rgb }): { [key: string]: string }; - /** - * Get and set axes of the data loaded in the chart. - * @param axes If this argument is given, the axes of data will be updated. If not given, the current axes will be returned. The format of this argument is the same as data.axes. - */ - axes(axes?: { [key: string]: string }): { [key: string]: string }; - }; - - /** - * Gets and sets the value a category - * @param index Index of the category to get or set - * @param category: Value of the category to update - */ - category(index: number, category?: string): string; - - /** - * Get and set the categories - * @param categories: Value of the categories to update - */ - categories(categories?: string[]): string[]; - - /** - * Get the color for the specified targetId - */ - color(targetId: string): string; - - /** - * Get and set x values for the chart. - * @param x If x is given, x values of every target will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids. - */ - x(x?: PrimitiveArray): PrimitiveArray; - - /** - * Get and set x values for the chart. - * @param x If x is given, x values of every target will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids. - */ - xs(xs?: { [key: string]: PrimitiveArray }): { [key: string]: PrimitiveArray }; - - axis: { - /** - * Get and set axis labels. - * @param labels If labels is given, specified axis' label will be updated. - */ - labels(labels?: { [key: string]: string }): { [key: string]: string } - /** - * Get and set axis min value. - * @param min If min is given, specified axis' min value will be updated. If no argument is given, the current min values for each axis will be returned. - */ - min(min?: number | { [key: string]: number }): number | { [key: string]: number } - /** - * Get and set axis max value. - * @param max If max is given, specified axis' max value will be updated. If no argument is given, the current max values for each axis will be returned. - */ - max(max?: number | { [key: string]: number }): number | { [key: string]: number } - /** - * Get and set axis min and max value. - * @param range If range is given, specified axis' min and max value will be updated. If no argument is given, the current min and max values for each axis will be returned. - */ - range(range?: { min?: number | { [key: string]: number }; max?: number | { [key: string]: number } }): { min: number | { [key: string]: number }; max: number | { [key: string]: number } } - }; - - legend: { - /** - * Show legend for each target. - * @param targetIds If targetIds is given, specified target's legend will be shown. If only one target is the candidate, String can be passed. If no argument is given, all of target's - * legend will be shown. - */ - show(targetIds?: ArrayOrString): void; - /** - * Hide legend for each target. - * @param targetIds If targetIds is given, specified target's legend will be hidden. If only one target is the candidate, String can be passed. If no argument is given, all of target's - * legend will be hidden. - */ - hide(targetIds?: ArrayOrString): void; - }; - - zoom: { - /** - * Zoom by giving x domain. - * @param domain If domain is given, the chart will be zoomed to the given domain. If no argument is given, the current zoomed domain will be returned. - */ - (domain?: number[]): number[]; - - /** - * Enable and disable zooming. - * @param enabled If enabled is true, the feature of zooming will be enabled. If false is given, it will be disabled. - */ - enable(enabled: boolean): void; - }; - - /** - * Unzoom to the original domain. - */ - unzoom(): void; - - /** - * Resize the chart. If no size is specified it will resize to fit. - * @param size This argument should include width and height in pixels. - */ - resize(size?: { width?: number; height?: number }): void; - - /** - * Force to redraw. - */ - flush(): void; - - /** - * Reset the chart object and remove element and events completely. - */ - destroy(): void; - } - - interface GridOperations { - /** - * Update the x/y grid lines. - * @param grids X/Y grid lines will be replaced with this argument. The format of this argument is the same as grid.x.lines or grid.y.lines. - */ - (grids: any[]): void; - /** - * Add x/y grid lines. This API adds new x/y grid lines instead of replacing like xgrids. - * @param grids New x/y grid lines will be added. The format of this argument is the same as grid.x.lines or grid.y.lines and it's possible to give an Object if only one line will be added. - */ - add(grids: any[] | {}): void; - /** - * Remove x/y grid lines. This API removes x/y grid lines. - * @param args This argument should include value or class. If value is given, the x/y grid lines that have specified x/y value will be removed. If class is given, the x/y grid lines that - * have specified class will be removed. If args is not given, all of x/y grid lines will be removed. - */ - remove(args?: { class?: string; value?: number | string }): void; - } - - function generate(config: ChartConfiguration): ChartAPI; + }; } + +export interface Data { + /** + * Load a CSV or JSON file from a URL. Note that this will not work if loading via the "file://" protocol as most browsers with block XMLHTTPRequests. + */ + url?: string; + /** + * Parse a JSON object for data. + */ + json?: {}; + /** + * Load data from a multidimensional array, with the first element containing the data names, the following containing related data in that order. + */ + rows?: PrimitiveArray[]; + /* + * Load data from a multidimensional array, with each element containing an array consisting of a datum name and associated data values. + */ + columns?: PrimitiveArray[]; + /** + * Used if loading JSON via data.url + */ + mimeType?: string; + /** + * Choose which JSON object keys correspond to desired data. + */ + keys?: { x?: string; value: string[]; }; + /** + * Specify the key of x values in the data. + * We can show the data with non-index x values by this option. This option is required when the type of x axis is timeseries. If this option is set on category axis, the values of the data + * on the key will be used for category names. + */ + x?: string; + /** + * Specify the keys of the x values for each data. + * This option can be used if we want to show the data that has different x values. + */ + xs?: { [key: string]: string }; + /** + * Set a format to parse string specifed as x. + * Default is %Y-%m-%d + */ + xFormat?: string; + // xLocaltime?: any; + // xSort?: any; + /** + * Set custom data name. + */ + names?: { [key: string]: string }; + /** + * Set custom data class. + * If this option is specified, the element g for the data has an additional class that has the prefix c3-target- (e.g. c3-target-additional-data1-class). + */ + classes?: { [key: string]: string }; + /** + * Set groups for the data for stacking. + */ + groups?: string[][]; + /** + * Set y axis the data related to. y and y2 can be used. + */ + axes?: { [key: string]: string }; + /** + * Set chart type at once. + * If this option is specified, the type will be applied to every data. This setting can be overwritten by data.types. + * Available Values: line, spline, step, area, area-spline, area-step, bar, scatter, pie, donut, gauge + */ + type?: string; + /** + * Set chart type for each data. + * This setting overwrites data.type setting. + */ + types?: { [key: string]: string }; + /** + * Show labels on each data points or set formatter function for data labels. + * The formatter function receives 4 arguments such as v, id, i, j and it must return a string that will be shown as the label. The arguments are: + * - v is the value of the data point where the label is shown. + * - id is the id of the data where the label is shown. + * - i is the index of the data point where the label is shown. + * - j is the sub index of the data point where the label is shown. + * Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (e.g. d3.format('$')) + */ + labels?: boolean | + { format: FormatFunction } | + { format: { [key: string]: FormatFunction } }; + /** + * Define the order of the data. + * This option changes the order of stacking the data and pieces of pie/donut. If null specified, it will be the order the data loaded. If function specified, it will be used to sort the data + * and it will recieve the data as argument. + * Available Values: desc, asc, function (data1, data2) { ... }, null + */ + order?: string | ((...data: string[]) => void) | null; + /** + * Define regions for each data. + * The values must be an array for each data and it should include an object that has start, end, style. If start is not set, the start will be the first data point. If end is not set, the + * end will be the last data point. + * Currently this option supports only line chart and dashed style. If this option specified, the line will be dashed only in the regions. + */ + regions?: { [key: string]: any }; + /** + * Set color converter function. + * This option should a function and the specified function receives color (e.g. '#ff0000') and d that has data parameters like id, value, index, etc. And it must return a string that + * represents color (e.g. '#00ff00'). + */ + color?(color: string, d: any): string | d3.Rgb; + /** + * Set color for each data. + */ + colors?: { [key: string]: string | d3.Rgb | ((d: any) => string | d3.Rgb) }; + /** + * Hide each data when the chart appears. + * If true specified, all of data will be hidden. If multiple ids specified as an array, those will be hidden. + */ + hide?: boolean | string[]; + /** + * Set text displayed when empty data. + */ + empty?: { label: { text: string } }; + + selection?: { + enabled?: boolean; + grouped?: boolean; + multiple?: boolean; + draggable?: boolean; + isselectable?(d?: any): boolean; + }; + /** + * Set a callback for click event on each data point. + * This callback will be called when each data point clicked and will receive d and element as the arguments. + * - d is the data clicked and element is the element clicked. In this callback, this will be the Chart object. + */ + onclick?(d: any, element: any): void; + /** + * Set a callback for mouseover event on each data point. + * This callback will be called when mouse cursor moves onto each data point and will receive d as the argument. + * - d is the data where mouse cursor moves onto. In this callback, this will be the Chart object. + */ + onmouseover?(d: any, element?: any): void; + /** + * Set a callback for mouseout event on each data point. + * This callback will be called when mouse cursor moves out each data point and will receive d as the argument. + * - d is the data where mouse cursor moves out. In this callback, this will be the Chart object. + */ + onmouseout?(d: any, element?: any): void; + + onselected?(d: any, element?: any): void; + + onunselected?(d: any, element?: any): void; +} + +export interface Axis { + /** + * Switch x and y axis position. + */ + rotated?: boolean; + x?: XAxisConfiguration; + y?: YAxisConfiguration; + y2?: YAxisConfiguration; +} + +export interface XAxisConfiguration { + /** + * Show or hide x axis. + */ + show?: boolean; + /** + * Set type of x axis (timeseries, category, indexed) + */ + type?: string; + /** + * Set how to treat the timezone of x values. + * If true, treat x value as localtime. If false, convert to UTC internally. + */ + localtime?: boolean; + /** + * Set category names on category axis. + * This must be an array that includes category names in string. If category names are included in the date by data.x option, this is not required. + */ + categories?: string[]; + + tick?: XTickConfiguration; + /** + * Set max value of x axis range. + */ + max?: string | number | Date; + /** + * Set min value of x axis range. + */ + min?: string | number | Date; + /** + * Set padding for x axis. + * If this option is set, the range of x axis will increase/decrease according to the values. If no padding is needed in the ragen of x axis, 0 should be set. On category axis, this option + * will be ignored. + */ + padding?: { + left?: number; + right?: number; + }; + /** + * Set height of x axis. + * The height of x axis can be set manually by this option. If you need more space for x axis, please use this option for that. The unit is pixel. + */ + height?: number; + /** + * Set default extent for subchart and zoom. This can be an array or function that returns an array. + */ + extent?: number[] | (() => number[]); + /** + * Set label on x axis. + * You can set x axis label and change its position by this option. string and object can be passed and we can change the poisiton by passing object that has position key. Available position + * differs according to the axis direction (vertical or horizontal). If string set, the position will be the default. + * Valid horizontal positions: inner-right (Default), inner-center, inner-left, outer-right, outer-center, outer-left + * Valid vertical positions: inner-top, inner-middle, inner-bottom, outer-top, outer-middle, outer-bottom + */ + label?: string | { text: string; position: string }; +} + +export interface YAxisConfiguration { + /** + * Show or hide y axis. + */ + show?: boolean; + /** + * Show y axis inside of the chart. + */ + inner?: boolean; + /** + * Set max value of y axis. + */ + max?: number; + /** + * Set min value of y axis. + */ + min?: number; + /** + * Change the direction of y axis. + * If true set, the direction will be from the top to the bottom. + */ + inverted?: boolean; + /** + * Set center value of y axis. + */ + center?: number; + /** + * Set label on y axis. This option works in the same way as axis.x.label. + * Valid horizontal positions: inner-right (Default), inner-center, inner-left, outer-right, outer-center, outer-left + * Valid vertical positions: inner-top, inner-middle, inner-bottom, outer-top, outer-middle, outer-bottom + */ + label?: string | { text: string; position: string }; + tick?: YTickConfiguration; + /** + * Set padding for y axis. + * You can set padding for y axis to create more space on the edge of the axis. This option accepts object and it can include top and bottom. top, bottom will be treated as pixels. + */ + padding?: { + top?: number; + bottom?: number; + }; + /** + * Set default range of y axis. This option set the default value for y axis when there is no data on init. + */ + default?: number[]; +} + +export interface XTickConfiguration { + /** + * Centerise ticks on category axis + */ + centered?: boolean; + /** + * A function to format tick value. Format string is also available for timeseries data. + */ + format?: string | ((x: number | Date) => string | number); + /** + * Setting for culling ticks. + * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown. + */ + culling?: boolean | CullingConfiguration; + /** + * The number of x axis ticks to show. + * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will + * have rough second value). + */ + count?: number; + /** + * Fit x axis ticks. + * If true set, the ticks will be positioned nicely. If false set, the ticks will be positioned according to x value of the data points. + */ + fit?: boolean; + /** + * Set the x values of ticks manually. + * If this option is provided, the position of the ticks will be determined based on those values. This option works with timeseries data and the x values will be parsed accoding to the type + * of the value and data.xFormat option. + */ + values?: number[] | string[]; + /** + * Rotate x axis tick text. If you set negative value, it will rotate to opposite direction. + */ + rotate?: number; + /** + * Show x axis outer tick. + */ + outer?: boolean; + multiline?: boolean; // Undocumented +} + +export interface YTickConfiguration { + /** + * Set formatter for y axis tick text. + * This option accepts d3.format object as well as a function you define. + */ + format?(x: number): string; + /** + * Show or hide outer tick. + */ + outer?: boolean; + /** + * Set the y values of ticks manually. + */ + values?: number[]; + /** + * The number of y axis ticks to show. + * The position of the ticks will be calculated precisely, so the values on the ticks will not be rounded nicely. In the case, axis.y.tick.format or axis.y.tick.values will be helpful. + */ + count?: number; +} + +export interface CullingConfiguration { + /** + * The number of tick texts will be adjusted to less than this value. + */ + max: number; +} + +export interface Grid { + x?: { + /** + * Show grids along x axis. + */ + show?: boolean; + /** + * Show additional grid lines along x axis. + * This option accepts array including object that has value, text, position and class. text, position and class are optional. For position, start, middle and end (default) are available. + * If x axis is category axis, value can be category name. If x axis is timeseries axis, value can be date string, Date object and unixtime integer. + */ + lines?: LineOptions[]; + }; + y?: { + /** + * Show grids along y axis. + */ + show?: boolean; + /** + * Show additional grid lines along y axis. + * This option accepts array including object that has value, text, position and class. + */ + lines?: LineOptions[]; + }; +} + +export interface LineOptions { + value: string | number | Date; + text?: string; + axis?: string; + position?: string; + class?: string; +} + +export interface RegionOptions { + axis?: string; + start?: string | number | Date; + end?: string | number | Date; + class?: string; +} + +export interface LegendOptions { + /** + * Show or hide legend. + */ + show?: boolean; + /** + * Hide legend + * If true given, all legend will be hidden. If string or array given, only the legend that has the id will be hidden. + */ + hide?: boolean | ArrayOrString; + /** + * Change the position of legend. + * Currently bottom, right and inset are supported. + */ + position?: string; + /** + * Change inset legend attributes. + * This option accepts object that has the keys anchor, x, y and step. + * anchor decides the position of the legend. These anchors are available: top-left, top-right, bottom-left, bottom-right + * x and y set the position of the legend based on the anchor. + * step defines the max step the lagend has (e.g. If 2 set and legend has 3 legend item, the legend 2 columns). + */ + inset?: { + anchor?: string; + x?: number; + y?: number; + step?: number; + }; + + item?: { + /** + * Set click event handler to the legend item. + */ + onclick?(id: any): void; + /** + * Set mouseover event handler to the legend item. + */ + onmouseover?(id: any): void; + /** + * Set mouseout event handler to the legend item. + */ + onmouseout?(id: any): void; + }; +} + +export interface TooltipOptions { + /** + * Show or hide tooltip. + */ + show?: boolean; + /** + * Set if tooltip is grouped or not for the data points. + */ + grouped?: boolean; + format?: { + /** + * Set format for the title of tooltip. Specified function receives x of the data point to show. + */ + title?(x: any): string; + /** + * Set format for the name of each data in tooltip. Specified function receives name, ratio, id and index of the data point to show. ratio will be undefined if the chart is not + * donut/pie/gauge. + */ + name?(name: string, ratio: number, id: string, index: number): string; + /** + * Set format for the value of each data in tooltip. + * Specified function receives name, ratio, id and index of the data point to show. ratio will be undefined if the chart is not donut/pie/gauge. + * If undefined returned, the row of that value will be skipped. + */ + value?(value: any, ratio: number, id: string, index: number): string; + }; + /** + * Set custom position for the tooltip. This option can be used to modify the tooltip position by returning object that has top and left. + */ + position?(data: any, width: number, height: number, element: any): { top: number; left: number }; + /** + * Set custom HTML for the tooltip. + * Specified function receives data, defaultTitleFormat, defaultValueFormat and color of the data point to show. If tooltip.grouped is true, data includes multiple data points. + */ + contents?(data: any, defaultTitleFormat: string, defaultValueFormat: string, color: any): string; +} + +export interface SubchartOptions { + /** + * Show sub chart on the bottom of the chart. + */ + show?: boolean; + size?: { + /** + * Change the height of the subchart. + */ + height: number; + }; + /** + * Set callback for brush event. + * Specified function receives the current zoomed x domain. + */ + onbrush?(domain: any): void; +} + +export interface ZoomOptions { + /** + * Enable zooming. + */ + enabled?: boolean; + /** + * Enable to rescale after zooming. If true set, y domain will be updated according to the zoomed region. + */ + rescale?: boolean; + /** + * Change zoom extent. + */ + extent?: [number, number]; + /** + * Set callback that is called when the chart is zooming. Specified function receives the zoomed domain. + */ + onzoom?(domain: any): void; + /** + * Set callback that is called when zooming starts. Specified function receives the zoom event. + */ + onzoomstart?(event: Event): void; + /** + * Set callback that is called when zooming ends. Specified function receives the zoomed domain. + */ + onzoomend?(domain: any): void; +} + +export interface PointOptions { + /** + * Whether to show each point in line. + */ + show?: boolean; + /** + * The radius size of each point. + */ + r?: number | ((d: any) => number); + + focus?: { + expand: { + /** + * Whether to expand each point on focus. + */ + enabled?: boolean; + /** + * The radius size of each point on focus. + */ + r?: number + }; + }; + + select?: { + /** + * The radius size of each point on selected. + */ + r?: number; + }; +} + +export interface ChartAPI { + /** + * This API highlights specified targets and fade out the others. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be highlighted. + */ + focus(targetIds?: ArrayOrString): void; + /** + * This API fades out specified targets and reverts the others. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be faded out. + */ + defocus(targetIds?: ArrayOrString): void; + /** + * This API reverts specified targets. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be reverted. + */ + revert(targetIds?: ArrayOrString): void; + + /** + * This API shows specified targets. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be shown. + * If withLegend is set true, legend will be shown together with the specified data. + */ + show(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; + /** + * This API hides specified targets. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be hidden. + * If withLegend is set true, legend will be hidden together with the specified data. + */ + hide(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; + /** + * This API toggles (shows or hides) specified targets. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles. + * If withLegend is set true, legend will be toggled together with the specified data. + */ + toggle(targetIds?: ArrayOrString, options?: { withLegend: boolean }): void; + /** + * Load data to the chart. + * If url, json, rows and columns given, the data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added. + * If classes given, the classes specifed by data.classes will be updated. classes must be Object that has target id as keys. + * If categories given, the categories specifed by axis.x.categories or data.x will be updated. categories must be Array. + * If axes given, the axes specifed by data.axes will be updated. axes must be Object that has target id as keys. + * If colors given, the colors specifed by data.colors will be updated. colors must be Object that has target id as keys. + * If type or types given, the type of targets will be updated. type must be String and types must be Object. + * If unload given, data will be unloaded before loading new data. If true given, all of data will be unloaded. If target ids given as String or Array, specified targets will be unloaded. + * If done given, the specified function will be called after data loded. + * NOTE: unload should be used if some data needs to be unloaded simultaneously. If you call unload API soon after/before load instead of unload param, chart will not be rendered properly + * because of cancel of animation. + * NOTE: done will be called after data loaded, but it's not after rendering. It's because rendering will finish after some transition and there is some time lag between loading and rendering. + */ + load(args: { + url?: string; + json?: {}; + keys?: { x?: string; value: string[]; } + rows?: PrimitiveArray[]; + columns?: PrimitiveArray[]; + names?: { [key: string]: string }; + classes?: { [key: string]: string }; + categories?: string[]; + axes?: { [key: string]: string }; + colors?: { [key: string]: string | d3.Rgb }; + type?: string; + types?: { [key: string]: string }; + unload?: boolean | ArrayOrString; + done?(): any; + }): void; + /** + * Unload data to the chart. + * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles. + * If ids given, the data that has specified target id will be unloaded. ids should be String or Array. If ids is not specified, all data will be unloaded. + * If done given, the specified function will be called after data loded. + * NOTE: If you call load API soon after/before unload, unload param of load should be used. Otherwise chart will not be rendered properly because of cancel of animation. + * NOTE: done will be called after data loaded, but it's not after rendering. It's because rendering will finish after some transition and there is some time lag between loading and rendering. + */ + unload(targetIds?: TargetIds, done?: () => any): any; + /** + * Flow data to the chart. By this API, you can append new data points to the chart. + * If json, rows and columns given, the data will be loaded. If data that has the same target id is given, the chart will be appended. Otherwise, new target will be added. One of these is + * required when calling. If json specified, keys is required as well as data.json + * If to is given, the lower x edge will move to that point. If not given, the lower x edge will move by the number of given data points. + * If length is given, the lower x edge will move by the number of this argument. + * If duration is given, the duration of the transition will be specified value. If not given, transition.duration will be used as default. + * If done is given, the specified function will be called when flow ends. + */ + flow(args: { + json?: {}; + keys?: { x?: string; value: string[]; } + rows?: PrimitiveArray[]; + columns?: PrimitiveArray[]; + to?: any; + length?: number; + duration?: number; + done?(): any; + }): void; + /** + * Change data point state to selected. By this API, you can select data points. To use this API, data.selection.enabled needs to be set true. + * @param ids Specify target ids to be selected. If this argument is not given, all targets will be the candidate. + * @param indices Specify indices to be selected. If this argument is not given, all data points will be the candidate. + * @param resetOthers If this argument is set true, the data points that are not specified by ids, indices will be unselected. + */ + select(ids?: string[], indices?: number[], resetOthers?: boolean): void; + /** + * Change data point state to unselected. By this API, you can unselect data points. To use this API, data.selection.enabled needs to be set true. + * @param ids Specify target ids to be unselected. If this argument is not given, all targets will be the candidate. + * @param indices Specify indices to be unselected. If this argument is not given, all data points will be the candidate. + */ + unselect(ids?: string[], indices?: number[]): void; + /** + * Get selected data points. By this API, you can get selected data points information. To use this API, data.selection.enabled needs to be set true. + * @param targetId You can filter the result by giving target id that you want to get. If not given, all of data points will be returned. + */ + selected(targetId?: string): Data; + /** + * Change the type of the chart. + * @param type Specify the type to be transformed. The types listed in data.type can be used. + * @param targetIds Specify targets to be transformed. If not given, all targets will be the candidate. + */ + transform(type: string, targetIds?: ArrayOrString): void; + /** + * Update groups for the targets. + * @param groups This argument needs to be an Array that includes one or more Array that includes target ids to be grouped. + */ + groups(groups: string[][]): void; + + xgrids: GridOperations; + + ygrids: GridOperations; + + regions: { + /** + * Update regions. + * @param regions Regions will be replaced with this argument. The format of this argument is the same as regions. + */ + (regions: any[]): void; + /** + * Add new region. This API adds new region instead of replacing like regions. + * @param grids New region will be added. The format of this argument is the same as regions and it's possible to give an Object if only one region will be added. + */ + add(regions: any[] | {}): void; + /** + * Remove regions. This API removes regions. + * @param args This argument should include classes. If classes is given, the regions that have one of the specified classes will be removed. If args is not given, all of regions will be + * removed. + */ + remove(args?: { value?: number | string; class?: string }): void; + }; + + data: { + /** + * Get data loaded in the chart. + * @param targetIds If this argument is given, this API returns the specified target data. If this argument is not given, all of data will be returned. + */ + (targetIds?: ArrayOrString): Data; + /** + * Get data shown in the chart. + * @param targetIds If this argument is given, this API filters the data with specified target ids. If this argument is not given, all shown data will be returned. + */ + shown(targetIds?: ArrayOrString): Data; + /** + * Get values of the data loaded in the chart. + * @param targetIds This API returns the values of specified target. If this argument is not given, null will be retruned. + */ + values(targetIds?: ArrayOrString): any[]; + /** + * Get and set names of the data loaded in the chart. + * @param names If this argument is given, the names of data will be updated. If not given, the current names will be returned. The format of this argument is the same as data.names. + */ + names(names?: { [key: string]: string }): { [key: string]: string }; + /** + * Get and set colors of the data loaded in the chart. + * @param colors If this argument is given, the colors of data will be updated. If not given, the current colors will be returned. The format of this argument is the same as data.colors. + */ + colors(colors?: { [key: string]: string | d3.Rgb }): { [key: string]: string }; + /** + * Get and set axes of the data loaded in the chart. + * @param axes If this argument is given, the axes of data will be updated. If not given, the current axes will be returned. The format of this argument is the same as data.axes. + */ + axes(axes?: { [key: string]: string }): { [key: string]: string }; + }; + + /** + * Gets and sets the value a category + * @param index Index of the category to get or set + * @param category: Value of the category to update + */ + category(index: number, category?: string): string; + + /** + * Get and set the categories + * @param categories: Value of the categories to update + */ + categories(categories?: string[]): string[]; + + /** + * Get the color for the specified targetId + */ + color(targetId: string): string; + + /** + * Get and set x values for the chart. + * @param x If x is given, x values of every target will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids. + */ + x(x?: PrimitiveArray): PrimitiveArray; + + /** + * Get and set x values for the chart. + * @param x If x is given, x values of every target will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids. + */ + xs(xs?: { [key: string]: PrimitiveArray }): { [key: string]: PrimitiveArray }; + + axis: { + /** + * Get and set axis labels. + * @param labels If labels is given, specified axis' label will be updated. + */ + labels(labels?: { [key: string]: string }): { [key: string]: string } + /** + * Get and set axis min value. + * @param min If min is given, specified axis' min value will be updated. If no argument is given, the current min values for each axis will be returned. + */ + min(min?: number | { [key: string]: number }): number | { [key: string]: number } + /** + * Get and set axis max value. + * @param max If max is given, specified axis' max value will be updated. If no argument is given, the current max values for each axis will be returned. + */ + max(max?: number | { [key: string]: number }): number | { [key: string]: number } + /** + * Get and set axis min and max value. + * @param range If range is given, specified axis' min and max value will be updated. If no argument is given, the current min and max values for each axis will be returned. + */ + range(range?: { min?: number | { [key: string]: number }; max?: number | { [key: string]: number } }): { min: number | { [key: string]: number }; max: number | { [key: string]: number } } + }; + + legend: { + /** + * Show legend for each target. + * @param targetIds If targetIds is given, specified target's legend will be shown. If only one target is the candidate, String can be passed. If no argument is given, all of target's + * legend will be shown. + */ + show(targetIds?: ArrayOrString): void; + /** + * Hide legend for each target. + * @param targetIds If targetIds is given, specified target's legend will be hidden. If only one target is the candidate, String can be passed. If no argument is given, all of target's + * legend will be hidden. + */ + hide(targetIds?: ArrayOrString): void; + }; + + zoom: { + /** + * Zoom by giving x domain. + * @param domain If domain is given, the chart will be zoomed to the given domain. If no argument is given, the current zoomed domain will be returned. + */ + (domain?: number[]): number[]; + + /** + * Enable and disable zooming. + * @param enabled If enabled is true, the feature of zooming will be enabled. If false is given, it will be disabled. + */ + enable(enabled: boolean): void; + }; + + /** + * Unzoom to the original domain. + */ + unzoom(): void; + + /** + * Resize the chart. If no size is specified it will resize to fit. + * @param size This argument should include width and height in pixels. + */ + resize(size?: { width?: number; height?: number }): void; + + /** + * Force to redraw. + */ + flush(): void; + + /** + * Reset the chart object and remove element and events completely. + */ + destroy(): void; +} + +export interface GridOperations { + /** + * Update the x/y grid lines. + * @param grids X/Y grid lines will be replaced with this argument. The format of this argument is the same as grid.x.lines or grid.y.lines. + */ + (grids: any[]): void; + /** + * Add x/y grid lines. This API adds new x/y grid lines instead of replacing like xgrids. + * @param grids New x/y grid lines will be added. The format of this argument is the same as grid.x.lines or grid.y.lines and it's possible to give an Object if only one line will be added. + */ + add(grids: any[] | {}): void; + /** + * Remove x/y grid lines. This API removes x/y grid lines. + * @param args This argument should include value or class. If value is given, the x/y grid lines that have specified x/y value will be removed. If class is given, the x/y grid lines that + * have specified class will be removed. If args is not given, all of x/y grid lines will be removed. + */ + remove(args?: { class?: string; value?: number | string }): void; +} + +export function generate(config: ChartConfiguration): ChartAPI; diff --git a/types/cache-manager/index.d.ts b/types/cache-manager/index.d.ts index 40d644b546..fcd4458767 100644 --- a/types/cache-manager/index.d.ts +++ b/types/cache-manager/index.d.ts @@ -16,13 +16,19 @@ interface StoreConfig extends CachingConfig { 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; + set(key: string, value: T, ttl: number): Promise; wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void, options: CachingConfig, callback: (error: any, result: T) => void): void; wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void, callback: (error: any, result: T) => void): void; + wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => any, options: CachingConfig): Promise; + wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void): Promise; get(key: string, callback: (error: any, result: T) => void): void; + get(key: string): Promise; - del(key: string, callback?: (error: any) => void): void; + del(key: string, callback: (error: any) => void): void; + del(key: string): Promise; } diff --git a/types/cache-manager/tslint.json b/types/cache-manager/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cache-manager/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cachefactory/cachefactory-tests.ts b/types/cachefactory/cachefactory-tests.ts deleted file mode 100644 index 32eeb63257..0000000000 --- a/types/cachefactory/cachefactory-tests.ts +++ /dev/null @@ -1,32 +0,0 @@ -CacheFactory.get('test'); - -CacheFactory.createCache('test', { - deleteOnExpire: 'aggressive', - recycleFreq: 60000 -}); - -let testCache = CacheFactory.get('test'); - -testCache.put('testOne', {title: 'testOne', id: 1}); - -let item = testCache.get('testOne'); - - -let profileCache = CacheFactory('profileCache', { - maxAge: 60 * 60 * 1000, - deleteOnExpire: 'aggressive' -}); - -let localStoragePolyfill = { - getItem: (key: string) => { return ""; }, - setItem: (key: string, value: string) => { }, - removeItem: (key: string) => { } -}; - -let myAwesomeCache = CacheFactory('myAwesomeCache', { - maxAge: 15 * 60 * 1000, - cacheFlushInterval: 60 * 60 * 1000, - deleteOnExpire: 'aggressive', - storageMode: 'localStorage', - storageImpl: localStoragePolyfill -}); \ No newline at end of file diff --git a/types/cachefactory/index.d.ts b/types/cachefactory/index.d.ts deleted file mode 100644 index 658a2660f4..0000000000 --- a/types/cachefactory/index.d.ts +++ /dev/null @@ -1,441 +0,0 @@ -// Type definitions for CacheFactory 1.4.0 -// Project: https://github.com/jmdobry/CacheFactory -// Definitions by: Vaggelis Mparmpas , Daniel Massa -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace CacheFactory { - export interface IStoreImplementation { - getItem(key: string): string; - - setItem(key: string, value: string): void; - - removeItem(key: string): void; - } - - export interface CacheGetOptions { - /* - * A callback function to be executed whenever an expired item is removed from a cache when the cache is in passive - * or aggressive mode. Will be passed the key and value of the expired item. - * - * Will be passed a third done argument if the cache is in passive mode. This allows you to synchronously access the - * key and value of the expired item when you make the cache#get(key[, options]) call that is the reason the expired - * item is being removed in the first place. Default: null. - */ - onExpire?(key: string, value: any): any; - } - - export interface CachePutOptions { - /* - * The number of milliseconds until a newly inserted item expires. Default: Number.MAX_VALUE. - */ - maxAge?: number; - - /* - * If inserting a promise into a cache, also insert the rejection value if the promise rejects. Default: false. - */ - storeOnReject?: boolean; - - /* - * If inserting a promise into a cache, also insert the resolved value if the promise resolves. Default: false. - */ - storeOnResolve?: boolean; - - created?: Date; - access?: Date; - expires?: Date; - } - - export interface CacheTouchOptions extends CachePutOptions { } - - export interface CacheOptions { - /* - * If set, remove all items from a cache on an interval after the given number of milliseconds. Default: null. - */ - cacheFlushInterval?: number; - - /* - * Maximum number of items a cache can hold. Adding more items than the capacity will cause the cache to operate - * like an LRU cache, removing the least recently used items to stay under capacity. Default: Number.MAX_VALUE. - */ - - capacity?: number; - - /* - * Determines the behavior of a cache when an item expires. Default: none. - * - * Possible values: - * - * none - cache will do nothing when an item expires. - * passive - cache will do nothing when an item expires. Expired items will remain in the cache until requested, - * at which point they are removed, and undefined is returned. - * aggressive - cache will remove expired items as soon as they are discovered. - */ - deleteOnExpire?: string; - - /* - * Determines whether a cache is disabled. Default: false. - */ - disabled?: boolean; - - /* - * The number of milliseconds until a newly inserted item expires. Default: Number.MAX_VALUE. - */ - maxAge?: number; - - /* - * Determines how often a cache will scan for expired items when in aggressive mode. Default: 1000 (milliseconds). - */ - recycleFreq?: number; - - /* - * If inserting a promise into a cache, also insert the rejection value if the promise rejects. Default: false. - */ - storeOnReject?: boolean; - - /* - * If inserting a promise into a cache, also insert the resolved value if the promise resolves. Default: false. - */ - storeOnResolve?: boolean; - - /* - * Provide a custom storage medium, e.g. a polyfill for localStorage. Default: null. - * - * Must implement: - * - * setItem - Same API as localStorage.setItem(key, value) - * getItem - Same API as localStorage.getItem(key) - * removeItem - Same API as localStorage.removeItem(key) - */ - storageImpl?: IStoreImplementation; - - /* - * Determines the storage medium used by a cache. Default: memory. - * - * Possible values: - * - * memory - cache will hold data in memory. Data is cleared when the page is refreshed. - * localStorage - cache will hold data in localStorage if available. Data is not cleared when the page is refreshed. - * sessionStorage - cache will hold data in sessionStorage if available. Data is not cleared when the page is refreshed. - */ - storageMode?: string; - - /* - * Determines the namespace of a cache when storageMode is set to localStorage or sessionStorage. Make it a shorter - * string to save space. Default: angular-cache.caches. - */ - storagePrefix?: string; - - /* - * A callback function to be executed whenever an expired item is removed from a cache when the cache is in passive - * or aggressive mode. Will be passed the key and value of the expired item. - * - * Will be passed a third done argument if the cache is in passive mode. This allows you to synchronously access the - * key and value of the expired item when you make the cache#get(key[, options]) call that is the reason the expired - * item is being removed in the first place. Default: null. - */ - onExpire?(key: string, value: any): any; - } - - export interface ICache { - - $$id: string; - - /** - * Return the item with the given key.options, if provided, must be an object. - * - * If the cache is in passive mode, then options.onExpire can be a function that will be called with the key - * and value of the requested item if the requested item is expired, with the get call itself returning undefined. - * @param key - * @returns {} - */ - get(key: string, options?: CacheGetOptions): T; - - /** - * Insert the item with the given key and value into the cache.options, if provided, must be an object. - * - * If inserting a promise, options.storeOnReject determines whether to insert the rejection value if the promise - * rejects (overriding the default storeOnReject setting for the cache). If inserting a promise, options.storeOnResolve - * determines whether to insert the resolved value if the promise resolves (overriding the default storeOnResolve setting for the cache). - * - * @param key - * @param value - * @param options - */ - put(key: string, value: T, options?: CachePutOptions): void; - - /** - * Remove and return the item with the given key, if it is in the cache. - * @param key - * @returns {} - */ - remove(key: string): T; - - /** - * Remove all items in the cache. - */ - removeAll(): void; - - /** - * Remove and return all expired items in the cache. - * @returns {} - */ - removeExpired(): { [key: string]: any }; - - /** - * Completely destroy this cache and its data. - * @returns {} - */ - destroy(): void; - - /** - * Returns an object containing information about the cache. - * - * @param key - */ - info(): CacheInfo; - - /** - * Returns an object containing information about the item with the given key, if the item is in the cache. - * - * @param key - */ - info(key: string): CacheItemInfo; - - /** - * Return the keys of all items in the cache as an object. - * @returns {} - */ - keySet(): any; - - /** - * Return the keys of all items in the cache as an array. - * @returns [] - */ - keys(): Array; - - /** - * Enable the cache. - */ - enable(): void; - - /** - * Disable the cache. - */ - disable(): void; - - /** - * cache#touch() will "touch" all items in the cache. - * cache#touch(key) will "touch" the item with the given key. - * - * @param key - */ - touch(key?: string, options?: CacheTouchOptions): void; - - /** - * Set the cacheFlushInterval for the cache. - * @param cacheFlushInterval - */ - setCacheFlushInterval(cacheFlushInterval: number): void; - - /** - * Set the capacity for the cache.Setting this lower than the current item count will result in those items being removed. - * @param capacity - */ - setCapacity(capacity: number): void; - - /** - * Set the deleteOnExpire for the cache. - * @param deleteOnExpire - */ - setDeleteOnExpire(deleteOnExpire: string): void; - - /** - * Set the maxAge for the cache. - */ - setMaxAge(maxAge: number): void; - - /** - * Set the onExpire for the cache. - * @param onExpire - */ - setOnExpire(onExpire: Function): void; - - /** - * Set the recycleFreq for the cache. - * @param recycleFreq - */ - setRecycleFreq(recycleFreq: number): void; - - /** - * Set the storageMode for the cache.This will move data from the current storage medium to the new one. - * @param storageMode - */ - setStorageMode(storageMode: string): void; - - /** - * Set multiple options for the cache at a time.Setting strict to true will reset options for the cache - * that are not specifically set in the options hash to CacheFactoryProvider.defaults. - * @param options - */ - setOptions(options: CacheOptions, strict?: boolean): void; - - /** - * Return the values of all items in the cache as an array. - * @returns Array - */ - values(): Array - } - - export interface ICacheFactory { - - BinaryHeap: IBinaryHeap; - utils: IUtils; - defaults: CacheOptions; - - /** - * Create a cache. cache must not already exist. cacheId must be a string. options is an optional argument and must be an object. - * Any options you pass here will override any default options. - * @param cacheId - * @param options - * @returns ICache - */ - (cacheId: string, options?: CacheOptions): ICache; - - /** - * Create a cache. cache must not already exist. cacheId must be a string. options is an optional argument and must be an object. - * Any options you pass here will override any default options. - * @param cacheId - * @param options - * @returns ICache - */ - createCache(cacheId: string, options?: CacheOptions): ICache; - - /** - * Return the cache with the given cacheId. - * @param cacheId The id of the cache storage. - * @returns ICache - */ - get(cacheId: string, options?: CacheOptions): ICache; - - /** - * Return an object of key- value pairs, the keys being cache ids and the values being the result of .info() being called on each cache. - * @returns CacheInfo - */ - info(): CacheInfo; - - /** - * Return the ids of all registered caches as an object. - * @returns {[key: string]: ICache} - */ - keySet(): { [key: string]: ICache }; - - /** - * Return the ids of all registered caches as an array. - * @returns Array - */ - keys(): Array; - - /** - * Destroy the cache with the given cacheId. - * @param cacheId - */ - destroy(cacheId: string): void; - - /** - * Destroy all registered caches. - */ - destroyAll(): void; - - /** - * Remove all data from all registered caches. - */ - clearAll(): void; - - /** - * Enable all registered caches. - */ - enableAll(): void; - - /** - * Disable all registered caches. - */ - disableAll(): void; - - /** - * Call.touch() on all registered caches. - */ - touchAll(): void; - - /** - * Call.removeExpired() on all registered caches.Returns a hash of any expired items, keyed by cache id. - * @returns {} - */ - removeExpiredFromAll(): Array<{ [key: string]: Array<{ [key: string]: any }> }>; - } - - export interface IUtils { - isNumber(value: any): boolean; - isString(value: any): boolean; - isObject(value: any): boolean; - isFunction(value: any): boolean; - equals(a: any, b: any): boolean; - fromJson(value: any): {} - Promise: any; - } - - export interface HeapItem { - key: string; - accessed: Date; - } - - export interface IBinaryHeap { - (w?: IWeightFunc, c?: ICompareFunc): void; - - heap: Array; - weightFunc: IWeightFunc; - compareFunc: ICompareFunc; - - push(node: HeapItem): void; - pop(): HeapItem; - peek(): HeapItem; - remove(node: HeapItem): HeapItem; - removeAll(): void; - size(): Number; - } - - export interface IWeightFunc { - (x: T): T; - } - - export interface ICompareFunc { - (x: T, y: T): boolean; - } - - export interface CacheInfo { - size: Number; - caches: { [key: string]: any }; - capacity: Number; - maxAge: Number; - deleteOnExpire: string; - onExpire: Function; - cacheFlushInterval: Number; - recycleFreq: Number; - storageMode: string; - storageImpl: IStoreImplementation; - disabled: boolean; - storagePrefix: string; - storeOnResolve: boolean; - storeOnReject: boolean; - } - - export interface CacheItemInfo { - created: Date; - accessed: Date; - expires: Date; - isExpired: boolean; - } -} - -declare const CacheFactory: CacheFactory.ICacheFactory; -export = CacheFactory; -export as namespace CacheFactory; diff --git a/types/cachefactory/tsconfig.json b/types/cachefactory/tsconfig.json deleted file mode 100644 index 2008da5619..0000000000 --- a/types/cachefactory/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "cachefactory-tests.ts" - ] -} \ No newline at end of file diff --git a/types/cal-heatmap/tslint.json b/types/cal-heatmap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cal-heatmap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/callsite/tslint.json b/types/callsite/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/callsite/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/calq/tslint.json b/types/calq/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/calq/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/camljs/tslint.json b/types/camljs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/camljs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/camo/camo-tests.ts b/types/camo/camo-tests.ts index 6830133f8f..b88f7007f6 100644 --- a/types/camo/camo-tests.ts +++ b/types/camo/camo-tests.ts @@ -16,10 +16,10 @@ connect("mongodb://user:password@localhost:27017/database?authSource=admin").the } class User extends CamoDocument { - private name: SchemaTypeExtended = String; - private password: SchemaTypeExtended = String; - private friends: SchemaTypeExtended = [String]; - private dateCreated: SchemaTypeExtended = { + private readonly name: SchemaTypeExtended = String; + private readonly password: SchemaTypeExtended = String; + private readonly friends: SchemaTypeExtended = [String]; + private readonly dateCreated: SchemaTypeExtended = { type: Date, default: Date.now }; diff --git a/types/camo/tslint.json b/types/camo/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/camo/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cancan/cancan-tests.ts b/types/cancan/cancan-tests.ts new file mode 100644 index 0000000000..0d6ab3e9a7 --- /dev/null +++ b/types/cancan/cancan-tests.ts @@ -0,0 +1,32 @@ +import CanCan = require('cancan'); + +const cancan = new CanCan(); + +// $ExpectType void +cancan.allow('admin', 'manage', 'all'); + +// $ExpectType void +cancan.allow('user', 'read', 'post', {public: true}); + +// $ExpectType boolean +cancan.can('user', 'read', 'post'); + +// $ExpectType boolean +cancan.cannot('user', 'delete', 'post'); + +// $ExpectType void +cancan.authorize('user', 'delete', 'post'); + +// $ExpectType boolean +cancan.can('user', 'read', 'post', {fields: ['title']}); + +// $ExpectType boolean +cancan.cannot('user', 'delete', 'post', {fields: ['title']}); + +// $ExpectType void +cancan.authorize('user', 'delete', 'post', {fields: ['title']}); + +const cancanWithOption = new CanCan({ + instanceOf: (_instance, _model) => true, + createError: () => true +}); diff --git a/types/cancan/index.d.ts b/types/cancan/index.d.ts new file mode 100644 index 0000000000..e739af1ef5 --- /dev/null +++ b/types/cancan/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for cancan 3.1 +// Project: https://github.com/vadimdemedes/cancan +// Definitions by: Vincent Pang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +declare namespace CanCan { + interface Option { + instanceOf?: (instance: any, model: any) => boolean; + createError?: () => any; + } +} + +declare class CanCan { + constructor(options?: CanCan.Option); + + allow(model: any, + actions: string | ReadonlyArray, + targets: T | ReadonlyArray | string | ReadonlyArray, + condition?: object | ((performer: any, target: any, options?: any) => boolean)): void; + + can(performer: any, action: string, target: any, options?: any): boolean; + + cannot(performer: any, action: string, target: any, options?: any): boolean; + + authorize(performer: any, action: string, target: any, options?: any): void; +} + +export = CanCan; diff --git a/types/cancan/tsconfig.json b/types/cancan/tsconfig.json new file mode 100644 index 0000000000..8aace9dd52 --- /dev/null +++ b/types/cancan/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", + "cancan-tests.ts" + ] +} diff --git a/types/react-native-modal/tslint.json b/types/cancan/tslint.json similarity index 100% rename from types/react-native-modal/tslint.json rename to types/cancan/tslint.json diff --git a/types/cannon/index.d.ts b/types/cannon/index.d.ts index 45e005d53d..56272a6b1f 100644 --- a/types/cannon/index.d.ts +++ b/types/cannon/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for cannon 0.1 // Project: https://github.com/clark-stevenson/cannon.d.ts // Definitions by: Clark Stevenson +// Grzegorz Rozdzialik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -20,10 +21,14 @@ declare module CANNON { constructor(options?: IAABBOptions); - setFromPoints(points: Vec3[], position?: Vec3, quaternion?: Quaternion, skinSize?: number): void; + clone(): AABB; copy(aabb: AABB): void; extend(aabb: AABB): void; + getCorners(a: Vec3, b: Vec3, c: Vec3, d: Vec3, e: Vec3, f: Vec3, g: Vec3, h: Vec3): void; overlaps(aabb: AABB): boolean; + setFromPoints(points: Vec3[], position?: Vec3, quaternion?: Quaternion, skinSize?: number): AABB; + toLocalFrame(frame: Transform, target: AABB): AABB; + toWorldFrame(frame: Transform, target: AABB): AABB; } @@ -32,7 +37,7 @@ declare module CANNON { matrix: Mat3[]; get(i: number, j: number): number; - set(i: number, j: number, value?: number): void; + set(i: number, j: number, value: number): void; reset(): void; setNumObjects(n: number): void; @@ -148,6 +153,8 @@ declare module CANNON { constructor(bodyA: Body, bodyB: Body, options?: IConstraintOptions); update(): void; + disable(): void; + enable(): void; } @@ -188,9 +195,24 @@ declare module CANNON { } + export interface ILockConstraintOptions { + maxForce?: number; + } export class LockConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, options?:any); + constructor(bodyA: Body, bodyB: Body, options?: ILockConstraintOptions); + } + + export interface IConeTwistConstraintOptions { + pivotA?: Vec3; + pivotB?: Vec3; + axisA?: Vec3; + axisB?: Vec3; + maxForce?: number; + } + + export class ConeTwistConstraint extends Constraint { + constructor(bodyA: Body, bodyB: Body, options?: IConeTwistConstraintOptions); } @@ -428,7 +450,7 @@ declare module CANNON { angularVelocity?: Vec3; quaternion?: Quaternion; mass?: number; - material?: number; + material?: Material; type?: number; linearDamping?: number; angularDamping?: number; @@ -478,7 +500,7 @@ declare module CANNON { interpolatedQuaternion: Quaternion; shapes: Shape[]; shapeOffsets: any[]; - shapeOrentiations: any[]; + shapeOrientations: any[]; inertia: Vec3; invInertia: Vec3; invInertiaWorld: Mat3; @@ -735,7 +757,7 @@ declare module CANNON { vertices: Vec3[]; worldVertices: Vec3[]; worldVerticesNeedsUpdate: boolean; - faces: number[]; + faces: number[][]; faceNormals: Vec3[]; uniqueEdges: Vec3[]; @@ -776,7 +798,7 @@ declare module CANNON { export class Heightfield extends Shape { - data: number[]; + data: number[][]; maxValue: number; minValue: number; elementSize: number; @@ -930,7 +952,7 @@ declare module CANNON { } export class World extends EventTarget { - + iterations: number; dt: number; allowSleep: boolean; contacts: ContactEquation[]; @@ -992,6 +1014,10 @@ declare module CANNON { } + export interface ICollisionEvent extends IBodyEvent { + contact: any; + } + } diff --git a/types/cannon/tslint.json b/types/cannon/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cannon/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/canvas-gauges/tslint.json b/types/canvas-gauges/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/canvas-gauges/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts b/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts new file mode 100644 index 0000000000..a4370cff73 --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts @@ -0,0 +1,15 @@ +import { Configuration } from 'webpack'; +import CaseSensitivePathsWebpackPlugin = require('case-sensitive-paths-webpack-plugin'); + +const options: CaseSensitivePathsWebpackPlugin.Options = { + debug: true, +}; + +const c: Configuration = { + plugins: [ + new CaseSensitivePathsWebpackPlugin(), + new CaseSensitivePathsWebpackPlugin({ + debug: true + }), + ], +}; diff --git a/types/case-sensitive-paths-webpack-plugin/index.d.ts b/types/case-sensitive-paths-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..360d3d6d08 --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for case-sensitive-paths-webpack-plugin 2.1 +// Project: https://github.com/Urthen/case-sensitive-paths-webpack-plugin#readme +// Definitions by: Andrew Makarov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'webpack'; + +export = CaseSensitivePathsWebpackPlugin; + +declare class CaseSensitivePathsWebpackPlugin extends Plugin { + constructor(options?: CaseSensitivePathsWebpackPlugin.Options); +} + +declare namespace CaseSensitivePathsWebpackPlugin { + interface Options { + /** + * Show more information + */ + debug?: boolean; + } +} diff --git a/types/case-sensitive-paths-webpack-plugin/tsconfig.json b/types/case-sensitive-paths-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..b8cb05390a --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/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", + "case-sensitive-paths-webpack-plugin-tests.ts" + ] +} diff --git a/types/redux-saga-routines/tslint.json b/types/case-sensitive-paths-webpack-plugin/tslint.json similarity index 100% rename from types/redux-saga-routines/tslint.json rename to types/case-sensitive-paths-webpack-plugin/tslint.json diff --git a/types/caseless/caseless-tests.ts b/types/caseless/caseless-tests.ts new file mode 100644 index 0000000000..2fb16afaad --- /dev/null +++ b/types/caseless/caseless-tests.ts @@ -0,0 +1,40 @@ +import caseless, { Caseless, httpify } from "caseless"; + +new Caseless(); // $ExpectError + +// tslint:disable-next-line: prefer-const +let c1: Caseless; + +caseless(); // $ExpectType Caseless +caseless({}); // $ExpectType Caseless +caseless(null); // $ExpectError +caseless(1); // $ExpectError +caseless("2"); // $ExpectError + +const c2 = caseless(); + +c2.set({}); // $ExpectType void +c2.set('foo', 'bar'); // $ExpectType string | false +c2.set('foo', 'bar', false); // $ExpectType string | false +c2.set('foo', new Date()); // $ExpectType string | false +c2.set(10, 'bar'); // $ExpectError + +c2.get('foo'); // $ExpectType any +c2.get(10); // $ExpectError + +c2.has('foo'); // $ExpectType string | false +c2.has(10); // $ExpectError + +c2.swap('foo'); // $ExpectType void +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 + +httpify({}, {}); // $ExpectType Caseless diff --git a/types/caseless/index.d.ts b/types/caseless/index.d.ts new file mode 100644 index 0000000000..db295a8f89 --- /dev/null +++ b/types/caseless/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for caseless 0.12 +// Project: https://github.com/mikeal/caseless +// Definitions by: downace +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +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; +} + +export function httpify(resp: object, headers: RawDict): Caseless; + +declare function caseless(dict?: RawDict): Caseless; + +export default caseless; diff --git a/types/caseless/tsconfig.json b/types/caseless/tsconfig.json new file mode 100644 index 0000000000..c7dace4424 --- /dev/null +++ b/types/caseless/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", + "caseless-tests.ts" + ] +} diff --git a/types/smooth-scrollbar/tslint.json b/types/caseless/tslint.json similarity index 100% rename from types/smooth-scrollbar/tslint.json rename to types/caseless/tslint.json diff --git a/types/cash/tslint.json b/types/cash/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cash/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/casperjs/index.d.ts b/types/casperjs/index.d.ts index e8388d17c7..f2378f1f97 100644 --- a/types/casperjs/index.d.ts +++ b/types/casperjs/index.d.ts @@ -1,17 +1,17 @@ -// Type definitions for CasperJS v1.0.29 +// Type definitions for CasperJS 1.1 // Project: http://casperjs.org/ // Definitions by: Jed Mao +// Uriel Chemouni // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// - export function create(options?: CasperOptions): Casper; -export function selectXPath(expression: string): Object; +export function selectXPath(expression: string): object; export class Casper { - constructor(options: CasperOptions); test: Tester; @@ -23,23 +23,23 @@ export class Casper { // Methods back(): Casper; base64encode(url: string, method?: string, data?: any): string; - bypass(nb: number): any; - click(selector: string): boolean; + bypass(nb: number): Casper; + click(selector: string, X?: number | string, Y?: number | string): boolean; clickLabel(label: string, tag?: string): boolean; - capture(targetFilePath: string, clipRect: ClipRect): Casper; - captureBase64(format: string): string; - captureBase64(format: string, area: string): string; - captureBase64(format: string, area: ClipRect): string; - captureBase64(format: string, area: any): string; - captureSelector(targetFile: string, selector: string): Casper; + capture(targetFilePath: string, clipRect?: ClipRect, imgOptions?: ImgOptions): Casper; + captureBase64(format: string, area?: string | ClipRect | CasperSelector): string; + captureSelector(targetFile: string, selector: string, imgOptions?: ImgOptions): Casper; clear(): Casper; + clearCache(): Casper; + clearMemoryCache(): Casper; debugHTML(selector?: string, outer?: boolean): Casper; debugPage(): Casper; die(message: string, status?: number): Casper; - download(url: string, target?: string, method?: string, data?: any): Casper; + download(url: string, target: string, method?: string, data?: any): Casper; each(array: T[], fn: (this: Casper, item: T, index: number) => void): Casper; + eachThen(array: any[], then?: FunctionThen): Casper; echo(message: string, style?: string): Casper; - evaluate(fn: (...args: any[]) => T, ...args: any[]): T + evaluate(fn: (...args: any[]) => T, ...args: any[]): T; evaluateOrDie(fn: () => any, message?: string, status?: number): Casper; exit(status?: number): Casper; exists(selector: string): boolean; @@ -52,7 +52,7 @@ export class Casper { getCurrentUrl(): string; getElementAttribute(selector: string, attribute: string): string; getElementsAttribute(selector: string, attribute: string): string; - getElementBounds(selector: string): ElementBounds; + getElementBounds(selector: string, page?: boolean): ElementBounds | null; getElementsBounds(selector: string): ElementBounds[]; getElementInfo(selector: string): ElementInfo; getElementsInfo(selector: string): ElementInfo; @@ -61,83 +61,125 @@ export class Casper { getHTML(selector?: string, outer?: boolean): string; getPageContent(): string; getTitle(): string; - mouseEvent(type: string, selector: string): boolean; + mouseEvent(type: string, selector: string, X?: number|string, Y?: number|string): boolean; + newPage(): any; open(location: string, settings: OpenSettings): Casper; - reload(then?: (response: HttpResponse) => void): Casper; - repeat(times: number, then: Function): Casper; - resourceExists(test: Function): boolean; - resourceExists(test: string): boolean; - run(onComplete: Function, time?: number): Casper; + reload(then?: FunctionThen): Casper; + repeat(times: number, then: FunctionThen): Casper; + resourceExists(test: string | Function | RegExp): boolean; + run(onComplete?: Function, time?: number): Casper; scrollTo(x: number, y: number): Casper; scrollToBottom(): Casper; - sendKeys(selector: string, keys: string, options?: any): Casper; + sendKeys(selector: string, keys: string, options?: KeyOptions): Casper; setHttpAuth(username: string, password: string): Casper; - start(url?: string, then?: (response: HttpResponse) => void): Casper; - status(asString: boolean): any; + setMaxListeners(maxListeners: number): Casper; + start(url?: string, then?: FunctionThen): Casper; + status(asString?: false): number; + status(asString: true): string; + switchToFrame(frameInfo: string | number): Casper; + switchToMainFrame(): Casper; + switchToParentFrame(): Casper; then(fn: (this: Casper) => void): Casper; thenBypass(nb: number): Casper; thenBypassIf(condition: any, nb: number): Casper; thenBypassUnless(condition: any, nb: number): Casper; - thenClick(selector: string): Casper; + thenClick(selector: string, then?: FunctionThen): Casper; thenEvaluate(fn: () => any, ...args: any[]): Casper; thenOpen(location: string, then?: (response: HttpResponse) => void): Casper; thenOpen(location: string, options?: OpenSettings, then?: (response: HttpResponse) => void): Casper; - thenOpenAndEvaluate(location: string, then?: Function, ...args: any[]): Casper; + thenOpenAndEvaluate(location: string, then?: FunctionThen, ...args: any[]): Casper; toString(): string; unwait(): Casper; - userAgent(agent: string): string; - viewport(width: number, height: number): Casper; + // 2017-10-19 Doc said returning String but code return Casper object. + userAgent(agent: string): Casper; + viewport(width: number, height: number, then?: FunctionThen): Casper; visible(selector: string): boolean; - wait(timeout: number, then?: Function): Casper; - waitFor(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForAlert(then: Function, onTimeout?: Function, timeout?: number): Casper; - waitForPopup(urlPattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForPopup(urlPattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForUrl(url: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForUrl(url: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitWhileSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForResource(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForText(pattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForText(pattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitUntilVisible(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitWhileVisible(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + wait(timeout: number, then?: FunctionThen): Casper; + waitFor(testFx: Function, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number, details?: any): Casper; + waitForAlert(then: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForExec(command: string | null, parameter: string[], then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForPopup(urlPattern: RegExp | string | number | FindByUrlNameTitle, then?: FunctionThen, onTimeout?: Function, timeout?: number): Casper; + waitForResource(testFx: RegExp | string | ((resource: {url: string}) => boolean), then?: FunctionThen, onTimeout?: Function, timeout?: number): Casper; + waitForUrl(url: RegExp | string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForSelector(selector: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitWhileSelector(selector: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForSelectorTextChange(selectors: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForText(pattern: RegExp | string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitUntilVisible(selector: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitWhileVisible(selector: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; warn(message: string): Casper; - withFrame(frameInfo: string, then: Function): Casper; - withFrame(frameInfo: number, then: Function): Casper; - withPopup(popupInfo: string, step: Function): Casper; - withPopup(popupInfo: RegExp, step: Function): Casper; + withFrame(frameInfo: string | number, then: FunctionThen): Casper; + withPopup(popupInfo: RegExp | string | number | FindByUrlNameTitle, step: FunctionThen): Casper; + withSelectorScope(selector: string, then: FunctionThen): Casper; zoom(factor: number): Casper; - removeAllFilters(filter: string): Casper; - setFilter(filter: string, cb: Function): boolean; + // do not exists anymore + // removeAllFilters(filter: string): Casper; + // do not exists anymore + // setFilter(filter: string, cb: Function): boolean; } -interface HttpResponse { +export type FunctionThen = (this: Casper, response: HttpResponse) => void; +export type FunctionOnTimeout = (this: Casper, timeout: number, details: any) => void; +// not visible in doc +// interface QtRuntimeObject {id?: any; url?: string;} +// see modules/pagestack.js in casperjs + +export interface ImgOptions { + // format to set the image format manually, avoiding relying on the filename + format?: string; + // quality to set the image quality, from 1 to 100 + quality?: number; +} + +export interface FindByUrlNameTitle { + url?: string; + title?: string; + windowName?: string; +} + +export interface Header { + name: string; + value: string; +} + +export interface CasperSelector { + type?: 'xpath' | 'css'; + path: string; +} + +export interface KeyOptions { + reset?: boolean; + keepFocus?: boolean; + modifiers?: string; // combinaison of 'ctrl+alt+shift+meta+keypad' +} + +export interface HttpResponse { contentType: string; - headers: any[]; + headers: Header[]; id: number; - redirectURL: string; + redirectURL: string | null; stage: string; status: number; statusText: string; time: string; url: string; + data: any; } -interface OpenSettings { +export interface OpenSettings { method: string; data: any; headers: any; } -interface ElementBounds { +export interface ElementBounds { top: number; left: number; width: number; height: number; } -interface ElementInfo { +export interface ElementInfo { nodeName: string; attributes: any; tag: string; @@ -150,7 +192,7 @@ interface ElementInfo { visible: boolean; } -interface CasperOptions { +export interface CasperOptions { clientScripts?: any[]; exitOnError?: boolean; httpStatusHandlers?: any; @@ -179,7 +221,7 @@ interface CasperOptions { waitTimeout?: number; } -interface ClientUtils { +export interface ClientUtils { echo(message: string): void; encode(contents: string): void; exists(selector: string): void; @@ -200,12 +242,12 @@ interface ClientUtils { visible(selector: string): void; } -interface Colorizer { +export interface Colorizer { colorize(text: string, styleName: string): void; format(text: string, style: any): void; } -interface Tester { +export interface Tester { assert(condition: boolean, message?: string): any; assertDoesntExist(selector: string, message?: string): any; assertElementCount(selctor: string, expected: number, message?: string): any; @@ -235,15 +277,14 @@ interface Tester { assertTruthy(subject: any, message?: string): any; assertType(input: any, type: string, message?: string): any; assertInstanceOf(input: any, ctor: Function, message?: string): any; - assertUrlMatch(pattern: string, message?: string): any; - assertUrlMatch(pattern: RegExp, message?: string): any; + assertUrlMatch(pattern: RegExp | string, message?: string): any; assertVisible(selector: string, message?: string): any; /* since 1.1 */ begin(description: string, planned: number, suite: Function): any; begin(description: string, suite: Function): any; - begin(description: string, planned: number, config: Object): any; - begin(description: string, config: Object): any; + begin(description: string, planned: number, config: object): any; + begin(description: string, config: object): any; colorize(message: string, style: string): any; comment(message: string): any; @@ -262,12 +303,12 @@ interface Tester { tearDown(fn: Function): any; } -interface Cases { +export interface Cases { length: number; cases: Case[]; } -interface Case { +export interface Case { success: boolean; type: string; standard: string; @@ -275,12 +316,12 @@ interface Case { values: CaseValues; } -interface CaseValues { +export interface CaseValues { subject: boolean; expected: boolean; } -interface Utils { +export interface Utils { betterTypeOf(input: any): any; dump(value: any): any; fileExt(file: string): any; diff --git a/types/casperjs/tslint.json b/types/casperjs/tslint.json new file mode 100644 index 0000000000..c2a140228c --- /dev/null +++ b/types/casperjs/tslint.json @@ -0,0 +1,12 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // need to fix some Function type + "ban-types": false, + // can not merge + // begin(description: string, planned: number, suite: Function): any; + // and + // begin(description: string, planned: number, config: object): any; + "unified-signatures": false + } +} diff --git a/types/cassandra-driver/cassandra-driver-tests.ts b/types/cassandra-driver/cassandra-driver-tests.ts index 40971c7183..891c5a0167 100644 --- a/types/cassandra-driver/cassandra-driver-tests.ts +++ b/types/cassandra-driver/cassandra-driver-tests.ts @@ -1,9 +1,16 @@ import * as cassandra from 'cassandra-driver'; import * as util from 'util'; +import * as fs from 'fs'; -var client = new cassandra.Client({ contactPoints: ['h1', 'h2'], keyspace: 'ks1'}); +const client = new cassandra.Client({ + contactPoints: ['h1', 'h2'], + keyspace: 'ks1', + sslOptions: { + cert: fs.readFileSync('certFilePath') + } +}); -var query = 'SELECT email, last_name FROM user_profiles WHERE key=?'; +const query = 'SELECT email, last_name FROM user_profiles WHERE key=?'; client.execute(query, ['guy'], function(err, result) { console.log('got user profile with email ' + result.rows[0].email); }); diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index a581071dfb..5c0578ccf2 100644 --- a/types/cassandra-driver/index.d.ts +++ b/types/cassandra-driver/index.d.ts @@ -12,11 +12,12 @@ export type ResultCallback = (err: Error, result: types.ResultSet) => void; import * as events from "events"; import * as stream from "stream"; +import * as tls from "tls"; import _Long = require("long"); export namespace policies { namespace addressResolution { - var EC2MultiRegionTranslator: EC2MultiRegionTranslatorStatic; + let EC2MultiRegionTranslator: EC2MultiRegionTranslatorStatic; interface AddressTranslator { translate(address: string, port: number, callback: Callback): void; @@ -32,10 +33,10 @@ export namespace policies { } namespace loadBalancing { - var DCAwareRoundRobinPolicy: DCAwareRoundRobinPolicyStatic; - var RoundRobinPolicy: RoundRobinPolicyStatic; - var TokenAwarePolicy: TokenAwarePolicyStatic; - var WhiteListPolicy: WhiteListPolicyStatic; + let DCAwareRoundRobinPolicy: DCAwareRoundRobinPolicyStatic; + let RoundRobinPolicy: RoundRobinPolicyStatic; + let TokenAwarePolicy: TokenAwarePolicyStatic; + let WhiteListPolicy: WhiteListPolicyStatic; interface LoadBalancingPolicy { init(client: Client, hosts: HostMap, callback: Callback): void; @@ -72,8 +73,8 @@ export namespace policies { } namespace reconnection { - var ConstantReconnectionPolicy: ConstantReconnectionPolicyStatic; - var ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic; + let ConstantReconnectionPolicy: ConstantReconnectionPolicyStatic; + let ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic; interface ReconnectionPolicy { newSchedule(): { next: Function }; @@ -93,7 +94,7 @@ export namespace policies { } namespace retry { - var RetryPolicy: RetryPolicyStatic; + let RetryPolicy: RetryPolicyStatic; interface DecisionInfo { decision: number; @@ -128,18 +129,18 @@ export namespace policies { } export namespace types { - var BigDecimal: BigDecimalStatic; - var InetAddress: InetAddressStatic; - var Integer: IntegerStatic; - var LocalDate: LocalDateStatic; - var LocalTime: LocalTimeStatic; - var Long: _Long; - var ResultSet: ResultSetStatic; - // var ResultStream: ResultStreamStatic; - var Row: RowStatic; - var TimeUuid: TimeUuidStatic; - var Tuple: TupleStatic; - var Uuid: UuidStatic; + let BigDecimal: BigDecimalStatic; + let InetAddress: InetAddressStatic; + let Integer: IntegerStatic; + let LocalDate: LocalDateStatic; + let LocalTime: LocalTimeStatic; + let Long: _Long; + let ResultSet: ResultSetStatic; + // let ResultStream: ResultStreamStatic; + let Row: RowStatic; + let TimeUuid: TimeUuidStatic; + let Tuple: TupleStatic; + let Uuid: UuidStatic; enum consistencies { any = 0, @@ -433,10 +434,10 @@ export namespace types { } } -export var Client: ClientStatic; -export var Host: HostStatic; -export var HostMap: HostMapStatic; -export var Encoder: EncoderStatic; +export let Client: ClientStatic; +export let Host: HostStatic; +export let HostMap: HostMapStatic; +export let Encoder: EncoderStatic; export interface ClientOptions { contactPoints: Array, @@ -468,7 +469,7 @@ export interface ClientOptions { coalescingThreshold: number }, authProvider?: auth.AuthProvider, - sslOptions?: any, + sslOptions?: tls.ConnectionOptions, encoding?: { map: Function, set: Function, @@ -512,6 +513,7 @@ export interface Client extends events.EventEmitter { batch(queries: Array | Array<{ query: string, params?: any }>, options?: QueryOptions): Promise; connect(callback: Callback): void; + connect(): Promise; eachRow(query: string, params?: any, options?: QueryOptions, rowCallback?: Callback, callback?: Callback): void; execute(query: string, params: any, options: QueryOptions, callback: ResultCallback): void; execute(query: string, params: any, callback: ResultCallback): void; @@ -519,6 +521,7 @@ export interface Client extends events.EventEmitter { execute(query: string, params?: any, options?: QueryOptions): Promise; getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return? shutdown(callback?: Callback): void; + shutdown(): Promise; stream(query: string, params?: any, options?: QueryOptions, callback?: Callback): NodeJS.ReadableStream; } @@ -564,8 +567,8 @@ export interface Encoder { } export namespace auth { - var Authenticator: AuthenticatorStatic; - var PlainTextAuthProvider: PlainTextAuthProviderStatic; + let Authenticator: AuthenticatorStatic; + let PlainTextAuthProvider: PlainTextAuthProviderStatic; interface AuthenticatorStatic { new (): Authenticator; @@ -623,12 +626,12 @@ export namespace errors { } export namespace metadata { - var Aggregate: AggregateStatic; - var Index: IndexStatic; - var MaterializedView: MaterializedViewStatic; - var Metadata: MetadataStatic; - var SchemaFunction: SchemaFunctionStatic; - var TableMetadata: TableMetadataStatic; + let Aggregate: AggregateStatic; + let Index: IndexStatic; + let MaterializedView: MaterializedViewStatic; + let Metadata: MetadataStatic; + let SchemaFunction: SchemaFunctionStatic; + let TableMetadata: TableMetadataStatic; type caching = "all" | "keys_only" | "rows_only" | "none"; diff --git a/types/cassandra-driver/tslint.json b/types/cassandra-driver/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cassandra-driver/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/catbox/index.d.ts b/types/catbox/index.d.ts index 7bc691abdc..826f1f7369 100644 --- a/types/catbox/index.d.ts +++ b/types/catbox/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapijs/catbox // Definitions by: Jason Swearingen , AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 import * as Boom from 'boom'; diff --git a/types/catbox/tsconfig.json b/types/catbox/tsconfig.json index feb19f81dc..16f6fb780e 100644 --- a/types/catbox/tsconfig.json +++ b/types/catbox/tsconfig.json @@ -13,6 +13,9 @@ "../" ], "types": [], + "paths": { + "boom": ["boom/v4"] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -20,4 +23,4 @@ "index.d.ts", "catbox-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/cbor/tslint.json b/types/cbor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cbor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-as-promised/tslint.json b/types/chai-as-promised/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-as-promised/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-datetime/tslint.json b/types/chai-datetime/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-datetime/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-dom/tslint.json b/types/chai-dom/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-dom/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-enzyme/tslint.json b/types/chai-enzyme/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-enzyme/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-fuzzy/tslint.json b/types/chai-fuzzy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-fuzzy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts b/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts index 05cf190765..c93c4a1d04 100644 --- a/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts +++ b/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts @@ -16,7 +16,7 @@ const mockContext: Mocha.IBeforeAndAfterContext = { } }; -chaiJestSnapshot.setFileName("filename"); +chaiJestSnapshot.setFilename("filename"); chaiJestSnapshot.setTestName("testname"); chaiJestSnapshot.configureUsingMochaContext(mockContext); chaiJestSnapshot.resetSnapshotRegistry(); diff --git a/types/chai-jest-snapshot/index.d.ts b/types/chai-jest-snapshot/index.d.ts index f19158e282..862da8cd16 100644 --- a/types/chai-jest-snapshot/index.d.ts +++ b/types/chai-jest-snapshot/index.d.ts @@ -9,12 +9,7 @@ declare global { namespace Chai { interface Assertion { - /** - * Assert that the object matches the snapshot - * @param snapshotFilename - * @param snapshotName - * @param update - */ + /** Assert that the object matches the snapshot */ matchSnapshot(snapshotFilename?: string, snapshotName?: string, update?: boolean): Assertion; matchSnapshot(update: boolean): Assertion; } @@ -22,40 +17,24 @@ declare global { } interface ChaiJestSnapshot { - /** - * Chai bootstrapper - * @param chai - * @param utils - */ + /** Chai bootstrapper */ (chai: any, utils: any): void; - /** - * Set snapshot file name - * @param filename - */ - setFileName(filename: string): void; + /** Set snapshot file name */ + setFilename(filename: string): void; /** * Set snapshot test name - * @param testname */ setTestName(testname: string): void; - /** - * Configure snapshot name using mocha context - * @param context - */ + /** Configure snapshot name using mocha context */ configureUsingMochaContext(context: Mocha.IBeforeAndAfterContext): void; - /** - * Reset snapshot registry - */ + /** Reset snapshot registry */ resetSnapshotRegistry(): void; - /** - * Add a serializer plugin - * @param serializer - */ + /** Add a serializer plugin */ addSerializer(serializer: any): void; } diff --git a/types/chai-jquery/index.d.ts b/types/chai-jquery/index.d.ts index e1628f1743..e84a1ec272 100644 --- a/types/chai-jquery/index.d.ts +++ b/types/chai-jquery/index.d.ts @@ -10,21 +10,21 @@ declare namespace Chai { interface Assertion { - attr: (name: string, value?: string) => Assertion; - prop: (name: string, value?: any) => Assertion; - css: (name: string, value?: string) => Assertion; - data: (name: string, value?: string) => Assertion; + attr(name: string, value?: string): Assertion; + prop(name: string, value?: any): Assertion; + css(name: string, value?: string): Assertion; + data(name: string, value?: string): Assertion; class(className: string): Assertion; id(id: string): Assertion; html(html: string): Assertion; text(text: string): Assertion; value(text: string): Assertion; descendants(selector: string): Assertion; - visible: Assertion; - hidden: Assertion; - selected: Assertion; - checked: Assertion; - disabled: Assertion; + visible(): Assertion; + hidden(): Assertion; + selected(): Assertion; + checked(): Assertion; + disabled(): Assertion; (selector: string): Assertion; } } diff --git a/types/chai-jquery/tslint.json b/types/chai-jquery/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-jquery/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-spies/tslint.json b/types/chai-spies/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-spies/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-string/tslint.json b/types/chai-string/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-string/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-things/tslint.json b/types/chai-things/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-things/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-webdriverio/chai-webdriverio-tests.ts b/types/chai-webdriverio/chai-webdriverio-tests.ts new file mode 100644 index 0000000000..989eb64960 --- /dev/null +++ b/types/chai-webdriverio/chai-webdriverio-tests.ts @@ -0,0 +1,30 @@ +import chai = require('chai'); +import webdriverio = require('webdriverio'); +import chaiWebdriverio = require('chai-webdriverio'); + +const options = { + desiredCapabilities: { + browserName: 'firefox' + } +}; + +const browser = webdriverio.remote(options); +chai.use(chaiWebdriverio(browser)); + +const selector = 'Hello, World!'; + +chai.expect(selector).to.be.there(); + +chai.expect(selector).to.be.visible(); + +chai.expect(selector).to.have.text(selector); + +chai.expect(selector).to.have.text(/regex/); + +chai.expect(selector).to.have.count(10); + +chai.expect(selector).to.have.value('x'); + +chai.expect(selector).to.have.value(/regex/); + +chai.expect(selector).to.have.focus(); diff --git a/types/chai-webdriverio/index.d.ts b/types/chai-webdriverio/index.d.ts new file mode 100644 index 0000000000..d0b958dad5 --- /dev/null +++ b/types/chai-webdriverio/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for chai-webdriverio 0.4 +// Project: https://github.com/marcodejongh/chai-webdriverio +// Definitions by: Nikolai Orekhov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare namespace Chai { + interface Assertion { + count: (count: number) => void; + focus: () => void; + text: (expected: string|number|RegExp) => void; + there: () => void; + value: (expected: string|number|RegExp) => void; + visible: () => void; + immediately: Assertion; + } +} + +declare module 'chai-webdriverio' { + function chaiWebdriverIO(client: WebdriverIO.Client, options?: any): (chai: any, utils: any) => void; + export = chaiWebdriverIO; +} diff --git a/types/chai-webdriverio/tsconfig.json b/types/chai-webdriverio/tsconfig.json new file mode 100644 index 0000000000..c44958af89 --- /dev/null +++ b/types/chai-webdriverio/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", + "chai-webdriverio-tests.ts" + ] +} \ No newline at end of file diff --git a/types/chai-webdriverio/tslint.json b/types/chai-webdriverio/tslint.json new file mode 100644 index 0000000000..1be28efd2f --- /dev/null +++ b/types/chai-webdriverio/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-single-declare-module" : false, + "no-declare-current-package": false + } +} diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts index 31802ca303..57b7d127ac 100644 --- a/types/chai/chai-tests.ts +++ b/types/chai/chai-tests.ts @@ -1,4 +1,5 @@ -import * as chai from "chai"; +/// +import * as chai from 'chai'; const expect = chai.expect; const assert = chai.assert; @@ -88,10 +89,10 @@ function _undefined() { function _NaN() { expect(NaN).to.be.NaN; expect(12).to.be.not.NaN; - expect("NaN").to.be.not.NaN; + expect('NaN').to.be.not.NaN; (NaN).should.be.NaN; (12).should.be.not.NaN; - ("NaN").should.be.not.NaN; + ('NaN').should.be.not.NaN; } function exist() { @@ -132,7 +133,9 @@ function _typeof() { expect(5).to.be.a('number'); (5).should.be.a('number'); + // tslint:disable-next-line:no-construct expect(new Number(1)).to.be.a('number'); + // tslint:disable-next-line:no-construct (new Number(1)).should.be.a('number'); expect(Number(1)).to.be.a('number'); Number(1).should.be.a('number'); @@ -146,8 +149,10 @@ function _typeof() { ({}).should.be.a('object'); expect([]).to.be.a('array'); [].should.be.a('array'); - expect(() => { }).to.be.a('function'); - (() => { }).should.be.a('function'); + expect(() => { + }).to.be.a('function'); + (() => { + }).should.be.a('function'); expect(null).to.be.a('null'); // N.B. previous line has no should equivalent @@ -155,7 +160,9 @@ function _typeof() { (5).should.not.be.a('number', 'blah'); } -class Foo { } +class Foo { +} + function _instanceof() { expect(new Foo()).to.be.an.instanceof(Foo); (new Foo()).should.be.an.instanceof(Foo); @@ -337,8 +344,8 @@ function length2() { function eql() { expect('test').to.eql('test'); 'test'.should.eql('test'); - expect({ foo: 'bar' }).to.eql({ foo: 'bar' }); - ({ foo: 'bar' }).should.eql({ foo: 'bar' }); + expect({foo: 'bar'}).to.eql({foo: 'bar'}); + ({foo: 'bar'}).should.eql({foo: 'bar'}); expect(1).to.eql(1); (1).should.eql(1); expect('4').to.not.eql(4); @@ -348,10 +355,6 @@ function eql() { (4).should.eql(3, 'blah'); } -class Buffer { - constructor(arr: number[]) { - } -} function buffer() { expect(new Buffer([1])).to.eql(new Buffer([1])); (new Buffer([1])).should.eql(new Buffer([1])); @@ -378,9 +381,9 @@ function equal2() { } function deepEqual() { - expect({ foo: 'bar' }).to.deep.equal({ foo: 'bar' }); - ({ foo: 'bar' }).should.deep.equal({ foo: 'bar' }); - expect({ foo: 'bar' }).not.to.deep.equal({ foo: 'baz' }); + expect({foo: 'bar'}).to.deep.equal({foo: 'bar'}); + ({foo: 'bar'}).should.deep.equal({foo: 'bar'}); + expect({foo: 'bar'}).not.to.deep.equal({foo: 'baz'}); } function deepEqual2() { @@ -435,12 +438,12 @@ function empty() { ['foo'].should.not.be.empty; expect(new FakeArgs).to.be.empty; (new FakeArgs).should.be.empty; - expect({ arguments: 0 }).not.to.be.empty; - ({ arguments: 0 }).should.not.be.empty; + expect({arguments: 0}).not.to.be.empty; + ({arguments: 0}).should.not.be.empty; expect({}).to.be.empty; ({}).should.be.empty; - expect({ foo: 'bar' }).not.to.be.empty; - ({ foo: 'bar' }).should.not.be.empty; + expect({foo: 'bar'}).not.to.be.empty; + ({foo: 'bar'}).should.not.be.empty; expect('').not.to.be.empty; ''.should.not.be.empty; @@ -458,14 +461,14 @@ function empty() { expect(new FakeArgs).not.to.be.empty; (new FakeArgs).should.not.be.empty; - expect({ arguments: 0 }).to.be.empty; - ({ arguments: 0 }).should.be.empty; + expect({arguments: 0}).to.be.empty; + ({arguments: 0}).should.be.empty; expect({}).not.to.be.empty; ({}).should.not.be.empty; - expect({ foo: 'bar' }).to.be.empty; - ({ foo: 'bar' }).should.be.empty; + expect({foo: 'bar'}).to.be.empty; + ({foo: 'bar'}).should.be.empty; } function property() { @@ -474,35 +477,35 @@ function property() { expect(4).to.not.have.property('length'); (4).should.not.have.property('length'); - expect({ 'foo.bar': 'baz' }) + expect({'foo.bar': 'baz'}) .to.have.property('foo.bar'); - ({ 'foo.bar': 'baz' }).should.have.property('foo.bar'); - expect({ foo: { bar: 'baz' } }) + ({'foo.bar': 'baz'}).should.have.property('foo.bar'); + expect({foo: {bar: 'baz'}}) .to.not.have.property('foo.bar'); - ({ foo: { bar: 'baz' } }).should.not.have.property('foo.bar'); + ({foo: {bar: 'baz'}}).should.not.have.property('foo.bar'); expect('asd').to.have.property('foo'); 'asd'.should.have.property('foo'); - expect({ foo: { bar: 'baz' } }) + expect({foo: {bar: 'baz'}}) .to.have.property('foo.bar'); - ({ foo: { bar: 'baz' } }).should.have.property('foo.bar'); + ({foo: {bar: 'baz'}}).should.have.property('foo.bar'); } function nestedProperty() { - expect({ 'foo.bar': 'baz' }) + expect({'foo.bar': 'baz'}) .to.not.have.nested.property('foo.bar'); - ({ 'foo.bar': 'baz' }).should + ({'foo.bar': 'baz'}).should .not.have.nested.property('foo.bar'); - expect({ foo: { bar: 'baz' } }) + expect({foo: {bar: 'baz'}}) .to.have.nested.property('foo.bar'); - ({ foo: { bar: 'baz' } }).should + ({foo: {bar: 'baz'}}).should .have.nested.property('foo.bar'); - expect({ 'foo.bar': 'baz' }) + expect({'foo.bar': 'baz'}) .to.have.nested.property('foo.bar'); - ({ 'foo.bar': 'baz' }).should + ({'foo.bar': 'baz'}).should .have.nested.property('foo.bar'); } @@ -526,22 +529,22 @@ function property2() { } function nestedProperty2() { - expect({ foo: { bar: 'baz' } }) + expect({foo: {bar: 'baz'}}) .to.have.nested.property('foo.bar', 'baz'); - ({ foo: { bar: 'baz' } }).should + ({foo: {bar: 'baz'}}).should .have.nested.property('foo.bar', 'baz'); - expect({ foo: { bar: 'baz' } }) + expect({foo: {bar: 'baz'}}) .to.have.nested.property('foo.bar', 'quux', 'blah'); - ({ foo: { bar: 'baz' } }).should + ({foo: {bar: 'baz'}}).should .have.nested.property('foo.bar', 'quux', 'blah'); - expect({ foo: { bar: 'baz' } }) + expect({foo: {bar: 'baz'}}) .to.not.have.nested.property('foo.bar', 'baz', 'blah'); - ({ foo: { bar: 'baz' } }).should + ({foo: {bar: 'baz'}}).should .not.have.nested.property('foo.bar', 'baz', 'blah'); - expect({ foo: 5 }) + expect({foo: 5}) .to.not.have.nested.property('foo.bar', 'baz', 'blah'); - ({ foo: 5 }).should + ({foo: 5}).should .not.have.nested.property('foo.bar', 'baz', 'blah'); } @@ -550,23 +553,43 @@ function ownProperty() { 'test'.should.have.ownProperty('length'); expect('test').to.haveOwnProperty('length'); 'test'.should.haveOwnProperty('length'); - expect({ length: 12 }).to.have.ownProperty('length'); - ({ length: 12 }).should.have.ownProperty('length'); + expect({length: 12}).to.have.ownProperty('length'); + ({length: 12}).should.have.ownProperty('length'); - expect({ length: 12 }).to.not.have.ownProperty('length', 'blah'); - ({ length: 12 }).should.not.have.ownProperty('length', 'blah'); + expect({length: 12}).to.not.have.ownProperty('length', 'blah'); + ({length: 12}).should.not.have.ownProperty('length', 'blah'); } function ownPropertyDescriptor() { expect('test').to.have.ownPropertyDescriptor('length'); - expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); - expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); + expect('test').to.have.ownPropertyDescriptor('length', { + enumerable: false, + configurable: false, + writable: false, + value: 4 + }); + expect('test').not.to.have.ownPropertyDescriptor('length', { + enumerable: false, + configurable: false, + writable: false, + value: 3 + }); expect('test').to.haveOwnPropertyDescriptor('length').to.have.property('enumerable', false); expect('test').to.haveOwnPropertyDescriptor('length').to.contain.keys('value'); 'test'.should.have.ownPropertyDescriptor('length'); - 'test'.should.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); - 'test'.should.not.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); + 'test'.should.have.ownPropertyDescriptor('length', { + enumerable: false, + configurable: false, + writable: false, + value: 4 + }); + 'test'.should.not.have.ownPropertyDescriptor('length', { + enumerable: false, + configurable: false, + writable: false, + value: 3 + }); 'test'.should.haveOwnPropertyDescriptor('length').to.have.property('enumerable', false); 'test'.should.haveOwnPropertyDescriptor('length').to.contain.keys('value'); } @@ -614,88 +637,88 @@ function include() { } function keys() { - expect({ foo: 1 }).to.have.keys(['foo']); - ({ foo: 1 }).should.have.keys(['foo']); - expect({ foo: 1, bar: 2 }).to.have.keys(['foo', 'bar']); - ({ foo: 1, bar: 2 }).should.have.keys(['foo', 'bar']); - expect({ foo: 1, bar: 2 }).to.have.keys('foo', 'bar'); - ({ foo: 1, bar: 2 }).should.have.keys('foo', 'bar'); - expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('foo', 'bar'); - ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('foo', 'bar'); - expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('bar', 'foo'); - ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('bar', 'foo'); - expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('baz'); - ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('baz'); + expect({foo: 1}).to.have.keys(['foo']); + ({foo: 1}).should.have.keys(['foo']); + expect({foo: 1, bar: 2}).to.have.keys(['foo', 'bar']); + ({foo: 1, bar: 2}).should.have.keys(['foo', 'bar']); + expect({foo: 1, bar: 2}).to.have.keys('foo', 'bar'); + ({foo: 1, bar: 2}).should.have.keys('foo', 'bar'); + expect({foo: 1, bar: 2, baz: 3}).to.contain.keys('foo', 'bar'); + ({foo: 1, bar: 2, baz: 3}).should.contain.keys('foo', 'bar'); + expect({foo: 1, bar: 2, baz: 3}).to.contain.keys('bar', 'foo'); + ({foo: 1, bar: 2, baz: 3}).should.contain.keys('bar', 'foo'); + expect({foo: 1, bar: 2, baz: 3}).to.contain.keys('baz'); + ({foo: 1, bar: 2, baz: 3}).should.contain.keys('baz'); // alias - expect({ foo: 1, bar: 2, baz: 3 }).contains.keys('baz'); + expect({foo: 1, bar: 2, baz: 3}).contains.keys('baz'); - expect({ foo: 1, bar: 2 }).to.have.all.keys(['foo', 'bar']); - expect({ foo: 1, bar: 2 }).to.have.any.keys(['foo', 'bar']); - ({ foo: 1, bar: 2, baz: 3 }).should.contain.all.keys('baz'); - ({ foo: 1, bar: 2, baz: 3 }).should.contain.any.keys('baz'); + expect({foo: 1, bar: 2}).to.have.all.keys(['foo', 'bar']); + expect({foo: 1, bar: 2}).to.have.any.keys(['foo', 'bar']); + ({foo: 1, bar: 2, baz: 3}).should.contain.all.keys('baz'); + ({foo: 1, bar: 2, baz: 3}).should.contain.any.keys('baz'); - expect({ foo: 1, bar: 2 }).to.contain.keys('foo'); - ({ foo: 1, bar: 2 }).should.contain.keys('foo'); - expect({ foo: 1, bar: 2 }).to.contain.keys('bar', 'foo'); - ({ foo: 1, bar: 2 }).should.contain.keys('bar', 'foo'); - expect({ foo: 1, bar: 2 }).to.contain.keys(['foo']); - ({ foo: 1, bar: 2 }).should.contain.keys(['foo']); - expect({ foo: 1, bar: 2 }).to.contain.keys(['bar']); - ({ foo: 1, bar: 2 }).should.contain.keys(['bar']); - expect({ foo: 1, bar: 2 }).to.contain.keys(['bar', 'foo']); - ({ foo: 1, bar: 2 }).should.contain.keys(['bar', 'foo']); + expect({foo: 1, bar: 2}).to.contain.keys('foo'); + ({foo: 1, bar: 2}).should.contain.keys('foo'); + expect({foo: 1, bar: 2}).to.contain.keys('bar', 'foo'); + ({foo: 1, bar: 2}).should.contain.keys('bar', 'foo'); + expect({foo: 1, bar: 2}).to.contain.keys(['foo']); + ({foo: 1, bar: 2}).should.contain.keys(['foo']); + expect({foo: 1, bar: 2}).to.contain.keys(['bar']); + ({foo: 1, bar: 2}).should.contain.keys(['bar']); + expect({foo: 1, bar: 2}).to.contain.keys(['bar', 'foo']); + ({foo: 1, bar: 2}).should.contain.keys(['bar', 'foo']); - expect({ foo: 1, bar: 2 }).to.not.have.keys('baz'); - ({ foo: 1, bar: 2 }).should.not.have.keys('baz'); - expect({ foo: 1, bar: 2 }).to.not.have.keys('foo', 'baz'); - ({ foo: 1, bar: 2 }).should.not.have.keys('foo', 'baz'); - expect({ foo: 1, bar: 2 }).to.not.contain.keys('baz'); - ({ foo: 1, bar: 2 }).should.not.contain.keys('baz'); - expect({ foo: 1, bar: 2 }).to.not.contain.keys('foo', 'baz'); - ({ foo: 1, bar: 2 }).should.not.contain.keys('foo', 'baz'); - expect({ foo: 1, bar: 2 }).to.not.contain.keys('baz', 'foo'); - ({ foo: 1, bar: 2 }).should.not.contain.keys('baz', 'foo'); + expect({foo: 1, bar: 2}).to.not.have.keys('baz'); + ({foo: 1, bar: 2}).should.not.have.keys('baz'); + expect({foo: 1, bar: 2}).to.not.have.keys('foo', 'baz'); + ({foo: 1, bar: 2}).should.not.have.keys('foo', 'baz'); + expect({foo: 1, bar: 2}).to.not.contain.keys('baz'); + ({foo: 1, bar: 2}).should.not.contain.keys('baz'); + expect({foo: 1, bar: 2}).to.not.contain.keys('foo', 'baz'); + ({foo: 1, bar: 2}).should.not.contain.keys('foo', 'baz'); + expect({foo: 1, bar: 2}).to.not.contain.keys('baz', 'foo'); + ({foo: 1, bar: 2}).should.not.contain.keys('baz', 'foo'); - expect({ foo: 1 }).to.have.keys(); - ({ foo: 1 }).should.have.keys(); + expect({foo: 1}).to.have.keys(); + ({foo: 1}).should.have.keys(); - expect({ foo: 1 }).to.have.keys([]); - ({ foo: 1 }).should.have.keys([]); + expect({foo: 1}).to.have.keys([]); + ({foo: 1}).should.have.keys([]); - expect({ foo: 1 }).to.not.have.keys([]); - ({ foo: 1 }).should.not.have.keys([]); + expect({foo: 1}).to.not.have.keys([]); + ({foo: 1}).should.not.have.keys([]); - expect({ foo: 1 }).to.contain.keys([]); - ({ foo: 1 }).should.contain.keys([]); + expect({foo: 1}).to.contain.keys([]); + ({foo: 1}).should.contain.keys([]); - expect({ foo: 1 }).to.have.keys(['bar']); - ({ foo: 1 }).should.have.keys(['bar']); + expect({foo: 1}).to.have.keys(['bar']); + ({foo: 1}).should.have.keys(['bar']); - expect({ foo: 1 }).to.have.keys(['bar', 'baz']); - ({ foo: 1 }).should.have.keys(['bar', 'baz']); + expect({foo: 1}).to.have.keys(['bar', 'baz']); + ({foo: 1}).should.have.keys(['bar', 'baz']); - expect({ foo: 1 }).to.have.keys(['foo', 'bar', 'baz']); - ({ foo: 1 }).should.have.keys(['foo', 'bar', 'baz']); + expect({foo: 1}).to.have.keys(['foo', 'bar', 'baz']); + ({foo: 1}).should.have.keys(['foo', 'bar', 'baz']); - expect({ foo: 1 }).to.not.have.keys(['foo']); - ({ foo: 1 }).should.not.have.keys(['foo']); + expect({foo: 1}).to.not.have.keys(['foo']); + ({foo: 1}).should.not.have.keys(['foo']); - expect({ foo: 1 }).to.not.have.keys(['foo']); - ({ foo: 1 }).should.not.have.keys(['foo']); + expect({foo: 1}).to.not.have.keys(['foo']); + ({foo: 1}).should.not.have.keys(['foo']); - expect({ foo: 1, bar: 2 }).to.not.have.keys(['foo', 'bar']); - ({ foo: 1, bar: 2 }).should.not.have.keys(['foo', 'bar']); + expect({foo: 1, bar: 2}).to.not.have.keys(['foo', 'bar']); + ({foo: 1, bar: 2}).should.not.have.keys(['foo', 'bar']); - expect({ foo: 1 }).to.not.contain.keys(['foo']); - ({ foo: 1 }).should.not.contain.keys(['foo']); + expect({foo: 1}).to.not.contain.keys(['foo']); + ({foo: 1}).should.not.contain.keys(['foo']); - expect({ foo: 1 }).to.contain.keys('foo', 'bar'); - ({ foo: 1 }).should.contain.keys('foo', 'bar'); + expect({foo: 1}).to.contain.keys('foo', 'bar'); + ({foo: 1}).should.contain.keys('foo', 'bar'); } function chaining() { - const tea = { name: 'chai', extras: ['milk', 'sugar', 'smile'] }; + const tea = {name: 'chai', extras: ['milk', 'sugar', 'smile']}; expect(tea).to.have.property('extras').with.lengthOf(3); tea.should.have.property('extras').with.lengthOf(3); @@ -712,6 +735,7 @@ function exxtensible() { ({}).should.be.extensible; Object.preventExtensions({}).should.not.be.extensible; } + function sealed() { expect({}).to.be.not.sealed; expect(Object.seal({})).to.be.sealed; @@ -726,8 +750,9 @@ function frozen() { Object.freeze({}).should.be.frozen; } +class PoorlyConstructedError { +} -class PoorlyConstructedError { } function _throw() { // See GH-45: some poorly-constructed custom errors don't have useful names // on either their constructor or their constructor prototype, but instead @@ -736,11 +761,20 @@ function _throw() { const specificError = new RangeError('boo'); - const goodFn = () => { } - , badFn = () => { throw new Error('testing'); } - , refErrFn = () => { throw new ReferenceError('hello'); } - , ickyErrFn = () => { throw new PoorlyConstructedError(); } - , specificErrFn = () => { throw specificError; }; + const goodFn = () => { + }; + const badFn = () => { + throw new Error('testing'); + }; + const refErrFn = () => { + throw new ReferenceError('hello'); + }; + const ickyErrFn = () => { + throw new PoorlyConstructedError(); + }; + const specificErrFn = () => { + throw specificError; + }; expect(goodFn).to.not.throw(); goodFn.should.not.throw(); @@ -891,18 +925,26 @@ function use() { _chai.can.use.any(); }); - let expect = chai - .use((_chai, util) => {}) - .use((_chai, util) => {}) + const expect = chai + .use((_chai, util) => { + }) + .use((_chai, util) => { + }) .expect; } class Klass { val: number; - constructor() { this.val = 0; } - bar() { } - static baz() { } + constructor() { + this.val = 0; + } + + bar() { + } + + static baz() { + } } function respondTo() { @@ -1001,20 +1043,21 @@ function sameMembers() { assert.sameMembers([5, 4], [4, 5]); } + function sameDeepMembers() { - expect([{ id: 5 }, { id: 4 }]).to.have.same.deep.members([{ id: 4 }, { id: 5 }]); - [{ id: 5 }, { id: 4 }].should.have.same.deep.members([{ id: 4 }, { id: 5 }]); - expect([{ id: 5 }, { id: 4 }]).to.have.same.members([{ id: 5 }, { id: 4 }]); - [{ id: 5 }, { id: 4 }].should.have.same.members([{ id: 5 }, { id: 4 }]); + expect([{id: 5}, {id: 4}]).to.have.same.deep.members([{id: 4}, {id: 5}]); + [{id: 5}, {id: 4}].should.have.same.deep.members([{id: 4}, {id: 5}]); + expect([{id: 5}, {id: 4}]).to.have.same.members([{id: 5}, {id: 4}]); + [{id: 5}, {id: 4}].should.have.same.members([{id: 5}, {id: 4}]); - expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([]); - [{ id: 5 }, { id: 4 }].should.not.have.same.members([]); - expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([{ id: 6 }, { id: 3 }]); - [{ id: 5 }, { id: 4 }].should.not.have.same.members([{ id: 6 }, { id: 3 }]); - expect([{ id: 5 }, { id: 4 }]).to.not.have.same.members([{ id: 5 }, { id: 4 }, { id: 2 }]); - [{ id: 5 }, { id: 4 }].should.not.have.same.members([{ id: 5 }, { id: 4 }, { id: 2 }]); + expect([{id: 5}, {id: 4}]).to.not.have.same.members([]); + [{id: 5}, {id: 4}].should.not.have.same.members([]); + expect([{id: 5}, {id: 4}]).to.not.have.same.members([{id: 6}, {id: 3}]); + [{id: 5}, {id: 4}].should.not.have.same.members([{id: 6}, {id: 3}]); + expect([{id: 5}, {id: 4}]).to.not.have.same.members([{id: 5}, {id: 4}, {id: 2}]); + [{id: 5}, {id: 4}].should.not.have.same.members([{id: 5}, {id: 4}, {id: 2}]); - assert.sameDeepMembers([{ id: 5 }, { id: 4 }], [{ id: 4 }, { id: 5 }]); + assert.sameDeepMembers([{id: 5}, {id: 4}], [{id: 4}, {id: 5}]); } function orderedMembers() { @@ -1024,15 +1067,15 @@ function orderedMembers() { expect([1, 2, 3]).to.have.members([2, 1, 3]).but.not.ordered.members([2, 1, 3]); expect([{a: 1}, {b: 2}, {c: 3}]).to.include.deep.ordered.members([{a: 1}, {b: 2}]).but.not.include.deep.ordered.members([{b: 2}, {c: 3}]); - assert.sameOrderedMembers([ 1, 2, 3 ], [ 1, 2, 3 ], 'same ordered members'); - assert.notSameOrderedMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'not same ordered members'); - assert.sameDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { a: 1 }, { b: 2 }, { c: 3 } ], 'same deep ordered members'); - assert.notSameDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { a: 1 }, { c: 3 } ], 'not same deep ordered members'); + assert.sameOrderedMembers([1, 2, 3], [1, 2, 3], 'same ordered members'); + assert.notSameOrderedMembers([1, 2, 3], [2, 1, 3], 'not same ordered members'); + assert.sameDeepOrderedMembers([{a: 1}, {b: 2}, {c: 3}], [{a: 1}, {b: 2}, {c: 3}], 'same deep ordered members'); + assert.notSameDeepOrderedMembers([{a: 1}, {b: 2}, {c: 3}], [{b: 2}, {a: 1}, {c: 3}], 'not same deep ordered members'); - assert.includeOrderedMembers([ 1, 2, 3 ], [ 1, 2 ], 'include ordered members'); - assert.notIncludeOrderedMembers([ 1, 2, 3 ], [ 2, 1 ], 'not include ordered members'); - assert.includeDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { a: 1 }, { b: 2 } ], 'include deep ordered members'); - assert.notIncludeDeepOrderedMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { c: 3 } ], 'not include deep ordered members'); + assert.includeOrderedMembers([1, 2, 3], [1, 2], 'include ordered members'); + assert.notIncludeOrderedMembers([1, 2, 3], [2, 1], 'not include ordered members'); + assert.includeDeepOrderedMembers([{a: 1}, {b: 2}, {c: 3}], [{a: 1}, {b: 2}], 'include deep ordered members'); + assert.notIncludeDeepOrderedMembers([{a: 1}, {b: 2}, {c: 3}], [{b: 2}, {c: 3}], 'not include deep ordered members'); } function members() { @@ -1045,39 +1088,44 @@ function members() { } function increaseDecreaseChange() { - const obj = { val: 10 }; - const inc = () => { obj.val++; }; - const dec = () => { obj.val--; }; - const same = () => { }; + const obj = {val: 10}; + const inc = () => { + obj.val++; + }; + const dec = () => { + obj.val--; + }; + const same = () => { + }; - expect(inc).to.increase(obj, "val"); - expect(inc).increases(obj, "val"); - expect(inc).to.change(obj, "val"); + expect(inc).to.increase(obj, 'val'); + expect(inc).increases(obj, 'val'); + expect(inc).to.change(obj, 'val'); - expect(dec).to.decrease(obj, "val"); - expect(dec).decreases(obj, "val"); - expect(dec).to.change(obj, "val"); - expect(dec).changes(obj, "val"); + expect(dec).to.decrease(obj, 'val'); + expect(dec).decreases(obj, 'val'); + expect(dec).to.change(obj, 'val'); + expect(dec).changes(obj, 'val'); - expect(inc).to.not.decrease(obj, "val"); - expect(dec).to.not.increase(obj, "val"); - expect(same).to.not.increase(obj, "val"); - expect(same).to.not.decrease(obj, "val"); - expect(same).to.not.change(obj, "val"); + expect(inc).to.not.decrease(obj, 'val'); + expect(dec).to.not.increase(obj, 'val'); + expect(same).to.not.increase(obj, 'val'); + expect(same).to.not.decrease(obj, 'val'); + expect(same).to.not.change(obj, 'val'); - inc.should.increase(obj, "val"); - inc.should.change(obj, "val"); + inc.should.increase(obj, 'val'); + inc.should.change(obj, 'val'); - dec.should.decrease(obj, "val"); - dec.should.change(obj, "val"); + dec.should.decrease(obj, 'val'); + dec.should.change(obj, 'val'); - inc.should.not.decrease(obj, "val"); - dec.should.not.increase(obj, "val"); - same.should.not.change(obj, "val"); + inc.should.not.decrease(obj, 'val'); + dec.should.not.increase(obj, 'val'); + same.should.not.change(obj, 'val'); } function oneOf() { - const obj = { z: 3 }; + const obj = {z: 3}; expect(5).to.be.oneOf([1, 5, 4]); expect('z').to.be.oneOf(['x', 'y', 'z']); @@ -1087,11 +1135,12 @@ function oneOf() { expect(5).to.not.be.oneOf([1, [5], 4]); expect('z').to.not.be.oneOf(['w', 'x', 'y']); expect('z').to.not.be.oneOf(['x', 'y', ['z']]); - expect(obj).to.not.be.oneOf([{ z: 3 }]); + expect(obj).to.not.be.oneOf([{z: 3}]); } -//tdd +// tdd declare function suite(description: string, action: Function): void; + declare function test(description: string, action: Function): void; interface FieldObj { @@ -1105,9 +1154,8 @@ class CrashyObject { } suite('assert', () => { - test('assert', () => { - const foo: string = 'bar'; + const foo = 'bar' as string; assert(foo === 'bar', 'expected foo to equal `bar`'); assert(foo === 'baz', 'expected foo to equal `bar`'); @@ -1204,29 +1252,29 @@ suite('assert', () => { }); test('deepEqual', () => { - assert.deepEqual({ tea: 'chai' }, { tea: 'chai' }); - assert.deepEqual({ tea: 'chai' }, { tea: 'black' }); + assert.deepEqual({tea: 'chai'}, {tea: 'chai'}); + assert.deepEqual({tea: 'chai'}, {tea: 'black'}); - const obja = Object.create({ tea: 'chai' }) - , objb = Object.create({ tea: 'chai' }); + const obja = Object.create({tea: 'chai'}); + const objb = Object.create({tea: 'chai'}); assert.deepEqual(obja, objb); - const obj1 = Object.create({ tea: 'chai' }) - , obj2 = Object.create({ tea: 'black' }); + const obj1 = Object.create({tea: 'chai'}); + const obj2 = Object.create({tea: 'black'}); assert.deepEqual(obj1, obj2); }); test('deepEqual (ordering)', () => { - const a = { a: 'b', c: 'd' } - , b = { c: 'd', a: 'b' }; + const a = {a: 'b', c: 'd'}; + const b = {c: 'd', a: 'b'}; assert.deepEqual(a, b); }); test('deepEqual (circular)', () => { - const circularObject: any = {} - , secondCircularObject: any = {}; + const circularObject: any = {}; + const secondCircularObject: any = {}; circularObject.field = circularObject; secondCircularObject.field = secondCircularObject; @@ -1237,13 +1285,13 @@ suite('assert', () => { }); test('notDeepEqual', () => { - assert.notDeepEqual({ tea: 'jasmine' }, { tea: 'chai' }); - assert.notDeepEqual({ tea: 'chai' }, { tea: 'chai' }); + assert.notDeepEqual({tea: 'jasmine'}, {tea: 'chai'}); + assert.notDeepEqual({tea: 'chai'}, {tea: 'chai'}); }); test('notDeepEqual (circular)', () => { - const circularObject: any = {} - , secondCircularObject: any = { tea: 'jasmine' }; + const circularObject: any = {}; + const secondCircularObject: any = {tea: 'jasmine'}; circularObject.field = circularObject; secondCircularObject.field = secondCircularObject; @@ -1292,7 +1340,8 @@ suite('assert', () => { test('isNotFunction', () => { assert.isNotFunction(5); - assert.isNotFunction(() => {}); + assert.isNotFunction(() => { + }); }); test('isArray', () => { @@ -1309,6 +1358,7 @@ suite('assert', () => { test('isString', () => { assert.isString('Foo'); + // tslint:disable-next-line:no-construct assert.isString(new String('foo')); assert.isString(1); }); @@ -1357,11 +1407,61 @@ suite('assert', () => { assert.notInclude(undefined, 'bar'); }); + test('deepInclude', () => { + assert.deepInclude('foobar', 'bar'); + assert.deepInclude([1, 2, 3], 3); + assert.deepInclude('foobar', 'baz'); + assert.deepInclude(undefined, 'bar'); + }); + + test('notDeepInclude', () => { + assert.notDeepInclude('foobar', 'baz'); + assert.notDeepInclude([1, 2, 3], 4); + assert.notDeepInclude('foobar', 'bar'); + assert.notDeepInclude(undefined, 'bar'); + }); + + test('nestedInclude', () => { + assert.nestedInclude({'.a': {b: 'x'}}, {'\\.a.[b]': 'x'}); + assert.nestedInclude({a: {'[b]': 'x'}}, {'a.\\[b\\]': 'x'}); + }); + + test('notNestedInclude', () => { + assert.notNestedInclude({'.a': {b: 'x'}}, {'\\.a.b': 'y'}); + assert.notNestedInclude({a: {'[b]': 'x'}}, {'a.\\[b\\]': 'y'}); + }); + + test('deepNestedInclude', () => { + assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}}); + assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}}); + }); + + test('notDeepNestedInclude', () => { + assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}}); + assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}}); + }); + + test('ownInclude', () => { + assert.ownInclude({a: 1}, {a: 1}); + }); + + test('notOwnInclude', () => { + assert.notOwnInclude({a: 1}, {a: 1}); + }); + + test('deepOwnInclude', () => { + assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}}); + }); + + test('notDeepOwnInclude', () => { + assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}}); + }); + test('lengthOf', () => { assert.lengthOf([1, 2, 3], 3); assert.lengthOf('foobar', 6); assert.lengthOf('foobar', 5); - assert.lengthOf({ length: 1 }, 5); + assert.lengthOf({length: 1}, 5); }); test('match', () => { @@ -1372,8 +1472,8 @@ suite('assert', () => { }); test('property', () => { - const obj = { foo: { bar: 'baz' } }; - const simpleObj = { foo: 'bar' } as any; + const obj = {foo: {bar: 'baz'}}; + const simpleObj = {foo: 'bar'} as any; assert.property(obj, 'foo'); assert.deepProperty(obj, 'foo.bar'); assert.notDeepProperty(obj, 'foo.baz'); @@ -1422,7 +1522,8 @@ suite('assert', () => { throw new Error('foo'); }, TypeError, 'bar'); - assert.throws(() => {}); + assert.throws(() => { + }); assert.throws(() => { throw new Error(''); @@ -1434,8 +1535,10 @@ suite('assert', () => { }); test('doesNotThrow', () => { - assert.doesNotThrow(() => { }); - assert.doesNotThrow(() => { }, 'foo'); + assert.doesNotThrow(() => { + }); + assert.doesNotThrow(() => { + }, 'foo'); assert.doesNotThrow(() => { throw new Error('foo'); @@ -1498,7 +1601,6 @@ suite('assert', () => { assert.sameMembers([1, 54], [6, 1, 54]); }); - test('isAbove', () => { assert.isAbove(10, 5); assert.isAbove(1, 5); @@ -1511,20 +1613,44 @@ suite('assert', () => { assert.isBelow(5, 5); }); - test('extensible', () => { assert.extensible({}); }); - test('isExtensible', () => { assert.isExtensible({}); }); - test('notExtensible', () => { assert.notExtensible(Object.preventExtensions({})); }); - test('isNotExtensible', () => { assert.isNotExtensible(Object.preventExtensions({})); }); + test('extensible', () => { + assert.extensible({}); + }); + test('isExtensible', () => { + assert.isExtensible({}); + }); + test('notExtensible', () => { + assert.notExtensible(Object.preventExtensions({})); + }); + test('isNotExtensible', () => { + assert.isNotExtensible(Object.preventExtensions({})); + }); - test('sealed', () => { assert.sealed(Object.seal({})); }); - test('isSealed', () => { assert.isSealed(Object.seal({})); }); - test('notSealed', () => { assert.notSealed({}); }); - test('isNotSealed', () => { assert.isNotSealed({}); }); + test('sealed', () => { + assert.sealed(Object.seal({})); + }); + test('isSealed', () => { + assert.isSealed(Object.seal({})); + }); + test('notSealed', () => { + assert.notSealed({}); + }); + test('isNotSealed', () => { + assert.isNotSealed({}); + }); - test('frozen', () => { assert.frozen(Object.freeze({})); }); - test('isFrozen', () => { assert.isFrozen(Object.freeze({})); }); - test('notFrozen', () => { assert.notFrozen({}); }); - test('isNotFrozen', () => { assert.isNotFrozen({}); }); + test('frozen', () => { + assert.frozen(Object.freeze({})); + }); + test('isFrozen', () => { + assert.isFrozen(Object.freeze({})); + }); + test('notFrozen', () => { + assert.notFrozen({}); + }); + test('isNotFrozen', () => { + assert.isNotFrozen({}); + }); test('isNotTrue', () => { assert.isNotTrue(false); @@ -1549,132 +1675,256 @@ suite('assert', () => { }); test('oneOf', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.oneOf(5, [1, 5, 4]); assert.oneOf('z', ['x', 'y', 'z']); assert.oneOf(obj, [obj]); assert.oneOf(5, [1, [5], 4]); assert.oneOf('z', ['w', 'x', 'y']); - assert.oneOf(obj, [{ z: 3 }]); + assert.oneOf(obj, [{z: 3}]); }); test('changes', () => { - const obj = { z: 3 }; + const obj = {z: 3}; - assert.changes(() => {}, obj, 'z'); - assert.changes(() => {}, obj, 'z', 'message'); + assert.changes(() => { + }, obj, 'z'); + assert.changes(() => { + }, obj, 'z', 'message'); }); test('doesNotChange', () => { - const obj = { z: 3 }; + const obj = {z: 3}; - assert.doesNotChange(() => {}, obj, 'z'); - assert.doesNotChange(() => {}, obj, 'z', 'message'); + assert.doesNotChange(() => { + }, obj, 'z'); + assert.doesNotChange(() => { + }, obj, 'z', 'message'); }); test('increases', () => { - const obj = { z: 3 }; + const obj = {z: 3}; - assert.increases(() => {}, obj, 'z'); - assert.increases(() => {}, obj, 'z', 'message'); + assert.increases(() => { + }, obj, 'z'); + assert.increases(() => { + }, obj, 'z', 'message'); }); test('doesNotIncrease', () => { - const obj = { z: 3 }; + const obj = {z: 3}; - assert.doesNotIncrease(() => {}, obj, 'z'); - assert.doesNotIncrease(() => {}, obj, 'z', 'message'); + assert.doesNotIncrease(() => { + }, obj, 'z'); + assert.doesNotIncrease(() => { + }, obj, 'z', 'message'); }); test('decreases', () => { - const obj = { z: 3 }; + const obj = {z: 3}; - assert.decreases(() => {}, obj, 'z'); - assert.decreases(() => {}, obj, 'z', 'message'); + assert.decreases(() => { + }, obj, 'z'); + assert.decreases(() => { + }, obj, 'z', 'message'); }); test('doesNotDecrease', () => { - const obj = { z: 3 }; + const obj = {z: 3}; - assert.doesNotDecrease(() => {}, obj, 'z'); - assert.doesNotDecrease(() => {}, obj, 'z', 'message'); + assert.doesNotDecrease(() => { + }, obj, 'z'); + assert.doesNotDecrease(() => { + }, obj, 'z', 'message'); }); test('ifError', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.ifError(obj); assert.ifError(obj, 'message'); }); test('extensible', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.extensible(obj); assert.extensible(obj, 'message'); }); test('isNotExtensible', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.isNotExtensible(obj); assert.isNotExtensible(obj, 'message'); }); test('isSealed', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.isSealed(obj); assert.isSealed(obj, 'message'); }); test('sealed', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.sealed(obj); assert.sealed(obj, 'message'); }); test('isNotSealed', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.isNotSealed(obj); assert.isNotSealed(obj, 'message'); }); test('notSealed', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.notSealed(obj); assert.notSealed(obj, 'message'); }); test('isFrozen', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.isFrozen(obj); assert.isFrozen(obj, 'message'); }); test('frozen', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.frozen(obj); assert.frozen(obj, 'message'); }); test('isNotFrozen', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.isNotFrozen(obj); assert.isNotFrozen(obj, 'message'); }); test('notFrozen', () => { - const obj = { z: 3 }; + const obj = {z: 3}; assert.notFrozen(obj); assert.notFrozen(obj, 'message'); }); + + test('hasAnyKeys', () => { + assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'iDontExist', 'baz']); + assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, iDontExist: 99, baz: 1337}); + assert.hasAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + }); + + test('hasAllKeys', () => { + assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337}); + assert.hasAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + }); + + test('containsAllKeys', () => { + assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'baz']); + assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, baz: 1337}); + assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337}); + assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}]); + assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}]); + assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + }); + + test('doesNotHaveAnyKeys', () => { + assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + assert.doesNotHaveAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']); + }); + + test('doesNotHaveAllKeys', () => { + assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + assert.doesNotHaveAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']); + }); + + test('hasAnyDeepKeys', () => { + assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), [{one: 'one'}, {two: 'two'}]); + assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {three: 'three'}]); + assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + }); + + test('hasAllDeepKeys', () => { + assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne']]), {one: 'one'}); + assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + assert.hasAllDeepKeys(new Set([{one: 'one'}]), {one: 'one'}); + assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + }); + + test('containsAllDeepKeys', () => { + assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + }); + + test('doesNotHaveAnyDeepKeys', () => { + assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + }); + + test('doesNotHaveAllDeepKeys', () => { + assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {one: 'one'}]); + assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]); + }); + + test('nestedProperty', () => { + assert.nestedProperty({ tea: { green: 'matcha' }}, 'tea.green'); + assert.nestedProperty({ tea: { green: 'matcha' }}, 'tea.green', 'Should have tea.green nested property'); + }); + + test('notNestedProperty', () => { + assert.notNestedProperty({ tea: { green: 'matcha' }}, 'tea.oolong'); + assert.notNestedProperty({ tea: { green: 'matcha' }}, 'tea.oolong', 'Should not have tea.oolong nested property'); + }); + + test('nestedPropertyVal', () => { + assert.nestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha'); + assert.nestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha', 'Should have tea.green nested property'); + }); + + test('notNestedPropertyVal', () => { + assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha'); + assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'coffee.green', 'matcha'); + assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha', 'Should not have konacha as value'); + assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'coffee.green', 'matcha', 'Should not have matcha as value'); + }); + + test('deepNestedPropertyVal', () => { + assert.deepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yum' }); + assert.deepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yum' }, 'Should have correct value of the property'); + }); + + test('notDeepNestedPropertyVal', () => { + assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { oolong: 'yum' }); + assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yuck' }); + assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.black', { matcha: 'yum' }); + assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { oolong: 'yum' }, 'Should have correct value of the property'); + assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yuck' }, 'Should have correct value of the property'); + assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.black', { matcha: 'yum' }, 'Should have correct value of the property'); + }); }); diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index bb730fe598..70bc0f2b67 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chai 4.0.0 +// Type definitions for chai 4.1 // Project: http://chaijs.com/ // Definitions by: Jed Mao , // Bart van der Schoor , @@ -7,12 +7,13 @@ // Matt Wistrand , // Josh Goldberg // Shaun Luttin +// Gintautas Miselis +// Satana Charuwichitratana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // declare namespace Chai { - interface ChaiStatic { expect: ExpectStatic; should(): Should; @@ -54,8 +55,7 @@ declare namespace Chai { } interface ShouldThrow { - (actual: Function): void; - (actual: Function, expected: string|RegExp, message?: string): void; + (actual: Function, expected?: string|RegExp, message?: string): void; (actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void; } @@ -218,9 +218,7 @@ declare namespace Chai { } interface Include { - (value: Object, message?: string): Assertion; - (value: string, message?: string): Assertion; - (value: number, message?: string): Assertion; + (value: Object | string | number, message?: string): Assertion; keys: Keys; deep: Deep; ordered: Ordered; @@ -235,18 +233,12 @@ declare namespace Chai { interface Keys { (...keys: string[]): Assertion; - (keys: any[]): Assertion; - (keys: Object): Assertion; + (keys: any[]|Object): Assertion; } interface Throw { - (): Assertion; - (expected: string, message?: string): Assertion; - (expected: RegExp, message?: string): Assertion; - (constructor: Error, expected?: string, message?: string): Assertion; - (constructor: Error, expected?: RegExp, message?: string): Assertion; - (constructor: Function, expected?: string, message?: string): Assertion; - (constructor: Function, expected?: RegExp, message?: string): Assertion; + (expected?: string|RegExp, message?: string): Assertion; + (constructor: Error|Function, expected?: string|RegExp, message?: string): Assertion; } interface RespondTo { @@ -697,21 +689,134 @@ declare namespace Chai { /** * Asserts that haystack does not include needle. * + * @param haystack Container string or array. + * @param needle Potential expected substring of haystack. + * @param message Message to display on error. + */ + notInclude(haystack: string | any[], needle: any, message?: string): void; + + /** + * Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used. + * * @param haystack Container string. * @param needle Potential expected substring of haystack. * @param message Message to display on error. */ - notInclude(haystack: string, needle: any, message?: string): void; + deepInclude(haystack: string, needle: string, message?: string): void; /** - * Asserts that haystack does not include needle. + * Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used. * - * @type T Type of values in haystack. - * @param haystack Container array. - * @param needle Potential value contained in haystack. + * @param haystack + * @param needle * @param message Message to display on error. */ - notInclude(haystack: any[], needle: any, message?: string): void; + deepInclude(haystack: any, needle: any, message?: string): void; + + /** + * Asserts that haystack does not include needle. Can be used to assert the absence of a value in an array or a subset of properties in an object. Deep equality is used. + * + * @param haystack Container string or array. + * @param needle Potential expected substring of haystack. + * @param message Message to display on error. + */ + notDeepInclude(haystack: string | any[], needle: any, message?: string): void; + + /** + * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object. + * + * Enables the use of dot- and bracket-notation for referencing nested properties. + * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’. + * Can be used to assert the inclusion of a subset of properties in an object. + * Enables the use of dot- and bracket-notation for referencing nested properties. + * ‘[]’ and ‘.’ in property names can be escaped using double backslashes. + * + * @param haystack + * @param needle + * @param message Message to display on error. + */ + nestedInclude(haystack: any, needle: any, message?: string): void; + + /** + * Asserts that ‘haystack’ does not include ‘needle’. Can be used to assert the absence of a subset of properties in an object. + * + * Enables the use of dot- and bracket-notation for referencing nested properties. + * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’. + * Can be used to assert the inclusion of a subset of properties in an object. + * Enables the use of dot- and bracket-notation for referencing nested properties. + * ‘[]’ and ‘.’ in property names can be escaped using double backslashes. + * + * @param haystack + * @param needle + * @param message Message to display on error. + */ + notNestedInclude(haystack: any, needle: any, message?: string): void; + + /** + * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while checking for deep equality + * + * Enables the use of dot- and bracket-notation for referencing nested properties. + * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’. + * Can be used to assert the inclusion of a subset of properties in an object. + * Enables the use of dot- and bracket-notation for referencing nested properties. + * ‘[]’ and ‘.’ in property names can be escaped using double backslashes. + * + * @param haystack + * @param needle + * @param message Message to display on error. + */ + deepNestedInclude(haystack: any, needle: any, message?: string): void; + + /** + * Asserts that ‘haystack’ does not include ‘needle’. Can be used to assert the absence of a subset of properties in an object while checking for deep equality. + * + * Enables the use of dot- and bracket-notation for referencing nested properties. + * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’. + * Can be used to assert the inclusion of a subset of properties in an object. + * Enables the use of dot- and bracket-notation for referencing nested properties. + * ‘[]’ and ‘.’ in property names can be escaped using double backslashes. + * + * @param haystack + * @param needle + * @param message Message to display on error. + */ + notDeepNestedInclude(haystack: any, needle: any, message?: string): void; + + /** + * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while ignoring inherited properties. + * + * @param haystack + * @param needle + * @param message Message to display on error. + */ + ownInclude(haystack: any, needle: any, message?: string): void; + + /** + * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the absence of a subset of properties in an object while ignoring inherited properties. + * + * @param haystack + * @param needle + * @param message Message to display on error. + */ + notOwnInclude(haystack: any, needle: any, message?: string): void; + + /** + * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while ignoring inherited properties and checking for deep + * + * @param haystack + * @param needle + * @param message Message to display on error. + */ + deepOwnInclude(haystack: any, needle: any, message?: string): void; + + /** + * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the absence of a subset of properties in an object while ignoring inherited properties and checking for deep equality. + * + * @param haystack + * @param needle + * @param message Message to display on error. + */ + notDeepOwnInclude(haystack: any, needle: any, message?: string): void; /** * Asserts that value matches the regular expression regexp. @@ -881,19 +986,10 @@ declare namespace Chai { * Asserts that function will throw an error with message matching regexp. * * @param fn Function that may throw. - * @param regExp Potential expected message match. + * @param errType Potential expected message match or error constructor. * @param message Message to display on error. */ - throws(fn: Function, regExp: RegExp, message?: string): void; - - /** - * Asserts that function will throw an error that is an instance of constructor. - * - * @param fn Function that may throw. - * @param constructor Potential expected error constructor. - * @param message Message to display on error. - */ - throws(fn: Function, errType: Function, message?: string): void; + throws(fn: Function, errType: RegExp|Function, message?: string): void; /** * Asserts that function will throw an error that is an instance of constructor @@ -1156,7 +1252,7 @@ declare namespace Chai { * @param property Property of object expected to be modified. * @param message Message to display on error. */ - changes(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + changes(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; /** * Asserts that a function does not change the value of a property. @@ -1167,7 +1263,7 @@ declare namespace Chai { * @param property Property of object expected not to be modified. * @param message Message to display on error. */ - doesNotChange(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + doesNotChange(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; /** * Asserts that a function increases an object property. @@ -1178,7 +1274,7 @@ declare namespace Chai { * @param property Property of object expected to be increased. * @param message Message to display on error. */ - increases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + increases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; /** * Asserts that a function does not increase an object property. @@ -1189,7 +1285,7 @@ declare namespace Chai { * @param property Property of object expected not to be increased. * @param message Message to display on error. */ - doesNotIncrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + doesNotIncrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; /** * Asserts that a function decreases an object property. @@ -1200,7 +1296,7 @@ declare namespace Chai { * @param property Property of object expected to be decreased. * @param message Message to display on error. */ - decreases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + decreases(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; /** * Asserts that a function does not decrease an object property. @@ -1211,7 +1307,7 @@ declare namespace Chai { * @param property Property of object expected not to be decreased. * @param message Message to display on error. */ - doesNotDecrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void + doesNotDecrease(modifier: Function, object: T, property: string /* keyof T */, message?: string): void; /** * Asserts if value is not a false value, and throws if it is a true value. @@ -1360,6 +1456,207 @@ declare namespace Chai { * @param message Message to display on error. */ isNotEmpty(object: T, message?: string): void; + + /** + * Asserts that `object` has at least one of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + hasAnyKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has all and only all of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + hasAllKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has all of the `keys` provided but may have more keys not listed. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + containsAllKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has none of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + doesNotHaveAnyKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` does not have at least one of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + doesNotHaveAllKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has at least one of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + hasAnyDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has all and only all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + hasAllDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` contains all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + containsAllDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` contains all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + doesNotHaveAnyDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` contains all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + doesNotHaveAllDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that object has a direct or inherited property named by property, + * which can be a string using dot- and bracket-notation for nested reference. + * + * @type T Type of object. + * @param object Object to test. + * @param property Property to test. + * @param message Message to display on error. + */ + nestedProperty(object: T, property: string, message?: string): void; + + /** + * Asserts that object does not have a property named by property, + * which can be a string using dot- and bracket-notation for nested reference. + * The property cannot exist on the object nor anywhere in its prototype chain. + * + * @type T Type of object. + * @param object Object to test. + * @param property Property to test. + * @param message Message to display on error. + */ + notNestedProperty(object: T, property: string, message?: string): void; + + /** + * Asserts that object has a property named by property with value given by value. + * property can use dot- and bracket-notation for nested reference. Uses a strict equality check (===). + * + * @type T Type of object. + * @param object Object to test. + * @param property Property to test. + * @param value Value to test. + * @param message Message to display on error. + */ + nestedPropertyVal(object: T, property: string, value: any, message?: string): void; + + /** + * Asserts that object does not have a property named by property with value given by value. + * property can use dot- and bracket-notation for nested reference. Uses a strict equality check (===). + * + * @type T Type of object. + * @param object Object to test. + * @param property Property to test. + * @param value Value to test. + * @param message Message to display on error. + */ + notNestedPropertyVal(object: T, property: string, value: any, message?: string): void; + + /** + * Asserts that object has a property named by property with a value given by value. + * property can use dot- and bracket-notation for nested reference. Uses a deep equality check. + * + * @type T Type of object. + * @param object Object to test. + * @param property Property to test. + * @param value Value to test. + * @param message Message to display on error. + */ + deepNestedPropertyVal(object: T, property: string, value: any, message?: string): void; + + /** + * Asserts that object does not have a property named by property with value given by value. + * property can use dot- and bracket-notation for nested reference. Uses a deep equality check. + * + * @type T Type of object. + * @param object Object to test. + * @param property Property to test. + * @param value Value to test. + * @param message Message to display on error. + */ + notDeepNestedPropertyVal(object: T, property: string, value: any, message?: string): void; } export interface Config { diff --git a/types/chai/tslint.json b/types/chai/tslint.json new file mode 100644 index 0000000000..f99183c97d --- /dev/null +++ b/types/chai/tslint.json @@ -0,0 +1,14 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false, + "callable-types": false, + "new-parens": false, + "no-declare-current-package": false, + "no-empty-interface": false, + "no-redundant-jsdoc-2": false, + "no-single-declare-module": false, + "no-unnecessary-generics": false, + "strict-export-declare-modifiers": false + } +} diff --git a/types/chai/v2/tslint.json b/types/chai/v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai/v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chalk/chalk-tests.ts b/types/chalk/chalk-tests.ts deleted file mode 100644 index 20bdd9382c..0000000000 --- a/types/chalk/chalk-tests.ts +++ /dev/null @@ -1,42 +0,0 @@ -import chalk = require('chalk'); - -var str = ''; -var bool = false; -var chain: chalk.ChalkChain; - -chalk.enabled = bool; -str = chalk.stripColor(str); - -bool = chalk.supportsColor; -bool = chalk.hasColor(str); - -// style a string -console.log( chalk.blue('Hello world!') ); - -// combine styled and normal strings -console.log( chalk.blue('Hello'), 'World' + chalk.red('!') ); - -// compose multiple styles using the chainable API -console.log( chalk.blue.bgRed.bold('Hello world!') ); - -// pass in multiple arguments -console.log( chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz') ); - -// nest styles -console.log( chalk.red('Hello', chalk.underline.bgBlue('world') + '!') ); - -// nest styles of the same type even (color, underline, background) -console.log( chalk.green('I am a green line ' + chalk.blue('with a blue substring') + ' that becomes green again!') ); - -chain = chalk.green; -chain = chain.underline; -str = chain('someString'); - -chalk.enabled = chalk.supportsColor = bool; - -var chalkObj = new chalk.constructor({enabled: false}); - -chain = chalkObj.green; -chain = chalkObj.underline; -chalkObj.enabled = true; -str = chain('foo'); diff --git a/types/chalk/index.d.ts b/types/chalk/index.d.ts deleted file mode 100644 index 3651e8077d..0000000000 --- a/types/chalk/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for chalk v0.4.0 -// Project: https://github.com/sindresorhus/chalk -// Definitions by: Diullei Gomes , Bart van der Schoor , Nico Jansen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = Chalk; - -declare namespace Chalk { - export var enabled: boolean; - export var supportsColor: boolean; - export var styles: ChalkStyleMap; - - export function stripColor(value: string): any; - export function hasColor(str: string): boolean; - - export interface ChalkChain extends ChalkStyle { - (): boolean; - (...text: string[]): string; - } - - export interface ChalkStyleElement { - open: string; - close: string; - } - - // General - export var reset: ChalkChain; - export var bold: ChalkChain; - export var dim: ChalkChain; - export var italic: ChalkChain; - export var underline: ChalkChain; - export var inverse: ChalkChain; - export var hidden: ChalkChain; - export var strikethrough: ChalkChain; - - // Text colors - export var black: ChalkChain; - export var red: ChalkChain; - export var green: ChalkChain; - export var yellow: ChalkChain; - export var blue: ChalkChain; - export var magenta: ChalkChain; - export var cyan: ChalkChain; - export var white: ChalkChain; - export var gray: ChalkChain; - export var grey: ChalkChain; - - // Background colors - export var bgBlack: ChalkChain; - export var bgRed: ChalkChain; - export var bgGreen: ChalkChain; - export var bgYellow: ChalkChain; - export var bgBlue: ChalkChain; - export var bgMagenta: ChalkChain; - export var bgCyan: ChalkChain; - export var bgWhite: ChalkChain; - - - export interface ChalkStyle { - // General - reset: ChalkChain; - bold: ChalkChain; - dim: ChalkChain; - italic: ChalkChain; - underline: ChalkChain; - inverse: ChalkChain; - hidden: ChalkChain; - strikethrough: ChalkChain; - - // Text colors - black: ChalkChain; - red: ChalkChain; - green: ChalkChain; - yellow: ChalkChain; - blue: ChalkChain; - magenta: ChalkChain; - cyan: ChalkChain; - white: ChalkChain; - gray: ChalkChain; - grey: ChalkChain; - - // Background colors - bgBlack: ChalkChain; - bgRed: ChalkChain; - bgGreen: ChalkChain; - bgYellow: ChalkChain; - bgBlue: ChalkChain; - bgMagenta: ChalkChain; - bgCyan: ChalkChain; - bgWhite: ChalkChain; - } - - export interface ChalkStyleMap { - // General - reset: ChalkStyleElement; - bold: ChalkStyleElement; - dim: ChalkStyleElement; - italic: ChalkStyleElement; - underline: ChalkStyleElement; - inverse: ChalkStyleElement; - hidden: ChalkStyleElement; - strikethrough: ChalkStyleElement; - - // Text colors - black: ChalkStyleElement; - red: ChalkStyleElement; - green: ChalkStyleElement; - yellow: ChalkStyleElement; - blue: ChalkStyleElement; - magenta: ChalkStyleElement; - cyan: ChalkStyleElement; - white: ChalkStyleElement; - gray: ChalkStyleElement; - - // Background colors - bgBlack: ChalkStyleElement; - bgRed: ChalkStyleElement; - bgGreen: ChalkStyleElement; - bgYellow: ChalkStyleElement; - bgBlue: ChalkStyleElement; - bgMagenta: ChalkStyleElement; - bgCyan: ChalkStyleElement; - bgWhite: ChalkStyleElement; - } - - export const constructor: { - new (options: {enabled: boolean}): Chalk; - } - - export interface Chalk extends ChalkStyle { - enabled: boolean; - } -} diff --git a/types/chalk/tsconfig.json b/types/chalk/tsconfig.json deleted file mode 100644 index 13ab93883b..0000000000 --- a/types/chalk/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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", - "chalk-tests.ts" - ] -} \ No newline at end of file diff --git a/types/chance/chance-tests.ts b/types/chance/chance-tests.ts index dfb942f5c5..8e89d8227e 100644 --- a/types/chance/chance-tests.ts +++ b/types/chance/chance-tests.ts @@ -1,22 +1,24 @@ - - // Instantiation -var globalInstance: Chance.Chance = chance; -var createYourOwn = new Chance(Math.random); +let globalInstance: Chance.Chance = chance; +let createYourOwn = new Chance(Math.random); // Basic usage -var randBool: boolean = chance.bool(); +let randBool: boolean = chance.bool(); -var birthday: Date = chance.birthday(); -var birthdayStr: Date|string = chance.birthday({ string: true }); +let birthday: Date = chance.birthday(); +let birthdayStr: Date | string = chance.birthday({ string: true }); -var strArr: string[] = chance.n(chance.string, 42); +let guid = chance.guid(); +guid = chance.guid({ version: 4 }); +guid = chance.guid({ version: 5 }); -var uniqInts: number[] = chance.unique(chance.integer, 99); +let strArr: string[] = chance.n(chance.string, 42); -var currencyPair = chance.currency_pair(); -var firstCurrency = currencyPair[0]; -var secondCurrency = currencyPair[1]; +let uniqInts: number[] = chance.unique(chance.integer, 99); + +let currencyPair = chance.currency_pair(); +let firstCurrency = currencyPair[0]; +let secondCurrency = currencyPair[1]; // Mixins can be used with on-the-fly type declaration declare namespace Chance { @@ -26,15 +28,15 @@ declare namespace Chance { } chance.mixin({ - time: function () { - var h = chance.hour({ twentyfour: true }), - m = chance.minute(); + time() { + const h = chance.hour({ twentyfour: true }); + const m = chance.minute(); return `${h}:${m}`; - } + }, }); -var timeString: string = chance.time(); +let timeString: string = chance.time(); -var chanceConstructedWithSeed100 = new Chance(100); -var chanceCalledWithSeed100 = Chance() -var chanceConstructedWithStringSeed = new Chance("test") +let chanceConstructedWithSeed100 = new Chance(100); +let chanceCalledWithSeed100 = Chance(); +let chanceConstructedWithStringSeed = new Chance("test"); diff --git a/types/chance/index.d.ts b/types/chance/index.d.ts index 3b477c4bce..212e90dfe2 100644 --- a/types/chance/index.d.ts +++ b/types/chance/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Chance 0.7.3 +// Type definitions for Chance 0.7.4 // Project: http://chancejs.com // Definitions by: Chris Bowdon +// Brice BERNARD // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Chance { @@ -13,17 +14,16 @@ declare namespace Chance { type SeededChance = Chance & Seeded; interface ChanceStatic { - (): Chance - (seed: Seed): SeededChance - (generator: () => any): Chance + (): Chance; + (seed: Seed): SeededChance; + (generator: () => any): Chance; - new(): Chance; - new(seed: Seed): SeededChance; - new(generator: () => any): Chance; + new (): Chance; + new (seed: Seed): SeededChance; + new (generator: () => any): Chance; } interface Chance { - // Basics bool(opts?: Options): boolean; character(opts?: Options): string; @@ -42,7 +42,7 @@ declare namespace Chance { age(opts?: Options): number; gender(): string; birthday(): Date; - birthday(opts?: Options): Date|string; + birthday(opts?: Options): Date | string; cpf(): string; first(opts?: Options): string; last(opts?: Options): string; @@ -95,7 +95,7 @@ declare namespace Chance { // Time ampm(): string; date(): Date; - date(opts: DateOptions): Date|string; + date(opts: DateOptions): Date | string; hammertime(): number; hour(opts?: Options): number; millisecond(): number; @@ -109,12 +109,12 @@ declare namespace Chance { // Finance cc(opts?: Options): string; cc_type(): string; - cc_type(opts: Options): string|CreditCardType; + cc_type(opts: Options): string | CreditCardType; currency(): Currency; - currency_pair(): [ Currency, Currency ]; + currency_pair(): [Currency, Currency]; dollar(opts?: Options): string; exp(): string; - exp(opts: Options): string|CreditCardExpiration; + exp(opts: Options): string | CreditCardExpiration; exp_month(opts?: Options): string; exp_year(opts?: Options): string; @@ -124,11 +124,11 @@ declare namespace Chance { pad(num: number, width: number, padChar?: string): string; /** * @deprecated Use pickone - */ + */ pick(arr: T[]): T; pickone(arr: T[]): T; /** - * @deprecated Use pickset + * @deprecated Use pickset */ pick(arr: T[], count: number): T[]; pickset(arr: T[], count?: number): T[]; @@ -144,13 +144,13 @@ declare namespace Chance { d20(): number; d30(): number; d100(): number; - guid(): string; + guid(options?: { version: 4 | 5 }): string; hash(opts?: Options): string; n(generator: () => T, count: number, opts?: Options): T[]; normal(opts?: Options): number; radio(opts?: Options): string; rpg(dice: string): number[]; - rpg(dice: string, opts?: Options): number[]|number; + rpg(dice: string, opts?: Options): number[] | number; tv(opts?: Options): string; unique(generator: () => T, count: number, opts?: Options): T[]; weighted(values: T[], weights: number[]): T; @@ -168,7 +168,9 @@ declare namespace Chance { // A more rigorous approach might be to produce // the correct options interfaces for each method - interface Options { [id: string]: any; } + interface Options { + [id: string]: any; + } interface DateOptions { string?: boolean; @@ -201,19 +203,21 @@ declare namespace Chance { year: string; } - interface MixinDescriptor { [id: string]: () => any; } + interface MixinDescriptor { + [id: string]: () => any; + } interface Setter { - (key: 'firstNames', values: string[]): any; - (key: 'lastNames', values: string[]): any; - (key: 'provinces', values: string[]): any; - (key: 'us_states_and_dc', values: string[]): any; - (key: 'territories', values: string[]): any; - (key: 'armed_forces', values: string[]): any; - (key: 'street_suffixes', values: string[]): any; - (key: 'months', values: string[]): any; - (key: 'cc_types', values: string[]): any; - (key: 'currency_types', values: string[]): any; + (key: "firstNames", values: string[]): any; + (key: "lastNames", values: string[]): any; + (key: "provinces", values: string[]): any; + (key: "us_states_and_dc", values: string[]): any; + (key: "territories", values: string[]): any; + (key: "armed_forces", values: string[]): any; + (key: "street_suffixes", values: string[]): any; + (key: "months", values: string[]): any; + (key: "cc_types", values: string[]): any; + (key: "currency_types", values: string[]): any; (key: string, values: T[]): any; } @@ -228,7 +232,7 @@ declare var chance: Chance.Chance; declare var Chance: Chance.ChanceStatic; // import Chance = require('chance'); -declare module 'chance' { +declare module "chance" { interface ExportedChance extends Chance.ChanceStatic { Chance: ExportedChance; } diff --git a/types/chance/tslint.json b/types/chance/tslint.json new file mode 100644 index 0000000000..2ef6444ebb --- /dev/null +++ b/types/chance/tslint.json @@ -0,0 +1,12 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "dt-header": false, + "no-declare-current-package": false, + "no-single-declare-module": false, + "no-unnecessary-generics": false, + "no-var-keyword": false, + "unified-signatures": false + } +} diff --git a/types/change-emitter/tslint.json b/types/change-emitter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/change-emitter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/charset/charset-tests.ts b/types/charset/charset-tests.ts new file mode 100644 index 0000000000..d9ecd5b24b --- /dev/null +++ b/types/charset/charset-tests.ts @@ -0,0 +1,11 @@ +import charset = require('charset'); +import http = require('http'); + +http.get('http://nodejs.org', (res) => { + res.on('data', (chunk: Buffer) => { + console.log(charset(res.headers, chunk)); + console.log(charset(res, chunk)); + console.log(charset('content-type header, for example charset=utf8', chunk)); + res.destroy(); + }); +}); diff --git a/types/charset/index.d.ts b/types/charset/index.d.ts new file mode 100644 index 0000000000..da8d086868 --- /dev/null +++ b/types/charset/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for charset 1.0 +// Project: https://github.com/node-modules/charset +// Definitions by: Andrew Bradley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import { ClientResponse, IncomingHttpHeaders } from 'http'; + +/** + * guess data charset from req.headers, xml, html content-type meta tag + * + * headers: + * + * 'content-type': 'text/html;charset=gbk' + * + * meta tag: + * + * + * + * xml file: + * + * + * + * @param obj `Content-Type` String, or `res.headers`, or `res` Object + * @param data content buffer + * @param peekSize max content peek size, default is 512 + * @return charset, lower case, e.g.: utf8, gbk, gb2312, .... If can\'t guess, return null + */ +// tslint:disable-next-line strict-export-declare-modifiers +declare function charset(obj: string | IncomingHttpHeaders | ClientResponse, data?: Buffer, peekSize?: number): string | null; + +// tslint:disable-next-line strict-export-declare-modifiers +export = charset; diff --git a/types/charset/tsconfig.json b/types/charset/tsconfig.json new file mode 100644 index 0000000000..52652c8e44 --- /dev/null +++ b/types/charset/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", + "charset-tests.ts" + ] +} diff --git a/types/charset/tslint.json b/types/charset/tslint.json new file mode 100644 index 0000000000..ca595ee830 --- /dev/null +++ b/types/charset/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-redundant-jsdoc-2": false + } +} diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index a4cccb0bae..d1e86fd317 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -36,9 +36,16 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { ticks: { callback: Math.floor }, - gridLines: { display: false } + gridLines: { + display: false, + borderDash: [5, 15], + borderDashOffset: 2, + zeroLineBorderDash: [5, 15], + zeroLineBorderDashOffset: 2 + } }] - } + }, + plugins: { arbitraryPlugin: {option: "value"} } } }); chart.update(); diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 78f1aa6142..614fbe26ef 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chart.js 2.6 +// Type definitions for Chart.js 2.7 // Project: https://github.com/nnnick/Chart.js // Definitions by: Alberto Nuti // Fabien Lavocat @@ -6,6 +6,7 @@ // Larry Bahr // Daniel Luz // Joseph Page +// Dan Manastireanu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -77,7 +78,7 @@ interface Size { } declare namespace Chart { - type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble'; + type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie'; type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; @@ -113,18 +114,25 @@ declare namespace Chart { index?: number; } + interface ChartTooltipLabelColor { + borderColor: ChartColor; + backgroundColor: ChartColor; + } + interface ChartTooltipCallback { - beforeTitle?(item?: ChartTooltipItem[], data?: any): void; - title?(item?: ChartTooltipItem[], data?: any): void; - afterTitle?(item?: ChartTooltipItem[], data?: any): void; - beforeBody?(item?: ChartTooltipItem[], data?: any): void; - beforeLabel?(tooltipItem?: ChartTooltipItem, data?: any): void; - label?(tooltipItem?: ChartTooltipItem, data?: any): void; - afterLabel?(tooltipItem?: ChartTooltipItem, data?: any): void; - afterBody?(item?: ChartTooltipItem[], data?: any): void; - beforeFooter?(item?: ChartTooltipItem[], data?: any): void; - footer?(item?: ChartTooltipItem[], data?: any): void; - afterFooter?(item?: ChartTooltipItem[], data?: any): void; + beforeTitle?(item: ChartTooltipItem[], data: ChartData): string | string[]; + title?(item: ChartTooltipItem[], data: ChartData): string | string[]; + afterTitle?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeBody?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeLabel?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + label?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + labelColor?(tooltipItem: ChartTooltipItem, chart: Chart): ChartTooltipLabelColor; + labelTextColor?(tooltipItem: ChartTooltipItem, chart: Chart): string; + afterLabel?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + afterBody?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeFooter?(item: ChartTooltipItem[], data: ChartData): string | string[]; + footer?(item: ChartTooltipItem[], data: ChartData): string | string[]; + afterFooter?(item: ChartTooltipItem[], data: ChartData): string | string[]; } interface ChartAnimationParameter { @@ -151,21 +159,25 @@ declare namespace Chart { interface ChartOptions { responsive?: boolean; responsiveAnimationDuration?: number; + aspectRatio?: number; maintainAspectRatio?: boolean; events?: string[]; - onClick?(any?: any): any; + onClick?(event?: MouseEvent, activeElements?: Array<{}>): any; title?: ChartTitleOptions; legend?: ChartLegendOptions; tooltips?: ChartTooltipOptions; hover?: ChartHoverOptions; animation?: ChartAnimationOptions; elements?: ChartElementsOptions; + layout?: ChartLayoutOptions; scales?: ChartScales; showLines?: boolean; spanGaps?: boolean; cutoutPercentage?: number; circumference?: number; rotation?: number; + // Plugins can require any options + plugins?: any; } interface ChartFontOptions { @@ -312,9 +324,23 @@ declare namespace Chart { borderColor?: ChartColor; borderSkipped?: string; } + + interface ChartLayoutOptions { + padding?: ChartLayoutPaddingObject | number; + } + + interface ChartLayoutPaddingObject { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + interface GridLineOptions { display?: boolean; color?: ChartColor; + borderDash?: number[]; + borderDashOffset?: number; lineWidth?: number; drawBorder?: boolean; drawOnChartArea?: boolean; @@ -322,6 +348,8 @@ declare namespace Chart { tickMarkLength?: number; zeroLineWidth?: number; zeroLineColor?: ChartColor; + zeroLineBorderDash?: number[]; + zeroLineBorderDashOffset?: number; offsetGridLines?: boolean; } @@ -336,7 +364,7 @@ declare namespace Chart { interface TickOptions { autoSkip?: boolean; - autoSkipPadding?: boolean; + autoSkipPadding?: number; callback?(value: any, index: any, values: any): string|number; display?: boolean; fontColor?: ChartColor; @@ -393,8 +421,8 @@ declare namespace Chart { interface ChartDataSets { cubicInterpolationMode?: 'default' | 'monotone'; backgroundColor?: ChartColor | ChartColor[]; - borderWidth?: number; - borderColor?: ChartColor; + borderWidth?: number | number[]; + borderColor?: ChartColor | ChartColor[]; borderCapStyle?: string; borderDash?: number[]; borderDashOffset?: number; diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index 6bdb7ebfe3..93918a5eeb 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chartist v0.9.8 +// Type definitions for Chartist v0.9.81 // Project: https://github.com/gionkunz/chartist-js // Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -78,7 +78,7 @@ declare namespace Chartist { // TODO: come in and tidy this up and make it fit better interface IChartistData { labels?: Array | Array | Array; - series: Array | Array | Array>; + series: Array | Array> | Array | Array>; } interface IChartistSeriesData { diff --git a/types/chartist/tslint.json b/types/chartist/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chartist/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chartjs/chartjs-tests.ts b/types/chartjs/chartjs-tests.ts deleted file mode 100644 index ef50da1b40..0000000000 --- a/types/chartjs/chartjs-tests.ts +++ /dev/null @@ -1,393 +0,0 @@ - - -var canvas = document.getElementById('example-chart'); -var ctx = canvas.getContext('2d'); - -Chart.defaults.global = { - animation: true, - animationSteps: 60, - animationEasing: "easeOutQuart", - showScale: true, - scaleOverride: false, - scaleSteps: null, - scaleStepWidth: null, - scaleStartValue: null, - scaleLineColor: "rgba(0,0,0,.1)", - scaleLineWidth: 1, - scaleShowLabels: true, - scaleLabel: "<%=value%>", - scaleIntegersOnly: true, - scaleBeginAtZero: false, - scaleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - scaleFontSize: 12, - scaleFontStyle: "normal", - scaleFontColor: "#666", - responsive: false, - maintainAspectRatio: true, - showTooltips: true, - tooltipEvents: ["mousemove", "touchstart", "touchmove"], - tooltipFillColor: "rgba(0,0,0,0.8)", - tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - tooltipFontSize: 14, - tooltipFontStyle: "normal", - tooltipFontColor: "#fff", - tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - tooltipTitleFontSize: 14, - tooltipTitleFontStyle: "bold", - tooltipTitleFontColor: "#fff", - tooltipYPadding: 6, - tooltipXPadding: 6, - tooltipCaretSize: 8, - tooltipCornerRadius: 6, - tooltipXOffset: 10, - tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>", - multiTooltipTemplate: "<%= value %>", - onAnimationProgress: function () { }, - onAnimationComplete: function () { } -} - -var lineData: LinearChartData = { - labels: ['03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00'], - datasets: [ - { - label: 'Accepted', - type: 'bar', - fillColor: 'rgba(220,220,220,0.2)', - strokeColor: 'rgba(220,220,220,1)', - pointColor: 'rgba(220,220,220,1)', - pointStrokeColor: '#fff', - pointHighlightFill: '#fff', - pointHighlightStroke: 'rgba(220,220,220,1)', - borderColor: "#9b0391", - data: [65, 59, 80, 81, 56, 55, 40] - }, - { - label: 'Quarantined', - fillColor: 'rgba(151,187,205,0.2)', - strokeColor: 'rgba(151,187,205,1)', - pointColor: 'rgba(151,187,205,1)', - pointStrokeColor: '#fff', - pointHighlightFill: '#fff', - pointHighlightStroke: 'rgba(151,187,205,1)', - data: [28, 48, 40, 19, 86, 27, 90], - yAxisID: 'quarantined' - } - ] -}; - -var myLineChart = new Chart(ctx).Line(lineData, { - scaleShowGridLines: true, - scaleGridLineColor: "rgba(0,0,0,.05)", - scaleGridLineWidth: 1, - bezierCurve: true, - bezierCurveTension: 0.4, - pointDot: true, - pointDotRadius: 4, - pointDotStrokeWidth: 1, - pointHitDetectionRadius: 20, - datasetStroke: true, - datasetStrokeWidth: 2, - datasetFill: true, - scales: { - xAxes: [{ - stacked: true, - }], - yAxes: [{ - position: "left", - "id": "users" - }, { - position: "right", - "id": "ratio", - ticks: { - min: -13 - } - }] - }, - legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
" -}); - -var myLineChartLegend: string = myLineChart.generateLegend(); -var myLineChartImage: string = myLineChart.toBase64Image(); -myLineChart.addData([1, 2, 3, 4, 5, 6, 7], 'new'); -myLineChart.clear(); -myLineChart.removeData(); -myLineChart.resize(); -myLineChart.update(); -myLineChart.stop(); -myLineChart.destroy(); - -var barData: LinearChartData = { - labels: ["January", "February", "March", "April", "May", "June", "July"], - datasets: [ - { - label: "My First dataset", - fillColor: "rgba(220,220,220,0.5)", - strokeColor: "rgba(220,220,220,0.8)", - highlightFill: "rgba(220,220,220,0.75)", - highlightStroke: "rgba(220,220,220,1)", - data: [65, 59, 80, 81, 56, 55, 40] - }, - { - label: "My Second dataset", - fillColor: "rgba(151,187,205,0.5)", - strokeColor: "rgba(151,187,205,0.8)", - highlightFill: "rgba(151,187,205,0.75)", - highlightStroke: "rgba(151,187,205,1)", - data: [28, 48, 40, 19, 86, 27, 90] - } - ] -}; - -var myBarChart = new Chart(ctx).Bar(barData, { - scaleBeginAtZero: true, - scaleShowGridLines: true, - scaleGridLineColor: "rgba(0,0,0,.05)", - scaleGridLineWidth: 1, - barShowStroke: true, - barStrokeWidth: 2, - barValueSpacing: 5, - barDatasetSpacing: 1, - legend: { - display: true, - position: 'bottom' - }, - legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
" -}); - -var myBarChartLegend: string = myBarChart.generateLegend(); -var myBarChartImage: string = myBarChart.toBase64Image(); -myBarChart.addData([1, 2, 3, 4, 5, 6, 7], 'new'); -myBarChart.clear(); -myBarChart.removeData(); -myBarChart.resize(); -myBarChart.update(); -myBarChart.stop(); -myBarChart.destroy(); - -var radarData: LinearChartData = { - labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"], - datasets: [ - { - label: "My First dataset", - fillColor: "rgba(220,220,220,0.2)", - strokeColor: "rgba(220,220,220,1)", - pointColor: "rgba(220,220,220,1)", - pointStrokeColor: "#fff", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(220,220,220,1)", - data: [65, 59, 90, 81, 56, 55, 40] - }, - { - label: "My Second dataset", - fillColor: "rgba(151,187,205,0.2)", - strokeColor: "rgba(151,187,205,1)", - pointColor: "rgba(151,187,205,1)", - pointStrokeColor: "#fff", - pointHighlightFill: "#fff", - pointHighlightStroke: "rgba(151,187,205,1)", - data: [28, 48, 40, 19, 96, 27, 100] - } - ] -}; - -var myRadarChart = new Chart(ctx).Radar(radarData, { - scaleShowLine: true, - angleShowLineOut: true, - scaleShowLabels: false, - scaleBeginAtZero: true, - angleLineColor: "rgba(0,0,0,.1)", - angleLineWidth: 1, - pointLabelFontFamily: "'Arial'", - pointLabelFontStyle: "normal", - pointLabelFontSize: 10, - pointLabelFontColor: "#666", - pointDot: true, - pointDotRadius: 3, - pointDotStrokeWidth: 1, - pointHitDetectionRadius: 20, - datasetStroke: true, - datasetStrokeWidth: 2, - datasetFill: true, - legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
" -}); - -var myRadarChartLegend: string = myRadarChart.generateLegend(); -var myRadarChartImage: string = myRadarChart.toBase64Image(); -myRadarChart.addData([1, 2, 3, 4, 5, 6, 7], 'new'); -myRadarChart.clear(); -myRadarChart.removeData(); -myRadarChart.resize(); -myRadarChart.update(); -myRadarChart.stop(); -myRadarChart.destroy(); - -var polarAreaData: CircularChartData[] = [ - { - value: 300, - color: "#F7464A", - highlight: "#FF5A5E", - label: "Red" - }, - { - value: 50, - color: "#46BFBD", - highlight: "#5AD3D1", - label: "Green" - }, - { - value: 100, - color: "#FDB45C", - highlight: "#FFC870", - label: "Yellow" - }, - { - value: 40, - color: "#949FB1", - highlight: "#A8B3C5", - label: "Grey" - }, - { - value: 120, - color: "#4D5360", - highlight: "#616774", - label: "Dark Grey" - } - -]; - -var myPolarAreaChart = new Chart(ctx).PolarArea(polarAreaData, { - scaleShowLabelBackdrop: true, - scaleBackdropColor: "rgba(255,255,255,0.75)", - scaleBeginAtZero: true, - scaleBackdropPaddingY: 2, - scaleBackdropPaddingX: 2, - scaleShowLine: true, - segmentShowStroke: true, - segmentStrokeColor: "#fff", - segmentStrokeWidth: 2, - animationSteps: 100, - animationEasing: "easeOutBounce", - animateRotate: true, - animateScale: false, - legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>
" -}); - -var myPolarAreaChartLegend: string = myPolarAreaChart.generateLegend(); -var myPolarAreaChartImage: string = myPolarAreaChart.toBase64Image(); -myPolarAreaChart.addData({ - value: 120, - color: "#4D5360", - highlight: "#616774", - label: "Dark Grey" -}, 0); -myPolarAreaChart.clear(); -myPolarAreaChart.removeData(0); -myPolarAreaChart.resize(); -myPolarAreaChart.update(); -myPolarAreaChart.stop(); -myPolarAreaChart.destroy(); - -var pieData: CircularChartData[] = [ - { - value: 300, - color: "#F7464A", - highlight: "#FF5A5E", - label: "Red" - }, - { - value: 50, - color: "#46BFBD", - highlight: "#5AD3D1", - label: "Green" - }, - { - value: 100, - color: "#FDB45C", - highlight: "#FFC870", - label: "Yellow" - } -]; - -// For a pie chart -var myPieChart = new Chart(ctx).Pie(pieData, { - segmentShowStroke: true, - segmentStrokeColor: "#fff", - segmentStrokeWidth: 2, - percentageInnerCutout: 0, - animationSteps: 100, - animationEasing: "easeOutBounce", - animateRotate: true, - animateScale: false, - legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>
" -}); - -var myPieChartLegend: string = myPieChart.generateLegend(); -var myPieChartImage: string = myPieChart.toBase64Image(); -myPieChart.addData({ - value: 120, - color: "#4D5360", - highlight: "#616774", - label: "Dark Grey" -}, 0); -myPieChart.clear(); -myPieChart.removeData(0); -myPieChart.resize(); -myPieChart.update(); -myPieChart.stop(); -myPieChart.destroy(); - -// And for a doughnut chart -var myDoughnutChart = new Chart(ctx).Doughnut(pieData, { - segmentShowStroke: true, - segmentStrokeColor: "#fff", - segmentStrokeWidth: 2, - percentageInnerCutout: 50, - animationSteps: 100, - animationEasing: "easeOutBounce", - animateRotate: true, - animateScale: false, - legendTemplate: "
    -legend\"><% for (var i=0; i
  • \"><%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>
" -}); - -var myDoughnutChartLegend: string = myDoughnutChart.generateLegend(); -var myDoughnutChartImage: string = myDoughnutChart.toBase64Image(); -myPieChart.addData({ - value: 120, - color: "#4D5360", - highlight: "#616774", - label: "Dark Grey" -}, 0); -myDoughnutChart.clear(); -myDoughnutChart.removeData(0); -myDoughnutChart.resize(); -myDoughnutChart.update(); -myDoughnutChart.stop(); -myDoughnutChart.destroy(); - -// Test using charts with overrides of a subset of global options -var partialOpts: ChartSettings = { - showTooltips: true, - tooltipEvents: ["mousemove", "touchstart", "touchmove"], - tooltipFillColor: "rgba(0,0,0,0.8)", - tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - tooltipFontSize: 14, - tooltipFontStyle: "normal", - tooltipFontColor: "#fff", - tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - tooltipTitleFontSize: 14, - tooltipTitleFontStyle: "bold", - tooltipTitleFontColor: "#fff", - tooltipYPadding: 6, - tooltipXPadding: 6, - tooltipCaretSize: 8, - tooltipCornerRadius: 6, - tooltipXOffset: 10, - tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>" -}; - -var my2ndLineChart = new Chart(ctx).Line(lineData, partialOpts); -var my2ndBarChart = new Chart(ctx).Bar(barData, partialOpts); -var my2ndRadarChart = new Chart(ctx).Radar(radarData, partialOpts); -var my2ndPolarAreaChart = new Chart(ctx).PolarArea(polarAreaData, partialOpts); -var my2ndPieChart = new Chart(ctx).Pie(pieData, partialOpts); -var my2ndDoughnutChart = new Chart(ctx).Doughnut(pieData, partialOpts); diff --git a/types/chartjs/index.d.ts b/types/chartjs/index.d.ts deleted file mode 100644 index 4caaef4981..0000000000 --- a/types/chartjs/index.d.ts +++ /dev/null @@ -1,255 +0,0 @@ -// Type definitions for Chart.js -// Project: https://github.com/nnnick/Chart.js -// Definitions by: Steve Fenton -// Alessio Fanelli -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface ChartDataSet { - label: string; - fillColor: string; - strokeColor: string; - type?: string; - yAxisID?: string; - xAxisID?: string; - - borderColor?: string; - /* Line, Radar */ - pointColor?: string; - pointStrokeColor?: string; - pointHighlightFill?: string; - pointHighlightStroke?: string; - - /* Bar */ - highlightFill?: string; - highlightStroke?: string; - backgroundColorHover?: string; - - data: number[]; -} - -interface LinearChartData { - labels: string[]; - datasets: ChartDataSet[]; -} - -interface CircularChartData { - value: number; - color?: string; - highlight?: string; - label?: string; -} - -interface ChartSettings { - animation?: boolean; - animationSteps?: number; - animationEasing?: string; - showScale?: boolean; - scaleOverride?: boolean; - scaleSteps?: number; - scaleStepWidth?: number; - scaleStartValue?: number; - scaleLineColor?: string; - scaleLineWidth?: number; - scaleShowLabels?: boolean; - scaleLabel?: string; - scaleIntegersOnly?: boolean; - scaleBeginAtZero?: boolean; - scaleFontFamily?: string; - scaleFontSize?: number; - scaleFontStyle?: string; - scaleFontColor?: string; - responsive?: boolean; - maintainAspectRatio?: boolean; - showTooltips?: boolean; - tooltipEvents?: string[]; - tooltipFillColor?: string; - tooltipFontFamily?: string; - tooltipFontSize?: number; - tooltipFontStyle?: string; - tooltipFontColor?: string; - tooltipTitleFontFamily?: string; - tooltipTitleFontSize?: number; - tooltipTitleFontStyle?: string; - tooltipTitleFontColor?: string; - tooltipYPadding?: number; - tooltipXPadding?: number; - tooltipCaretSize?: number; - tooltipCornerRadius?: number; - tooltipXOffset?: number; - tooltipTemplate?: string; - multiTooltipTemplate?: string; - onAnimationProgress?: () => any; - onAnimationComplete?: () => any; -} - -interface ChartOptions extends ChartSettings { - scaleShowGridLines?: boolean; - scaleGridLineColor?: string; - scaleGridLineWidth?: number; - scaleShowHorizontalLines?: boolean; - scaleShowVerticalLines?: boolean; - legendTemplate?: string; - tooltips?: ChartTooltips; - legend?: ChartLegend; - scales?: ChartScales; - title?: ChartTitle; -} - -interface ChartTooltips { - mode?: string; - intersect?: boolean; -} - -interface ChartLegend { - display?: boolean; - position?: string; -} - -interface ChartScales { - xAxes?: Array; - yAxes?: Array; -} - -interface ChartScalesOptions { - stacked?: boolean; - position?: string; - id?: string; - ticks?: ScaleTicksOptions; -} - -interface ScaleTicksOptions { - min?: number; - max?: number; - maxTicksLimit?: number; - suggestedMin?: number; - suggestedMax?: number; - stepSize?: number; -} - -interface ChartTitle { - display?: boolean; - text?: string; -} - -interface PointsAtEvent { - value: number; - label: string; - datasetLabel: string; - strokeColor: string; - fillColor: string; - highlightFill: string; - highlightStroke: string; - x: number; - y: number; -} - -interface ChartInstance { - clear: () => void; - stop: () => void; - resize: () => void; - destroy: () => void; - toBase64Image: () => string; - generateLegend: () => string; -} - -interface LinearInstance extends ChartInstance { - getPointsAtEvent: (event: Event) => PointsAtEvent[]; - update: () => void; - addData: (valuesArray: number[], label: string) => void; - removeData: (index?: number) => void; -} - -interface CircularInstance extends ChartInstance { - getSegmentsAtEvent: (event: Event) => {}[]; - update: () => void; - addData: (valuesArray: CircularChartData, index?: number) => void; - removeData: (index: number) => void; - segments: Array; -} - -interface LineChartOptions extends ChartOptions { - bezierCurve?: boolean; - bezierCurveTension?: number; - pointDot?: boolean; - pointDotRadius?: number; - pointDotStrokeWidth?: number; - pointHitDetectionRadius?: number; - datasetStroke?: boolean; - datasetStrokeWidth?: number; - datasetFill?: boolean; -} - -interface BarChartOptions extends ChartOptions { - scaleBeginAtZero?: boolean; - barShowStroke?: boolean; - barStrokeWidth?: number; - barValueSpacing?: number; - barDatasetSpacing?: number; -} - -interface RadarChartOptions extends ChartSettings { - scaleShowLine?: boolean; - angleShowLineOut?: boolean; - scaleShowLabels?: boolean; - scaleBeginAtZero?: boolean; - angleLineColor?: string; - angleLineWidth?: number; - pointLabelFontFamily?: string; - pointLabelFontStyle?: string; - pointLabelFontSize?: number; - pointLabelFontColor?: string; - pointDot?: boolean; - pointDotRadius?: number; - pointDotStrokeWidth?: number; - pointHitDetectionRadius?: number; - datasetStroke?: boolean; - datasetStrokeWidth?: number; - datasetFill?: boolean; - legendTemplate?: string; -} - -interface PolarAreaChartOptions extends ChartSettings { - scaleShowLabelBackdrop?: boolean; - scaleBackdropColor?: string; - scaleBeginAtZero?: boolean; - scaleBackdropPaddingY?: number; - scaleBackdropPaddingX?: number; - scaleShowLine?: boolean; - segmentShowStroke?: boolean; - segmentStrokeColor?: string; - segmentStrokeWidth?: number; - animationSteps?: number; - animationEasing?: string; - animateRotate?: boolean; - animateScale?: boolean; - legendTemplate?: string; -} - -interface PieChartOptions extends ChartSettings { - segmentShowStroke?: boolean; - segmentStrokeColor?: string; - segmentStrokeWidth?: number; - percentageInnerCutout?: number; - animationSteps?: number; - animationEasing?: string; - animateRotate?: boolean; - animateScale?: boolean; - legendTemplate?: string; -} - -interface Chart { - Line(data: LinearChartData, options?: LineChartOptions): LinearInstance; - Bar(data: LinearChartData, options?: BarChartOptions): LinearInstance; - Radar(data: LinearChartData, options?: RadarChartOptions): LinearInstance; - - PolarArea(data: CircularChartData[], options?: PolarAreaChartOptions): CircularInstance; - Pie(data: CircularChartData[], options?: PieChartOptions): CircularInstance; - Doughnut(data: CircularChartData[], options?: PieChartOptions): CircularInstance; -} - -declare var Chart: { - new (context: CanvasRenderingContext2D): Chart; - defaults: { - global: ChartSettings; - } -}; diff --git a/types/chartjs/tsconfig.json b/types/chartjs/tsconfig.json deleted file mode 100644 index 17d7edaf2a..0000000000 --- a/types/chartjs/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "chartjs-tests.ts" - ] -} \ No newline at end of file diff --git a/types/check-types/check-types-tests.ts b/types/check-types/check-types-tests.ts new file mode 100644 index 0000000000..1f0fc31c98 --- /dev/null +++ b/types/check-types/check-types-tests.ts @@ -0,0 +1,57 @@ +import * as check from "check-types"; + +const a: boolean = check.number(2); + +const b: any = 2; + +if (check.string(b)) { + const c = b.slice(0, 1); +} + +check.map({ val: 1, val2: 2 }, { val: check.number, val2: check.string }); + +check.even(3); + +check.not.even(3); + +check.maybe.even(2); + +check.assert.like({ foo: 'bar' }, { baz: 'qux' }); + +check.assert(false, "msg", Error); + +check.assert.not.like({ foo: 'bar' }, { baz: 'qux' }); + +check.assert.maybe.like(undefined, { foo: 'bar' }); + +check.assert(function a(): any { return {}; }, 'Something went wrong', Error); + +check.apply([ 'foo', 'bar', '' ], check.nonEmptyString); + +check.any( + check.apply( + [ 1, 2, 3, '' ], + check.string + ) +); + +check.any( + check.map( + { foo: 0, bar: '' }, + { foo: check.number, bar: check.string } + ) +); + +check.all( + check.map( + { foo: 0, bar: '' }, + { foo: check.number, bar: check.string } + ) +); + +check.all( + check.apply( + [ 1, 2, 3, '' ], + check.string + ) +); diff --git a/types/check-types/index.d.ts b/types/check-types/index.d.ts new file mode 100644 index 0000000000..fad987692f --- /dev/null +++ b/types/check-types/index.d.ts @@ -0,0 +1,162 @@ +// Type definitions for check-types 7.3 +// Project: https://github.com/philbooth/check-types.js +// Definitions by: idchlife +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/ +// TypeScript Version: 2.2 + +type NegationFunction = (val: any) => boolean; + +type MaybeFunction = (val: T) => boolean | T; + +interface ArrayFunction { + (a: any): a is any[]; + + // TODO: Maybe there is a way to create type guards for array type checks + // Since syntax is like check.array.of.number(2) - it's not yet clear to me how this even works, so... + // I might use of: CheckType, but it will just return type guards for primitives and object type + // and will make variable simply non array type in conditionals. + of: { + [method: string]: boolean; + }; +} + +interface ArrayLikeFunction { + (a: any): a is ArrayLike; + + // See in array explanation of this type + of: { + [method: string]: boolean; + }; +} + +interface IterableFunction { + (a: any): a is Iterable; + + // See in array explanation of this type + of: { + [method: string]: boolean; + }; +} + +interface ObjectFunction { + (a: any): a is object; + + // See in array explanation of this type + of: { + [method: string]: boolean; + }; +} + +interface AssertFunction extends CheckType { + (possibleFalsy: T, message?: string, errorType?: { new(...args: any[]): any }): T; +} + +interface CheckType { + /* General predicates */ + + equal(a: any, b: any): boolean; + null(a: any): a is null; + undefined(a: any): a is undefined; + assigned(a: any): boolean; + primitive(a: any): a is number | string | boolean | null | undefined | symbol; + hasLength(a: any, length: number): boolean; + + /* String predicates */ + + string(a: any): a is string; + emptyString(a: string): boolean; + nonEmptyString(a: string): boolean; + contains(a: string, substring: string): boolean; + match(a: string, b: RegExp): boolean; + + /* Number predicates */ + + number(a: any): a is number; + integer(a: any): a is number; + zero(a: any): boolean; + infinity(a: any): boolean; + greater(num: number, greaterThan: number): boolean; + greaterOrEqual(num: number, greaterOrEqual: number): boolean; + less(num: number, lessThan: number): boolean; + lessOrEqual(num: number, lessOrEqual: number): boolean; + /** + * Excluding a and b. Any order of a, b + */ + between(num: number, a: number, b: number): boolean; + /** + * Including a, b. Any order of a, b + */ + inRange(num: number, a: number, b: number): boolean; + positive(num: number): boolean; + negative(num: number): boolean; + odd(num: number): boolean; + even(num: number): boolean; + + /* Boolean predicates */ + + boolean(a: any): a is boolean; + + /* Object predicates */ + + object: ObjectFunction; + emptyObject(a: object): boolean; + nonEmptyObject(a: object): boolean; + /** + * Checking via instanceof + */ + instanceStrict(a: any, prototype: T): a is T; + /** + * Checking via instanceof, fallback constructor.name and .toString() + */ + instance(a: any, prototype: T): a is T; + /** + * Duck type checking. Structural in other words. Checking if a has all properties of duck + */ + like(a: any, duck: T): a is T; + + /* Array predicates */ + + array: ArrayFunction; + emptyArray(a: any[]): boolean; + nonEmptyArray(a: any[]): boolean; + arrayLike: ArrayLikeFunction; + iterable: IterableFunction; + includes(a: any[], value: any): boolean; + + /* Date predicates */ + + date(a: any): a is Date; + + /* Function predicates */ + + function(a: any): a is (...args: any[]) => any; + + /* Modifiers (some of them in their respected sections) */ + not: CheckType & NegationFunction; + maybe: CheckType & MaybeFunction; + assert: AssertFunction; + + /* Batch operations */ + + /** + * Applying predicate to every element of array and returning resulting array + * + * Example: apply([2, 3, "four"], check.number) => [true, true, false] + */ + apply(arr: any[], predicate: (...args: any[]) => T): T[]; + + // Also some difficulties with returning object with only defined in predicates object propertis. + // Will gladly accept help or ideas. Now using any for returned object + map( + arr: T, + predicates: Partial<{ [k in keyof T]: (...args: any[]) => boolean }> + ): Partial<{ [k in keyof T]: any }>; + + all(arr: boolean[] | { [k: string]: boolean }): boolean; + + any(arr: boolean[] | { [k: string]: boolean }): boolean; +} + +declare const check: CheckType; + +export = check; diff --git a/types/check-types/tsconfig.json b/types/check-types/tsconfig.json new file mode 100644 index 0000000000..d3c89a7ac7 --- /dev/null +++ b/types/check-types/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "check-types-tests.ts" + ] +} \ No newline at end of file diff --git a/types/check-types/tslint.json b/types/check-types/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/check-types/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/checksum/tslint.json b/types/checksum/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/checksum/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index 2037e83c7a..42bcae6eff 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Cheerio v0.22.0 // Project: https://github.com/cheeriojs/cheerio -// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Cheerio { @@ -172,7 +172,7 @@ interface Cheerio { empty(): Cheerio; - html(): string; + html(): string | null; html(html: string): Cheerio; text(): string; @@ -255,6 +255,7 @@ interface CheerioElement { children: CheerioElement[]; childNodes: CheerioElement[]; lastChild: CheerioElement; + firstChild: CheerioElement; next: CheerioElement; nextSibling: CheerioElement; prev: CheerioElement; @@ -262,6 +263,7 @@ interface CheerioElement { parent: CheerioElement; parentNode: CheerioElement; nodeValue: string; + data?: string; } interface CheerioAPI extends CheerioSelector, CheerioStatic { @@ -269,6 +271,8 @@ interface CheerioAPI extends CheerioSelector, CheerioStatic { load(element: CheerioElement, options?: CheerioOptionsInterface): CheerioStatic; } +interface Document { } + declare var cheerio:CheerioAPI; declare module "cheerio" { diff --git a/types/cheerio/tslint.json b/types/cheerio/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cheerio/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chocolatechipjs/index.d.ts b/types/chocolatechipjs/index.d.ts index 4c1d49f6d1..2b53368f08 100644 --- a/types/chocolatechipjs/index.d.ts +++ b/types/chocolatechipjs/index.d.ts @@ -10,7 +10,6 @@ interface ChocolateChipStatic { * * @param selector A string containing a selector expression * @param context A DOM HTMLElement to use as context - * @return HTMLElement[] */ (selector: string | HTMLElement | Document, context?: HTMLElement | ChocolateChipElementArray): ChocolateChipElementArray; @@ -18,7 +17,6 @@ interface ChocolateChipStatic { * Binds a function to be executed when the DOM has finished loading. * * @param callback A function to execute after the DOM is ready. - * @return void */ (callback: () => any): void; @@ -26,7 +24,6 @@ interface ChocolateChipStatic { * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param element A DOM element to wrap in an array. - * @return HTMLElement[] */ (element: HTMLElement): ChocolateChipElementArray; @@ -34,7 +31,6 @@ interface ChocolateChipStatic { * Accepts a string containing a CSS selector which is then used to match a set of elements. * * @param elementArray An array of DOM elements to convert into a ChocolateChip Collection. - * @return HTMLElement[] */ (elementArray: ChocolateChipElementArray): ChocolateChipElementArray; @@ -42,13 +38,11 @@ interface ChocolateChipStatic { * Accepts the document element and returns it wrapped in an array. * * @param document The document object. - * @return document[] */ (document: Document): Document[]; /** * If no argument is provided, return the document as a ChocolateChipElementArray. - * @return Document[] */ (): Document[]; @@ -94,8 +88,6 @@ interface ChocolateChipStatic { /** * An empty function. - * - * @return void. */ noop(): void; @@ -106,40 +98,27 @@ interface ChocolateChipStatic { /** * Create a random number to use as a uuid. - * - * @return number. */ uuidNum(): number; /** * Creates a uuid using uuidNum(). - * - * @return A string. */ makeUuid(): string; /** * Create a ChocolateChip collection object by creating elements from an HTML string. - * - * @param selector - * @return any */ make(selector: string): ChocolateChipElementArray; /** * Create a ChocolateChip collection object by creating elements from an HTML string. This is an alias for $.make. - * - * @param selector - * @return any */ html(selector: string): ChocolateChipElementArray; /** * Replace one element with another. - * - * @param new HTMLElement - * @param old HTMLElement - * @return HTMLElement[] + * @return {HTMLElement[]} */ replace(newElement: ChocolateChipElementArray, oldElement: ChocolateChipElementArray): void; @@ -148,7 +127,7 @@ interface ChocolateChipStatic { * * @param url A string containing the URL where the script resides. * @param callback A callback function that is executed after the script loads. - * @return void + * @return {void} */ require(url: string, callback: Function): Function; @@ -157,7 +136,7 @@ interface ChocolateChipStatic { * * @param url A string containing the URL where the script resides. * @param callback A callback function that is executed after the script loads. - * @return Function + * @return {Function} */ processJSON(json: string, name?: string): any; @@ -173,7 +152,6 @@ interface ChocolateChipStatic { * Parse the data in a Promise response as JSON. * * @param response The response from a Promise. - * @result */ json(reponse: Response): JSON; @@ -182,7 +160,6 @@ interface ChocolateChipStatic { * * @param callback A function to execute. * @param duration The number of milliseconds to delay execution. - * @return any */ delay(callback: Function, duration?: number): any; @@ -190,7 +167,6 @@ interface ChocolateChipStatic { * The method will defer the execution of its callback until the call stack is clear. * * @param callback A callback to execute after a delay. - * @return Function. */ defer(callback: Function): Function; @@ -215,16 +191,14 @@ interface ChocolateChipStatic { /** * This method will concatenate strings or values as a cleaner alternative to using the '+' operator. * - * @param string or number A comma separated series of strings to concatenate. - * @return string + * @param {string | number} A comma separated series of strings to concatenate. */ concat(...string: string[]): string; /** * This method takes a space-delimited string of words and returns it as an array where the individual words are indices. * - * @param string Any string with values separated by spaces. - * @return string[] + * @param Any string with values separated by spaces. */ w(string: string): string[]; @@ -232,7 +206,6 @@ interface ChocolateChipStatic { * This method converts a string of hyphenated tokens into a camel cased string. * * @param string A string of hyphenated tokens. - * @return string */ camelize(string: string): string; @@ -240,16 +213,11 @@ interface ChocolateChipStatic { * This method converts a camel case string into lowercase with hyphens. * * @param string A camel case string. - * @return string */ deCamelize(string: string): string; /** * This method capitalizes the first letter of a string. - * - * @param string A string. - * @param boolean A boolean value. - * @return string */ capitalize(string: string, boolean?: boolean): string; @@ -257,7 +225,6 @@ interface ChocolateChipStatic { * Determine whether the argument is a string. * * @param obj Object to test whether or not it is a string. - * @return boolean */ isString(obj: any): boolean; @@ -265,7 +232,6 @@ interface ChocolateChipStatic { * Determine whether the argument is an array. * * @param obj Object to test whether or not it is an array. - * @return boolean */ isArray(obj: any): boolean; @@ -273,7 +239,6 @@ interface ChocolateChipStatic { * Determine whether the argument is a function. * * @param obj Object to test whether or not it is an function. - * @return boolean */ isFunction(obj: any): boolean; @@ -281,7 +246,6 @@ interface ChocolateChipStatic { * Determine whether the argument is an object. * * @param obj Object to test whether or not it is an object. - * @return boolean */ isObject(obj: any): boolean; @@ -297,7 +261,6 @@ interface ChocolateChipStatic { * Determine whether the argument is an empty object. * * @param obj Object to test whether or not it is an empty object. - * @return boolean */ isEmptyObject(obj: any): boolean; @@ -305,7 +268,6 @@ interface ChocolateChipStatic { * Determine whether the argument is a number. * * @param obj Object to test whether or not it is a number. - * @return boolean */ isNumber(obj: any): boolean; @@ -313,7 +275,6 @@ interface ChocolateChipStatic { * Determine whether the argument is an integer. * * @param obj Object to test whether or not it is an integer. - * @return boolean */ isInteger(obj: any): boolean; @@ -321,7 +282,6 @@ interface ChocolateChipStatic { * Determine whether the argument is a float. * * @param obj Object to test whether or not it is a float. - * @return boolean */ isFloat(obj: any): boolean; @@ -443,8 +403,8 @@ interface ChocolateChipStatic { /** * Grabs values from a form and converts them into a JSON object. * - * @param rootNode: string | HTMLElement A form whose values you want to convert to JSON. - * @param delimiter string A delimiter to namespace your form values. The default is "." + * @param rootNode: A form whose values you want to convert to JSON. + * @param delimiter A delimiter to namespace your form values. The default is "." * You use the form input's name to set up the namespace structure for your JSON, e.g. name="newUser.name.first". */ form2JSON(rootNode: string | HTMLElement, delimiter: string): Object; @@ -453,35 +413,33 @@ interface ChocolateChipStatic { * Subscribe to a publication. You provide the topic you want to subscribe to, as well as a callback to execute when a publication occurs. * Any data passed by the publisher is exposed to the callback as its second parameter. The callback's first parameter is the published topic. * - * @param topic string A topic to subscribe to. This can be a single term, or any type of namespaced term with delimiters. - * @data any You can receive any type: string, number, array, object, etc. - * @return any + * @param topic A topic to subscribe to. This can be a single term, or any type of namespaced term with delimiters. + * @param callback You can receive any type: string, number, array, object, etc. */ subscribe(topic: string, callback: (topic: string, data: any) => any): boolean; /** * Unsubscribe from a topic. Pass this the topic you wish to unsubscribe from. The subscription will be terminated immediately. * - * @param topic string The name of the topic to unsubscribe from. - * @return void + * @param topic The name of the topic to unsubscribe from. */ unsubscribe(topic: string): void; /** * Publish a topic with data for the topic's subscribers to receive. * - * @param topic string The topic you wish to publish. + * @param topic The topic you wish to publish. * @param data The data to send with the publication. This can be of any type: string, number, array, object, etc. - * @return void + * @return {void} */ publish(topic: string, data: any): string; /** * Object used to store string templates and parsed templates. * - * @param string A string defining the template. - * @param string A label used to access an object's properties in the template. If none is provided it defaults to "data": [[= data.name]]. - * @return void + * @param {strin} A string defining the template. + * @param {string} A label used to access an object's properties in the template. If none is provided it defaults to "data": [[= data.name]]. + * @return {void} */ templates: Object; @@ -495,7 +453,6 @@ interface ChocolateChipStatic { * * @param template A string of markup to use as a template. * @param variable An option name to use in the template. If it were "myData": [[= myData.name]]. Otherwise it defaults to "data": [[= data.name]]. - * @return A function. */ (template: string, variable?: string): Function; @@ -514,7 +471,6 @@ interface ChocolateChipStatic { * @param element The target container into which the content will be inserted. * @param template A string of markup. * @param data The iterable data the template will consume. - * @return void. */ (element: ChocolateChipElementArray, template: string, data: any): void; } @@ -523,7 +479,6 @@ interface ChocolateChipStatic { * An object that holds the reference to the controller for a repeater. * This is used to cache the data that a repeater uses. After the repeater is rendered, the reference is deleted from this object. * Example: $.template.data["myRepeater"] = [{name: "Joe"}, {name: "Sue"}]; - * */ data: any; @@ -567,16 +522,11 @@ interface ChocolateChipStatic { interface ChocolateChipElementArray extends Array { /** * Iterate over an Array object, executing a function for each matched element. - * - * @param Function - * @return void */ each(func: (ctx: any, idx: number) => void): void; /** * Sorts an array and removes duplicates before returning it. - * - * @return Array */ unique(): ChocolateChipElementArray; @@ -585,16 +535,13 @@ interface ChocolateChipElementArray extends Array { * When dealing with document nodes, this allows you to cherry pick a node from its collection based on its * position amongst its siblings. * - * @param number Index value indicating the node you wish to access from a collection. This is zero-based. - * @return HTMLElement + * @param index Value indicating the node you wish to access from a collection. This is zero-based. */ eq(index: number): ChocolateChipElementArray; /** * Search for a given element from among the matched elements on a collection. * This method returns the index value as an integer. - * - * @return number */ index(): number; @@ -603,7 +550,6 @@ interface ChocolateChipElementArray extends Array { * This method returns the index value as an integer. * * @param selector A selector representing an element to look for in a collection of elements. - * @return number */ index(selector: string | HTMLElement[]): number; @@ -612,7 +558,6 @@ interface ChocolateChipElementArray extends Array { * if it matches the given arguments. * * @param selector A string containing a selector expression to match elements against. - * @return HTMLElement[] */ is(selector: string): ChocolateChipElementArray; @@ -621,7 +566,6 @@ interface ChocolateChipElementArray extends Array { * if it matches the given arguments. * * @param elements One or more elements to match the current set of elements against. - * @ return HTMLElement[] */ is(element: any): ChocolateChipElementArray; @@ -630,7 +574,6 @@ interface ChocolateChipElementArray extends Array { * if it does not match the given arguments. * * @param selector A string containing a selector expression to match elements against. - * @ return HTMLElement[] */ isnt(selector: string): ChocolateChipElementArray; @@ -639,7 +582,6 @@ interface ChocolateChipElementArray extends Array { * if it does not match the given arguments. * * @param elements One or more elements to match the current set of elements against. - * @ return HTMLElement[] */ isnt(element: any): ChocolateChipElementArray; @@ -647,7 +589,6 @@ interface ChocolateChipElementArray extends Array { * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. * * @param selector A string containing a selector expression to match elements against. - * @ return HTMLElement[] */ has(selector: string): ChocolateChipElementArray; @@ -655,7 +596,6 @@ interface ChocolateChipElementArray extends Array { * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. * * @param contained A DOM element to match elements against. - * @ return HTMLElement[] */ has(contained: HTMLElement): ChocolateChipElementArray; @@ -671,7 +611,6 @@ interface ChocolateChipElementArray extends Array { * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. * * @param contained A DOM element to match elements against. - * @ return HTMLElement[] */ hasnt(contained: HTMLElement): ChocolateChipElementArray; @@ -684,7 +623,6 @@ interface ChocolateChipElementArray extends Array { * Get the descendants of each element in the current set of matched elements, filtered by a selector or element. * * @param selector A string containing a selector expression to match elements against. - * @ return HTMLElement[] */ find(selector: string): ChocolateChipElementArray; @@ -692,21 +630,16 @@ interface ChocolateChipElementArray extends Array { * Get the descendants of each element in the current set of matched elements, filtered by a selector or element. * * @param element An element to match elements against. - * @ return HTMLElement[] */ find(element: HTMLElement): ChocolateChipElementArray; /** * Get the immediately preceding sibling of each element in the set of matched elements. - * - * @ return HTMLElement[] */ prev(): ChocolateChipElementArray; /** * Get the immediately following sibling of each element in the set of matched elements. - * - * @ return HTMLElement[] */ next(): ChocolateChipElementArray; @@ -717,8 +650,6 @@ interface ChocolateChipElementArray extends Array { /** * Reduce the set of matched elements to the last in the set. - * - * @return HTMLElement[] */ last(): ChocolateChipElementArray; @@ -726,7 +657,6 @@ interface ChocolateChipElementArray extends Array { * Get the children of each element in the set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. - * @return HTMLElement[] */ children(selector?: string): ChocolateChipElementArray; @@ -735,7 +665,6 @@ interface ChocolateChipElementArray extends Array { * If multiple elements have the same parent, only one instance of the parent is returned. * * @param selector A string containing a selector expression to match elements against. - * @return HTMLElement[] */ parent(selector?: string): ChocolateChipElementArray; @@ -745,7 +674,6 @@ interface ChocolateChipElementArray extends Array { * retrieving that ancestor based on its distance from the element. * * @param selector A string containing a selector expression to match elements against. - * @return HTMLElement[] */ ancestor(selector: string | number): ChocolateChipElementArray; @@ -754,7 +682,6 @@ interface ChocolateChipElementArray extends Array { * itself and traversing up through its ancestors in the DOM tree. * * @param selector A string containing a selector expression to match elements against. - * @return HTMLElement[] */ closest(selector: string | number): ChocolateChipElementArray; @@ -762,14 +689,11 @@ interface ChocolateChipElementArray extends Array { * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. * * @param selector A string containing a selector expression to match elements against. - * @return HTMLElement[] */ siblings(selector?: string): ChocolateChipElementArray; /** * Get the HTML contents of the first element in the set of matched elements. - * - * @return HTMLElement[] */ html(): ChocolateChipElementArray; @@ -777,7 +701,6 @@ interface ChocolateChipElementArray extends Array { * Set the HTML contents of each element in the set of matched elements. * * @param htmlString A string of HTML to set as the content of each matched element. - * @return HTMLElement[] */ html(htmlString: string): ChocolateChipElementArray; @@ -785,7 +708,6 @@ interface ChocolateChipElementArray extends Array { * Get the value of style properties for the first element in the set of matched elements. * * @param propertyName A CSS property. - * @return string */ css(propertyName: string): string; @@ -794,7 +716,6 @@ interface ChocolateChipElementArray extends Array { * * @param propertyName A CSS property name. * @param value A value to set for the property. - * @return HTMLElement[] */ css(propertyName: string, value: string): ChocolateChipElementArray; @@ -802,7 +723,6 @@ interface ChocolateChipElementArray extends Array { * Set one or more CSS properties for the set of matched elements. * * @param properties An object of property-value pairs to set. - * @return HTMLElement[] */ css(properties: Object): ChocolateChipElementArray; @@ -819,7 +739,6 @@ interface ChocolateChipElementArray extends Array { * * @param attributeName A string indicating the attribute to set. * @param value A string indicating the value to set the attribute to. - * @return HTMLElement[] */ attr(attributeName: string, value: string): ChocolateChipElementArray; @@ -827,7 +746,6 @@ interface ChocolateChipElementArray extends Array { * Remove an attribute from a node. * * @param attributeName A string indicating the attribute to remove. - * @return HTMLElement[] */ removeAttr(attributeName: string): ChocolateChipElementArray; @@ -835,7 +753,6 @@ interface ChocolateChipElementArray extends Array { * Return any of the matched elements that have the given attribute. * * @param className The class name to search for. - * @return HTMLElement[] */ hasAttr(attributeName: string): ChocolateChipElementArray; @@ -843,7 +760,6 @@ interface ChocolateChipElementArray extends Array { * Test whether an attribute exists on the first element in the set of matched elements. The value returned is a boolean. * * @param attributeName The name of the attribute to get. - * @return boolean */ prop(propertyName: string): boolean; @@ -852,7 +768,6 @@ interface ChocolateChipElementArray extends Array { * * @param propertyName A string indicating the property to set. * @param value A string indicating the value to set the property to. - * @return HTMLElement[] */ prop(propertyName: string, value: any | boolean): ChocolateChipElementArray; @@ -860,7 +775,6 @@ interface ChocolateChipElementArray extends Array { * Remove an element property. * * @param property The property to remove. - * @return HTMLElement[] */ removeProp(property: string): ChocolateChipElementArray; @@ -868,7 +782,6 @@ interface ChocolateChipElementArray extends Array { * Adds the specified class(es) to each of the set of matched elements. * * @param className One or more space-separated classes to be added to the class attribute of each matched element. - * @return HTMLElement[] */ addClass(className: string): ChocolateChipElementArray; @@ -876,7 +789,6 @@ interface ChocolateChipElementArray extends Array { * Remove a single class or multiple classes from each element in the set of matched elements. * * @param className One or more space-separated classes to be removed from the class attribute of each matched element. - * @return HTMLElement[] */ removeClass(className?: string): ChocolateChipElementArray; @@ -884,7 +796,6 @@ interface ChocolateChipElementArray extends Array { * Add or remove a classe from each element in the set of matched elements, depending on whether the class is present or not. * * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. - * @return HTMLElement[] */ toggleClass(className: string, swtch?: boolean): ChocolateChipElementArray; @@ -892,7 +803,6 @@ interface ChocolateChipElementArray extends Array { * Return any of the matched elements that have the given class. * * @param className The class name to search for. - * @return HTMLElement[] */ hasClass(className: string): ChocolateChipElementArray; @@ -901,7 +811,6 @@ interface ChocolateChipElementArray extends Array { * * @param key A string naming the piece of data to set. * @param value The new data value; it can be any Javascript type including Array or Object. - * @return HTMLElement[] */ data(key: string, value: any): ChocolateChipElementArray; @@ -910,7 +819,6 @@ interface ChocolateChipElementArray extends Array { * data(name). * * @param key Name of the data stored. - * @return any */ data(key: string): any; @@ -918,7 +826,6 @@ interface ChocolateChipElementArray extends Array { * Remove the value at the named data store for the first element in the element collection, as set by data(name, value). * * @param key Name of the data stored. - * @return any */ removeData(key?: string): any; @@ -927,7 +834,6 @@ interface ChocolateChipElementArray extends Array { * * @param key A string naming the piece of data to set. * @param value The new data value; it must be a string. You can convert JSON into a string to use with this. - * @return HTMLElement[] */ dataset(key: string, value: any): ChocolateChipElementArray; @@ -935,7 +841,6 @@ interface ChocolateChipElementArray extends Array { * Retrieve a dataset key's value for the first element in the element collection. * * @param key A string naming the piece of data to set. - * @return HTMLElement[] */ dataset(key: string): ChocolateChipElementArray; @@ -943,7 +848,6 @@ interface ChocolateChipElementArray extends Array { * Return the value at the named data store for the first element in the element collection, as set by data(name, value). * * @param key Name of the data stored. - * @return any */ data(key: string): any; @@ -952,7 +856,6 @@ interface ChocolateChipElementArray extends Array { * * @param key A string naming the piece of data to set. * @param value The new data value; it can be any Javascript type including Array or Object. - * @return HTMLElement[] */ data(key: string, value?: any): ChocolateChipElementArray; @@ -966,21 +869,16 @@ interface ChocolateChipElementArray extends Array { * * @param value A string of text or an array of strings corresponding to the value of each matched element * to set as selected/checked. - * @return any */ val(value: string): ChocolateChipElementArray; /** * Set the property of an element to enabled by removing the "disabled" attribute. - * - * @return HTMLElement[] */ enable(): ChocolateChipElementArray; /** * Set the property of an element to "disabled". - * - * @return HTMLElement[] */ disable(): ChocolateChipElementArray; @@ -989,7 +887,6 @@ interface ChocolateChipElementArray extends Array { * * @param speed A string or number determining how long the animation will run. * @param callback A function to call once the animation is complete. - * @return HTMLElement[] */ show(duration?: number | string, callback?: Function): ChocolateChipElementArray; @@ -998,7 +895,6 @@ interface ChocolateChipElementArray extends Array { * * @param duration A string or number determining how long the animation will run. * @param callback A function to call once the animation is complete. - * @return HTMLElement[] */ hide(duration?: number | string, callback?: Function): ChocolateChipElementArray; @@ -1006,7 +902,6 @@ interface ChocolateChipElementArray extends Array { * Insert content, specified by the parameter, before each element in the set of matched elements. * * @param content HTML string, DOM element, array of elements to insert before each element in the set of matched elements. - * @return HTMLElement[] */ before(content: ChocolateChipElementArray | HTMLElement | string): ChocolateChipElementArray; @@ -1014,7 +909,6 @@ interface ChocolateChipElementArray extends Array { * Insert content, specified by the parameter, after each element in the set of matched elements. * * @param content HTML string, DOM element, array of elements to insert after each element in the set of matched elements. - * @return HTMLElement[] */ after(content: ChocolateChipElementArray | HTMLElement | string): ChocolateChipElementArray; @@ -1023,7 +917,6 @@ interface ChocolateChipElementArray extends Array { * * @param content DOM element, array of elements, or HTML string to insert at the end of each element in the set * of matched elements. - * @return HTMLElement[] */ append(content: ChocolateChipElementArray | HTMLElement | Text | string): ChocolateChipElementArray; @@ -1031,7 +924,6 @@ interface ChocolateChipElementArray extends Array { * Insert content, specified by the parameter, at the beginning of each element in the set of matched elements. * * @param content DOM element, array of elements, or HTML string to insert at the beginning of each element in the set of matched elements. - * @return HTMLElement[] */ prepend(content: ChocolateChipElementArray | HTMLElement | Text | string): ChocolateChipElementArray; @@ -1039,7 +931,6 @@ interface ChocolateChipElementArray extends Array { * Insert every element in the set of matched elements to the beginning of the target. * * @param target A selector, element, or HTML string. The matched set of elements will be inserted at the beginning of the element specified by this parameter. - * @return HTMLElement[] */ prependTo(target: any[] | HTMLElement | string): ChocolateChipElementArray; @@ -1048,14 +939,11 @@ interface ChocolateChipElementArray extends Array { * * @param target A selector, element, or HTML string. The matched set of elements will be inserted at the end of the element specified by this parameter. * If no position value is provided it will simply append the content to the target. - * @return HTMLElement[] */ appendTo(target: any[] | HTMLElement | string): ChocolateChipElementArray; /** * Insert element(s) into the target element. - * - * @return HTMLElement[] */ insert(content: string, position?: number | string): ChocolateChipElementArray; @@ -1063,7 +951,6 @@ interface ChocolateChipElementArray extends Array { * Create a copy of the set of matched elements. * * @param value A Boolean indicating whether to copy the element(s) with their children. A true value copies the children. - * @return HTMLElement[] */ clone(value?: boolean): ChocolateChipElementArray; @@ -1071,14 +958,11 @@ interface ChocolateChipElementArray extends Array { * Wrap an HTML structure around each element in the set of matched elements. * * @param wrappingElement A selector or HTML string specifying the structure to wrap around the matched elements. - * @return HTMLElement[] */ wrap(wrappingElement: string): ChocolateChipElementArray; /** * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. - * - * @return HTMLElement[] */ unwrap(): ChocolateChipElementArray; @@ -1086,21 +970,17 @@ interface ChocolateChipElementArray extends Array { * Remove the set of matched elements from the DOM. If there are any attached events, this will remove them to prevent memory leaks. * * @param selector A selector expression that filters the set of matched elements to be removed. - * @return HTMLElement[] */ remove(selector?: string): ChocolateChipElementArray; /** * Remove all child nodes of the set of matched elements from the DOM. - * - * @return HTMLElement[] */ empty(): ChocolateChipElementArray; /** * Get an object of the current coordinates of the first element in the set of matched elements, relative to the document. * These are: top, left, bottom and right. The values are numbers representing pixel values. - * @return Object */ offset(): { top: number; @@ -1112,23 +992,17 @@ interface ChocolateChipElementArray extends Array { /** * Get the current computed width for the first element in the set of matched elements, * including padding but excluding borders. - * - * @return number */ width(): number; /** * Get the current computed height for the first element in the set of matched elements, * including padding but excluding borders. - * - * @return number */ height(): number; /** - * Get the combined text contents of each element in the set of matched elements, including their descendants. - * - * @return string + * Get the combined text contents of each element in the set of matched elements, including their descendants */ text(): string; @@ -1139,7 +1013,6 @@ interface ChocolateChipElementArray extends Array { * The text to set as the content of each matched element. * When Number is supplied, it will be converted to a String representation. * To delete text, use ChocolateChipElementArray.empty() or ChocolateChipElementArray.remove(). - * @return HTMLElement */ text(text: string | number): HTMLElement; @@ -1149,7 +1022,6 @@ interface ChocolateChipElementArray extends Array { * @param options And object of key value pairs define the CSS properties and values to animate. * @param duration A string representing the time. Should have a time identifier: "200s", "200ms", etc. * @param easing A string indicating the easing for the animation, such as "ease-out", "ease-in", "ease-in-out". - * @return void */ animate(options: Object, duration?: string, easing?: string): void; @@ -1159,7 +1031,6 @@ interface ChocolateChipElementArray extends Array { * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param handler A function to execute each time the event is triggered. * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. - * @return ChocolateChipStatic */ bind(eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; @@ -1169,7 +1040,6 @@ interface ChocolateChipElementArray extends Array { * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param handler A function to execute each time the event is triggered. * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. - * @return ChocolateChipStatic */ unbind(eventType?: string, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; @@ -1181,7 +1051,6 @@ interface ChocolateChipElementArray extends Array { * @param handler A function to execute each time the event is triggered. The keyword "this" will refer * to the element receiving the event. * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. - * @return ChocolateChipStatic */ delegate(selector: any, eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; @@ -1192,7 +1061,6 @@ interface ChocolateChipElementArray extends Array { * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. * @param handler A function handler assigned to this event. * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. - * @return ChocolateChipStatic */ undelegate(selector?: any, eventType?: string, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; @@ -1203,7 +1071,6 @@ interface ChocolateChipElementArray extends Array { * @param selector A string defining the descendant elements are listening for the event. * @param handler A function handler assigned to this event. * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. - * @return ChocolateChipStatic */ on(eventType: string, selector: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic; @@ -1215,7 +1082,6 @@ interface ChocolateChipElementArray extends Array { * @param selector A string defining the descendant elements are listening for the event. * @param handler A function handler assigned to this event. * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. - * @return ChocolateChipStatic */ off(eventType?: string, selector?: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic; @@ -1223,7 +1089,6 @@ interface ChocolateChipElementArray extends Array { * Trigger an event on an element. * * @param eventType The event to trigger. - * @return void */ trigger(eventType: string): void; } diff --git a/types/chocolatechipjs/tslint.json b/types/chocolatechipjs/tslint.json index ce367ade18..9969e961d1 100644 --- a/types/chocolatechipjs/tslint.json +++ b/types/chocolatechipjs/tslint.json @@ -7,6 +7,10 @@ "dt-header": false, "no-any-union": false, "unified-signatures": false, - "no-unnecessary-generics": false + "no-unnecessary-generics": false, + // TODO: left in redundant jsdoc that conflicts with type declarations + // Need to go over each and decide whether the jsdoc or type is correct + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false } } diff --git a/types/chokidar/index.d.ts b/types/chokidar/index.d.ts index 229ffb556f..396ad10e0a 100644 --- a/types/chokidar/index.d.ts +++ b/types/chokidar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for chokidar 1.7.1 +// Type definitions for chokidar 1.7 // Project: https://github.com/paulmillr/chokidar // Definitions by: Stefan Steinhart // Felix Becker @@ -19,7 +19,6 @@ export interface WatchedPaths { } export class FSWatcher extends EventEmitter implements fs.FSWatcher { - /** * Constructs a new FSWatcher instance with optional WatchOptions parameter. */ @@ -52,7 +51,6 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher { } 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`, @@ -86,7 +84,7 @@ export interface WatchOptions { * 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. @@ -155,7 +153,6 @@ export interface WatchOptions { } export interface AwaitWriteFinishOptions { - /** * Amount of time in milliseconds for a file size to remain constant before emitting its event. */ diff --git a/types/zetapush-js/tslint.json b/types/chokidar/tslint.json similarity index 100% rename from types/zetapush-js/tslint.json rename to types/chokidar/tslint.json diff --git a/types/chosen-js/tslint.json b/types/chosen-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chosen-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index f826c8f254..c18484dc1f 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -34,9 +34,6 @@ declare namespace chroma { /** * Create a color in the specified color space using a, b and c as values. * - * @param a - * @param b - * @param c * @param colorSpace The color space to use. Defaults to "rgb". * @return the color object. */ diff --git a/types/chroma-js/v0/tslint.json b/types/chroma-js/v0/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chroma-js/v0/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chrome/chrome-app.d.ts b/types/chrome/chrome-app.d.ts index f80b335125..4ecf1d344a 100644 --- a/types/chrome/chrome-app.d.ts +++ b/types/chrome/chrome-app.d.ts @@ -1,59 +1,86 @@ // Type definitions for Chrome packaged application development // Project: http://developer.chrome.com/apps/ -// Definitions by: Adam Lay , MIZUNE Pine , MIZUSHIMA Junki , Ingvar Stepanyan +// Definitions by: Adam Lay , MIZUNE Pine , MIZUSHIMA Junki , Ingvar Stepanyan , Adam Pyle , Nikolai Ommundsen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /// //////////////////// // App //////////////////// declare namespace chrome.app { - interface AppDetails extends chrome.runtime.Manifest { - id: string; - } + export interface AppDetails extends chrome.runtime.Manifest { + id: string; + } - export function getDetails(): AppDetails; + export function getDetails(): AppDetails; } //////////////////// // App Runtime //////////////////// declare namespace chrome.app.runtime { + enum LaunchSource { + "untracked" = "untracked", + "app_launcher" = "app_launcher", + "new_tab_page" = "new_tab_page", + "reload" = "reload", + "restart" = "restart", + "load_and_launch" = "load_and_launch", + "command_line" = "command_line", + "file_handler" = "file_handler", + "url_handler" = "url_handler", + "system_tray" = "system_tray", + "about_page" = "about_page", + "keyboard" = "keyboard", + "extensions_page" = "extensions_page", + "management_api" = "management_api", + "ephemeral_app" = "ephemeral_app", + "background" = "background", + "kiosk" = "kiosk", + "chrome_internal" = "chrome_internal", + "test" = "test", + "installed_notification" = "installed_notification", + "context_menu" = "context_menu", + } + interface LaunchData { id?: string; items?: LaunchDataItem[]; url?: string; referrerUrl?: string; isKioskSession?: boolean; + isPublicSession?: boolean; + source?: LaunchSource; + actionData?: {}; } - interface LaunchDataItem { + export interface LaunchDataItem { entry: FileEntry; type: string; } - interface LaunchedEvent extends chrome.events.Event<(launchData: LaunchData) => void> {} + export interface LaunchedEvent extends chrome.events.Event<(launchData: LaunchData) => void> { } - interface RestartedEvent extends chrome.events.Event<() => void> {} + export interface RestartedEvent extends chrome.events.Event<() => void> { } - var onLaunched: LaunchedEvent; - var onRestarted: RestartedEvent; + export var onLaunched: LaunchedEvent; + export var onRestarted: RestartedEvent; } //////////////////// // App Window //////////////////// declare namespace chrome.app.window { - interface ContentBounds { + export interface ContentBounds { left?: number; top?: number; width?: number; height?: number; } - interface BoundsSpecification { + export interface BoundsSpecification { left?: number; top?: number; width?: number; @@ -64,7 +91,7 @@ declare namespace chrome.app.window { maxHeight?: number; } - interface Bounds { + export interface Bounds { left: number; top: number; width: number; @@ -78,14 +105,14 @@ declare namespace chrome.app.window { setMinimumSize(minWidth: number, minHeight: number): void; setMaximumSize(maxWidth: number, maxHeight: number): void; } - interface FrameOptions { + export interface FrameOptions { type?: string; color?: string; activeColor?: string; inactiveColor?: string; } - interface CreateWindowOptions { + export interface CreateWindowOptions { id?: string; innerBounds?: BoundsSpecification; outerBounds?: BoundsSpecification; @@ -93,10 +120,20 @@ declare namespace chrome.app.window { minHeight?: number; maxWidth?: number; maxHeight?: number; - frame?: any; // string ("none", "chrome") or FrameOptions + /** + * @description + * @type {(string | FrameOptions)} string ("none", "chrome") or FrameOptions + * @memberof CreateWindowOptions + */ + frame?: string | FrameOptions; bounds?: ContentBounds; alphaEnabled?: boolean; - state?: string; // "normal", "fullscreen", "maximized", "minimized" + /** + * @description + * @type {string} "normal", "fullscreen", "maximized", "minimized" + * @memberof CreateWindowOptions + */ + state?: string; hidden?: boolean; resizable?: boolean; singleton?: boolean; @@ -105,7 +142,7 @@ declare namespace chrome.app.window { visibleOnAllWorkspaces?: boolean; } - interface AppWindow { + export interface AppWindow { focus: () => void; fullscreen: () => void; isFullscreen: () => boolean; @@ -144,14 +181,14 @@ declare namespace chrome.app.window { export function getAll(): AppWindow[]; export function canSetVisibleOnAllWorkspaces(): boolean; - interface WindowEvent extends chrome.events.Event<() => void> {} + export interface WindowEvent extends chrome.events.Event<() => void> { } - var onBoundsChanged: WindowEvent; - var onClosed: WindowEvent; - var onFullscreened: WindowEvent; - var onMaximized: WindowEvent; - var onMinimized: WindowEvent; - var onRestored: WindowEvent; + export var onBoundsChanged: WindowEvent; + export var onClosed: WindowEvent; + export var onFullscreened: WindowEvent; + export var onMaximized: WindowEvent; + export var onMinimized: WindowEvent; + export var onRestored: WindowEvent; } //////////////////// @@ -159,13 +196,13 @@ declare namespace chrome.app.window { //////////////////// declare namespace chrome.fileSystem { - interface AcceptOptions { + export interface AcceptOptions { description?: string; mimeTypes?: string[]; extensions?: string[]; } - interface ChooseEntryOptions { + export interface ChooseEntryOptions { type?: string; suggestedName?: string; accepts?: AcceptOptions[]; @@ -189,11 +226,11 @@ declare namespace chrome.fileSystem { // Media Galleries //////////////////// declare namespace chrome.mediaGalleries { - interface MediaFileSystemsOptions { + export interface MediaFileSystemsOptions { interactive?: 'no' | 'yes' | 'if_needed'; } - interface MediaFileSystemMetadata { + export interface MediaFileSystemMetadata { name: string; galleryId: string; deviceId?: string; @@ -202,16 +239,16 @@ declare namespace chrome.mediaGalleries { isAvailable: boolean; } - interface MetadataOptions { + export interface MetadataOptions { metadataType: 'all' | 'mimeTypeAndTags' | 'mimeTypeOnly'; } - interface RawTag { + export interface RawTag { type: string; tags: { [name: string]: string; }; } - interface Metadata { + export interface Metadata { // The browser sniffed mime type. mimeType: string; // Defined for images and video. In pixels. @@ -248,17 +285,17 @@ declare namespace chrome.mediaGalleries { attachedImages: Blob[]; } - interface GalleryWatchResult { + export interface GalleryWatchResult { galleryId: string; success: boolean; } - interface GalleryChangedEventArgs { + export interface GalleryChangedEventArgs { type: 'contents_changed' | 'watch_dropped'; galleryId: string; } - interface ScanProgressEventArgs { + export interface ScanProgressEventArgs { // The type of progress event, i.e. start, finish, etc. type: 'start' | 'cancel' | 'finish' | 'error'; // The number of Galleries found. @@ -285,40 +322,40 @@ declare namespace chrome.mediaGalleries { export function getAllGalleryWatch(callback: (galleryIds: string[]) => void): void; export function removeAllGalleryWatch(): void; - var onGalleryChanged: chrome.events.Event<(args: GalleryChangedEventArgs) => void>; - var onScanProgress: chrome.events.Event<(args: ScanProgressEventArgs) => void>; + export var onGalleryChanged: chrome.events.Event<(args: GalleryChangedEventArgs) => void>; + export var onScanProgress: chrome.events.Event<(args: ScanProgressEventArgs) => void>; } //////////////////// // Sockets //////////////////// declare namespace chrome.sockets.tcp { - interface CreateInfo { + export interface CreateInfo { socketId: number; } - interface SendInfo { + export interface SendInfo { resultCode: number; bytesSent?: number; } - interface ReceiveEventArgs { + export interface ReceiveEventArgs { socketId: number; data: ArrayBuffer; } - interface ReceiveErrorEventArgs { + export interface ReceiveErrorEventArgs { socketId: number; resultCode: number; } - interface SocketProperties { + export interface SocketProperties { persistent?: boolean; name?: string; bufferSize?: number; } - interface SocketInfo { + export interface SocketInfo { socketId: number; persistent: boolean; name?: string; @@ -351,8 +388,8 @@ declare namespace chrome.sockets.tcp { export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; - var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; - var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; + export var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } /** @@ -364,23 +401,23 @@ declare namespace chrome.sockets.tcp { * @see https://developer.chrome.com/apps/sockets_udp */ declare namespace chrome.sockets.udp { - interface CreateInfo { + export interface CreateInfo { socketId: number; } - interface SendInfo { + export interface SendInfo { resultCode: number; bytesSent?: number; } - interface ReceiveEventArgs { + export interface ReceiveEventArgs { socketId: number; data: ArrayBuffer; remoteAddress: string; remotePort: number; } - interface ReceiveErrorEventArgs { + export interface ReceiveErrorEventArgs { socketId: number; resultCode: number; } @@ -388,7 +425,7 @@ declare namespace chrome.sockets.udp { /** * @see https://developer.chrome.com/apps/sockets_udp#type-SocketProperties */ - interface SocketProperties { + export interface SocketProperties { /** * Flag indicating if the socket is left open when the event page of the * application is unloaded. The default value is "false." When the @@ -412,7 +449,7 @@ declare namespace chrome.sockets.udp { /** * @see https://developer.chrome.com/apps/sockets_udp#type-SocketInfo */ - interface SocketInfo { + export interface SocketInfo { /** The socket identifier. */ socketId: number; @@ -636,7 +673,7 @@ declare namespace chrome.sockets.udp { * * @see https://developer.chrome.com/apps/sockets_udp#event-onReceive */ - var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + export var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; /** * Event raised when a network error occured while the runtime was waiting @@ -646,7 +683,7 @@ declare namespace chrome.sockets.udp { * * @see https://developer.chrome.com/apps/sockets_udp#event-onReceiveError */ - var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; + export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } /** @@ -658,16 +695,16 @@ declare namespace chrome.sockets.udp { * @see https://developer.chrome.com/apps/sockets_tcpServer */ declare namespace chrome.sockets.tcpServer { - interface CreateInfo { + export interface CreateInfo { socketId: number; } - interface AcceptEventArgs { + export interface AcceptEventArgs { socketId: number; clientSocketId: number; } - interface AcceptErrorEventArgs { + export interface AcceptErrorEventArgs { socketId: number; resultCode: number; } @@ -675,7 +712,7 @@ declare namespace chrome.sockets.tcpServer { /** * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketProperties */ - interface SocketProperties { + export interface SocketProperties { /** * Flag indicating if the socket remains open when the event page of the * application is unloaded. The default value is "false." When the @@ -693,7 +730,7 @@ declare namespace chrome.sockets.tcpServer { /** * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketInfo */ - interface SocketInfo { + export interface SocketInfo { /** The socket identifier. */ socketId: number; @@ -836,7 +873,7 @@ declare namespace chrome.sockets.tcpServer { * * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAccept */ - var onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>; + export var onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>; /** * Event raised when a network error occured while the runtime was waiting @@ -846,7 +883,7 @@ declare namespace chrome.sockets.tcpServer { * * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAcceptError */ - var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; + export var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; } //////////////////// @@ -858,7 +895,7 @@ declare namespace chrome.sockets.tcpServer { * @since Chrome 30. */ declare namespace chrome.system.display { - interface Bounds { + export interface Bounds { /** The x-coordinate of the upper-left corner. */ left: number; /** The y-coordinate of the upper-left corner. */ @@ -869,7 +906,7 @@ declare namespace chrome.system.display { height: number; } - interface Insets { + export interface Insets { /** The x-axis distance from the left bound. */ left: number; /** The y-axis distance from the top bound. */ @@ -880,7 +917,141 @@ declare namespace chrome.system.display { bottom: number; } - interface DisplayInfo { + /** + * @since Chrome 57 + */ + export interface Point { + /** The x-coordinate of the point. */ + x: number; + /** The y-coordinate of the point. */ + y: number; + } + + /** + * @since Chrome 57 + */ + export interface TouchCalibrationPair { + /** The coordinates of the display point. */ + displayPoint: Point; + /** The coordinates of the touch point corresponding to the display point. */ + touchPoint: Point; + } + + /** + * @since Chrome 52 + */ + export interface DisplayMode { + /** The display mode width in device independent (user visible) pixels. */ + width: number; + + /** The display mode height in device independent (user visible) pixels. */ + height: number; + + /** The display mode width in native pixels. */ + widthInNativePixels: number; + + /** The display mode height in native pixels. */ + heightInNativePixels: number; + + /** The display mode UI scale factor. */ + uiScale: number; + + /** The display mode device scale factor. */ + deviceScaleFactor: number; + + /** True if the mode is the display's native mode. */ + isNative: boolean; + + /** True if the display mode is currently selected. */ + isSelected: boolean; + } + + /** + * @since Chrome 53 + */ + export interface DisplayLayout { + /** The unique identifier of the display. */ + id: string; + /** The unique identifier of the parent display. Empty if this is the root. */ + parentId: string; + /** The layout position of this display relative to the parent. This will be ignored for the root. */ + position: 'top' | 'right' | 'bottom' | 'left'; + /** The offset of the display along the connected edge. 0 indicates that the topmost or leftmost corners are aligned. */ + offset: number; + } + + /** + * @description The pairs of point used to calibrate the display. + * @export + * @interface TouchCalibrationPairs + */ + export interface TouchCalibrationPairs { + /** First pair of touch and display point required for touch calibration. */ + pair1: TouchCalibrationPair, + /** Second pair of touch and display point required for touch calibration. */ + pair2: TouchCalibrationPair, + /** Third pair of touch and display point required for touch calibration. */ + pair3: TouchCalibrationPair, + /** Fourth pair of touch and display point required for touch calibration. */ + pair4: TouchCalibrationPair + } + + /** + * @description Representation of info data to be used in chrome.system.display.setDisplayProperties() + * @export + * @interface DisplayPropertiesInfo + */ + export interface DisplayPropertiesInfo { + /** + * @description Chrome OS only. If set to true, changes the display mode to unified desktop (see enableUnifiedDesktop for details). If set to false, unified desktop mode will be disabled. This is only valid for the primary display. If provided, mirroringSourceId must not be provided and other properties may not apply. This is has no effect if not provided. + * @since Chrome 59 + * */ + isUnified?: boolean; + + /** + * Chrome OS only. If set and not empty, enables mirroring for this display. Otherwise disables mirroring for this display. This value should indicate the id of the source display to mirror, which must not be the same as the id passed to setDisplayProperties. If set, no other property may be set. + */ + mirroringSourceId?: string; + + /** If set to true, makes the display primary. No-op if set to false. */ + isPrimary?: boolean; + + /** If set, sets the display's overscan insets to the provided values. Note that overscan values may not be negative or larger than a half of the screen's size. Overscan cannot be changed on the internal monitor. It's applied after isPrimary parameter. */ + overscan?: Insets; + + /** If set, updates the display's rotation. Legal values are [0, 90, 180, 270]. The rotation is set clockwise, relative to the display's vertical position. It's applied after overscan paramter. */ + rotation?: 0 | 90 | 180 | 270; + + /** If set, updates the display's logical bounds origin along x-axis. Applied together with boundsOriginY, if boundsOriginY is set. Note that, when updating the display origin, some constraints will be applied, so the final bounds origin may be different than the one set. The final bounds can be retrieved using getInfo. The bounds origin is applied after rotation. The bounds origin cannot be changed on the primary display. Note that is also invalid to set bounds origin values if isPrimary is also set (as isPrimary parameter is applied first). */ + boundsOriginX?: number; + + /** If set, updates the display's logical bounds origin along y-axis. See documentation for boundsOriginX parameter. */ + boundsOriginY: number; + + /** + * @since Chrome 52 + * @description If set, updates the display mode to the mode matching this value. + */ + displayMode?: DisplayMode; + } + + /** + * @description Options affecting how the information is returned. + * @since Chrome 59 + * @export + * @interface DisplayInfoFlags + */ + export interface DisplayInfoFlags { + /** + * @description If set to true, only a single DisplayUnitInfo will be returned by getInfo when in unified desktop mode (see enableUnifiedDesktop). Defaults to false. + * @type {boolean} + * @memberof DisplayInfoFlags + */ + singleUnified?: boolean; + } + + /** Information about display properties. */ + export interface DisplayInfo { /** The unique identifier of the display. */ id: string; /** The user-friendly name (e.g. "HP LCD monitor"). */ @@ -908,7 +1079,7 @@ declare namespace chrome.system.display { } /** The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|. */ - interface DisplayProps { + export interface DisplayProps { /** If set and not empty, starts mirroring between this and the display with the provided id (the system will determine which of the displays is actually mirrored). If set and not empty, stops mirroring between this and the display with the specified id (if mirroring is in progress). If set, no other parameter may be set. */ mirroringSourceId?: string; /** If set to true, makes the display primary. No-op if set to false. */ @@ -923,14 +1094,131 @@ declare namespace chrome.system.display { boundsOriginY?: number; } - interface DisplayChangedEvent extends chrome.events.Event<() => void> { } + /** + * @description Fired when anything changes to the display configuration. + * @export + * @interface DisplayChangedEvent + * @extends {chrome.events.Event<() => void>} + */ + export interface DisplayChangedEvent extends chrome.events.Event<() => void> { } - /** Queries basic CPU information of the system. */ + /** + * @description Requests the information for all attached display devices. + * @export + * @param {(info: DisplayInfo[]) => void} callback The callback to invoke with the results. + */ export function getInfo(callback: (info: DisplayInfo[]) => void): void; + /** + * @description Requests the information for all attached display devices. + * @export + * @since Chrome 59 + * @param {DisplayInfoFlags} [flags] Options affecting how the information is returned. + * @param {(info: DisplayInfo[]) => void} callback The callback to invoke with the results. + */ + export function getInfo(flags: DisplayInfoFlags, callback: (info: DisplayInfo[]) => void): void; - /** Updates the properties for the display specified by |id|, according to the information provided in |info|. On failure, runtime.lastError will be set. */ - export function setDisplayProperties(id: string, info: DisplayInfo, callback?: () => void): void; + /** + * @description Requests the layout info for all displays. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * @since Chrome 53 + * @export + * @param {(layouts: DisplayLayout[]) => void} callback The callback to invoke with the results. + */ + export function getDisplayLayout(callback: (layouts: DisplayLayout[]) => void): void; + /** + * @description Updates the properties for the display specified by |id|, according to the information provided in |info|. On failure, runtime.lastError will be set. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * @export + * @param {string} id The display's unique identifier. + * @param {DisplayPropertiesInfo} info The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|. + * @param {() => void} [callback] Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried. + */ + export function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback?: () => void): void; + + /** + * @description Set the layout for all displays. Any display not included will use the default layout. If a layout would overlap or be otherwise invalid it will be adjusted to a valid layout. After layout is resolved, an onDisplayChanged event will be triggered. NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * @since Chrome 53 + * @export + * @param {DisplayLayout[]} layouts The layout information, required for all displays except the primary display. + * @param {() => void} callback Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried. + */ + export function setDisplayLayout(layouts: DisplayLayout[], callback?: () => void): void; + + /** + * @description Enables/disables the unified desktop feature. Note that this simply enables the feature, but will not change the actual desktop mode. (That is, if the desktop is in mirror mode, it will stay in mirror mode) NOTE: This is only available to Chrome OS Kiosk apps and Web UI. + * @since Chrome 46 + * @export + * @param {boolean} enabled True if unified desktop should be enabled. + */ + export function enableUnifiedDesktop(enabled: boolean): void; + /** + * @description Starts overscan calibration for a display. This will show an overlay on the screen indicating the current overscan insets. If overscan calibration for display |id| is in progress this will reset calibration. + * @since Chrome 53 + * @export + * @param {string} id The display's unique identifier. + */ + export function overscanCalibrationStart(id: string): void; + /** + * @description Adjusts the current overscan insets for a display. Typically this should etiher move the display along an axis (e.g. left+right have the same value) or scale it along an axis (e.g. top+bottom have opposite values). Each Adjust call is cumulative with previous calls since Start. + * @since Chrome 53 + * @export + * @param {string} id The display's unique identifier. + * @param {Insets} delta The amount to change the overscan insets. + */ + export function overscanCalibrationAdjust(id: string, delta: Insets): void; + + /** + * @description Resets the overscan insets for a display to the last saved value (i.e before Start was called). + * @since Chrome 53 + * @export + * @param {string} id The display's unique identifier. + */ + export function overscanCalibrationReset(id: string): void; + + /** + * @description Complete overscan adjustments for a display by saving the current values and hiding the overlay. + * @since Chrome 53 + * @export + * @param {string} id The display's unique identifier. + */ + export function overscanCalibrationComplete(id: string): void; + + /** + * @description Displays the native touch calibration UX for the display with |id| as display id. This will show an overlay on the screen with required instructions on how to proceed. The callback will be invoked in case of successful calibraion only. If the calibration fails, this will throw an error. + * @since Chrome 57 + * @export + * @param {string} id The display's unique identifier. + * @param {(success) => void} callback Optional callback to inform the caller that the touch calibration has ended. The argument of the callback informs if the calibration was a success or not. + */ + export function showNativeTouchCalibration(id: string, callback: (success) => void): void; + + /** + * @description Starts custom touch calibration for a display. This should be called when using a custom UX for collecting calibration data. If another touch calibration is already in progress this will throw an error. + * @since Chrome 57 + * @export + * @param {string} id The display's unique identifier. + */ + export function startCustomTouchCalibration(id: string): void; + + /** + * @description Sets the touch calibration pairs for a display. These |pairs| would be used to calibrate the touch screen for display with |id| called in startCustomTouchCalibration(). Always call |startCustomTouchCalibration| before calling this method. If another touch calibration is already in progress this will throw an error. + * @since Chrome 57 + * @export + * @param {TouchCalibrationPairs} pairs The pairs of point used to calibrate the display. + * @param {Bounds} bounds Bounds of the display when the touch calibration was performed. |bounds.left| and |bounds.top| values are ignored. + */ + export function completeCustomTouchCalibration(pairs: TouchCalibrationPairs, bounds: Bounds): void; + /** + * @description Resets the touch calibration for the display and brings it back to its default state by clearing any touch calibration data associated with the display. + * @since Chrome 57 + * @export + * @param {string} id The display's unique identifier. + */ + export function clearTouchCalibration(id: string): void; + + /** + * @description Fired when anything changes to the display configuration. + * @export + */ export var onDisplayChanged: DisplayChangedEvent; } @@ -938,7 +1226,7 @@ declare namespace chrome.system.display { // System - Network //////////////////// declare namespace chrome.system.network { - interface NetworkInterface { + export interface NetworkInterface { name: string; address: string; prefixLength: number; @@ -948,159 +1236,268 @@ declare namespace chrome.system.network { } declare namespace chrome.runtime { - interface Manifest { - app?: { - background?: { - scripts?: string[]; - } - }, - bluetooth?: { - uuids?: string[]; - socket?: boolean; - low_energy?: boolean; - peripheral?: boolean; - }, - file_handlers?: { - [name: string]: { - types?: string[]; - extensions?: string[]; - title?: string; - } - }, - kiosk_enabled?: boolean, - kiosk_only?: boolean, - url_handlers?: { - [name: string]: { - matches: string[]; - title?: string; - } - }, - usb_printers?: { - filters: { - vendorId?: number; - productId?: number; - interfaceClass?: number; - interfaceSubclass?: number; - interfaceProtocol?: number; - }[] - }, - webview?: { - partitions?: { - name: string; - accessible_resources: string[]; - }[] - } - } + export interface Manifest { + app?: { + background?: { + scripts?: string[]; + } + }, + bluetooth?: { + uuids?: string[]; + socket?: boolean; + low_energy?: boolean; + peripheral?: boolean; + }, + file_handlers?: { + [name: string]: { + types?: string[]; + extensions?: string[]; + title?: string; + } + }, + kiosk_enabled?: boolean, + kiosk_only?: boolean, + url_handlers?: { + [name: string]: { + matches: string[]; + title?: string; + } + }, + usb_printers?: { + filters: { + vendorId?: number; + productId?: number; + interfaceClass?: number; + interfaceSubclass?: number; + interfaceProtocol?: number; + }[] + }, + webview?: { + partitions?: { + name: string; + accessible_resources: string[]; + }[] + } + } } //////////////////// // USB //////////////////// declare namespace chrome.usb { - type Direction = 'in' | 'out'; + type Direction = 'in' | 'out'; - interface Device { - device: number, - vendorId: number, - productId: number, - productName: string, - manufacturerName: string, - serialNumber: string - } + export interface Device { + device: number, + vendorId: number, + productId: number, + productName: string, + manufacturerName: string, + serialNumber: string + } - interface ConnectionHandle { - handle: number, - vendorId: number, - productId: number - } + export interface ConnectionHandle { + handle: number, + vendorId: number, + productId: number + } - interface EndpointDescriptor { - address: number, - type: 'control' | 'interrupt' | 'isochronous' | 'bulk', - direction: Direction, - maximumPacketSize: number, - synchronization?: 'asynchronous' | 'adaptive' | 'synchronous', - usage?: 'data' | 'feedback' | 'explicitFeedback', - pollingInterval?: number, - extra_data: ArrayBuffer - } + export interface EndpointDescriptor { + address: number, + type: 'control' | 'interrupt' | 'isochronous' | 'bulk', + direction: Direction, + maximumPacketSize: number, + synchronization?: 'asynchronous' | 'adaptive' | 'synchronous', + usage?: 'data' | 'feedback' | 'explicitFeedback', + pollingInterval?: number, + extra_data: ArrayBuffer + } - interface InterfaceDescriptor { - interfaceNumber: number, - alternateSetting: number, - interfaceClass: number, - interfaceSubclass: number, - interfaceProtocol: number, - description?: string, - endpoints: EndpointDescriptor[], - extra_data: ArrayBuffer - } + export interface InterfaceDescriptor { + interfaceNumber: number, + alternateSetting: number, + interfaceClass: number, + interfaceSubclass: number, + interfaceProtocol: number, + description?: string, + endpoints: EndpointDescriptor[], + extra_data: ArrayBuffer + } - interface ConfigDescriptor { - active: boolean, - configurationValue: number, - description?: string, - selfPowered: boolean, - remoteWakeup: boolean, - maxPower: number, - interfaces: InterfaceDescriptor[], - extra_data: ArrayBuffer - } + export interface ConfigDescriptor { + active: boolean, + configurationValue: number, + description?: string, + selfPowered: boolean, + remoteWakeup: boolean, + maxPower: number, + interfaces: InterfaceDescriptor[], + extra_data: ArrayBuffer + } - interface GenericTransferInfo { - direction: Direction, - endpoint: number, - length?: number, - data?: ArrayBuffer, - timeout?: number - } + export interface GenericTransferInfo { + direction: Direction, + endpoint: number, + length?: number, + data?: ArrayBuffer, + timeout?: number + } - interface TransferResultInfo { - resultCode: number, - data?: ArrayBuffer - } + export interface TransferResultInfo { + resultCode: number, + data?: ArrayBuffer + } - interface DeviceFilter { - vendorId?: number, - productId?: number, - interfaceClass?: number, - interfaceSubclass?: number, - interfaceProtocol?: number - } + export interface DeviceFilter { + vendorId?: number, + productId?: number, + interfaceClass?: number, + interfaceSubclass?: number, + interfaceProtocol?: number + } - interface TransferInfo { - direction: Direction; - recipient: 'device' | 'interface' | 'endpoint' | 'other'; - requestType: 'standard' | 'class' | 'vendor' | 'reserved'; - request: number; - value: number; - index: number; - length?: number; - data?: ArrayBuffer; - timeout?: number; - } + export interface TransferInfo { + direction: Direction; + recipient: 'device' | 'interface' | 'endpoint' | 'other'; + requestType: 'standard' | 'class' | 'vendor' | 'reserved'; + request: number; + value: number; + index: number; + length?: number; + data?: ArrayBuffer; + timeout?: number; + } - interface DeviceEvent extends chrome.events.Event<(device: Device) => void> {} + export interface DeviceEvent extends chrome.events.Event<(device: Device) => void> { } - export var onDeviceAdded: DeviceEvent; - export var onDeviceRemoved: DeviceEvent; + export var onDeviceAdded: DeviceEvent; + export var onDeviceRemoved: DeviceEvent; - export function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; - export function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; - export function getConfigurations(device: Device, callback: (configs: ConfigDescriptor[]) => void): void; - export function requestAccess(device: Device, interfaceId: number, callback: (success: boolean) => void): void; - export function openDevice(device: Device, callback: (handle: ConnectionHandle) => void): void; - export function findDevices(options: { vendorId: number, productId: number, interfaceId?: number }, callback: (handles: ConnectionHandle[]) => void): void; - export function closeDevice(handle: ConnectionHandle, callback?: () => void): void; - export function setConfiguration(handle: ConnectionHandle, configurationValue: number, callback: () => void): void; - export function getConfiguration(handle: ConnectionHandle, callback: (config: ConfigDescriptor) => void): void; - export function listInterfaces(handle: ConnectionHandle, callback: (descriptors: InterfaceDescriptor[]) => void): void; - export function claimInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; - export function releaseInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; - export function setInterfaceAlternateSetting(handle: ConnectionHandle, interfaceNumber: number, alternateSetting: number, callback: () => void): void; - export function controlTransfer(handle: ConnectionHandle, transferInfo: TransferInfo, callback: (info: TransferResultInfo) => void): void; - export function bulkTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; - export function interruptTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; - export function isochronousTransfer(handle: ConnectionHandle, transferInfo: { transferInfo: GenericTransferInfo, packets: number, packetLength: number }, callback: (info: TransferResultInfo) => void): void; - export function resetDevice(handle: ConnectionHandle, callback: (success: boolean) => void): void; + export function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; + export function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void; + export function getConfigurations(device: Device, callback: (configs: ConfigDescriptor[]) => void): void; + export function requestAccess(device: Device, interfaceId: number, callback: (success: boolean) => void): void; + export function openDevice(device: Device, callback: (handle: ConnectionHandle) => void): void; + export function findDevices(options: { vendorId: number, productId: number, interfaceId?: number }, callback: (handles: ConnectionHandle[]) => void): void; + export function closeDevice(handle: ConnectionHandle, callback?: () => void): void; + export function setConfiguration(handle: ConnectionHandle, configurationValue: number, callback: () => void): void; + export function getConfiguration(handle: ConnectionHandle, callback: (config: ConfigDescriptor) => void): void; + export function listInterfaces(handle: ConnectionHandle, callback: (descriptors: InterfaceDescriptor[]) => void): void; + export function claimInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; + export function releaseInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void; + export function setInterfaceAlternateSetting(handle: ConnectionHandle, interfaceNumber: number, alternateSetting: number, callback: () => void): void; + export function controlTransfer(handle: ConnectionHandle, transferInfo: TransferInfo, callback: (info: TransferResultInfo) => void): void; + export function bulkTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; + export function interruptTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void; + export function isochronousTransfer(handle: ConnectionHandle, transferInfo: { transferInfo: GenericTransferInfo, packets: number, packetLength: number }, callback: (info: TransferResultInfo) => void): void; + export function resetDevice(handle: ConnectionHandle, callback: (success: boolean) => void): void; +} + +declare namespace chrome.networking.onc { + export type ActivationStateType = 'Activated' | 'Activating' | 'NotActivated' | 'PartiallyActivated'; + export type CaptivePortalStatus = 'Unknown' | 'Offline' | 'Online' | 'Portal' | 'ProxyAuthRequired'; + export type ConnectionStateType = 'Connected' | 'Connecting' | 'NotConnected'; + export type IPConfigType = 'DHCP' | 'Static'; + export type NetworkType = 'All' | 'Cellular' | 'Ethernet' | 'VPN' | 'Wireless' | 'WiFi' | 'WiMAX'; + export type ProxySettingsType = 'Direct' | 'Manual' | 'PAC' | 'WPAD'; + export interface ManagedBoolean { + /** + * @description The active value currently used by the network configuration manager (e.g. Shill). + * @type {boolean} + * @memberof ManagedBoolean + */ + Active?: boolean, + /** + * @description The source from which the effective property value was determined. + * @type {string} + * @memberof ManagedBoolean + */ + Effective?: string, + /** + * @description The property value provided by the user policy. + * @type {boolean} + * @memberof ManagedBoolean + */ + UserPolicy?: boolean, + /** + * @description The property value provided by the device policy. + * @type {boolean} + * @memberof ManagedBoolean + */ + DevicePolicy?: boolean, + /** + * @description The property value set by the logged in user. Only provided if |UserEditable| is true. + * @type {boolean} + * @memberof ManagedBoolean + */ + UserSettings?: boolean, + /** + * @description The value set for all users of the device. Only provided if |DeviceEditiable| is true. + * @type {boolean} + * @memberof ManagedBoolean + */ + SharedSettings?: boolean, + /** + * @description Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. + * @type {boolean} + * @memberof ManagedBoolean + */ + UserEditable?: boolean, + /** + * @description Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. + * @type {boolean} + * @memberof ManagedBoolean + */ + DeviceEditable?: boolean + } + export interface ManagedLong { + /** + * @description The active value currently used by the network configuration manager (e.g. Shill). + * @type {number} + * @memberof ManagedLong + */ + Active?: number, + /** + * @description The source from which the effective property value was determined. + * @type {string} + * @memberof ManagedLong + */ + Effective?: string, + /** + * @description The property value provided by the user policy. + * @type {number} + * @memberof ManagedLong + */ + UserPolicy?: number, + /** + * @description The property value provided by the device policy. + * @type {number} + * @memberof ManagedLong + */ + DevicePolicy?: number, + /** + * @description The property value set by the logged in user. Only provided if |UserEditable| is true. + * @type {number} + * @memberof ManagedLong + */ + UserSettings?: number, + /** + * @description The value set for all users of the device. Only provided if |DeviceEditiable| is true. + * @type {number} + * @memberof ManagedLong + */ + SharedSettings?: number, + /** + * @description Whether a UserPolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. + * @type {boolean} + * @memberof ManagedLong + */ + UserEditable?: boolean, + /** + * @description Whether a DevicePolicy for the property exists and allows the property to be edited (i.e. the policy set recommended property value). Defaults to false. + * @type {boolean} + * @memberof ManagedLong + */ + DeviceEditable?: boolean + } } diff --git a/types/chrome/chrome-cast.d.ts b/types/chrome/chrome-cast.d.ts index 081d3de1bf..5c240ff25c 100644 --- a/types/chrome/chrome-cast.d.ts +++ b/types/chrome/chrome-cast.d.ts @@ -12,7 +12,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.AutoJoinPolicy */ - interface AutoJoinPolicy { + export interface AutoJoinPolicy { TAB_AND_ORIGIN_SCOPED: string; ORIGIN_SCOPED: string; PAGE_SCOPED: string; @@ -22,7 +22,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.DefaultActionPolicy */ - interface DefaultActionPolicy { + export interface DefaultActionPolicy { CREATE_SESSION: string; CAST_THIS_TAB: string; } @@ -31,7 +31,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Capability */ - interface Capability { + export interface Capability { VIDEO_OUT: string; AUDIO_OUT: string; VIDEO_IN: string; @@ -42,7 +42,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ErrorCode */ - interface ErrorCode { + export interface ErrorCode { CANCEL: string; TIMEOUT: string; API_NOT_INITIALIZED: string; @@ -59,7 +59,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverAvailability */ - interface ReceiverAvailability { + export interface ReceiverAvailability { AVAILABLE: string; UNAVAILABLE: string; } @@ -68,7 +68,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderPlatform */ - interface SenderPlatform { + export interface SenderPlatform { CHROME: string; IOS: string; ANDROID: string; @@ -78,7 +78,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverType */ - interface ReceiverType { + export interface ReceiverType { CAST: string; HANGOUT: string; CUSTOM: string; @@ -88,7 +88,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverAction */ - interface ReceiverAction { + export interface ReceiverAction { CAST: string; STOP: string; } @@ -99,7 +99,7 @@ declare namespace chrome.cast { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionStatus */ - interface SessionStatus { + export interface SessionStatus { CONNECTED: string; DISCONNECTED: string; STOPPED: string; @@ -109,13 +109,13 @@ declare namespace chrome.cast { * @const {!Array} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.VERSION */ - var VERSION: Array; + export var VERSION: Array; /** * @type {boolean} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.isAvailable */ - var isAvailable: boolean; + export var isAvailable: boolean; /** * @param {!chrome.cast.ApiConfig} apiConfig @@ -191,7 +191,7 @@ declare namespace chrome.cast { errorCallback: (error: chrome.cast.Error) => void ): void - interface ApiConfig { + export interface ApiConfig { /** * @param {!chrome.cast.SessionRequest} sessionRequest * @param {function(!chrome.cast.Session)} sessionListener @@ -217,7 +217,7 @@ declare namespace chrome.cast { defaultActionPolicy: chrome.cast.DefaultActionPolicy; } - interface Error { + export interface Error { /** * @param {!chrome.cast.ErrorCode} code * @param {string=} opt_description @@ -237,7 +237,7 @@ declare namespace chrome.cast { } - interface Image { + export interface Image { /** * @param {string} url * @constructor @@ -252,7 +252,7 @@ declare namespace chrome.cast { width?: number; } - interface SenderApplication { + export interface SenderApplication { /** * @param {!chrome.cast.SenderPlatform} platform * @constructor @@ -267,7 +267,7 @@ declare namespace chrome.cast { packageId?: string; } - interface SessionRequest { + export interface SessionRequest { /** * @param {string} appId * @param {!Array=} opt_capabilities @@ -287,7 +287,7 @@ declare namespace chrome.cast { language?: string; } - interface Session { + export interface Session { /** * @param {string} sessionId * @param {string} appId @@ -437,7 +437,7 @@ declare namespace chrome.cast { ):void } - interface Receiver { + export interface Receiver { /** * @param {string} label * @param {string} friendlyName @@ -461,7 +461,7 @@ declare namespace chrome.cast { displayStatus: chrome.cast.ReceiverDisplayStatus; } - interface ReceiverDisplayStatus { + export interface ReceiverDisplayStatus { /** * @param {string} statusText * @param {!Array} appImages @@ -477,7 +477,7 @@ declare namespace chrome.cast { appImages: Array; } - interface Volume { + export interface Volume { /** * @param {?number=} opt_level * @param {?boolean=} opt_muted @@ -496,13 +496,13 @@ declare namespace chrome.cast { declare namespace chrome.cast.media { - var DEFAULT_MEDIA_RECEIVER_APP_ID: string; + export var DEFAULT_MEDIA_RECEIVER_APP_ID: string; /** * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaCommand */ - interface MediaCommand { + export interface MediaCommand { PAUSE: string; SEEK: string; STREAM_VOLUME: string; @@ -513,7 +513,7 @@ declare namespace chrome.cast.media { * @enum {number} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MetadataType */ - interface MetadataType { + export interface MetadataType { GENERIC: number; TV_SHOW: number; MOVIE: number; @@ -525,7 +525,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayerState */ - interface PlayerState { + export interface PlayerState { IDLE: string; PLAYING: string; PAUSED: string; @@ -536,7 +536,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.ResumeState */ - interface ResumeState { + export interface ResumeState { PLAYBACK_START: string; PLAYBACK_PAUSE: string; } @@ -545,7 +545,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StreamType */ - interface StreamType { + export interface StreamType { BUFFERED: string; LIVE: string; OTHER: string; @@ -555,7 +555,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.IdleReason */ - interface IdleReason { + export interface IdleReason { CANCELLED: string; INTERRUPTED: string; FINISHED: string; @@ -566,14 +566,14 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.RepeatMode */ - interface RepeatMode { + export interface RepeatMode { OFF:string; ALL:string; SINGLE:string; ALL_AND_SHUFFLE:string; } - interface QueueItem { + export interface QueueItem { /** * @param {!chrome.cast.media.MediaInfo} mediaInfo * @constructor @@ -592,7 +592,7 @@ declare namespace chrome.cast.media { startTime: number; } - interface QueueLoadRequest { + export interface QueueLoadRequest { /** * @param {!Array} items * @constructor @@ -608,7 +608,7 @@ declare namespace chrome.cast.media { startIndex: number; } - interface QueueInsertItemsRequest { + export interface QueueInsertItemsRequest { /** * @param {!Array} * @constructor @@ -623,7 +623,7 @@ declare namespace chrome.cast.media { items: Array; } - interface QueueRemoveItemsRequest { + export interface QueueRemoveItemsRequest { /** * @param {!Array} * @constructor @@ -637,7 +637,7 @@ declare namespace chrome.cast.media { itemIds: Array; } - interface QueueReorderItemsRequest { + export interface QueueReorderItemsRequest { /** * @param {!Array} * @constructor @@ -652,7 +652,7 @@ declare namespace chrome.cast.media { itemIds: Array; } - interface QueueUpdateItemsRequest { + export interface QueueUpdateItemsRequest { /** * @param {!Array} * @constructor @@ -670,7 +670,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TrackType */ - interface TrackType { + export interface TrackType { TEXT: string; AUDIO: string; VIDEO: string; @@ -680,7 +680,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackType */ - interface TextTrackType { + export interface TextTrackType { SUBTITLES: string; CAPTIONS: string; DESCRIPTIONS: string; @@ -692,7 +692,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackEdgeType */ - interface TextTrackEdgeType { + export interface TextTrackEdgeType { NONE: string; OUTLINE: string; DROP_SHADOW: string; @@ -704,7 +704,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackWindowType */ - interface TextTrackWindowType { + export interface TextTrackWindowType { NONE: string; NORMAL: string; ROUNDED_CORNERS: string; @@ -714,7 +714,7 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackFontGenericFamily */ - interface TextTrackFontGenericFamily { + export interface TextTrackFontGenericFamily { SANS_SERIF: string; MONOSPACED_SANS_SERIF: string; SERIF: string; @@ -728,14 +728,14 @@ declare namespace chrome.cast.media { * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackFontStyle */ - interface TextTrackFontStyle { + export interface TextTrackFontStyle { NORMAL: string; BOLD: string; BOLD_ITALIC: string; ITALIC: string; } - interface GetStatusRequest { + export interface GetStatusRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest @@ -745,7 +745,7 @@ declare namespace chrome.cast.media { customData: Object; } - interface PauseRequest { + export interface PauseRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest @@ -755,7 +755,7 @@ declare namespace chrome.cast.media { customData: Object; } - interface PlayRequest { + export interface PlayRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest @@ -765,7 +765,7 @@ declare namespace chrome.cast.media { customData: Object; } - interface SeekRequest { + export interface SeekRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest @@ -777,7 +777,7 @@ declare namespace chrome.cast.media { customData: Object; } - interface StopRequest { + export interface StopRequest { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest @@ -787,7 +787,7 @@ declare namespace chrome.cast.media { customData: Object; } - interface VolumeRequest { + export interface VolumeRequest { /** * @param {!chrome.cast.Volume} volume * @constructor @@ -801,7 +801,7 @@ declare namespace chrome.cast.media { customData: Object; } - interface LoadRequest { + export interface LoadRequest { /** * @param {!chrome.cast.media.MediaInfo} mediaInfo * @constructor @@ -818,7 +818,7 @@ declare namespace chrome.cast.media { media: chrome.cast.media.MediaInfo; } - interface EditTracksInfoRequest { + export interface EditTracksInfoRequest { /** * @param {Array=} opt_activeTrackIds * @param {chrome.cast.media.TextTrackStyle=} opt_textTrackStyle @@ -834,7 +834,7 @@ declare namespace chrome.cast.media { textTrackStyle: chrome.cast.media.TextTrackStyle; } - interface GenericMediaMetadata { + export interface GenericMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GenericMediaMetadata @@ -852,7 +852,7 @@ declare namespace chrome.cast.media { type: chrome.cast.media.MetadataType; } - interface MovieMediaMetadata { + export interface MovieMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata @@ -871,7 +871,7 @@ declare namespace chrome.cast.media { type: chrome.cast.media.MetadataType; } - interface TvShowMediaMetadata { + export interface TvShowMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TvShowMediaMetadata @@ -898,7 +898,7 @@ declare namespace chrome.cast.media { releaseYear: number; } - interface MusicTrackMediaMetadata { + export interface MusicTrackMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata @@ -925,7 +925,7 @@ declare namespace chrome.cast.media { releaseYear: number; } - interface PhotoMediaMetadata { + export interface PhotoMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PhotoMediaMetadata @@ -947,7 +947,7 @@ declare namespace chrome.cast.media { type: chrome.cast.media.MetadataType; } - interface MediaInfo { + export interface MediaInfo { /** * @param {string} contentId * @param {string} contentType @@ -969,7 +969,7 @@ declare namespace chrome.cast.media { customData: Object; } - interface Media { + export interface Media { /** * @param {string} sessionId * @param {number} mediaSessionId @@ -1215,7 +1215,7 @@ declare namespace chrome.cast.media { } - interface Track { + export interface Track { /** * @param {number} trackId * @param {!chrome.cast.media.TrackType} trackType @@ -1237,7 +1237,7 @@ declare namespace chrome.cast.media { customData: Object; } - interface TextTrackStyle { + export interface TextTrackStyle { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackStyle @@ -1264,17 +1264,17 @@ declare namespace chrome.cast.media { * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.timeout */ declare namespace chrome.cast.media.timeout { - var load: number; - var getStatus: number; - var play: number; - var pause: number; - var seek: number; - var stop: number; - var setVolume: number; - var editTracksInfo: number; - var queueInsert: number; - var queueLoad: number; - var queueRemove: number; - var queueReorder: number; - var queueUpdate: number; + export var load: number; + export var getStatus: number; + export var play: number; + export var pause: number; + export var seek: number; + export var stop: number; + export var setVolume: number; + export var editTracksInfo: number; + export var queueInsert: number; + export var queueLoad: number; + export var queueRemove: number; + export var queueReorder: number; + export var queueUpdate: number; } diff --git a/types/chrome/chrome-webview.d.ts b/types/chrome/chrome-webview.d.ts new file mode 100644 index 0000000000..e2e0b7c429 --- /dev/null +++ b/types/chrome/chrome-webview.d.ts @@ -0,0 +1,109 @@ +/// + +// Project: http://developer.chrome.com/apps/ +// Definitions by: Nikolai Ommundsen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 +// +// WebView ref: https://chromium.googlesource.com/chromium/src/+/64.0.3274.2/chrome/common/extensions/api/webview_tag.json +// + + +/////////////////// +// Tag +/////////////////// +/** + * Use the webview tag to actively load live content from the web over the network and embed it in your Chrome App. Your app can control the appearance of the webview and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see Usage). + */ +declare namespace chrome.webviewTag { + /** Options that determine what data should be cleared by `clearData`. */ + export interface ClearDataOptions { + /** Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). */ + since: number; + } + export interface WindowEvent extends chrome.events.Event<() => void> {} + + export interface ConsoleEvent extends Event { + /** + * @description The severity level of the log message. Ranges from 0 to 4. + * @type {number} + * @memberof ConsoleEvent + */ + level: number, + /** + * @description The logged message contents. + * @type {string} + * @memberof ConsoleEvent + */ + message: string, + /** + * @description The line number of the message source. + * @type {number} + * @memberof ConsoleEvent + */ + line: number, + /** + * @description A string identifying the resource which logged the message. + * @type {string} + * @memberof ConsoleEvent + */ + sourceId: string + } + + /** Description of a declarative rule for handling events. */ + export interface Rule { + /** Optional priority of this rule. Defaults to 100. */ + priority?: number; + /** List of conditions that can trigger the actions. */ + conditions: any[]; + /** Optional. Optional identifier that allows referencing this rule. */ + id?: string; + /** List of actions that are triggered if one of the condtions is fulfilled. */ + actions: any[]; + /** + * @description Tags can be used to annotate rules and perform operations on sets of rules.¨ + * @since Chrome 28 + * @type {string[]} + * @memberof Rule + */ + tags?: string[]; + } + + /** + * @description Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @export + * @interface InjectDetails + */ + export interface InjectDetails { + /** + * @description JavaScript or CSS code to inject.

Warning:
Be careful using the code parameter. Incorrect use of it may open your app to cross site scripting attacks. + * @type {string} + * @memberof InjectDetails + */ + code?: string, + /** + * @description JavaScript or CSS file to inject. + * @type {string} + * @memberof InjectDetails + */ + file?: string + } + + export interface WebViewElementEventMap extends ElementEventMap { + 'message': ConsoleEvent + } + + /** + * @description + * @export + * @interface HTMLWebViewElement + * @extends {Element} + */ + export interface HTMLWebViewElement extends Element { + executeScript?: (details: InjectDetails, callback?: (result: any) => void) => void, + src: string, + contentWindow: Window + addEventListener(type: K, listener: (this: HTMLWebViewElement, ev: WebViewElementEventMap[K]) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + } +} diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 5104ab7ca1..3d85d3be14 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -2,7 +2,7 @@ // Project: http://developer.chrome.com/extensions/ // Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 /// @@ -23,12 +23,12 @@ interface Window { * Important: This API works only on Chrome OS. */ declare namespace chrome.accessibilityFeatures { - interface AccessibilityFeaturesGetArg { + export interface AccessibilityFeaturesGetArg { /** Optional. Whether to return the value that applies to the incognito session (default false). */ incognito?: boolean; } - interface AccessibilityFeaturesCallbackArg { + export interface AccessibilityFeaturesCallbackArg { /** The value of the setting. */ value: any; /** @@ -43,7 +43,7 @@ declare namespace chrome.accessibilityFeatures { incognitoSpecific?: boolean; } - interface AccessibilityFeaturesSetArg { + export interface AccessibilityFeaturesSetArg { /** * The value of the setting. * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. @@ -60,7 +60,7 @@ declare namespace chrome.accessibilityFeatures { scope?: string; } - interface AccessibilityFeaturesClearArg { + export interface AccessibilityFeaturesClearArg { /** * Optional. * The scope of the ChromeSetting. One of @@ -72,7 +72,7 @@ declare namespace chrome.accessibilityFeatures { scope?: string; } - interface AccessibilityFeaturesSetting { + export interface AccessibilityFeaturesSetting { /** * Gets the value of a setting. * @param details Which setting to consider. @@ -98,14 +98,14 @@ declare namespace chrome.accessibilityFeatures { clear(details: AccessibilityFeaturesClearArg, callback?: () => void): void; } - var spokenFeedback: AccessibilityFeaturesSetting; - var largeCursor: AccessibilityFeaturesSetting; - var stickyKeys: AccessibilityFeaturesSetting; - var highContrast: AccessibilityFeaturesSetting; - var screenMagnifier: AccessibilityFeaturesSetting; - var autoclick: AccessibilityFeaturesSetting; - var virtualKeyboard: AccessibilityFeaturesSetting; - var animationPolicy: AccessibilityFeaturesSetting; + export var spokenFeedback: AccessibilityFeaturesSetting; + export var largeCursor: AccessibilityFeaturesSetting; + export var stickyKeys: AccessibilityFeaturesSetting; + export var highContrast: AccessibilityFeaturesSetting; + export var screenMagnifier: AccessibilityFeaturesSetting; + export var autoclick: AccessibilityFeaturesSetting; + export var virtualKeyboard: AccessibilityFeaturesSetting; + export var animationPolicy: AccessibilityFeaturesSetting; } //////////////////// @@ -117,7 +117,7 @@ declare namespace chrome.accessibilityFeatures { * Permissions: "alarms" */ declare namespace chrome.alarms { - interface AlarmCreateInfo { + export interface AlarmCreateInfo { /** Optional. Length of time in minutes after which the onAlarm event should fire. */ delayInMinutes?: number; /** Optional. If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */ @@ -126,7 +126,7 @@ declare namespace chrome.alarms { when?: number; } - interface Alarm { + export interface Alarm { /** Optional. If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */ periodInMinutes?: number; /** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */ @@ -135,7 +135,7 @@ declare namespace chrome.alarms { name: string; } - interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> {} + export interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> {} /** * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. @@ -192,15 +192,16 @@ declare namespace chrome.alarms { export function get(name: string, callback: (alarm: Alarm) => void): void; /** Fired when an alarm has elapsed. Useful for event pages. */ - var onAlarm: AlarmEvent; + export var onAlarm: AlarmEvent; } + /** * Use the chrome.browser API to interact with the Chrome browser associated with * the current application and Chrome profile. */ declare namespace chrome.browser { - interface Options { + export interface Options { /** The URL to navigate to when the new tab is initially opened. */ url: string; } @@ -234,7 +235,7 @@ declare namespace chrome.browser { */ declare namespace chrome.bookmarks { /** A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. */ - interface BookmarkTreeNode { + export interface BookmarkTreeNode { /** Optional. The 0-based position of this node within its parent folder. */ index?: number; /** Optional. When this node was created, in milliseconds since the epoch (new Date(dateAdded)). */ @@ -259,48 +260,48 @@ declare namespace chrome.bookmarks { unmodifiable?: any; } - interface BookmarkRemoveInfo { + export interface BookmarkRemoveInfo { index: number; parentId: string; } - interface BookmarkMoveInfo { + export interface BookmarkMoveInfo { index: number; oldIndex: number; parentId: string; oldParentId: string; } - interface BookmarkChangeInfo { + export interface BookmarkChangeInfo { url?: string; title: string; } - interface BookmarkReorderInfo { + export interface BookmarkReorderInfo { childIds: string[]; } - interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> {} + export interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> {} - interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {} + export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {} - interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> {} + export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> {} - interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {} + export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {} - interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> {} + export interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> {} - interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> {} + export interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> {} - interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> {} + export interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> {} - interface BookmarkSearchQuery { + export interface BookmarkSearchQuery { query?: string; url?: string; title?: string; } - interface BookmarkCreateArg { + export interface BookmarkCreateArg { /** Optional. Defaults to the Other Bookmarks folder. */ parentId?: string; index?: number; @@ -308,20 +309,20 @@ declare namespace chrome.bookmarks { url?: string; } - interface BookmarkDestinationArg { + export interface BookmarkDestinationArg { parentId?: string; index?: number; } - interface BookmarkChangesArg { + export interface BookmarkChangesArg { title?: string; url?: string; } /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */ - var MAX_WRITE_OPERATIONS_PER_HOUR: number; + export var MAX_WRITE_OPERATIONS_PER_HOUR: number; /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */ - var MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; + export var MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; /** * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. @@ -410,19 +411,19 @@ declare namespace chrome.bookmarks { export function removeTree(id: string, callback?: Function): void; /** Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. */ - var onRemoved: BookmarkRemovedEvent; + export var onRemoved: BookmarkRemovedEvent; /** Fired when a bookmark import session is ended. */ - var onImportEnded: BookmarkImportEndedEvent; + export var onImportEnded: BookmarkImportEndedEvent; /** Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately. */ - var onImportBegan: BookmarkImportBeganEvent; + export var onImportBegan: BookmarkImportBeganEvent; /** Fired when a bookmark or folder changes. Note: Currently, only title and url changes trigger this. */ - var onChanged: BookmarkChangedEvent; + export var onChanged: BookmarkChangedEvent; /** Fired when a bookmark or folder is moved to a different parent folder. */ - var onMoved: BookmarkMovedEvent; + export var onMoved: BookmarkMovedEvent; /** Fired when a bookmark or folder is created. */ - var onCreated: BookmarkCreatedEvent; + export var onCreated: BookmarkCreatedEvent; /** Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move(). */ - var onChildrenReordered: BookmarkChildrenReordered; + export var onChildrenReordered: BookmarkChildrenReordered; } //////////////////// @@ -434,51 +435,51 @@ declare namespace chrome.bookmarks { * Manifest: "browser_action": {...} */ declare namespace chrome.browserAction { - interface BadgeBackgroundColorDetails { + export interface BadgeBackgroundColorDetails { /** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00. */ color: string | ColorArray; /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ tabId?: number; } - interface BadgeTextDetails { + export interface BadgeTextDetails { /** Any number of characters can be passed, but only about four can fit in the space. */ text: string; /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ tabId?: number; } - type ColorArray = [number, number, number, number]; + export type ColorArray = [number, number, number, number]; - interface TitleDetails { + export interface TitleDetails { /** The string the browser action should display when moused over. */ title: string; /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ tabId?: number; } - interface TabDetails { + export interface TabDetails { /** Optional. Specify the tab to get the information. If no tab is specified, the non-tab-specific information is returned. */ tabId?: number; } - interface TabIconDetails { + export interface TabIconDetails { /** Optional. Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */ path?: any; /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ tabId?: number; /** Optional. Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */ - imageData?: ImageData; + imageData?: ImageData | { [index: number]: ImageData }; } - interface PopupDetails { + export interface PopupDetails { /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ tabId?: number; /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ popup: string; } - interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} /** * Since Chrome 22. @@ -536,7 +537,7 @@ declare namespace chrome.browserAction { export function setIcon(details: TabIconDetails, callback?: Function): void; /** Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. */ - var onClicked: BrowserClickedEvent; + export var onClicked: BrowserClickedEvent; } //////////////////// @@ -548,7 +549,7 @@ declare namespace chrome.browserAction { * Permissions: "browsingData" */ declare namespace chrome.browsingData { - interface OriginTypes { + export interface OriginTypes { /** Optional. Websites that have been installed as hosted applications (be careful!). */ protectedWeb?: boolean; /** Optional. Extensions and packaged applications a user has installed (be _really_ careful!). */ @@ -558,7 +559,7 @@ declare namespace chrome.browsingData { } /** Options that determine exactly what data will be removed. */ - interface RemovalOptions { + export interface RemovalOptions { /** * Optional. * Since Chrome 21. @@ -573,7 +574,7 @@ declare namespace chrome.browsingData { * Since Chrome 27. * A set of data types. Missing data types are interpreted as false. */ - interface DataTypeSet { + export interface DataTypeSet { /** Optional. Websites' WebSQL data. */ webSQL?: boolean; /** Optional. Websites' IndexedDB data. */ @@ -608,7 +609,7 @@ declare namespace chrome.browsingData { serviceWorkers?: boolean; } - interface SettingsCallback { + export interface SettingsCallback { options: RemovalOptions; /** All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false. */ dataToRemove: DataTypeSet; @@ -726,7 +727,7 @@ declare namespace chrome.browsingData { * Manifest: "commands": {...} */ declare namespace chrome.commands { - interface Command { + export interface Command { /** Optional. The name of the Extension Command */ name?: string; /** Optional. The Extension Command description */ @@ -735,7 +736,7 @@ declare namespace chrome.commands { shortcut?: string; } - interface CommandEvent extends chrome.events.Event<(command: string) => void> {} + export interface CommandEvent extends chrome.events.Event<(command: string) => void> {} /** * Returns all the registered extension commands for this extension and their shortcut (if active). @@ -746,7 +747,7 @@ declare namespace chrome.commands { export function getAll(callback: (commands: Command[]) => void): void; /** Fired when a registered command is activated using a keyboard shortcut. */ - var onCommand: CommandEvent; + export var onCommand: CommandEvent; } //////////////////// @@ -758,7 +759,7 @@ declare namespace chrome.commands { * Permissions: "contentSettings" */ declare namespace chrome.contentSettings { - interface ClearDetails { + export interface ClearDetails { /** * Optional. * Where to clear the setting (default: regular). @@ -769,7 +770,7 @@ declare namespace chrome.contentSettings { scope?: string; } - interface SetDetails { + export interface SetDetails { /** Optional. The resource identifier for the content type. */ resourceIdentifier?: ResourceIdentifier; /** The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values. */ @@ -782,7 +783,7 @@ declare namespace chrome.contentSettings { primaryPattern: string; } - interface GetDetails { + export interface GetDetails { /** Optional. The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs. */ secondaryUrl?: string; /** Optional. A more specific identifier of the type of content for which the settings should be retrieved. */ @@ -793,12 +794,12 @@ declare namespace chrome.contentSettings { primaryUrl: string; } - interface ReturnedDetails { + export interface ReturnedDetails { /** The content setting. See the description of the individual ContentSetting objects for the possible values. */ setting: any; } - interface ContentSetting { + export interface ContentSetting { /** * Clear all content setting rules set by this extension. * @param callback If you specify the callback parameter, it should be a function that looks like this: @@ -826,7 +827,7 @@ declare namespace chrome.contentSettings { } /** The only content type using resource identifiers is contentSettings.plugins. For more information, see Resource Identifiers. */ - interface ResourceIdentifier { + export interface ResourceIdentifier { /** The resource identifier for the given content type. */ id: string; /** Optional. A human readable description of the resource. */ @@ -841,7 +842,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame. */ - var cookies: ContentSetting; + export var cookies: ContentSetting; /** * Whether to allow sites to show pop-ups. One of * allow: Allow sites to show pop-ups, @@ -849,7 +850,7 @@ declare namespace chrome.contentSettings { * Default is block. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - var popups: ContentSetting; + export var popups: ContentSetting; /** * Whether to run JavaScript. One of * allow: Run JavaScript, @@ -857,7 +858,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - var javascript: ContentSetting; + export var javascript: ContentSetting; /** * Whether to allow sites to show desktop notifications. One of * allow: Allow sites to show desktop notifications, @@ -866,7 +867,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used. */ - var notifications: ContentSetting; + export var notifications: ContentSetting; /** * Whether to run plugins. One of * allow: Run plugins automatically, @@ -875,7 +876,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - var plugins: ContentSetting; + export var plugins: ContentSetting; /** * Whether to show images. One of * allow: Show images, @@ -883,7 +884,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image. */ - var images: ContentSetting; + export var images: ContentSetting; /** * Since Chrome 42. * Whether to allow Geolocation. One of @@ -893,7 +894,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). */ - var location: ContentSetting; + export var location: ContentSetting; /** * Since Chrome 42. * Whether to allow sites to toggle the fullscreen mode. One of @@ -902,7 +903,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). */ - var fullscreen: ContentSetting; + export var fullscreen: ContentSetting; /** * Since Chrome 42. * Whether to allow sites to disable the mouse cursor. One of @@ -912,7 +913,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - var mouselock: ContentSetting; + export var mouselock: ContentSetting; /** * Since Chrome 42. * Whether to allow sites to run plugins unsandboxed. One of @@ -922,7 +923,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - var unsandboxedPlugins: ContentSetting; + export var unsandboxedPlugins: ContentSetting; /** * Since Chrome 42. * Whether to allow sites to download multiple files automatically. One of @@ -932,7 +933,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - var automaticDownloads: ContentSetting; + export var automaticDownloads: ContentSetting; } //////////////////// @@ -944,7 +945,7 @@ declare namespace chrome.contentSettings { * Permissions: "contextMenus" */ declare namespace chrome.contextMenus { - interface OnClickData { + export interface OnClickData { /** * Optional. * Since Chrome 35. @@ -1010,7 +1011,7 @@ declare namespace chrome.contextMenus { srcUrl?: string; } - interface CreateProperties { + export interface CreateProperties { /** Optional. Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */ documentUrlPatterns?: string[]; /** Optional. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. */ @@ -1046,7 +1047,7 @@ declare namespace chrome.contextMenus { id?: string; } - interface UpdateProperties { + export interface UpdateProperties { documentUrlPatterns?: string[]; checked?: boolean; title?: string; @@ -1060,13 +1061,13 @@ declare namespace chrome.contextMenus { type?: string; } - interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {} + export interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {} /** * Since Chrome 38. * The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored. */ - var ACTION_MENU_TOP_LEVEL_LIMIT: number; + export var ACTION_MENU_TOP_LEVEL_LIMIT: number; /** * Removes all context menu items added by this extension. @@ -1121,7 +1122,7 @@ declare namespace chrome.contextMenus { * Since Chrome 21. * Fired when a context menu item is clicked. */ - var onClicked: MenuClickedEvent; + export var onClicked: MenuClickedEvent; } //////////////////// @@ -1134,7 +1135,7 @@ declare namespace chrome.contextMenus { */ declare namespace chrome.cookies { /** Represents information about an HTTP cookie. */ - interface Cookie { + export interface Cookie { /** The domain of the cookie (e.g. "www.google.com", "example.com"). */ domain: string; /** The name of the cookie. */ @@ -1158,14 +1159,14 @@ declare namespace chrome.cookies { } /** Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window. */ - interface CookieStore { + export interface CookieStore { /** The unique identifier for the cookie store. */ id: string; /** Identifiers of all the browser tabs that share this cookie store. */ tabIds: number[]; } - interface GetAllDetails { + export interface GetAllDetails { /** Optional. Restricts the retrieved cookies to those whose domains match or are subdomains of this one. */ domain?: string; /** Optional. Filters the cookies by name. */ @@ -1182,7 +1183,7 @@ declare namespace chrome.cookies { secure?: boolean; } - interface SetDetails { + export interface SetDetails { /** Optional. The domain of the cookie. If omitted, the cookie becomes a host-only cookie. */ domain?: string; /** Optional. The name of the cookie. Empty by default if omitted. */ @@ -1203,13 +1204,13 @@ declare namespace chrome.cookies { secure?: boolean; } - interface Details { + export interface Details { name: string; url: string; storeId?: string; } - interface CookieChangeInfo { + export interface CookieChangeInfo { /** Information about the cookie that was set or removed. */ cookie: Cookie; /** True if a cookie was removed. */ @@ -1221,7 +1222,7 @@ declare namespace chrome.cookies { cause: string; } - interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {} + export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {} /** * Lists all existing cookie stores. @@ -1263,7 +1264,7 @@ declare namespace chrome.cookies { export function get(details: Details, callback: (cookie: Cookie | null) => void): void; /** Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". */ - var onChanged: CookieChangedEvent; + export var onChanged: CookieChangedEvent; } //////////////////// @@ -1274,104 +1275,106 @@ declare namespace chrome.cookies { * Availability: Since Chrome 18. * Permissions: "debugger" */ -// TODO: Uncomment when Microsoft/TypeScript#8312 is merged in -// declare module chrome.debugger { -// /** Debuggee identifier. Either tabId or extensionId must be specified */ -// interface Debuggee { -// /** Optional. The id of the tab which you intend to debug. */ -// tabId?: number; -// /** -// * Optional. -// * Since Chrome 27. -// * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. -// */ -// extensionId?: string; -// /** -// * Optional. -// * Since Chrome 28. -// * The opaque id of the debug target. -// */ -// targetId?: string; -// } -// -// /** -// * Since Chrome 28. -// * Debug target information -// */ -// interface TargetInfo { -// /** Target type. */ -// type: string; -// /** Target id. */ -// id: string; -// /** -// * Optional. -// * Since Chrome 30. -// * The tab id, defined if type == 'page'. -// */ -// tabId?: number; -// /** -// * Optional. -// * Since Chrome 30. -// * The extension id, defined if type = 'background_page'. -// */ -// extensionId?: string; -// /** True if debugger is already attached. */ -// attached: boolean; -// /** Target page title. */ -// title: string; -// /** Target URL. */ -// url: string; -// /** Optional. Target favicon URL. */ -// faviconUrl?: string; -// } -// -// interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {} -// -// interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} -// -// /** -// * Attaches debugger to the given target. -// * @param target Debugging target to which you want to attach. -// * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. -// * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function() {...}; -// */ -// export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; -// /** -// * Detaches debugger from the given target. -// * @param target Debugging target from which you want to detach. -// * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function() {...}; -// */ -// export function detach(target: Debuggee, callback?: () => void): void; -// /** -// * Sends given command to the debugging target. -// * @param target Debugging target to which you want to send the command. -// * @param method Method name. Should be one of the methods defined by the remote debugging protocol. -// * @param commandParams Since Chrome 22. -// * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. -// * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function(object result) {...}; -// */ -// export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; -// /** -// * Since Chrome 28. -// * Returns the list of available debug targets. -// * @param callback The callback parameter should be a function that looks like this: -// * function(array of TargetInfo result) {...}; -// * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. -// */ -// export function getTargets(callback: (result: TargetInfo[]) => void): void; -// -// /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */ -// var onDetach: DebuggerDetachedEvent; -// /** Fired whenever debugging target issues instrumentation event. */ -// var onEvent: DebuggerEventEvent; -// } +declare module chrome { + namespace _debugger { + /** Debuggee identifier. Either tabId or extensionId must be specified */ + export interface Debuggee { + /** Optional. The id of the tab which you intend to debug. */ + tabId?: number; + /** + * Optional. + * Since Chrome 27. + * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. + */ + extensionId?: string; + /** + * Optional. + * Since Chrome 28. + * The opaque id of the debug target. + */ + targetId?: string; + } + /** + * Since Chrome 28. + * Debug target information + */ + export interface TargetInfo { + /** Target type. */ + type: string; + /** Target id. */ + id: string; + /** + * Optional. + * Since Chrome 30. + * The tab id, defined if type == 'page'. + */ + tabId?: number; + /** + * Optional. + * Since Chrome 30. + * The extension id, defined if type = 'background_page'. + */ + extensionId?: string; + /** True if debugger is already attached. */ + attached: boolean; + /** Target page title. */ + title: string; + /** Target URL. */ + url: string; + /** Optional. Target favicon URL. */ + faviconUrl?: string; + } + + export interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {} + + export interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} + + /** + * Attaches debugger to the given target. + * @param target Debugging target to which you want to attach. + * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. + * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; + /** + * Detaches debugger from the given target. + * @param target Debugging target from which you want to detach. + * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function detach(target: Debuggee, callback?: () => void): void; + /** + * Sends given command to the debugging target. + * @param target Debugging target to which you want to send the command. + * @param method Method name. Should be one of the methods defined by the remote debugging protocol. + * @param commandParams Since Chrome 22. + * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. + * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result) {...}; + */ + export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; + /** + * Since Chrome 28. + * Returns the list of available debug targets. + * @param callback The callback parameter should be a function that looks like this: + * function(array of TargetInfo result) {...}; + * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. + */ + export function getTargets(callback: (result: TargetInfo[]) => void): void; + + /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */ + export var onDetach: DebuggerDetachedEvent; + /** Fired whenever debugging target issues instrumentation event. */ + export var onEvent: DebuggerEventEvent; + } + + export {_debugger as debugger} +} //////////////////// // Declarative Content //////////////////// @@ -1381,7 +1384,7 @@ declare namespace chrome.cookies { * Permissions: "declarativeContent" */ declare namespace chrome.declarativeContent { - interface PageStateUrlDetails { + export interface PageStateUrlDetails { /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */ hostContains?: string; /** Optional. Matches if the host name of the URL is equal to a specified string. */ @@ -1424,8 +1427,7 @@ declare namespace chrome.declarativeContent { ports?: (number | number[])[]; } - /** Matches the state of a web page by various criteria. */ - interface PageStateMatcher { + export class PageStateMatcherProperties { /** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ pageUrl?: PageStateUrlDetails; /** Optional. Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be compound selectors to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites. */ @@ -1437,13 +1439,26 @@ declare namespace chrome.declarativeContent { */ isBookmarked?: boolean; } + + /** Matches the state of a web page by various criteria. */ + export class PageStateMatcher { + constructor(options: PageStateMatcherProperties); + } + + /** Declarative event action that shows the extension's page action while the corresponding conditions are met. */ + export class ShowPageAction {} + + /** Provides the Declarative Event API consisting of addRules, removeRules, and getRules. */ + export interface PageChangedEvent extends chrome.events.Event<() => void> {} + + export var onPageChanged: PageChangedEvent; } //////////////////// // Declarative Web Request //////////////////// declare namespace chrome.declarativeWebRequest { - interface HeaderFilter { + export interface HeaderFilter { nameEquals?: string; valueContains?: any; nameSuffix?: string; @@ -1454,21 +1469,21 @@ declare namespace chrome.declarativeWebRequest { namePrefix?: string; } - interface AddResponseHeader { + export interface AddResponseHeader { name: string; value: string; } - interface RemoveResponseCookie { + export interface RemoveResponseCookie { filter: ResponseCookie; } - interface RemoveResponseHeader { + export interface RemoveResponseHeader { name: string; value?: string; } - interface RequestMatcher { + export interface RequestMatcher { contentType?: string[]; url?: chrome.events.UrlFilter; excludeContentType?: string[]; @@ -1477,17 +1492,17 @@ declare namespace chrome.declarativeWebRequest { responseHeaders?: HeaderFilter[]; } - interface IgnoreRules { + export interface IgnoreRules { lowerPriorityThan: number; } - interface RedirectToEmptyDocument { } + export interface RedirectToEmptyDocument { } - interface RedirectRequest { + export interface RedirectRequest { redirectUrl: string; } - interface ResponseCookie { + export interface ResponseCookie { domain?: string; name?: string; expires?: string; @@ -1498,54 +1513,54 @@ declare namespace chrome.declarativeWebRequest { secure?: string; } - interface AddResponseCookie { + export interface AddResponseCookie { cookie: ResponseCookie; } - interface EditResponseCookie { + export interface EditResponseCookie { filter: ResponseCookie; modification: ResponseCookie; } - interface CancelRequest { } + export interface CancelRequest { } - interface RemoveRequestHeader { + export interface RemoveRequestHeader { name: string; } - interface EditRequestCookie { + export interface EditRequestCookie { filter: RequestCookie; modification: RequestCookie; } - interface SetRequestHeader { + export interface SetRequestHeader { name: string; value: string; } - interface RequestCookie { + export interface RequestCookie { name?: string; value?: string; } - interface RedirectByRegEx { + export interface RedirectByRegEx { to: string; from: string; } - interface RedirectToTransparentImage { } + export interface RedirectToTransparentImage { } - interface AddRequestCookie { + export interface AddRequestCookie { cookie: RequestCookie; } - interface RemoveRequestCookie { + export interface RemoveRequestCookie { filter: RequestCookie; } - interface RequestedEvent extends chrome.events.Event {} + export interface RequestedEvent extends chrome.events.Event {} - var onRequest: RequestedEvent; + export var onRequest: RequestedEvent; } //////////////////// @@ -1590,7 +1605,7 @@ declare namespace chrome.desktopCapture { */ declare namespace chrome.devtools.inspectedWindow { /** A resource within the inspected page, such as a document, a script, or an image. */ - interface Resource { + export interface Resource { /** The URL of the resource. */ url: string; /** @@ -1614,7 +1629,7 @@ declare namespace chrome.devtools.inspectedWindow { setContent(content: string, commit: boolean, callback?: (error: Object) => void): void; } - interface ReloadOptions { + export interface ReloadOptions { /** Optional. If specified, the string will override the value of the User-Agent HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the navigator.userAgent property that's returned to any scripts that are running within the inspected page. */ userAgent?: string; /** Optional. When true, the loader will ignore the cache for all inspected page resources loaded before the load event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. */ @@ -1629,7 +1644,7 @@ declare namespace chrome.devtools.inspectedWindow { preprocessorScript?: string; } - interface EvaluationExceptionInfo { + export interface EvaluationExceptionInfo { /** Set if the error occurred on the DevTools side before the expression is evaluated. */ isError: boolean; /** Set if the error occurred on the DevTools side before the expression is evaluated. */ @@ -1644,12 +1659,12 @@ declare namespace chrome.devtools.inspectedWindow { value: string; } - interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> {} + export interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> {} - interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> {} + export interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> {} /** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */ - var tabId: number; + export var tabId: number; /** Reloads the inspected page. */ export function reload(reloadOptions: ReloadOptions): void; @@ -1662,7 +1677,7 @@ declare namespace chrome.devtools.inspectedWindow { * Parameter result: The result of evaluation. * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. */ - export function eval(expression: string, callback?: (result: Object, exceptionInfo: EvaluationExceptionInfo) => void): void; + export function eval(expression: string, callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void): void; /** * Retrieves the list of resources from the inspected page. * @param callback A function that receives the list of resources when the request completes. @@ -1672,9 +1687,9 @@ declare namespace chrome.devtools.inspectedWindow { export function getResources(callback: (resources: Resource[]) => void): void; /** Fired when a new resource is added to the inspected page. */ - var onResourceAdded: ResourceAddedEvent; + export var onResourceAdded: ResourceAddedEvent; /** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */ - var onResourceContentCommitted: ResourceContentCommittedEvent; + export var onResourceContentCommitted: ResourceContentCommittedEvent; } //////////////////// @@ -1686,7 +1701,7 @@ declare namespace chrome.devtools.inspectedWindow { */ declare namespace chrome.devtools.network { /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */ - interface Request { + export interface Request { /** * Returns content of the response body. * @param callback A function that receives the response body when the request completes. @@ -1698,9 +1713,9 @@ declare namespace chrome.devtools.network { getContent(callback: (content: string, encoding: string) => void): void; } - interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {} + export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {} - interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {} + export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {} /** * Returns HAR log that contains all known network requests. @@ -1712,9 +1727,9 @@ declare namespace chrome.devtools.network { export function getHAR(callback: (harLog: Object) => void): void; /** Fired when a network request is finished and all request data are available. */ - var onRequestFinished: RequestFinishedEvent; + export var onRequestFinished: RequestFinishedEvent; /** Fired when the inspected window navigates to a new page. */ - var onNavigated: NavigatedEvent; + export var onNavigated: NavigatedEvent; } //////////////////// @@ -1725,14 +1740,14 @@ declare namespace chrome.devtools.network { * Availability: Since Chrome 18. */ declare namespace chrome.devtools.panels { - interface PanelShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {} + export interface PanelShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {} - interface PanelHiddenEvent extends chrome.events.Event<() => void> {} + export interface PanelHiddenEvent extends chrome.events.Event<() => void> {} - interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {} + export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {} /** Represents a panel created by extension. */ - interface ExtensionPanel { + export interface ExtensionPanel { /** * Appends a button to the status bar of the panel. * @param iconPath Path to the icon of the button. The file should contain a 64x24-pixel image composed of two 32x24 icons. The left icon is used when the button is inactive; the right icon is displayed when the button is pressed. @@ -1748,10 +1763,10 @@ declare namespace chrome.devtools.panels { onSearch: PanelSearchEvent; } - interface ButtonClickedEvent extends chrome.events.Event<() => void> {} + export interface ButtonClickedEvent extends chrome.events.Event<() => void> {} /** A button created by the extension. */ - interface Button { + export interface Button { /** * Updates the attributes of the button. If some of the arguments are omitted or null, the corresponding attributes are not updated. * @param iconPath Path to the new icon of the button. @@ -1763,10 +1778,10 @@ declare namespace chrome.devtools.panels { onClicked: ButtonClickedEvent; } - interface SelectionChangedEvent extends chrome.events.Event<() => void> {} + export interface SelectionChangedEvent extends chrome.events.Event<() => void> {} /** Represents the Elements panel. */ - interface ElementsPanel { + export interface ElementsPanel { /** * Creates a pane within panel's sidebar. * @param title Text that is displayed in sidebar caption. @@ -1784,7 +1799,7 @@ declare namespace chrome.devtools.panels { * Since Chrome 41. * Represents the Sources panel. */ - interface SourcesPanel { + export interface SourcesPanel { /** * Creates a pane within panel's sidebar. * @param title Text that is displayed in sidebar caption. @@ -1798,12 +1813,12 @@ declare namespace chrome.devtools.panels { onSelectionChanged: SelectionChangedEvent; } - interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {} + export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {} - interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {} + export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {} /** A sidebar created by the extension. */ - interface ExtensionSidebarPane { + export interface ExtensionSidebarPane { /** * Sets the height of the sidebar. * @param height A CSS-like size specification, such as '100px' or '12ex'. @@ -1855,12 +1870,12 @@ declare namespace chrome.devtools.panels { } /** Elements panel. */ - var elements: ElementsPanel; + export var elements: ElementsPanel; /** * Since Chrome 38. * Sources panel. */ - var sources: SourcesPanel; + export var sources: SourcesPanel; /** * Creates an extension panel. @@ -1903,14 +1918,14 @@ declare namespace chrome.devtools.panels { * Important: This API works only on Chrome OS. */ declare namespace chrome.documentScan { - interface DocumentScanOptions { + export interface DocumentScanOptions { /** Optional. The MIME types that are accepted by the caller. */ mimeTypes?: string[]; /** Optional. The number of scanned images allowed (defaults to 1). */ maxImages?: number; } - interface DocumentScanCallbackArg { + export interface DocumentScanCallbackArg { /** The data image URLs in a form that can be passed as the "src" value to an image tag. */ dataUrls: string[]; /** The MIME type of dataUrls. */ @@ -1936,14 +1951,14 @@ declare namespace chrome.documentScan { * Permissions: "downloads" */ declare namespace chrome.downloads { - interface HeaderNameValuePair { + export interface HeaderNameValuePair { /** Name of the HTTP header. */ name: string; /** Value of the HTTP header. */ value: string; } - interface DownloadOptions { + export interface DownloadOptions { /** Optional. Post body. */ body?: string; /** Optional. Use a file-chooser to allow the user to select a filename regardless of whether filename is set or already exists. */ @@ -1960,7 +1975,7 @@ declare namespace chrome.downloads { conflictAction?: string; } - interface DownloadDelta { + export interface DownloadDelta { /** Optional. The change in danger, if any. */ danger?: StringDelta; /** Optional. The change in url, if any. */ @@ -1991,23 +2006,23 @@ declare namespace chrome.downloads { exists?: BooleanDelta; } - interface BooleanDelta { + export interface BooleanDelta { current?: boolean; previous?: boolean; } /** Since Chrome 34. */ - interface DoubleDelta { + export interface DoubleDelta { current?: number; previous?: number; } - interface StringDelta { + export interface StringDelta { current?: string; previous?: string; } - interface DownloadItem { + export interface DownloadItem { /** Number of bytes received so far from the host, without considering file compression. */ bytesReceived: number; /** Indication of whether this download is thought to be safe or known to be suspicious. */ @@ -2050,13 +2065,13 @@ declare namespace chrome.downloads { byExtensionName?: string; } - interface GetFileIconOptions { + export interface GetFileIconOptions { /** Optional. * The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size. */ size?: number; } - interface DownloadQuery { + export interface DownloadQuery { /** Optional. Set elements of this array to DownloadItem properties in order to sort search results. For example, setting orderBy=['startTime'] sorts the DownloadItem by their start time in ascending order. To specify descending order, prefix with a hyphen: '-startTime'. */ orderBy?: string[]; /** Optional. Limits results to DownloadItem whose url matches the given regular expression. */ @@ -2109,20 +2124,20 @@ declare namespace chrome.downloads { exists?: boolean; } - interface DownloadFilenameSuggestion { + export interface DownloadFilenameSuggestion { /** The DownloadItem's new target DownloadItem.filename, as a path relative to the user's default Downloads directory, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will be ignored. */ filename: string; /** Optional. The action to take if filename already exists. */ conflictAction?: string; } - interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> {} + export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> {} - interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> {} + export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> {} - interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {} + export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {} - interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> {} + export interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> {} /** * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page. @@ -2216,13 +2231,13 @@ declare namespace chrome.downloads { export function setShelfEnabled(enabled: boolean): void; /** When any of a DownloadItem's properties except bytesReceived and estimatedEndTime changes, this event fires with the downloadId and an object containing the properties that changed. */ - var onChanged: DownloadChangedEvent; + export var onChanged: DownloadChangedEvent; /** This event fires with the DownloadItem object when a download begins. */ - var onCreated: DownloadCreatedEvent; + export var onCreated: DownloadCreatedEvent; /** Fires with the downloadId when a download is erased from history. */ - var onErased: DownloadErasedEvent; + export var onErased: DownloadErasedEvent; /** During the filename determination process, extensions will be given the opportunity to override the target DownloadItem.filename. Each extension may not register more than one listener for this event. Each listener must call suggest exactly once, either synchronously or asynchronously. If the listener calls suggest asynchronously, then it must return true. If the listener neither calls suggest synchronously nor returns true, then suggest will be called automatically. The DownloadItem will not complete until all listeners have called suggest. Listeners may call suggest without any arguments in order to allow the download to use downloadItem.filename for its filename, or pass a suggestion object to suggest in order to override the target filename. If more than one extension overrides the filename, then the last extension installed whose listener passes a suggestion object to suggest wins. In order to avoid confusion regarding which extension will win, users should not install extensions that may conflict. If the download is initiated by download and the target filename is known before the MIME type and tentative filename have been determined, pass filename to download instead. */ - var onDeterminingFilename: DownloadDeterminingFilenameEvent; + export var onDeterminingFilename: DownloadDeterminingFilenameEvent; } //////////////////// @@ -2236,7 +2251,7 @@ declare namespace chrome.downloads { * Note: This API is only for extensions pre-installed by policy. */ declare namespace chrome.enterprise.platformKeys { - interface Token { + export interface Token { /** * Uniquely identifies this Token. * Static IDs are "user" and "system", referring to the platform's user-specific and the system-wide hardware token, respectively. Any other tokens (with other identifiers) might be returned by enterprise.platformKeys.getTokens. @@ -2287,6 +2302,27 @@ declare namespace chrome.enterprise.platformKeys { export function removeCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void; } +//////////////////// +// Enterprise Device Attributes +//////////////////// +/** + * Use the chrome.enterprise.deviceAttributes API to read device attributes. + * Permissions: "enterprise.deviceAttributes" + * Since: Chrome 46 + * Important: This API works only on Chrome OS. + * Note: This API is only for extensions pre-installed by policy. + */ +declare namespace chrome.enterprise.deviceAttributes { + /** + * @description Fetches the value of the device identifier of the directory API, that is generated by the server and identifies the cloud record of the device for querying in the cloud directory API. + * @export + * @param callback Called with the device identifier of the directory API when received. + * The callback parameter should be a function that looks like this: + * function(string deviceId) {...}; + */ + export function getDirectoryDeviceId(callback: (deviceId: string) => void): void; +} + //////////////////// // Events //////////////////// @@ -2296,7 +2332,7 @@ declare namespace chrome.enterprise.platformKeys { */ declare namespace chrome.events { /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ - interface UrlFilter { + export interface UrlFilter { /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ schemes?: string[]; /** @@ -2348,7 +2384,7 @@ declare namespace chrome.events { } /** An object which allows the addition and removal of listeners for a Chrome event. */ - interface Event { + export interface Event { /** * Registers an event listener callback to an event. * @param callback Called when an event occurs. The parameters of this function depend on the type of event. @@ -2412,7 +2448,7 @@ declare namespace chrome.events { } /** Description of a declarative rule for handling events. */ - interface Rule { + export interface Rule { /** Optional. Optional priority of this rule. Defaults to 100. */ priority?: number; /** List of conditions that can trigger the actions. */ @@ -2438,27 +2474,27 @@ declare namespace chrome.events { * Availability: Since Chrome 5. */ declare namespace chrome.extension { - interface FetchProperties { + export interface FetchProperties { /** Optional. The window to restrict the search to. If omitted, returns all views. */ windowId?: number; /** Optional. The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'notification', 'popup'. */ type?: string; } - interface LastError { + export interface LastError { /** Description of the error that has taken place. */ message: string; } - interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> {} + export interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> {} /** * Since Chrome 7. * True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior. */ - var inIncognitoContext: boolean; + export var inIncognitoContext: boolean; /** Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined. */ - var lastError: LastError; + export var lastError: LastError; /** Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page. */ export function getBackgroundPage(): Window | null; @@ -2517,12 +2553,12 @@ declare namespace chrome.extension { * Fired when a request is sent from either an extension process or a content script. * @deprecated Deprecated since Chrome 33. Please use runtime.onMessage. */ - var onRequest: OnRequestEvent; + export var onRequest: OnRequestEvent; /** * Fired when a request is sent from another extension. * @deprecated Deprecated since Chrome 33. Please use runtime.onMessageExternal. */ - var onRequestExternal: OnRequestEvent; + export var onRequestExternal: OnRequestEvent; } //////////////////// @@ -2535,7 +2571,7 @@ declare namespace chrome.extension { * Important: This API works only on Chrome OS. */ declare namespace chrome.fileBrowserHandler { - interface SelectionParams { + export interface SelectionParams { /** * Optional. * List of file extensions that the selected file can have. The list is also used to specify what files to be shown in the select file dialog. Files with the listed extensions are only shown in the dialog. Extensions should not include the leading '.'. Example: ['jpg', 'png'] @@ -2546,7 +2582,7 @@ declare namespace chrome.fileBrowserHandler { suggestedName: string; } - interface SelectionResult { + export interface SelectionResult { /** Optional. Selected file entry. It will be null if a file hasn't been selected. */ entry?: Object | null; /** Whether the file has been selected. */ @@ -2554,14 +2590,14 @@ declare namespace chrome.fileBrowserHandler { } /** Event details payload for fileBrowserHandler.onExecute event. */ - interface FileHandlerExecuteEventDetails { + export interface FileHandlerExecuteEventDetails { /** Optional. The ID of the tab that raised this event. Tab IDs are unique within a browser session. */ tab_id?: number; /** Array of Entry instances representing files that are targets of this action (selected in ChromeOS file browser). */ entries: any[]; } - interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> {} + export interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> {} /** * Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture. @@ -2575,7 +2611,7 @@ declare namespace chrome.fileBrowserHandler { export function selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void; /** Fired when file system action is executed from ChromeOS file browser. */ - var onExecute: FileBrowserHandlerExecuteEvent; + export var onExecute: FileBrowserHandlerExecuteEvent; } //////////////////// @@ -2588,7 +2624,7 @@ declare namespace chrome.fileBrowserHandler { * Important: This API works only on Chrome OS. */ declare namespace chrome.fileSystemProvider { - interface OpenedFileInfo { + export interface OpenedFileInfo { /** A request ID to be be used by consecutive read/write and close requests. */ openRequestId: number; /** The path of the opened file. */ @@ -2597,7 +2633,7 @@ declare namespace chrome.fileSystemProvider { mode: string; } - interface FileWatchersInfo { + export interface FileWatchersInfo { /** The path of the entry being observed. */ entryPath: string; /** Whether watching should include all child entries recursively. It can be true for directories only. */ @@ -2606,7 +2642,7 @@ declare namespace chrome.fileSystemProvider { lastTag?: string; } - interface EntryMetadata { + export interface EntryMetadata { /** True if it is a directory. */ isDirectory: boolean; /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. */ @@ -2621,7 +2657,7 @@ declare namespace chrome.fileSystemProvider { thumbnail?: string; } - interface FileSystemInfo { + export interface FileSystemInfo { /** The identifier of the file system. */ fileSystemId: string; /** A human-readable name for the file system. */ @@ -2652,7 +2688,7 @@ declare namespace chrome.fileSystemProvider { } /** @since Since Chrome 45. Warning: this is the current Beta channel. */ - interface GetActionsRequestedOptions { + export interface GetActionsRequestedOptions { /** The identifier of the file system related to this operation. */ fileSystemId: string; /** The unique identifier of this request. */ @@ -2662,7 +2698,7 @@ declare namespace chrome.fileSystemProvider { } /** @since Since Chrome 45. Warning: this is the current Beta channel. */ - interface Action { + export interface Action { /** The identifier of the action. Any string or CommonActionId for common actions. */ id: string; /** Optional. The title of the action. It may be ignored for common actions. */ @@ -2670,7 +2706,7 @@ declare namespace chrome.fileSystemProvider { } /** @since Since Chrome 45. Warning: this is the current Beta channel. */ - interface ExecuteActionRequestedOptions { + export interface ExecuteActionRequestedOptions { /** The identifier of the file system related to this operation. */ fileSystemId: string; /** The unique identifier of this request. */ @@ -2681,7 +2717,7 @@ declare namespace chrome.fileSystemProvider { actionId: string; } - interface MountOptions { + export interface MountOptions { /** The string indentifier of the file system. Must be unique per each extension. */ fileSystemId: string; /** A human-readable name for the file system. */ @@ -2702,19 +2738,19 @@ declare namespace chrome.fileSystemProvider { supportsNotifyTag?: boolean; } - interface UnmountOptions { + export interface UnmountOptions { /** The identifier of the file system to be unmounted. */ fileSystemId: string; } - interface NotificationChange { + export interface NotificationChange { /** The path of the changed entry. */ entryPath: string; /** The type of the change which happened to the entry. */ changeType: string; } - interface NotificationOptions { + export interface NotificationOptions { /** The identifier of the file system related to this change. */ fileSystemId: string; /** The path of the observed entry. */ @@ -2729,111 +2765,111 @@ declare namespace chrome.fileSystemProvider { tag?: string; } - interface RequestedEventOptions { + export interface RequestedEventOptions { /** The identifier of the file system related to this operation. */ fileSystemId: string; /** The unique identifier of this request. */ requestId: number; } - interface EntryPathRequestedEventOptions extends RequestedEventOptions { + export interface EntryPathRequestedEventOptions extends RequestedEventOptions { /** The path of the entry to which this operation is related to. */ entryPath: string; } - interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions { + export interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions { /** Set to true if the thumbnail is requested. */ thumbnail: boolean; } - interface DirectoryPathRequestedEventOptions extends RequestedEventOptions { + export interface DirectoryPathRequestedEventOptions extends RequestedEventOptions { /** The path of the directory which is to be operated on. */ directoryPath: string; } - interface FilePathRequestedEventOptions extends RequestedEventOptions { + export interface FilePathRequestedEventOptions extends RequestedEventOptions { /** The path of the entry for the operation */ filePath: string; } - interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions { + export interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions { /** Whether the file will be used for reading or writing. */ mode: string; } - interface OpenedFileRequestedEventOptions extends RequestedEventOptions { + export interface OpenedFileRequestedEventOptions extends RequestedEventOptions { /** A request ID used to open the file. */ openRequestId: number; } - interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions { + export interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions { /** Position in the file (in bytes) to start reading from. */ offset: number; /** Number of bytes to be returned. */ length: number; } - interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions { + export interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions { /** Whether the operation is recursive (for directories only). */ recursive: boolean; } - interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions { + export interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions { /** Whether the operation is recursive (for directories only). */ recursive: boolean; } - interface SourceTargetPathRequestedEventOptions extends RequestedEventOptions { + export interface SourceTargetPathRequestedEventOptions extends RequestedEventOptions { /** The source path for the operation. */ sourcePath: string; /** The destination path for the operation. */ targetPath: string; } - interface FilePathLengthRequestedEventOptions extends FilePathRequestedEventOptions { + export interface FilePathLengthRequestedEventOptions extends FilePathRequestedEventOptions { /** Number of bytes to be retained after the operation completes. */ length: number; } - interface OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions { + export interface OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions { /** Position in the file (in bytes) to start operating from. */ offset: number; /** Buffer of bytes to be operated on the file. */ data: ArrayBuffer; } - interface OperationRequestedEventOptions extends RequestedEventOptions { + export interface OperationRequestedEventOptions extends RequestedEventOptions { /** An ID of the request to which this operation is related. */ operationRequestId: number; } - interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> {} + export interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> {} - interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {} + export interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {} - interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {} + export interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {} - interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} - interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {} /** * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string. @@ -2881,53 +2917,53 @@ declare namespace chrome.fileSystemProvider { export function notify(options: NotificationOptions, callback: () => void): void; /** Raised when unmounting for the file system with the fileSystemId identifier is requested. In the response, the unmount API method must be called together with successCallback. If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. */ - var onUnmountRequested: RequestedEvent; + export var onUnmountRequested: RequestedEvent; /** Raised when metadata of a file or a directory at entryPath is requested. The metadata must be returned with the successCallback call. In case of an error, errorCallback must be called. */ - var onGetMetadataRequested: MetadataRequestedEvent; + export var onGetMetadataRequested: MetadataRequestedEvent; /** Raised when contents of a directory at directoryPath are requested. The results must be returned in chunks by calling the successCallback several times. In case of an error, errorCallback must be called. */ - var onReadDirectoryRequested: DirectoryPathRequestedEvent; + export var onReadDirectoryRequested: DirectoryPathRequestedEvent; /** Raised when opening a file at filePath is requested. If the file does not exist, then the operation must fail. Maximum number of files opened at once can be specified with MountOptions. */ - var onOpenFileRequested: OpenFileRequestedEvent; + export var onOpenFileRequested: OpenFileRequestedEvent; /** Raised when opening a file previously opened with openRequestId is requested to be closed. */ - var onCloseFileRequested: OpenedFileRequestedEvent; + export var onCloseFileRequested: OpenedFileRequestedEvent; /** Raised when reading contents of a file opened previously with openRequestId is requested. The results must be returned in chunks by calling successCallback several times. In case of an error, errorCallback must be called. */ - var onReadFileRequested: OpenedFileOffsetRequestedEvent; + export var onReadFileRequested: OpenedFileOffsetRequestedEvent; /** Raised when creating a directory is requested. The operation must fail with the EXISTS error if the target directory already exists. If recursive is true, then all of the missing directories on the directory path must be created. */ - var onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent; + export var onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent; /** Raised when deleting an entry is requested. If recursive is true, and the entry is a directory, then all of the entries inside must be recursively deleted as well. */ - var onDeleteEntryRequested: EntryPathRecursiveRequestedEvent; + export var onDeleteEntryRequested: EntryPathRecursiveRequestedEvent; /** Raised when creating a file is requested. If the file already exists, then errorCallback must be called with the "EXISTS" error code. */ - var onCreateFileRequested: FilePathRequestedEvent; + export var onCreateFileRequested: FilePathRequestedEvent; /** Raised when copying an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ - var onCopyEntryRequested: SourceTargetPathRequestedEvent; + export var onCopyEntryRequested: SourceTargetPathRequestedEvent; /** Raised when moving an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ - var onMoveEntryRequested: SourceTargetPathRequestedEvent; + export var onMoveEntryRequested: SourceTargetPathRequestedEvent; /** Raised when truncating a file to a desired length is requested. If an error occurs, then errorCallback must be called. */ - var onTruncateRequested: FilePathLengthRequestedEvent; + export var onTruncateRequested: FilePathLengthRequestedEvent; /** Raised when writing contents to a file opened previously with openRequestId is requested. */ - var onWriteFileRequested: OpenedFileIoRequestedEvent; + export var onWriteFileRequested: OpenedFileIoRequestedEvent; /** Raised when aborting an operation with operationRequestId is requested. The operation executed with operationRequestId must be immediately stopped and successCallback of this abort request executed. If aborting fails, then errorCallback must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling errorCallback, the request may be forcibly aborted. */ - var onAbortRequested: OperationRequestedEvent; + export var onAbortRequested: OperationRequestedEvent; /** * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true. * @since Since Chrome 44. */ - var onConfigureRequested: RequestedEvent; + export var onConfigureRequested: RequestedEvent; /** * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. * @since Since Chrome 44. */ - var onMountRequested: OptionlessRequestedEvent; + export var onMountRequested: OptionlessRequestedEvent; /** * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called. * @since Since Chrome 45. Warning: this is the current Beta channel. */ - var onAddWatcherRequested: EntryPathRecursiveRequestedEvent; + export var onAddWatcherRequested: EntryPathRecursiveRequestedEvent; /** * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called. * @since Since Chrome 45. Warning: this is the current Beta channel. */ - var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent; + export var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent; } //////////////////// @@ -2940,26 +2976,26 @@ declare namespace chrome.fileSystemProvider { */ declare namespace chrome.fontSettings { /** Represents a font name. */ - interface FontName { + export interface FontName { /** The display name of the font. */ displayName: string; /** The font ID. */ fontId: string; } - interface DefaultFontSizeDetails { + export interface DefaultFontSizeDetails { /** The font size in pixels. */ pixelSize: number; } - interface FontDetails { + export interface FontDetails { /** The generic font family for the font. */ genericFamily: string; /** Optional. The script for the font. If omitted, the global script font setting is affected. */ script?: string; } - interface FullFontDetails { + export interface FullFontDetails { /** The generic font family for which the font setting has changed. */ genericFamily: string; /** The level of control this extension has over the setting. */ @@ -2970,37 +3006,37 @@ declare namespace chrome.fontSettings { fontId: string; } - interface FontDetailsResult { + export interface FontDetailsResult { /** The level of control this extension has over the setting. */ levelOfControl: string; /** The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, fontId can differ from the font passed to setFont, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting. */ fontId: string; } - interface FontSizeDetails { + export interface FontSizeDetails { /** The font size in pixels. */ pixelSize: number; /** The level of control this extension has over the setting. */ levelOfControl: string; } - interface SetFontSizeDetails { + export interface SetFontSizeDetails { /** The font size in pixels. */ pixelSize: number; } - interface SetFontDetails extends FontDetails { + export interface SetFontDetails extends FontDetails { /** The font ID. The empty string means to fallback to the global script font setting. */ fontId: string; } - interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} - interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} - interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} - interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {} + export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {} /** * Sets the default font size. @@ -3088,13 +3124,13 @@ declare namespace chrome.fontSettings { export function clearDefaultFixedFontSize(details: Object, callback?: Function): void; /** Fired when the default fixed font size setting changes. */ - var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent; + export var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent; /** Fired when the default font size setting changes. */ - var onDefaultFontSizeChanged: DefaultFontSizeChangedEvent; + export var onDefaultFontSizeChanged: DefaultFontSizeChangedEvent; /** Fired when the minimum font size setting changes. */ - var onMinimumFontSizeChanged: MinimumFontSizeChangedEvent; + export var onMinimumFontSizeChanged: MinimumFontSizeChangedEvent; /** Fired when a font setting changes. */ - var onFontChanged: FontChangedEvent; + export var onFontChanged: FontChangedEvent; } //////////////////// @@ -3106,7 +3142,7 @@ declare namespace chrome.fontSettings { * Permissions: "gcm" */ declare namespace chrome.gcm { - interface OutgoingMessage { + export interface OutgoingMessage { /** The ID of the server to send the message to as assigned by Google API Console. */ destinationId: string; /** The ID of the message. It must be unique for each message in scope of the applications. See the Cloud Messaging documentation for advice for picking and handling an ID. */ @@ -3117,7 +3153,7 @@ declare namespace chrome.gcm { data: Object; } - interface IncomingMessage { + export interface IncomingMessage { /** The message data. */ data: Object; /** @@ -3133,7 +3169,7 @@ declare namespace chrome.gcm { collapseKey?: string; } - interface GcmError { + export interface GcmError { /** The error message describing the problem. */ errorMessage: string; /** Optional. The ID of the message with this error, if error is related to a specific message. */ @@ -3142,14 +3178,14 @@ declare namespace chrome.gcm { detail: Object; } - interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> {} + export interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> {} - interface MessageDeletionEvent extends chrome.events.Event<() => void> {} + export interface MessageDeletionEvent extends chrome.events.Event<() => void> {} - interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {} + export interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {} /** The maximum size (in bytes) of all key/value pairs in a message. */ - var MAX_MESSAGE_SIZE: number; + export var MAX_MESSAGE_SIZE: number; /** * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned. @@ -3178,11 +3214,11 @@ declare namespace chrome.gcm { export function send(message: OutgoingMessage, callback: (messageId: string) => void): void; /** Fired when a message is received through GCM. */ - var onMessage: MessageReceptionEvent; + export var onMessage: MessageReceptionEvent; /** Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. */ - var onMessagesDeleted: MessageDeletionEvent; + export var onMessagesDeleted: MessageDeletionEvent; /** Fired when it was not possible to send a message to the GCM server. */ - var onSendError: GcmErrorEvent; + export var onSendError: GcmErrorEvent; } //////////////////// @@ -3195,7 +3231,7 @@ declare namespace chrome.gcm { */ declare namespace chrome.history { /** An object encapsulating one visit to a URL. */ - interface VisitItem { + export interface VisitItem { /** The transition type for this visit from its referrer. */ transition: string; /** Optional. When this visit occurred, represented in milliseconds since the epoch. */ @@ -3209,7 +3245,7 @@ declare namespace chrome.history { } /** An object encapsulating one result of a history query. */ - interface HistoryItem { + export interface HistoryItem { /** Optional. The number of times the user has navigated to this page by typing in the address. */ typedCount?: number; /** Optional. The title of the page when it was last loaded. */ @@ -3224,7 +3260,7 @@ declare namespace chrome.history { id: string; } - interface HistoryQuery { + export interface HistoryQuery { /** A free-text query to the history service. Leave empty to retrieve all pages. */ text: string; /** Optional. The maximum number of results to retrieve. Defaults to 100. */ @@ -3235,28 +3271,28 @@ declare namespace chrome.history { endTime?: number; } - interface Url { + export interface Url { /** The URL for the operation. It must be in the format as returned from a call to history.search. */ url: string; } - interface Range { + export interface Range { /** Items added to history before this date, represented in milliseconds since the epoch. */ endTime: number; /** Items added to history after this date, represented in milliseconds since the epoch. */ startTime: number; } - interface RemovedResult { + export interface RemovedResult { /** True if all history was removed. If true, then urls will be empty. */ allHistory: boolean; /** Optional. */ urls?: string[]; } - interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {} + export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {} - interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {} + export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {} /** * Searches the history for the last visit time of each page matching the query. @@ -3296,9 +3332,9 @@ declare namespace chrome.history { export function deleteUrl(details: Url, callback?: () => void): void; /** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */ - var onVisited: HistoryVisitedEvent; + export var onVisited: HistoryVisitedEvent; /** Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. */ - var onVisitRemoved: HistoryVisitRemovedEvent; + export var onVisitRemoved: HistoryVisitRemovedEvent; } //////////////////// @@ -3310,25 +3346,25 @@ declare namespace chrome.history { */ declare namespace chrome.i18n { /** Holds detected ISO language code and its percentage in the input string */ - interface DetectedLanguage { - /** An ISO language code such as 'en' or 'fr'. - * For a complete list of languages supported by this method, see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}. + export interface DetectedLanguage { + /** An ISO language code such as 'en' or 'fr'. + * For a complete list of languages supported by this method, see [kLanguageInfoTable]{@link https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc}. * For an unknown language, 'und' will be returned, which means that [percentage] of the text is unknown to CLD */ language: string; /** The percentage of the detected language */ - percentage: number; + percentage: number; } /** Holds detected language reliability and array of DetectedLanguage */ - interface LanguageDetectionResult { + export interface LanguageDetectionResult { /** CLD detected language reliability */ isReliable: boolean; /** Array of detectedLanguage */ languages: DetectedLanguage[]; } - + /** * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage. * @param callback The callback parameter should be a function that looks like this: @@ -3347,7 +3383,7 @@ declare namespace chrome.i18n { * @since Chrome 35. */ export function getUILanguage(): string; - + /** Detects the language of the provided text using CLD. * @param text User input string to be translated. * @param callback The callback parameter should be a function that looks like this: function(object result) {...}; @@ -3365,12 +3401,12 @@ declare namespace chrome.i18n { */ declare namespace chrome.identity { /** @since Chrome 32. */ - interface AccountInfo { + export interface AccountInfo { /** A unique identifier for the account. This ID will not change for the lifetime of the account. */ id: string; } - interface TokenDetails { + export interface TokenDetails { /** * Optional. * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required. @@ -3392,19 +3428,19 @@ declare namespace chrome.identity { scopes?: string[]; } - interface UserInfo { + export interface UserInfo { /** An email address for the user account signed into the current profile. Empty if the user is not signed in or the identity.email manifest permission is not specified. */ email: string; /** A unique identifier for the account. This ID will not change for the lifetime of the account. Empty if the user is not signed in or (in M41+) the identity.email manifest permission is not specified. */ id: string; } - interface TokenInformation { + export interface TokenInformation { /** The specific token that should be removed from the cache. */ token: string; } - interface WebAuthFlowOptions { + export interface WebAuthFlowOptions { /** The URL that initiates the auth flow. */ url: string; /** @@ -3416,7 +3452,7 @@ declare namespace chrome.identity { interactive?: boolean; } - interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> {} + export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> {} /** * Retrieves a list of AccountInfo objects describing the accounts present on the profile. @@ -3471,7 +3507,7 @@ declare namespace chrome.identity { * Fired when signin state changes for an account on the user's profile. * @since Chrome 33. */ - var onSignInChanged: SignInChangeEvent; + export var onSignInChanged: SignInChangeEvent; } //////////////////// @@ -3483,7 +3519,7 @@ declare namespace chrome.identity { * @since Chrome 6. */ declare namespace chrome.idle { - interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> {} + export interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> {} /** * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. @@ -3501,7 +3537,7 @@ declare namespace chrome.idle { export function setDetectionInterval(intervalInSeconds: number): void; /** Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. */ - var onStateChanged: IdleStateChangedEvent; + export var onStateChanged: IdleStateChangedEvent; } //////////////////// @@ -3514,7 +3550,7 @@ declare namespace chrome.idle { */ declare namespace chrome.input.ime { /** See http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent */ - interface KeyboardEvent { + export interface KeyboardEvent { /** * Optional. * Whether or not the SHIFT key is pressed. @@ -3563,7 +3599,7 @@ declare namespace chrome.input.ime { } /** Describes an input Context */ - interface InputContext { + export interface InputContext { /** This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called. */ contextID: number; /** Type of value this text field edits, (Text, Number, URL, etc) */ @@ -3589,7 +3625,7 @@ declare namespace chrome.input.ime { * A menu item used by an input method to interact with the user from the language menu. * @since Chrome 30. */ - interface MenuItem { + export interface MenuItem { /** String that will be passed to callbacks referencing this MenuItem. */ id: string; /** Optional. Text displayed in the menu for this item. */ @@ -3604,28 +3640,28 @@ declare namespace chrome.input.ime { enabled?: boolean; } - interface ImeParameters { + export interface ImeParameters { /** MenuItems to use. */ items: MenuItem[]; /** ID of the engine to use */ engineID: string; } - interface CommitTextParameters { + export interface CommitTextParameters { /** The text to commit */ text: string; /** ID of the context where the text will be committed */ contextID: number; } - interface CandidateUsage { + export interface CandidateUsage { /** The title string of details description. */ title: string; /** The body string of detail description. */ body: string; } - interface CandidateTemplate { + export interface CandidateTemplate { /** The candidate */ candidate: string; /** The candidate's id */ @@ -3652,14 +3688,14 @@ declare namespace chrome.input.ime { usage?: CandidateUsage; } - interface CandidatesParameters { + export interface CandidatesParameters { /** ID of the context that owns the candidate window. */ contextID: number; /** List of candidates to show in the candidate window */ candidates: CandidateTemplate[]; } - interface CompositionParameterSegment { + export interface CompositionParameterSegment { /** Index of the character to start this segment at */ start: number; /** Index of the character to end this segment after. */ @@ -3668,7 +3704,7 @@ declare namespace chrome.input.ime { style: string; } - interface CompositionParameters { + export interface CompositionParameters { /** ID of the context where the composition text will be set */ contextID: number; /** Text to set */ @@ -3683,12 +3719,12 @@ declare namespace chrome.input.ime { selectionEnd?: number; } - interface MenuItemParameters { + export interface MenuItemParameters { items: Object[]; engineId: string; } - interface CandidateWindowParameterProperties { + export interface CandidateWindowParameterProperties { /** * Optional. * True to show the cursor, false to hide it. @@ -3727,32 +3763,32 @@ declare namespace chrome.input.ime { windowPosition?: string; } - interface CandidateWindowParameter { + export interface CandidateWindowParameter { /** ID of the engine to set properties on. */ engineID: string; properties: CandidateWindowParameterProperties; } - interface ClearCompositionParameters { + export interface ClearCompositionParameters { /** ID of the context where the composition will be cleared */ contextID: number; } - interface CursorPositionParameters { + export interface CursorPositionParameters { /** ID of the candidate to select. */ candidateID: number; /** ID of the context that owns the candidate window. */ contextID: number; } - interface SendKeyEventParameters { + export interface SendKeyEventParameters { /** ID of the context where the key events will be sent, or zero to send key events to non-input field. */ contextID: number; /** Data on the key event. */ keyData: KeyboardEvent[]; } - interface DeleteSurroundingTextParameters { + export interface DeleteSurroundingTextParameters { /** ID of the engine receiving the event. */ engineID: string; /** ID of the context where the surrounding text will be deleted. */ @@ -3763,7 +3799,7 @@ declare namespace chrome.input.ime { length: number; } - interface SurroundingTextInfo { + export interface SurroundingTextInfo { /** The text around cursor. */ text: string; /** The ending position of the selection. This value indicates caret position if there is no selection. */ @@ -3772,25 +3808,25 @@ declare namespace chrome.input.ime { anchor: number; } - interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {} + export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {} - interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> {} + export interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> {} - interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> {} + export interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> {} - interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {} + export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {} - interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {} + export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {} - interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {} + export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {} - interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {} + export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {} - interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {} + export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {} - interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> {} + export interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> {} - interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {} + export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {} /** * Adds the provided menu items to the language menu when this IME is active. @@ -3874,31 +3910,31 @@ declare namespace chrome.input.ime { export function keyEventHandled(requestId: string, response: boolean): void; /** This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */ - var onBlur: BlurEvent; + export var onBlur: BlurEvent; /** This event is sent if this extension owns the active IME. */ - var onCandidateClicked: CandidateClickedEvent; + export var onCandidateClicked: CandidateClickedEvent; /** This event is sent if this extension owns the active IME. */ - var onKeyEvent: KeyEventEvent; + export var onKeyEvent: KeyEventEvent; /** This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events. */ - var onDeactivated: DeactivatedEvent; + export var onDeactivated: DeactivatedEvent; /** This event is sent when the properties of the current InputContext change, such as the the type. It is sent to all extensions that are listening to this event, and enabled by the user. */ - var onInputContextUpdate: InputContextUpdateEvent; + export var onInputContextUpdate: InputContextUpdateEvent; /** This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events. */ - var onActivate: ActivateEvent; + export var onActivate: ActivateEvent; /** This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */ - var onFocus: FocusEvent; + export var onFocus: FocusEvent; /** Called when the user selects a menu item */ - var onMenuItemActivated: MenuItemActivatedEvent; + export var onMenuItemActivated: MenuItemActivatedEvent; /** * Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction. * @since Chrome 27. */ - var onSurroundingTextChanged: SurroundingTextChangedEvent; + export var onSurroundingTextChanged: SurroundingTextChangedEvent; /** * This event is sent when chrome terminates ongoing text input session. * @since Chrome 29. */ - var onReset: InputResetEvent; + export var onReset: InputResetEvent; } //////////////////// @@ -3911,7 +3947,7 @@ declare namespace chrome.input.ime { */ declare namespace chrome.management { /** Information about an installed extension, app, or theme. */ - interface ExtensionInfo { + export interface ExtensionInfo { /** * Optional. * A reason the item is disabled. @@ -4007,14 +4043,14 @@ declare namespace chrome.management { } /** Information about an icon belonging to an extension, app, or theme. */ - interface IconInfo { + export interface IconInfo { /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. */ url: string; /** A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. */ size: number; } - interface UninstallOptions { + export interface UninstallOptions { /** * Optional. * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown. @@ -4022,13 +4058,13 @@ declare namespace chrome.management { showConfirmDialog?: boolean; } - interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} - interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {} + export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {} - interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} - interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} /** * Enables or disables an app or extension. @@ -4141,13 +4177,13 @@ declare namespace chrome.management { export function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void; /** Fired when an app or extension has been disabled. */ - var onDisabled: ManagementDisabledEvent; + export var onDisabled: ManagementDisabledEvent; /** Fired when an app or extension has been uninstalled. */ - var onUninstalled: ManagementUninstalledEvent; + export var onUninstalled: ManagementUninstalledEvent; /** Fired when an app or extension has been installed. */ - var onInstalled: ManagementInstalledEvent; + export var onInstalled: ManagementInstalledEvent; /** Fired when an app or extension has been enabled. */ - var onEnabled: ManagementEnabledEvent; + export var onEnabled: ManagementEnabledEvent; } //////////////////// @@ -4160,7 +4196,7 @@ declare namespace chrome.management { * @since Chrome 43. */ declare namespace chrome.networking.config { - interface NetworkInfo { + export interface NetworkInfo { /** Currently only WiFi supported. */ Type: string; /** Optional. A unique identifier of the network. */ @@ -4175,7 +4211,7 @@ declare namespace chrome.networking.config { Security?: string; } - interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {} + export interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {} /** * Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list. @@ -4200,7 +4236,7 @@ declare namespace chrome.networking.config { export function finishAuthentication(GUID: string, result: string, callback?: () => void): void; /** This event fires everytime a captive portal is detected on a network matching any of the currently registered network filters and the user consents to use the extension for authentication. Network filters may be set using the setNetworkFilter. Upon receiving this event the extension should start its authentication attempt with the captive portal. When the extension finishes its attempt, it must call finishAuthentication with the GUID received with this event and the appropriate authentication result. */ - var onCaptivePortalDetected: CaptivePorttalDetectedEvent; + export var onCaptivePortalDetected: CaptivePorttalDetectedEvent; } //////////////////// @@ -4213,19 +4249,19 @@ declare namespace chrome.networking.config { * @since Chrome 28. */ declare namespace chrome.notifications { - interface ButtonOptions { + export interface ButtonOptions { title: string; iconUrl?: string; } - interface ItemOptions { + export interface ItemOptions { /** Title of one item of a list notification. */ title: string; /** Additional details about this item. */ message: string; } - interface NotificationOptions { + export interface NotificationOptions { /** Optional. Which type of notification to display. Required for notifications.create method. */ type?: string; /** @@ -4280,15 +4316,15 @@ declare namespace chrome.notifications { requireInteraction?: boolean; } - interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> {} + export interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> {} - interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {} + export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {} - interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> {} + export interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> {} - interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> {} + export interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> {} - interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> {} + export interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> {} /** The notification closed, either by the system or by user action. */ export var onClosed: NotificationClosedEvent; @@ -4376,25 +4412,25 @@ declare namespace chrome.notifications { */ declare namespace chrome.omnibox { /** A suggest result. */ - interface SuggestResult { + export interface SuggestResult { /** The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry. */ content: string; /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 */ description: string; } - interface Suggestion { + export interface Suggestion { /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. */ description: string; } - interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> {} + export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> {} - interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> {} + export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> {} - interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {} + export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {} - interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {} + export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {} /** * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar. @@ -4403,13 +4439,13 @@ declare namespace chrome.omnibox { export function setDefaultSuggestion(suggestion: Suggestion): void; /** User has accepted what is typed into the omnibox. */ - var onInputEntered: OmniboxInputEnteredEvent; + export var onInputEntered: OmniboxInputEnteredEvent; /** User has changed what is typed into the omnibox. */ - var onInputChanged: OmniboxInputChangedEvent; + export var onInputChanged: OmniboxInputChangedEvent; /** User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events. */ - var onInputStarted: OmniboxInputStartedEvent; + export var onInputStarted: OmniboxInputStartedEvent; /** User has ended the keyword input session without accepting the input. */ - var onInputCancelled: OmniboxInputCancelledEvent; + export var onInputCancelled: OmniboxInputCancelledEvent; } //////////////////// @@ -4421,28 +4457,28 @@ declare namespace chrome.omnibox { * @since Chrome 5. */ declare namespace chrome.pageAction { - interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + export interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} - interface TitleDetails { + export interface TitleDetails { /** The id of the tab for which you want to modify the page action. */ tabId: number; /** The tooltip string. */ title: string; } - interface GetDetails { + export interface GetDetails { /** Specify the tab to get the title from. */ tabId: number; } - interface PopupDetails { + export interface PopupDetails { /** The id of the tab for which you want to modify the page action. */ tabId: number; /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ popup: string; } - interface IconDetails { + export interface IconDetails { /** The id of the tab for which you want to modify the page action. */ tabId: number; /** @@ -4454,7 +4490,7 @@ declare namespace chrome.pageAction { * Optional. * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */ - imageData?: ImageData; + imageData?: ImageData | { [index: number]: ImageData }; /** * Optional. * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' @@ -4498,7 +4534,7 @@ declare namespace chrome.pageAction { export function setIcon(details: IconDetails, callback?: () => void): void; /** Fired when a page action icon is clicked. This event will not fire if the page action has a popup. */ - var onClicked: PageActionClickedEvent; + export var onClicked: PageActionClickedEvent; } //////////////////// @@ -4510,7 +4546,7 @@ declare namespace chrome.pageAction { * @since Chrome 18. */ declare namespace chrome.pageCapture { - interface SaveDetails { + export interface SaveDetails { /** The id of the tab to save as MHTML. */ tabId: number; } @@ -4533,7 +4569,7 @@ declare namespace chrome.pageCapture { * @since Chrome 16. */ declare namespace chrome.permissions { - interface Permissions { + export interface Permissions { /** * Optional. * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest. @@ -4546,7 +4582,7 @@ declare namespace chrome.permissions { permissions?: string[]; } - interface PermissionsRemovedEvent { + export interface PermissionsRemovedEvent { /** * @param callback The callback parameter should be a function that looks like this: * function( Permissions permissions) {...}; @@ -4555,7 +4591,7 @@ declare namespace chrome.permissions { addListener(callback: (permissions: Permissions) => void): void; } - interface PermissionsAddedEvent { + export interface PermissionsAddedEvent { /** * @param callback The callback parameter should be a function that looks like this: * function( Permissions permissions) {...}; @@ -4594,9 +4630,9 @@ declare namespace chrome.permissions { export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; /** Fired when access to permissions has been removed from the extension. */ - var onRemoved: PermissionsRemovedEvent; + export var onRemoved: PermissionsRemovedEvent; /** Fired when the extension acquires new permissions. */ - var onAdded: PermissionsAddedEvent; + export var onAdded: PermissionsAddedEvent; } //////////////////// @@ -4609,21 +4645,21 @@ declare namespace chrome.permissions { * @since Chrome 45. */ declare namespace chrome.platformKeys { - interface Match { + export interface Match { /** The DER encoding of a X.509 certificate. */ certificate: ArrayBuffer; /** The KeyAlgorithm of the certified key. This contains algorithm parameters that are inherent to the key of the certificate (e.g. the key length). Other parameters like the hash function used by the sign function are not included. */ keyAlgorithm: KeyAlgorithm; } - interface ClientCertificateSelectRequestDetails { + export interface ClientCertificateSelectRequestDetails { /** This field is a list of the types of certificates requested, sorted in order of the server's preference. Only certificates of a type contained in this list will be retrieved. If certificateTypes is the empty list, however, certificates of any type will be returned. */ certificateTypes: string[]; /** List of distinguished names of certificate authorities allowed by the server. Each entry must be a DER-encoded X.509 DistinguishedName. */ certificateAuthorities: ArrayBuffer[]; } - interface ClientCertificateSelectDetails { + export interface ClientCertificateSelectDetails { /** Only certificates that match this request will be returned. */ request: ClientCertificateSelectRequestDetails; /** @@ -4635,14 +4671,14 @@ declare namespace chrome.platformKeys { interactive: boolean; } - interface ServerCertificateVerificationDetails { + export interface ServerCertificateVerificationDetails { /** Each chain entry must be the DER encoding of a X.509 certificate, the first entry must be the server certificate and each entry must certify the entry preceding it. */ serverCertificateChain: ArrayBuffer[]; /** The hostname of the server to verify the certificate for, e.g. the server that presented the serverCertificateChain. */ hostname: string; } - interface ServerCertificateVerificationResult { + export interface ServerCertificateVerificationResult { /** The result of the trust verification: true if trust for the given verification details could be established and false if trust is rejected for any reason. */ trusted: boolean; /** @@ -4703,7 +4739,7 @@ declare namespace chrome.power { * @since Chrome 44. */ declare namespace chrome.printerProvider { - interface PrinterInfo { + export interface PrinterInfo { /** Unique printer ID. */ id: string; /** Printer's human readable name. */ @@ -4712,12 +4748,12 @@ declare namespace chrome.printerProvider { description?: string; } - interface PrinterCapabilities { + export interface PrinterCapabilities { /** Device capabilities in CDD format. */ capabilities: any; } - interface PrintJob { + export interface PrintJob { /** ID of the printer which should handle the job. */ printerId: string; /** The print job title. */ @@ -4730,13 +4766,13 @@ declare namespace chrome.printerProvider { document: Blob; } - interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> {} + export interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> {} - interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> {} + export interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> {} - interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> {} + export interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> {} - interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> {} + export interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> {} /** Event fired when print manager requests printers provided by extensions. */ export var onGetPrintersRequested: PrinterRequestedEvent; @@ -4762,7 +4798,7 @@ declare namespace chrome.printerProvider { * @since Chrome 18. */ declare namespace chrome.privacy { - interface Services { + export interface Services { /** since Chrome 20. */ spellingServiceEnabled: chrome.types.ChromeSetting; searchSuggestEnabled: chrome.types.ChromeSetting; @@ -4779,7 +4815,7 @@ declare namespace chrome.privacy { safeBrowsingExtendedReportingEnabled: chrome.types.ChromeSetting; } - interface Network { + export interface Network { networkPredictionEnabled: chrome.types.ChromeSetting; /** @since Chrome 42. */ webRTCMultipleRoutesEnabled: chrome.types.ChromeSetting; @@ -4787,7 +4823,7 @@ declare namespace chrome.privacy { webRTCNonProxiedUdpEnabled: chrome.types.ChromeSetting; } - interface Websites { + export interface Websites { thirdPartyCookiesAllowed: chrome.types.ChromeSetting; referrersEnabled: chrome.types.ChromeSetting; hyperlinkAuditingEnabled: chrome.types.ChromeSetting; @@ -4796,11 +4832,11 @@ declare namespace chrome.privacy { } /** Settings that enable or disable features that require third-party network services provided by Google and your default search provider. */ - var services: Services; + export var services: Services; /** Settings that influence Chrome's handling of network connections in general. */ - var network: Network; + export var network: Network; /** Settings that determine what information Chrome makes available to websites. */ - var websites: Websites; + export var websites: Websites; } //////////////////// @@ -4813,7 +4849,7 @@ declare namespace chrome.privacy { */ declare namespace chrome.proxy { /** An object holding proxy auto-config information. Exactly one of the fields should be non-empty. */ - interface PacScript { + export interface PacScript { /** Optional. URL of the PAC file to be used. */ url?: string; /** Optional. If true, an invalid PAC script will prevent the network stack from falling back to direct connections. Defaults to false. */ @@ -4823,7 +4859,7 @@ declare namespace chrome.proxy { } /** An object encapsulating a complete proxy configuration. */ - interface ProxyConfig { + export interface ProxyConfig { /** Optional. The proxy rules describing this configuration. Use this for 'fixed_servers' mode. */ rules?: ProxyRules; /** Optional. The proxy auto-config (PAC) script for this configuration. Use this for 'pac_script' mode. */ @@ -4839,7 +4875,7 @@ declare namespace chrome.proxy { } /** An object encapsulating a single proxy server's specification. */ - interface ProxyServer { + export interface ProxyServer { /** The URI of the proxy server. This must be an ASCII hostname (in Punycode format). IDNA is not supported, yet. */ host: string; /** Optional. The scheme (protocol) of the proxy server itself. Defaults to 'http'. */ @@ -4849,7 +4885,7 @@ declare namespace chrome.proxy { } /** An object encapsulating the set of proxy rules for all protocols. Use either 'singleProxy' or (a subset of) 'proxyForHttp', 'proxyForHttps', 'proxyForFtp' and 'fallbackProxy'. */ - interface ProxyRules { + export interface ProxyRules { /** Optional. The proxy server to be used for FTP requests. */ proxyForFtp?: ProxyServer; /** Optional. The proxy server to be used for HTTP requests. */ @@ -4864,7 +4900,7 @@ declare namespace chrome.proxy { bypassList?: string[]; } - interface ErrorDetails { + export interface ErrorDetails { /** Additional details about the error such as a JavaScript runtime error. */ details: string; /** The error description. */ @@ -4873,11 +4909,11 @@ declare namespace chrome.proxy { fatal: boolean; } - interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {} + export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {} - var settings: chrome.types.ChromeSetting; + export var settings: chrome.types.ChromeSetting; /** Notifies about proxy errors. */ - var onProxyError: ProxyErrorEvent; + export var onProxyError: ProxyErrorEvent; } //////////////////// @@ -4889,20 +4925,20 @@ declare namespace chrome.proxy { */ declare namespace chrome.runtime { /** This will be defined during an API method callback if there was an error */ - var lastError: LastError | undefined; + export var lastError: LastError | undefined; /** The ID of the extension/app. */ - var id: string; + export var id: string; - interface LastError { + export interface LastError { /** Optional. Details about the error which occurred. */ message?: string; } - interface ConnectInfo { + export interface ConnectInfo { name?: string; } - interface InstalledDetails { + export interface InstalledDetails { /** * The reason that this event is being dispatched. * One of: "install", "update", "chrome_update", or "shared_module_update" @@ -4921,7 +4957,7 @@ declare namespace chrome.runtime { id?: string; } - interface MessageOptions { + export interface MessageOptions { /** Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event. */ includeTlsChannelId?: boolean; } @@ -4930,7 +4966,7 @@ declare namespace chrome.runtime { * An object containing information about the script context that sent a message or request. * @since Chrome 26. */ - interface MessageSender { + export interface MessageSender { /** The ID of the extension or app that opened the connection, if any. */ id?: string; /** The tabs.Tab which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app. */ @@ -4956,7 +4992,7 @@ declare namespace chrome.runtime { * An object containing information about the current platform. * @since Chrome 36. */ - interface PlatformInfo { + export interface PlatformInfo { /** * The operating system chrome is running on. * One of: "mac", "win", "android", "cros", "linux", or "openbsd" @@ -4978,7 +5014,7 @@ declare namespace chrome.runtime { * An object which allows two way communication with other pages. * @since Chrome 26. */ - interface Port { + export interface Port { postMessage: (message: Object) => void; disconnect: () => void; /** @@ -4993,43 +5029,43 @@ declare namespace chrome.runtime { name: string; } - interface UpdateAvailableDetails { + export interface UpdateAvailableDetails { /** The version number of the available update. */ version: string; } - interface UpdateCheckDetails { + export interface UpdateCheckDetails { /** The version of the available update. */ version: string; } - interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> {} + export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> {} - interface PortMessageEvent extends chrome.events.Event<(message: Object, port: Port) => void> {} + export interface PortMessageEvent extends chrome.events.Event<(message: Object, port: Port) => void> {} - interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> {} + export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> {} - interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> {} + export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> {} - interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> {} + export interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> {} - interface RuntimeEvent extends chrome.events.Event<() => void> {} + export interface RuntimeEvent extends chrome.events.Event<() => void> {} - interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> {} + export interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> {} - interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> {} + export interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> {} - interface ManifestIcons { + export interface ManifestIcons { [size: number]: string; } - interface ManifestAction { + export interface ManifestAction { default_icon?: ManifestIcons; default_title?: string; default_popup?: string; } - interface SearchProvider { + export interface SearchProvider { name?: string; keyword?: string; favicon_url?: string; @@ -5047,7 +5083,7 @@ declare namespace chrome.runtime { is_default?: boolean; } - interface Manifest { + export interface Manifest { // Required manifest_version: number; name: string; @@ -5124,7 +5160,7 @@ declare namespace chrome.runtime { actions?: { type: string; }[]; - conditions?: chrome.declarativeContent.PageStateMatcher[] + conditions?: chrome.declarativeContent.PageStateMatcherProperties[] }[]; externally_connectable?: { ids?: string[]; @@ -5344,74 +5380,74 @@ declare namespace chrome.runtime { * Fired when a connection is made from either an extension process or a content script. * @since Chrome 26. */ - var onConnect: ExtensionConnectEvent; + export var onConnect: ExtensionConnectEvent; /** * Fired when a connection is made from another extension. * @since Chrome 26. */ - var onConnectExternal: ExtensionConnectEvent; + export var onConnectExternal: ExtensionConnectEvent; /** Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. */ - var onSuspend: RuntimeEvent; + export var onSuspend: RuntimeEvent; /** * Fired when a profile that has this extension installed first starts up. This event is not fired when an incognito profile is started, even if this extension is operating in 'split' incognito mode. * @since Chrome 23. */ - var onStartup: RuntimeEvent; + export var onStartup: RuntimeEvent; /** Fired when the extension is first installed, when the extension is updated to a new version, and when Chrome is updated to a new version. */ - var onInstalled: RuntimeInstalledEvent; + export var onInstalled: RuntimeInstalledEvent; /** Sent after onSuspend to indicate that the app won't be unloaded after all. */ - var onSuspendCanceled: RuntimeEvent; + export var onSuspendCanceled: RuntimeEvent; /** * Fired when a message is sent from either an extension process or a content script. * @since Chrome 26. */ - var onMessage: ExtensionMessageEvent; + export var onMessage: ExtensionMessageEvent; /** * Fired when a message is sent from another extension/app. Cannot be used in a content script. * @since Chrome 26. */ - var onMessageExternal: ExtensionMessageEvent; + export var onMessageExternal: ExtensionMessageEvent; /** * Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps. * @since Chrome 29. */ - var onRestartRequired: RuntimeRestartRequiredEvent; + export var onRestartRequired: RuntimeRestartRequiredEvent; /** * Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call chrome.runtime.reload(). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call chrome.runtime.reload() manually in response to this event the update will not get installed until the next time chrome itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if chrome.runtime.reload() is called in response to this event. * @since Chrome 25. */ - var onUpdateAvailable: RuntimeUpdateAvailableEvent; + export var onUpdateAvailable: RuntimeUpdateAvailableEvent; /** * @deprecated since Chrome 33. Please use chrome.runtime.onRestartRequired. * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required. */ - var onBrowserUpdateAvailable: RuntimeEvent; + export var onBrowserUpdateAvailable: RuntimeEvent; } //////////////////// // Script Badge //////////////////// declare namespace chrome.scriptBadge { - interface GetPopupDetails { + export interface GetPopupDetails { tabId: number; } - interface AttentionDetails { + export interface AttentionDetails { tabId: number; } - interface SetPopupDetails { + export interface SetPopupDetails { tabId: number; popup: string; } - interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + export interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} export function getPopup(details: GetPopupDetails, callback: Function): void; export function getAttention(details: AttentionDetails): void; export function setPopup(details: SetPopupDetails): void; - var onClicked: ScriptBadgeClickedEvent; + export var onClicked: ScriptBadgeClickedEvent; } //////////////////// @@ -5423,7 +5459,7 @@ declare namespace chrome.scriptBadge { * @since Chrome 37. */ declare namespace chrome.sessions { - interface Filter { + export interface Filter { /** * Optional. * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS). @@ -5431,7 +5467,7 @@ declare namespace chrome.sessions { maxResults?: number; } - interface Session { + export interface Session { /** The time when the window or tab was closed or modified, represented in milliseconds since the epoch. */ lastModified: number; /** @@ -5446,14 +5482,14 @@ declare namespace chrome.sessions { window?: windows.Window; } - interface Device { + export interface Device { /** The name of the foreign device. */ deviceName: string; /** A list of open window sessions for the foreign device, sorted from most recently to least recently modified session. */ sessions: Session[]; } - interface SessionChangedEvent extends chrome.events.Event<() => void> {} + export interface SessionChangedEvent extends chrome.events.Event<() => void> {} /** The maximum number of sessions.Session that will be included in a requested list. */ export var MAX_SESSION_RESULTS: number; @@ -5504,7 +5540,7 @@ declare namespace chrome.sessions { * @since Chrome 20. */ declare namespace chrome.storage { - interface StorageArea { + export interface StorageArea { /** * Gets the amount of space (in bytes) being used by one or more items. * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). @@ -5533,19 +5569,12 @@ declare namespace chrome.storage { */ set(items: Object, callback?: () => void): void; /** - * Removes one item from storage. - * @param key A single key for items to remove. + * Removes one or more items from storage. + * @param A single key or a list of keys for items to remove. * @param callback Optional. * Callback on success, or on failure (in which case runtime.lastError will be set). */ - remove(key: string, callback?: () => void): void; - /** - * Removes items from storage. - * @param keys A list of keys for items to remove. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ - remove(keys: string[], callback?: () => void): void; + remove(keys: string | string[], callback?: () => void): void; /** * Gets one or more items from storage. * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). @@ -5562,19 +5591,19 @@ declare namespace chrome.storage { get(keys: string | string[] | Object | null, callback: (items: { [key: string]: any }) => void): void; } - interface StorageChange { + export interface StorageChange { /** Optional. The new value of the item, if there is a new value. */ newValue?: any; /** Optional. The old value of the item, if there was an old value. */ oldValue?: any; } - interface LocalStorageArea extends StorageArea { + export interface LocalStorageArea extends StorageArea { /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ QUOTA_BYTES: number; } - interface SyncStorageArea extends StorageArea { + export interface SyncStorageArea extends StorageArea { /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ @@ -5596,53 +5625,53 @@ declare namespace chrome.storage { MAX_WRITE_OPERATIONS_PER_MINUTE: number; } - interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> {} + export interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> {} /** Items in the local storage area are local to each machine. */ - var local: LocalStorageArea; + export var local: LocalStorageArea; /** Items in the sync storage area are synced using Chrome Sync. */ - var sync: SyncStorageArea; + export var sync: SyncStorageArea; /** * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. * @since Chrome 33. */ - var managed: StorageArea; + export var managed: StorageArea; /** Fired when one or more items change. */ - var onChanged: StorageChangedEvent; + export var onChanged: StorageChangedEvent; } //////////////////// // Socket //////////////////// declare namespace chrome.socket { - interface CreateInfo { + export interface CreateInfo { socketId: number; } - interface AcceptInfo { + export interface AcceptInfo { resultCode: number; socketId?: number; } - interface ReadInfo { + export interface ReadInfo { resultCode: number; data: ArrayBuffer; } - interface WriteInfo { + export interface WriteInfo { bytesWritten: number; } - interface RecvFromInfo { + export interface RecvFromInfo { resultCode: number; data: ArrayBuffer; port: number; address: string; } - interface SocketInfo { + export interface SocketInfo { socketType: string; localPort?: number; peerAddress?: string; @@ -5651,7 +5680,7 @@ declare namespace chrome.socket { connected: boolean; } - interface NetworkInterface { + export interface NetworkInterface { name: string; address: string; } @@ -5682,7 +5711,7 @@ declare namespace chrome.socket { * @since Chrome 32. */ declare namespace chrome.system.cpu { - interface ProcessorUsage { + export interface ProcessorUsage { /** The cumulative time used by userspace programs on this processor. */ user: number; /** The cumulative time used by kernel programs on this processor. */ @@ -5693,12 +5722,12 @@ declare namespace chrome.system.cpu { total: number; } - interface ProcessorInfo { + export interface ProcessorInfo { /** Cumulative usage info for this logical processor. */ usage: ProcessorUsage; } - interface CpuInfo { + export interface CpuInfo { /** The number of logical processors. */ numOfProcessors: number; /** The architecture name of the processors. */ @@ -5727,7 +5756,7 @@ declare namespace chrome.system.cpu { * @since Chrome 32. */ declare namespace chrome.system.memory { - interface MemoryInfo { + export interface MemoryInfo { /** The total amount of physical memory capacity, in bytes. */ capacity: number; /** The amount of available capacity, in bytes. */ @@ -5747,7 +5776,7 @@ declare namespace chrome.system.memory { * @since Chrome 30. */ declare namespace chrome.system.storage { - interface StorageUnitInfo { + export interface StorageUnitInfo { /** The transient ID that uniquely identifies the storage device. This ID will be persistent within the same run of a single application. It will not be a persistent identifier between different runs of an application, or between different applications. */ id: string; /** The name of the storage unit. */ @@ -5763,16 +5792,16 @@ declare namespace chrome.system.storage { capacity: number; } - interface StorageCapacityInfo { + export interface StorageCapacityInfo { /** A copied |id| of getAvailableCapacity function parameter |id|. */ id: string; /** The available capacity of the storage device, in bytes. */ availableCapacity: number; } - interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {} + export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {} - interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {} + export interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {} /** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */ export function getInfo(callback: (info: StorageUnitInfo[]) => void): void; @@ -5803,7 +5832,7 @@ declare namespace chrome.system.storage { * @since Chrome 31. */ declare namespace chrome.tabCapture { - interface CaptureInfo { + export interface CaptureInfo { /** The id of the tab whose status changed. */ tabId: number; /** @@ -5815,7 +5844,7 @@ declare namespace chrome.tabCapture { fullscreen: boolean; } - interface CaptureOptions { + export interface CaptureOptions { /** Optional. */ audio?: boolean; /** Optional. */ @@ -5826,7 +5855,7 @@ declare namespace chrome.tabCapture { videoConstraints?: MediaStreamConstraints; } - interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {} + export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {} /** * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension. @@ -5841,7 +5870,7 @@ declare namespace chrome.tabCapture { export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void; /** Event fired when the capture status of a tab changes. This allows extension authors to keep track of the capture status of tabs to keep UI elements like page actions in sync. */ - var onStatusChanged: CaptureStatusChangedEvent; + export var onStatusChanged: CaptureStatusChangedEvent; } //////////////////// @@ -5857,7 +5886,7 @@ declare namespace chrome.tabs { * Tab muted state and the reason for the last state change. * @since Chrome 46. Warning: this is the current Beta channel. */ - interface MutedInfo { + export interface MutedInfo { /** Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing. */ muted: boolean; /** @@ -5875,7 +5904,7 @@ declare namespace chrome.tabs { extensionId?: string; } - interface Tab { + export interface Tab { /** * Optional. * Either loading or complete. @@ -5966,7 +5995,7 @@ declare namespace chrome.tabs { * Defines how zoom changes in a tab are handled and at what scope. * @since Chrome 38. */ - interface ZoomSettings { + export interface ZoomSettings { /** * Optional. * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to "automatic". @@ -5990,7 +6019,7 @@ declare namespace chrome.tabs { defaultZoomFactor?: number; } - interface InjectDetails { + export interface InjectDetails { /** * Optional. * If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame. @@ -6023,7 +6052,7 @@ declare namespace chrome.tabs { matchAboutBlank?: boolean; } - interface CreateProperties { + export interface CreateProperties { /** Optional. The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window. */ index?: number; /** @@ -6057,14 +6086,14 @@ declare namespace chrome.tabs { selected?: boolean; } - interface MoveProperties { + export interface MoveProperties { /** The position to move the window to. -1 will place the tab at the end of the window. */ index: number; /** Optional. Defaults to the window the tab is currently in. */ windowId?: number; } - interface UpdateProperties { + export interface UpdateProperties { /** * Optional. Whether the tab should be pinned. * @since Chrome 9. @@ -6099,7 +6128,7 @@ declare namespace chrome.tabs { muted?: boolean; } - interface CaptureVisibleTabOptions { + export interface CaptureVisibleTabOptions { /** * Optional. * When format is "jpeg", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease. @@ -6112,12 +6141,12 @@ declare namespace chrome.tabs { format?: string; } - interface ReloadProperties { + export interface ReloadProperties { /** Optional. Whether using any local cache. Default is false. */ bypassCache?: boolean; } - interface ConnectInfo { + export interface ConnectInfo { /** Optional. Will be passed into onConnect for content scripts that are listening for the connection event. */ name?: string; /** @@ -6127,19 +6156,19 @@ declare namespace chrome.tabs { frameId?: number; } - interface MessageSendOptions { + export interface MessageSendOptions { /** Optional. Send a message to a specific frame identified by frameId instead of all frames in the tab. */ frameId?: number; } - interface HighlightInfo { + export interface HighlightInfo { /** One or more tab indices to highlight. */ tabs: number | number[]; /** Optional. The window that contains the tabs. */ windowId?: number; } - interface QueryInfo { + export interface QueryInfo { /** * Optional. Whether the tabs have completed loading. * One of: "loading", or "complete" @@ -6189,12 +6218,12 @@ declare namespace chrome.tabs { muted?: boolean; } - interface TabHighlightInfo { + export interface TabHighlightInfo { windowId: number; tabIds: number[]; } - interface TabRemoveInfo { + export interface TabRemoveInfo { /** * The window whose tab is closed. * @since Chrome 25. @@ -6204,12 +6233,12 @@ declare namespace chrome.tabs { isWindowClosing: boolean; } - interface TabAttachInfo { + export interface TabAttachInfo { newPosition: number; newWindowId: number; } - interface TabChangeInfo { + export interface TabChangeInfo { /** Optional. The status of the tab. Can be either loading or complete. */ status?: string; /** @@ -6241,57 +6270,57 @@ declare namespace chrome.tabs { title?: string; } - interface TabMoveInfo { + export interface TabMoveInfo { toIndex: number; windowId: number; fromIndex: number; } - interface TabDetachInfo { + export interface TabDetachInfo { oldWindowId: number; oldPosition: number; } - interface TabActiveInfo { + export interface TabActiveInfo { /** The ID of the tab that has become active. */ tabId: number; /** The ID of the window the active tab changed inside of. */ windowId: number; } - interface TabWindowInfo { + export interface TabWindowInfo { /** The ID of the window of where the tab is located. */ windowId: number; } - interface ZoomChangeInfo { + export interface ZoomChangeInfo { tabId: number; oldZoomFactor: number; newZoomFactor: number; zoomSettings: ZoomSettings; } - interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> {} + export interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> {} - interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> {} + export interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> {} - interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> {} + export interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> {} - interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> {} + export interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> {} - interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> {} + export interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> {} - interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> {} + export interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> {} - interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> {} + export interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> {} - interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> {} + export interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> {} - interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> {} + export interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> {} - interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> {} + export interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> {} - interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {} + export interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {} /** * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. @@ -6553,57 +6582,57 @@ declare namespace chrome.tabs { * Fired when the highlighted or selected tabs in a window changes. * @since Chrome 18. */ - var onHighlighted: TabHighlightedEvent; + export var onHighlighted: TabHighlightedEvent; /** Fired when a tab is closed. */ - var onRemoved: TabRemovedEvent; + export var onRemoved: TabRemovedEvent; /** Fired when a tab is updated. */ - var onUpdated: TabUpdatedEvent; + export var onUpdated: TabUpdatedEvent; /** Fired when a tab is attached to a window, for example because it was moved between windows. */ - var onAttached: TabAttachedEvent; + export var onAttached: TabAttachedEvent; /** * Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see tabs.onDetached. */ - var onMoved: TabMovedEvent; + export var onMoved: TabMovedEvent; /** Fired when a tab is detached from a window, for example because it is being moved between windows. */ - var onDetached: TabDetachedEvent; + export var onDetached: TabDetachedEvent; /** Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. */ - var onCreated: TabCreatedEvent; + export var onCreated: TabCreatedEvent; /** * Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. * @since Chrome 18. */ - var onActivated: TabActivatedEvent; + export var onActivated: TabActivatedEvent; /** * Fired when a tab is replaced with another tab due to prerendering or instant. * @since Chrome 26. */ - var onReplaced: TabReplacedEvent; + export var onReplaced: TabReplacedEvent; /** * @deprecated since Chrome 33. Please use tabs.onActivated. * Fires when the selected tab in a window changes. */ - var onSelectionChanged: TabSelectedEvent; + export var onSelectionChanged: TabSelectedEvent; /** * @deprecated since Chrome 33. Please use tabs.onActivated. * Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to tabs.onUpdated events to be notified when a URL is set. */ - var onActiveChanged: TabSelectedEvent; + export var onActiveChanged: TabSelectedEvent; /** * @deprecated since Chrome 33. Please use tabs.onHighlighted. * Fired when the highlighted or selected tabs in a window changes. */ - var onHighlightChanged: TabHighlightedEvent; + export var onHighlightChanged: TabHighlightedEvent; /** * Fired when a tab is zoomed. * @since Chrome 38. */ - var onZoomChange: TabZoomChangeEvent; - + export var onZoomChange: TabZoomChangeEvent; + /** * An ID which represents the absence of a browser tab. * @since Chrome 46. */ - var TAB_ID_NONE: -1; + export var TAB_ID_NONE: -1; } //////////////////// @@ -6616,7 +6645,7 @@ declare namespace chrome.tabs { */ declare namespace chrome.topSites { /** An object encapsulating a most visited URL, such as the URLs on the new tab page. */ - interface MostVisitedURL { + export interface MostVisitedURL { /** The most visited URL. */ url: string; /** The title of the page */ @@ -6637,7 +6666,7 @@ declare namespace chrome.topSites { */ declare namespace chrome.tts { /** An event from the TTS engine to communicate the status of an utterance. */ - interface TtsEvent { + export interface TtsEvent { /** Optional. The index of the current character in the utterance. */ charIndex?: number; /** Optional. The error description, if the event type is 'error'. */ @@ -6650,7 +6679,7 @@ declare namespace chrome.tts { } /** A description of a voice available for speech synthesis. */ - interface TtsVoice { + export interface TtsVoice { /** Optional. The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ lang?: string; /** @@ -6671,7 +6700,7 @@ declare namespace chrome.tts { remote?: boolean; } - interface SpeakOptions { + export interface SpeakOptions { /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ volume?: number; /** @@ -6751,7 +6780,7 @@ declare namespace chrome.tts { * @since Chrome 14. */ declare namespace chrome.ttsEngine { - interface SpeakOptions { + export interface SpeakOptions { /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ lang?: string; /** Optional. The name of the voice to use for synthesis. */ @@ -6772,22 +6801,22 @@ declare namespace chrome.ttsEngine { pitch?: number; } - interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> {} + export interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> {} /** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */ - var onSpeak: TtsEngineSpeakEvent; + export var onSpeak: TtsEngineSpeakEvent; /** Fired when a call is made to tts.stop and this extension may be in the middle of speaking. If an extension receives a call to onStop and speech is already stopped, it should do nothing (not raise an error). If speech is in the paused state, this should cancel the paused state. */ - var onStop: chrome.events.Event<() => void>; + export var onStop: chrome.events.Event<() => void>; /** * Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state. * @since Chrome 29. */ - var onPause: chrome.events.Event<() => void>; + export var onPause: chrome.events.Event<() => void>; /** * Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state. * @since Chrome 29. */ - var onResume: chrome.events.Event<() => void>; + export var onResume: chrome.events.Event<() => void>; } //////////////////// @@ -6798,7 +6827,7 @@ declare namespace chrome.ttsEngine { * @since Chrome 13. */ declare namespace chrome.types { - interface ChromeSettingClearDetails { + export interface ChromeSettingClearDetails { /** * Optional. * The scope of the ChromeSetting. One of @@ -6810,7 +6839,7 @@ declare namespace chrome.types { scope?: string; } - interface ChromeSettingSetDetails extends ChromeSettingClearDetails { + export interface ChromeSettingSetDetails extends ChromeSettingClearDetails { /** * The value of the setting. * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. @@ -6827,7 +6856,7 @@ declare namespace chrome.types { scope?: string; } - interface ChromeSettingGetDetails { + export interface ChromeSettingGetDetails { /** Optional. Whether to return the value that applies to the incognito session (default false). */ incognito?: boolean; } @@ -6835,9 +6864,9 @@ declare namespace chrome.types { /** * @param details Details of the currently effective value. */ - type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; + export type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; - interface ChromeSettingGetResultDetails { + export interface ChromeSettingGetResultDetails { /** * One of * • not_controllable: cannot be controlled by any extension @@ -6856,10 +6885,10 @@ declare namespace chrome.types { incognitoSpecific?: boolean; } - interface ChromeSettingChangedEvent extends chrome.events.Event {} + export interface ChromeSettingChangedEvent extends chrome.events.Event {} /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */ - interface ChromeSetting { + export interface ChromeSetting { /** * Sets the value of a setting. * @param details Which setting to change. @@ -6892,7 +6921,7 @@ declare namespace chrome.types { * @since Chrome 43. */ declare namespace chrome.vpnProvider { - interface VpnSessionParameters { + export interface VpnSessionParameters { /** IP address for the VPN interface in CIDR notation. IPv4 is currently the only supported mode. */ address: string; /** Optional. Broadcast address for the VPN interface. (default: deduced from IP address and mask) */ @@ -6913,15 +6942,15 @@ declare namespace chrome.vpnProvider { dnsServer: string[]; } - interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> {} + export interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> {} - interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> {} + export interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> {} - interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> {} + export interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> {} - interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> {} + export interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> {} - interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {} + export interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {} /** * Creates a new VPN configuration that persists across multiple login sessions of the user. @@ -6958,15 +6987,15 @@ declare namespace chrome.vpnProvider { export function notifyConnectionStateChanged(state: string, callback?: Function): void; /** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */ - var onPlatformMessage: VpnPlatformMessageEvent; + export var onPlatformMessage: VpnPlatformMessageEvent; /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */ - var onPacketReceived: VpnPacketReceptionEvent; + export var onPacketReceived: VpnPacketReceptionEvent; /** Triggered when a configuration created by the extension is removed by the platform. */ - var onConfigRemoved: VpnConfigRemovalEvent; + export var onConfigRemoved: VpnConfigRemovalEvent; /** Triggered when a configuration is created by the platform for the extension. */ - var onConfigCreated: VpnConfigCreationEvent; + export var onConfigCreated: VpnConfigCreationEvent; /** Triggered when there is a UI event for the extension. UI events are signals from the platform that indicate to the app that a UI dialog needs to be shown to the user. */ - var onUIEvent: VpnUiEvent; + export var onUIEvent: VpnUiEvent; } //////////////////// @@ -6979,7 +7008,7 @@ declare namespace chrome.vpnProvider { * @since Chrome 43. */ declare namespace chrome.wallpaper { - interface WallpaperDetails { + export interface WallpaperDetails { /** Optional. The jpeg or png encoded wallpaper image. */ data?: any; /** Optional. The URL of the wallpaper to be set. */ @@ -7012,19 +7041,20 @@ declare namespace chrome.wallpaper { * @since Chrome 16. */ declare namespace chrome.webNavigation { - interface GetFrameDetails { + export interface GetFrameDetails { /** * The ID of the process runs the renderer for this tab. * @since Chrome 22. + * @deprecated since Chrome 49. Frames are now uniquely identified by their tab ID and frame ID; the process ID is no longer needed and therefore ignored. */ - processId: number; + processId?: number; /** The ID of the tab in which the frame is. */ tabId: number; /** The ID of the frame in the given tab. */ frameId: number; } - interface GetFrameResultDetails { + export interface GetFrameResultDetails { /** The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists. */ url: string; /** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */ @@ -7033,35 +7063,35 @@ declare namespace chrome.webNavigation { parentFrameId: number; } - interface GetAllFrameDetails { + export interface GetAllFrameDetails { /** The ID of the tab. */ tabId: number; } - interface GetAllFrameResultDetails extends GetFrameResultDetails { + export interface GetAllFrameResultDetails extends GetFrameResultDetails { /** The ID of the process runs the renderer for this tab. */ processId: number; /** The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. */ frameId: number; } - interface WebNavigationCallbackDetails { + export interface WebNavigationCallbackDetails { /** The ID of the tab in which the navigation is about to occur. */ tabId: number; /** The time when the browser was about to start the navigation, in milliseconds since the epoch. */ timeStamp: number; } - interface WebNavigationUrlCallbackDetails extends WebNavigationCallbackDetails { + export interface WebNavigationUrlCallbackDetails extends WebNavigationCallbackDetails { url: string; } - interface WebNavigationReplacementCallbackDetails extends WebNavigationCallbackDetails { + export interface WebNavigationReplacementCallbackDetails extends WebNavigationCallbackDetails { /** The ID of the tab that was replaced. */ replacedTabId: number; } - interface WebNavigationFramedCallbackDetails extends WebNavigationUrlCallbackDetails { + export interface WebNavigationFramedCallbackDetails extends WebNavigationUrlCallbackDetails { /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. */ frameId: number; /** @@ -7071,12 +7101,12 @@ declare namespace chrome.webNavigation { processId: number; } - interface WebNavigationFramedErrorCallbackDetails extends WebNavigationFramedCallbackDetails { + export interface WebNavigationFramedErrorCallbackDetails extends WebNavigationFramedCallbackDetails { /** The error description. */ error: string; } - interface WebNavigationSourceCallbackDetails extends WebNavigationUrlCallbackDetails { + export interface WebNavigationSourceCallbackDetails extends WebNavigationUrlCallbackDetails { /** The ID of the tab in which the navigation is triggered. */ sourceTabId: number; /** @@ -7088,7 +7118,7 @@ declare namespace chrome.webNavigation { sourceFrameId: number; } - interface WebNavigationParentedCallbackDetails extends WebNavigationFramedCallbackDetails { + export interface WebNavigationParentedCallbackDetails extends WebNavigationFramedCallbackDetails { /** * ID of frame that wraps the frame. Set to -1 of no parent frame exists. * @since Chrome 24. @@ -7096,7 +7126,7 @@ declare namespace chrome.webNavigation { parentFrameId: number; } - interface WebNavigationTransitionCallbackDetails extends WebNavigationFramedCallbackDetails { + export interface WebNavigationTransitionCallbackDetails extends WebNavigationFramedCallbackDetails { /** * Cause of the navigation. * One of: "link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", or "keyword_generated" @@ -7109,26 +7139,26 @@ declare namespace chrome.webNavigation { transitionQualifiers: string[]; } - interface WebNavigationEventFilter { + export interface WebNavigationEventFilter { /** Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event. */ url: chrome.events.UrlFilter[]; } - interface WebNavigationEvent extends chrome.events.Event<(details: T) => void> { + export interface WebNavigationEvent extends chrome.events.Event<(details: T) => void> { addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void; } - interface WebNavigationFramedEvent extends WebNavigationEvent {} + export interface WebNavigationFramedEvent extends WebNavigationEvent {} - interface WebNavigationFramedErrorEvent extends WebNavigationEvent {} + export interface WebNavigationFramedErrorEvent extends WebNavigationEvent {} - interface WebNavigationSourceEvent extends WebNavigationEvent {} + export interface WebNavigationSourceEvent extends WebNavigationEvent {} - interface WebNavigationParentedEvent extends WebNavigationEvent {} + export interface WebNavigationParentedEvent extends WebNavigationEvent {} - interface WebNavigationTransitionalEvent extends WebNavigationEvent {} + export interface WebNavigationTransitionalEvent extends WebNavigationEvent {} - interface WebNavigationReplacementEvent extends WebNavigationEvent {} + export interface WebNavigationReplacementEvent extends WebNavigationEvent {} /** * Retrieves information about the given frame. A frame refers to an